.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}

.ProseMirror pre {
  white-space: pre-wrap;
}

.ProseMirror li {
  position: relative;
}

.ProseMirror-hideselection *::selection { background: transparent; }
.ProseMirror-hideselection *::-moz-selection { background: transparent; }
.ProseMirror-hideselection { caret-color: transparent; }

/* See https://code.haverbeke.berlin/prosemirror/prosemirror/issues/1421#issuecomment-1759320191 */
.ProseMirror [draggable][contenteditable=false] { user-select: text }

.ProseMirror-selectednode {
  outline: 2px solid #8cf;
}

/* Make sure li selections wrap around markers */

li.ProseMirror-selectednode {
  outline: none;
}

li.ProseMirror-selectednode:after {
  content: "";
  position: absolute;
  left: -32px;
  right: -2px; top: -2px; bottom: -2px;
  border: 2px solid #8cf;
  pointer-events: none;
}

/* Protect against generic img rules */

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
}

@font-face {
  font-family: "Baskervville";
  src: url("/baskervville.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* Paper colors and type from the Donovan iOS design system. */
:root {
  color-scheme: light;
  --paper: #f6eedf;
  --card: #fcf8f0;
  --ink: #332d27;
  --muted: #756854;
  --line: #ded1bd;
  --input-line: #b4a28b;
  --terracotta: #b65032;
  --accent: #a8462b;
  --accent-hover: #923b25;
  --wash: #efe3d0;
  --serif: Baskerville, "Baskervville", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --radius: 22px;
  --control-radius: 15px;
  --shadow: 0 5px 12px #332d2708;
  --gutter: clamp(20px, 6vw, 52px);
  --measure: 1160px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--sans); }
button, input, select, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
/* WebKit can show a focus ring on programmatically focused content after a tap. */
:root[data-touch-input] :where(.site-main, h1, h2, section, article, label)[tabindex="-1"]:focus { outline: none; }
button:disabled { cursor: default; opacity: .52; }
h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; }
h1 { font-size: clamp(2.5rem, 5vw, 3.25rem); letter-spacing: -.025em; text-wrap: balance; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.4rem; }
p + p { margin-top: .75em; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .83rem; }
.skip-link { position: fixed; z-index: 9; top: 8px; left: 8px; padding: 10px 15px; background: var(--card); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner {
  min-height: 68px;
  width: min(var(--measure), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}
.wordmark { justify-self: start; color: var(--ink); text-decoration: none; font: 2.45rem/1 var(--serif); letter-spacing: -.055em; white-space: nowrap; }
.wordmark span, .title-period { color: var(--terracotta); }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav .nav-icon { display: none; }
.site-nav a, .account {
  min-height: 42px;
  padding: 9px 15px;
  border-radius: var(--control-radius);
  text-decoration: none;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 550;
}
.site-nav a { display: flex; align-items: center; }
.header-actions { display: flex; min-width: 0; justify-content: flex-end; gap: 6px; }
.header-actions .studio-link { flex: none; min-height: 42px; font-size: .88rem; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current], .account:hover, .account[aria-current] {
  background: var(--wash);
  color: var(--accent);
}
.account {
  justify-self: end;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}
.site-main { width: min(var(--measure), calc(100% - 2 * var(--gutter))); margin-inline: auto; padding: 32px 0 72px; }
.site-footer { width: min(var(--measure), calc(100% - 2 * var(--gutter))); margin-inline: auto; padding: 18px 0 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.privacy-page { max-width: 680px; margin-inline: auto; }
.privacy-page h2 { margin: 1.35em 0 .5em; }
.privacy-page .inline-actions { margin: 1em 0; }
.page-intro { margin: 10px 0 26px; }
.page-intro p { margin-top: 8px; font-size: 1rem; color: var(--muted); }

.studio-page { max-width: 940px; margin-inline: auto; }
.studio-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; }
.release-queue .studio-heading { margin-bottom: 9px; }
.release-queue h2 { font-size: clamp(1.9rem, 4vw, 2.5rem); letter-spacing: -.025em; }
.studio-book-heading {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 6px 0 clamp(20px, 4vw, 30px);
  padding: clamp(14px, 3vw, 24px);
}
.studio-book-heading h1 { text-wrap: wrap; }
.studio-book-heading p { margin-top: 4px; }
#compose-title, #queue-title { scroll-margin-top: 14px; }

.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 65px;
  padding: 11px clamp(15px, 2.3vw, 24px);
  border-bottom: 1px solid var(--line);
}
.panel-heading h2 { font-size: 1.625rem; }
.panel-body { padding: clamp(16px, 3vw, 30px); }
.editor-shell { max-width: 820px; margin-inline: auto; }
.editor-back { margin-bottom: 6px; }
.chapter-title-row {
  display: flex;
  align-items: end;
  gap: 14px;
  padding: 16px clamp(15px, 3vw, 26px) 12px;
}
.chapter-title-row .field { flex: 1; color: var(--muted); font-size: .83rem; }
.chapter-title-row .field input {
  min-height: 44px;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: clamp(1.65rem, 5vw, 2.3rem)/1.15 var(--serif);
}
.chapter-state { padding-bottom: 9px; }
.chapter-writing { padding: 0 clamp(12px, 3vw, 26px) 16px; }
.chapter-writing > label { font-size: .86rem; }
.compose #chapter-body, #chapter-writing[aria-busy] {
  position: relative;
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--input-line);
  border-radius: var(--control-radius);
  background: var(--card);
  overflow-wrap: anywhere;
  font: 1rem/1.55 var(--sans);
}
.compose #chapter-body:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.compose #chapter-body[data-empty="true"]::before {
  content: attr(data-placeholder);
  position: absolute;
  color: var(--muted);
  pointer-events: none;
}
#chapter-body p + p { margin-top: .85em; }
#chapter-body :is(h1, h2, h3, h4, h5, h6) { font: 650 1.25em/1.3 var(--serif); margin-block: .85em .35em; }
#chapter-body :is(ul, ol) { padding-inline-start: 1.5em; }
#chapter-body hr { width: 4em; margin: 1.4em auto; border: 0; border-top: 1px solid var(--muted); }
#chapter-body blockquote { margin-inline: 0; border-inline-start: 2px solid var(--line); padding-inline-start: 1em; }
#chapter-body pre { white-space: pre-wrap; }
#chapter-body table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; }
#chapter-body :is(th, td) { padding: .25em .55em; border: 1px solid var(--line); }
#chapter-body [data-align="left"] { text-align: left; }
#chapter-body [data-align="center"] { text-align: center; }
#chapter-body [data-align="right"] { text-align: right; }
.compose:has(#chapter-writing) .chapter-save-bar {
  position: sticky;
  z-index: 2;
  bottom: 0;
}
.chapter-save-bar {
  padding: 8px clamp(12px, 3vw, 26px);
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--card);
}
.chapter-save-bar .form-feedback { color: var(--accent); margin-bottom: 5px; }
.chapter-action-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px 14px; }
.chapter-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
#word-count { font-variant-numeric: tabular-nums; }
.chapter-save-meta { display: flex; align-items: center; gap: 8px; }
.danger { color: #972f29; }
.danger:hover { color: #76231e; }
.book-delete { margin-inline-start: auto; }
.rail-empty { display: grid; justify-items: start; gap: 13px; padding: clamp(17px, 2.5vw, 26px); color: var(--muted); }
.release-queue .queue-list { max-height: 465px; overflow: auto; }
.queue-list li + li { border-top: 1px solid var(--line); }
.queue-item { display: flex; justify-content: space-between; width: 100%; align-items: center; gap: 10px; padding: 13px 19px; border: 0; background: transparent; text-align: left; min-height: 64px; }
.queue-item:hover, .chapter-link:hover { background: var(--wash); }
.queue-item:focus-visible, .chapter-link:focus-visible { outline-offset: -3px; }
.queue-item strong, .queue-item small { display: block; overflow-wrap: anywhere; }
.queue-item small { color: var(--muted); font-size: .78rem; }
.queue-item span:first-child { min-width: 0; }
.queue-footer { padding: 6px 15px; border-top: 1px solid var(--line); }
.status { white-space: nowrap; color: var(--muted); background: var(--paper); border-radius: 99px; padding: 3px 8px; font-size: .73rem; }
.status-live { color: #28533d; background: #e3eee2; }
.status-scheduled { color: #674920; background: #f3e8d1; }

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 550;
  line-height: 1.25;
  text-align: center;
}
.btn:hover { background: var(--wash); }
.primary { color: var(--card); background: var(--terracotta); border-color: var(--terracotta); }
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.quiet { border-color: transparent; padding-inline: 9px; background: transparent; color: var(--accent); }
.btn.small { min-height: 44px; padding-inline: 10px; font-size: .79rem; white-space: nowrap; }

.form-stack { display: grid; gap: 17px; }
.field { display: grid; gap: 6px; min-width: 0; font-weight: 650; }
.field input, .field textarea, .field select, .search input {
  min-height: 46px;
  min-width: 0;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--input-line);
  border-radius: var(--control-radius);
  background: var(--card);
  font-size: 1rem;
  font-weight: 400;
}
.field textarea { resize: vertical; }
.optional { color: var(--muted); font-size: .82em; font-weight: 400; }
.back { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--accent); font-size: .88rem; font-weight: 650; text-decoration: none; text-align: left; overflow-wrap: anywhere; }
.back:hover, .account-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.details summary { cursor: pointer; min-height: 44px; align-content: center; color: var(--accent); font-weight: 650; }
.details[open] summary { margin-bottom: 10px; }
.preview-text { padding: 16px; background: var(--paper); border-radius: 8px; max-height: 260px; overflow: auto; font: 1.1rem/1.7 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; }
.inline-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notice { padding: 12px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--wash); color: var(--ink); }
.notice .btn { margin-left: 8px; }

.catalogue-page { max-width: 760px; margin-inline: auto; }
.search { position: relative; display: flex; align-items: stretch; gap: 8px; width: 100%; }
.search::before, .search::after { content: ""; position: absolute; pointer-events: none; }
.search::before { width: 12px; height: 12px; inset-inline-start: 16px; top: calc(50% - 8px); border: 1.5px solid var(--muted); border-radius: 50%; }
.search::after { width: 7px; height: 1.5px; inset-inline-start: 26px; top: calc(50% + 5px); transform: rotate(45deg); background: var(--muted); }
.search input { min-height: 50px; padding-inline-start: 42px; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input:focus-visible { outline-offset: 2px; }
.search .btn { flex: 0 0 auto; }
.catalogue-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px 15px; min-height: 44px; margin-bottom: 8px; }
.catalogue-status { padding: 22px; color: var(--muted); }
.catalogue-status, .series-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.catalogue-list { display: grid; gap: 12px; }
.series-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: clamp(16px, 4vw, 20px);
  text-decoration: none;
}
.series-card .card-copy { flex: 1; min-width: 0; }
.series-card .cover { order: -1; flex: 0 0 auto; width: clamp(56px, 14vw, 76px); }
.series-card:is(:hover, :focus-within) { border-color: var(--input-line); }
.series-card .card-title::after { content: ""; position: absolute; inset: 0; }
.series-card:has(.card-title:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.series-card .card-title:focus-visible { outline: none; }
.series-card .card-title:is(:hover, :focus-visible) { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.series-card .tag { position: relative; }
.series-card :is(h2, h3) { font-size: 1.5rem; overflow-wrap: anywhere; }
.series-card p { margin-top: 5px; overflow-wrap: anywhere; }
.card-synopsis { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: .94rem; }
.cover { display: block; width: 100%; aspect-ratio: 2/3; border-radius: 5px; background: var(--ink) url("/cover-strip.webp") 0 center / 300% 100%; box-shadow: 0 3px 9px #332d2726; }
.cover-1 { background-position: center; }
.cover-2 { background-position: right; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag { max-width: 100%; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); padding: 4px 9px; font-size: .78rem; }
.empty { padding: clamp(20px, 3.5vw, 34px); max-width: 680px; }
.empty h2 { margin-bottom: 7px; }
.empty .btn { margin-top: 16px; }

.chapters { list-style: none; padding: 0; }
.chapters li + li { border-top: 1px solid var(--line); }
.chapter-link { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 60px; padding: 12px 22px; text-decoration: none; }
.chapters li:last-child .chapter-link { border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px); }
.chapter-link strong { overflow-wrap: anywhere; }
.chapter-link span { color: var(--accent); }
.reading { width: min(670px, 100%); margin-inline: auto; }
.reading h1 { font-size: clamp(2.25rem, 6vw, 3rem); overflow-wrap: anywhere; }
.prose { margin: clamp(23px, 4vw, 39px) 0 34px; font: clamp(1.2rem, 2.5vw, 1.375rem)/1.7 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; }

.account-page { max-width: 940px; margin-inline: auto; }
.account-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; gap: 22px; }
.account-sidebar { display: grid; gap: 18px; }
.account-panel { display: grid; justify-items: start; gap: 12px; padding: clamp(19px, 3vw, 29px); }
.account-panel p { margin-top: 0; }
.account-panel form { width: 100%; margin-top: 9px; }
.account-signin { max-width: 570px; }
.account-signin .btn, .account-sidebar .btn { margin-top: 3px; }
.profile-identity { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; padding: clamp(19px, 3vw, 29px); border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; color: var(--ink); background: var(--wash); }
.profile-initial { display: grid; place-items: center; width: 58px; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 50%; background: var(--card); font: 1.85rem/1 var(--serif); }
.profile-identity p:first-child { color: var(--muted); font-size: .83rem; }
#profile-name { margin-top: 3px; font: clamp(1.7rem, 4vw, 2.4rem)/1.05 var(--serif); overflow-wrap: anywhere; }
.profile-handle-link { display: inline-flex; align-items: center; justify-self: start; gap: 8px; min-height: 44px; padding-inline: 11px; border-radius: var(--control-radius); background: var(--wash); color: var(--accent); text-decoration: none; }
.profile-handle-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.profile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.profile-actions [aria-disabled="true"] { opacity: .65; cursor: progress; }
.profile-status { color: var(--accent); }
.profile-status.profile-error { color: #922f25; }
.account-link { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--accent); text-align: left; text-decoration: none; font-weight: 650; }
.account-link + .account-link { margin-top: -12px; }

dialog { width: min(450px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); box-shadow: 0 24px 80px #12251b50; }
dialog::backdrop { background: #332d278c; }
.dialog-content { padding: clamp(19px, 4vw, 30px); }
.dialog-content h2 { margin-bottom: 12px; }
.dialog-content > .inline-actions { margin-top: 15px; }
.toast { display: none; position: fixed; z-index: 4; left: 50%; bottom: 24px; width: max-content; max-width: calc(100% - 28px); transform: translateX(-50%); padding: 10px 15px; border-radius: 8px; background: var(--ink); color: var(--card); box-shadow: var(--shadow); }
.toast.visible { display: block; }

@media (max-width: 930px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto auto; }
}

@media (max-width: 650px) {
  .site-footer { padding-bottom: calc(85px + env(safe-area-inset-bottom)); }
  .header-inner { min-height: 61px; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .wordmark { font-size: clamp(1.95rem, 7vw, 2.35rem); }
  .header-actions .studio-link, .header-actions .account { min-height: 44px; padding-inline: 8px; font-size: .79rem; }
  .site-main { padding-top: 18px; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .studio-book-heading { grid-template-columns: 52px minmax(0, 1fr); }
  .studio-book-heading > .inline-actions { grid-column: 1 / -1; }
  .account-grid { grid-template-columns: minmax(0, 1fr); }
  .account-sidebar { gap: 15px; }
  .profile-initial { width: 50px; }
  .panel-heading { min-height: 60px; }
  .release-queue .queue-list { max-height: none; overflow: visible; }
  .rail-empty { display: flex; align-items: center; }
  .search .btn { padding-inline: 11px; }
  .chapter-editing .site-nav { display: none; }
  .chapter-editing .site-main { padding-bottom: 24px; }
  .chapter-editing .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .chapter-save-meta { width: 100%; justify-content: space-between; }
  .chapter-actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .chapter-title-row { flex-wrap: wrap; gap: 3px 10px; }
  .chapter-state { padding-bottom: 2px; }
  .chapter-actions .btn { padding-inline: 4px; font-size: .82rem; }
  .compose .panel-heading { flex-wrap: wrap; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .site-nav {
    position: fixed;
    z-index: 3;
    inset: auto max(12px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--card);
    box-shadow: 0 3px 16px #332d2714;
  }
  .site-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 52px; border-radius: 18px; text-decoration: none; color: var(--muted); font-size: .73rem; font-weight: 550; }
  .site-nav a:focus-visible { outline-offset: -2px; }
  .site-nav .nav-icon { display: block; }
  .nav-icon { position: relative; display: block; width: 16px; height: 16px; border: 1.5px solid currentColor; }
  .compass { border-radius: 50%; }
  .compass::after { content: ""; position: absolute; inset: 3px auto auto 4px; width: 4px; height: 7px; border: 1px solid; transform: rotate(35deg); }
  .bookmark { width: 12px; border-radius: 2px 2px 3px 3px; }
}

.chapter-stats { list-style: none; margin: 0; padding: 0; }
@media (max-width: 360px) {
  .header-inner { width: calc(100% - 2 * max(12px, env(safe-area-inset-left), env(safe-area-inset-right))); }
}
.studio-book-link { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 11px clamp(12px, 3vw, 18px); text-decoration: none; }
.studio-book-link:hover { background: var(--wash); }
.studio-book-link:focus-visible { outline-offset: -3px; }
.studio-book-link .studio-series-info { flex: 1; }
.studio-book-link strong { display: block; font: 400 clamp(1.2rem, 4vw, 1.45rem)/1.15 var(--serif); }
.studio-book-link .small { display: block; margin-top: 3px; }
.studio-book-link > span:last-child { color: var(--accent); }
.studio-recovery { margin-top: 14px; }
.studio-book-link .cover { width: 44px; flex: 0 0 44px; }
.studio-page .shelf-list li + li, .chapter-stats li + li { border-top: 1px solid var(--line); }
.studio-series-info { min-width: 0; overflow-wrap: anywhere; }
.custom-cover { object-fit: cover; }
.markdown { white-space: normal; }
.markdown p + p, .markdown ul, .markdown ol, .markdown blockquote, .markdown pre { margin-block: .85em; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 { font-size: 1.18em; margin: 1.15em 0 .45em; }
.markdown hr { margin: 1.5em auto; width: 4em; border: 0; border-top: 1px solid var(--line); }
.markdown pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.markdown blockquote { border-inline-start: 2px solid var(--line); padding-inline-start: 1em; }
.markdown table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; }
.markdown th, .markdown td { padding: .3em .6em; border: 1px solid var(--line); }
.author-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; overflow-wrap: anywhere; }
.author-bio { margin-top: 9px; white-space: pre-wrap; }
#dialog { width: min(560px, calc(100% - 24px)); }
#dialog textarea { resize: vertical; }
#dialog .field input[type="file"] { width: 100%; min-width: 0; }
.cover-fields { display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: start; gap: 14px; }
.cover-fields .cover { width: 100%; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.book-form { display: grid; gap: 13px; }
.book-form-actions { position: sticky; bottom: 0; z-index: 1; padding-block: 7px; background: var(--card); }
.book-fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.book-fieldset legend { padding: 0; margin-bottom: 5px; font-weight: 650; }
.book-fieldset legend .optional { margin-left: 4px; }
.tag-picker { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 7px; }
.tag-picker legend { padding: 0; margin-bottom: 4px; font-weight: 650; }
.tag-selection, .tag-option-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-picker[data-kind="author"] .tag-selection:not(:empty) { display: grid; }
.tag-selection-row { display: grid; gap: 4px; }
.tag-picked-group { display: inline-flex; max-width: 100%; }
.tag-picked-group:has(.tag-promote) .tag-picked { border-start-end-radius: 0; border-end-end-radius: 0; }
.tag-picked-group .tag-promote { flex: 0 0 auto; width: 38px; border-inline-start: 0; border-start-start-radius: 0; border-end-start-radius: 0; }
.tag-selection:empty, .tag-picker-status:empty { display: none; }
.tag-picker .tag { min-height: 38px; max-width: 100%; overflow-wrap: anywhere; border-radius: 7px; background: var(--card); }
.tag-picker .tag:is([aria-pressed="true"], .tag-picked) { background: var(--wash); border-color: var(--input-line); }
.tag-picker .tag-featured { color: var(--accent); border-color: var(--accent); }
.tag-picker .tag[aria-disabled="true"] { opacity: .58; }
.tag-picker .tag:focus-visible { outline-offset: -3px; }
.tag-picker-status { color: var(--accent); }
.tag-picker-options { padding: 0 0 4px; }
.tag-picker-options:has([data-searching]) { max-height: 245px; overflow: auto; }
.tag-option-group { border-bottom: 1px solid var(--line); }
.tag-option-group > summary { min-height: 40px; align-content: center; cursor: pointer; font-weight: 600; }
.tag-option-group > div { padding: 3px 0 8px; }
.tag-picker-options .tag-option-group:last-child { margin-bottom: 2px; }
.tag-add-custom { margin-top: 7px; white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
.spice-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; max-width: 258px; }
.spice-option { position: relative; cursor: pointer; }
.spice-target {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.spice-option:hover .spice-target, .spice-option input:checked + .spice-target { background: var(--wash); border-color: var(--input-line); }
.spice-pepper { display: block; width: 19px; height: 26px; fill: none; stroke: #7d705f; stroke-width: 7.15; stroke-linecap: round; stroke-linejoin: round; }
.spice-option.is-filled .pepper-body { fill: #b66d52; stroke: none; }
.spice-selection { display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 258px; margin-top: 4px; }
.spice-field input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cover-controls { display: grid; gap: 5px; justify-items: start; }
.cover-picker { position: relative; cursor: pointer; }
.cover-picker:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.story-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.story-stats div { background: var(--wash); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.story-stats dt { color: var(--muted); font-size: .84rem; }
.story-stats dd { margin: 4px 0 0; font-size: 1.3rem; font-weight: 650; }
.chapter-stats { margin-top: 6px; }
.chapter-stats li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; }
.chapter-stats li span { overflow-wrap: anywhere; }
.chapter-stats li strong { flex: 0 0 auto; }
.import-sources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.import-picker .small { font-weight: 400; }
.import-file-selection { overflow-wrap: anywhere; }
.import-preview { display: grid; gap: 8px; padding: 12px; border-radius: 8px; background: var(--wash); overflow-wrap: anywhere; }
.manuscript-example { margin: 0; padding: 8px 10px; border-radius: 6px; background: var(--card); font-family: inherit; white-space: pre-wrap; }
.import-preview-chapters { margin: 0; padding-inline-start: 1.4rem; }
.import-preview-chapters li + li { margin-top: 4px; }
.import-preview-chapters span { display: block; }
.import-chapters { min-width: 0; margin: 0; padding: 8px 12px 0; border: 1px solid var(--line); border-radius: 9px; }
.import-chapters legend { padding-inline: 4px; font-weight: 650; }
.import-chapter summary { overflow-wrap: anywhere; }
.check-field { display: flex; align-items: center; gap: 10px; min-height: 42px; }
.check-field input { width: 20px; height: 20px; min-height: 0; }
.form-feedback:empty { display: none; }

@media (max-width: 640px) {
  .cover-fields { grid-template-columns: 50px minmax(0, 1fr); gap: 10px; }
  #dialog .dialog-content { padding: 16px; }
}

@media (pointer: coarse) {
  .tag-picker .tag, .tag-option-group > summary { min-height: 44px; }
  .tag-picked-group .tag-promote { width: 44px; }
}

.studio-queue-tools, .studio-metadata-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.studio-queue-tools { align-items: end; margin-block: 10px 12px; }
.studio-queue-tools > p { margin-bottom: 11px; }
.studio-queue-row { display: flex; align-items: center; padding-inline-end: 8px; gap: 4px; }
.studio-queue-row .queue-item { flex: 1 1 auto; min-width: 0; }
.studio-queue-select { display: grid; place-items: center; flex: 0 0 44px; min-height: 44px; cursor: pointer; }
.studio-queue-select input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
.studio-shift { margin-top: 10px; }
.studio-recovery-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.studio-warning-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; border: 0; padding: 0; }
.studio-warning-options > p { grid-column: 1 / -1; }
.studio-warning-options > legend { margin-bottom: 5px; font-weight: 650; }
.studio-warning-options .check-field { align-items: start; }
.chapter-writing .chapter-format { gap: 3px; margin-bottom: 2px; }
.chapter-save-meta { flex-wrap: wrap; }
.chapter-save-meta [hidden] { display: none; }
.studio-focus .site-header, .studio-focus .site-footer, .studio-focus .editor-back { display: none; }
.studio-focus .compose #chapter-body { min-height: 55vh; }
.studio-trash-list > li { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; gap: 12px; }
.studio-trash-list > li + li { border-top: 1px solid var(--line); }
#dialog.studio-preview { width: min(94vw, 890px); }
.studio-preview-heading, .studio-preview-navigation { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.studio-preview-heading h2 { margin: 0; }
.studio-preview-viewports { margin-block: 12px; }
.studio-preview-viewports [aria-pressed="true"] { background: var(--wash); border-color: var(--accent); color: var(--accent); }
.studio-reader-preview {
  --reader-gutter: clamp(14px, 5vw, 48px);
  --reading-width: 37rem;
  --reading-font: var(--serif);
  --reading-size: 1.32rem;
  --reading-line: 1.67;
  --reading-scale: 1;
  margin-inline: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  overflow: clip;
}
.studio-reader-preview[data-size="phone"] { max-width: 390px; --reading-size: 1.17rem; --reader-gutter: 17px; }
.studio-preview-navigation { padding: 10px 15px; border-bottom: 1px solid var(--line); font-size: .88rem; }
.studio-preview-notes { margin-block: 12px; font: .85rem/1.45 var(--sans); }
.studio-reader-preview .reader-end { padding-bottom: 20px; }
.studio-reader-preview[data-size="phone"] .reader-heading h1 { font-size: 2.3rem; }
.studio-book-preview .book-summary { padding: 14px; }
.studio-book-preview .book-description { white-space: pre-line; }
.import-chapter summary small { margin-inline-start: 7px; }
.import-chapter input[name="chapter_position"] { min-width: 0; width: 5em; }
@media (max-width: 520px) {
  .studio-queue-row { gap: 1px; padding-inline-end: 2px; }
  .studio-queue-row .queue-item { padding-inline: 6px; }
  .studio-queue-row .btn { padding-inline: 5px; }
  .studio-queue-row .status { font-size: .69rem; }
  .studio-reader-preview .reader-heading h1 { font-size: 2.2rem; }
}
.editorial-text { white-space: pre-wrap; overflow-wrap: anywhere; }
