/* Literata (SIL Open Font License, fonts/OFL.txt): the serif for devices without Iowan Old Style (Android, Windows). */
@font-face { font-family: "Literata"; src: url(/fonts/Literata-Regular.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url(/fonts/Literata-Italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Literata"; src: url(/fonts/Literata-Bold.woff2) format("woff2"); font-weight: 600 800; font-style: normal; font-display: swap; }
/* The Library: same paper-and-ink look as the front page. */
:root {
  --paper: #f6efe3;
  --paper-deep: #ece2cf;
  --card: #fffaf1;
  --ink: #1d1a16;
  --ink-soft: #4d463d;
  --ink-faint: #6f675b;
  --green: #1f3d36;
  --gold: #b9853a;
  --serif: "Iowan Old Style", Literata, "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.6; font-size: 17px; }
a { color: inherit; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }

header.site { padding: 16px 0; position: sticky; top: 0; z-index: 20; background: rgba(246, 239, 227, .86); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid rgba(216, 204, 182, .5); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; }
/* The reader keeps a plain header: nothing sits over the text, and night mode stays dark. */
body.reading header.site { position: static; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 0; }
.logo { font-family: var(--serif); font-size: 22px; font-weight: 700; text-decoration: none; }
.logo span { color: var(--gold); }
.logo { display: inline-flex; align-items: center; }
.logo::before { content: ""; flex: none; width: 1.9em; height: 1.05em; margin-right: .4em; background: url(/logo-mark.svg) center / contain no-repeat; }
nav a { margin-left: 22px; text-decoration: none; color: var(--ink-soft); font-size: 15px; }
nav a:hover, nav a.here { color: var(--ink); }

h1 { font-family: var(--serif); font-size: clamp(36px, 5.5vw, 58px); line-height: 1.08; margin: 0 0 16px; }
h2 { font-family: var(--serif); font-size: 28px; margin: 0 0 14px; }
.lede { font-size: 19px; color: var(--ink-soft); max-width: 46ch; margin: 0 0 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 13px; color: var(--gold); font-weight: 600; margin: 0 0 14px; }

.btn { display: inline-block; padding: 12px 22px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 15px; border: 0; cursor: pointer; }
.btn-main { background: var(--green); color: var(--on-dark, var(--paper)); }
.btn-main:hover { background: #163029; }
.btn-quiet { border: 1.5px solid var(--ink); background: none; color: var(--ink); }
.btn-quiet:hover { background: var(--paper-deep); }

.search { width: 100%; max-width: 420px; padding: 12px 18px; border-radius: 999px; border: 1.5px solid var(--line, #d8ccb6); background: var(--card); font-size: 16px; }
.search:focus { outline: none; border-color: var(--green-text, var(--green)); }

.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px; margin: 30px 0 80px; }
.book-card { background: var(--card); border: 1px solid var(--paper-deep); border-radius: 16px; padding: 24px; text-decoration: none; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.book-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(60, 45, 20, .1); }
.book-card h3 { font-family: var(--serif); font-size: 22px; line-height: 1.2; margin: 0 0 4px; }
.book-card .by { color: var(--ink-soft); font-size: 15px; margin-bottom: 12px; }
.book-card .blurb { color: var(--ink-soft); font-size: 15px; margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.book-card .meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }

.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--paper-deep); color: var(--ink-soft); }
.tag-ai { background: var(--tint-green, #dbe8e2); color: var(--green-text, var(--green)); }
.tag-sample { background: var(--tint-gold, #f2e2c4); color: var(--tint-gold-ink, #7a5520); }

.empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); background: var(--card); border: 1px dashed var(--line, #d8ccb6); border-radius: 16px; margin: 30px 0 80px; }
/* Empty Library: a "founding shelf" of designed covers instead of a dashed box */
.empty.founding { border: 0; background: radial-gradient(ellipse 70% 80% at 50% 0%, rgba(185, 133, 58, .14), transparent 70%), var(--card); box-shadow: 0 1px 0 var(--paper-deep), 0 20px 50px rgba(60, 45, 20, .07); padding: 48px 24px 52px; }
.empty.founding p { max-width: 52ch; margin: 0 auto 6px; }
.genre-intro { max-width: 62ch; margin-bottom: 22px; }
.genre-intro .lede { margin: 0 0 10px; max-width: none; }
.found-row { display: flex; justify-content: center; gap: 16px; margin: 30px 0 32px; flex-wrap: wrap; }
.found { width: 132px; height: 198px; border-radius: 3px 8px 8px 3px; background-color: var(--c); color: #f6efe3; position: relative; padding: 20px 14px 16px; display: flex; flex-direction: column; justify-content: space-between; text-align: left;
  text-decoration: none; font-family: var(--serif); box-shadow: inset 7px 0 0 rgba(0, 0, 0, .2), 0 12px 26px rgba(60, 45, 20, .2); transition: transform .2s, box-shadow .2s;
  background-image: linear-gradient(150deg, rgba(255, 255, 255, .12), transparent 45%, rgba(0, 0, 0, .15)); }
.found::after { content: ""; position: absolute; inset: 9px 9px 9px 15px; border: 1px solid rgba(226, 196, 143, .55); border-radius: 2px; pointer-events: none; }
.found:hover { transform: translateY(-5px); box-shadow: inset 7px 0 0 rgba(0, 0, 0, .2), 0 18px 32px rgba(60, 45, 20, .26); }
.found small { font-family: var(--sans); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #e8cd96; font-weight: 700; }
.found b { font-size: 19px; line-height: 1.12; }
.found b::after { content: ""; display: block; width: 28px; height: 2px; background: #e2c48f; margin-top: 10px; }
.found i { font-style: normal; font-size: 12px; color: rgba(246, 239, 227, .82); }
.found[style*="#b9853a"] small { color: #3a2a12; }
.found-steps { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 26px; margin: 22px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-faint); counter-reset: step; }
.found-steps li::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: var(--on-dark, var(--paper)); font-size: 12px; font-weight: 700; margin-right: 8px; }
@media (max-width: 600px) { .found { width: 104px; height: 156px; padding: 14px 10px 12px; } .found b { font-size: 15px; } .found-row { gap: 10px; } }
.btn { transition: transform .15s, box-shadow .15s, background .15s; }
.btn-main:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(31, 61, 54, .25); }

/* Book page */
.book-head { padding: 30px 0 10px; }
.book-head .by { font-size: 19px; color: var(--ink-soft); margin: 0 0 18px; }
.book-head .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.blurb-full { font-size: 18px; white-space: pre-line; margin: 0 0 30px; }
.panel { background: var(--card); border: 1px solid var(--paper-deep); border-radius: 16px; padding: 24px; margin: 0 0 22px; }
.panel h2 { font-size: 22px; }
.ai-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--paper-deep); margin: 12px 0 10px; }
.ai-bar span { display: block; height: 100%; }
.ai-bar .yours, .ai-legend .yours { background: var(--green); }
.ai-bar .edited, .ai-legend .edited { background: var(--gold); }
.ai-bar .unchanged, .ai-legend .unchanged { background: #c9b48e; }
.ai-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--ink-soft); }
.ai-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.small { font-size: 14px; color: var(--ink-faint); }
.toc { list-style: none; padding: 0; margin: 0; }
.toc li { border-top: 1px solid var(--paper-deep); }
.toc li:first-child { border-top: 0; }
.toc a { display: flex; justify-content: space-between; gap: 14px; padding: 12px 2px; text-decoration: none; }
.toc a:hover { color: var(--green-text, var(--green)); }
.toc .w { color: var(--ink-faint); font-size: 14px; white-space: nowrap; }
.toc li.extra a { color: var(--ink-soft); font-style: italic; }
.series-line { display: block; text-transform: uppercase; letter-spacing: 1.5px; font-size: 13px; font-weight: 600; color: var(--gold); text-decoration: none; margin-bottom: 6px; }
.series-line:hover { text-decoration: underline; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 4px 0 0; }
.book-head .blurb-full { margin-top: 26px; }

/* Reader */
.reader { padding: 20px 0 40px; }
.reader .book-line { font-size: 15px; color: var(--ink-soft); text-decoration: none; }
.reader h1 { font-size: clamp(30px, 4.5vw, 42px); margin: 14px 0 34px; }
.reader .chapter-no { text-transform: uppercase; letter-spacing: 2px; font-size: 13px; color: var(--gold); font-weight: 600; margin-top: 26px; }
.prose { font-family: var(--serif); font-size: 20px; line-height: 1.75; }
.prose p { margin: 0 0 1.1em; }
.prose p.q { margin-left: 0.4em; padding-left: 1em; border-left: 3px solid var(--gold); color: var(--ink-soft); }
.prose p.q + p.q { margin-top: -1.1em; padding-top: 0.4em; }
.prose p.brk { text-align: center; letter-spacing: 0.6em; color: var(--ink-faint); margin: 1.6em 0; }
.pager a { margin-left: 0; }
.pager { display: flex; justify-content: space-between; gap: 12px; padding: 30px 0 80px; border-top: 1px solid var(--paper-deep); margin-top: 30px; }
.buy-box { background: var(--tint-gold, #f2e2c4); border-radius: 16px; padding: 26px; margin-top: 30px; }
.buy-box h2 { font-size: 24px; }

footer.site { padding: 30px 0; font-size: 14px; color: var(--ink-soft); border-top: 1px solid var(--paper-deep); }
footer.site .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

@media (max-width: 600px) {
  nav a, .acct a { margin-left: 14px; font-size: 14px; }
  .logo { font-size: 19px; }
  .prose { font-size: 18px; }
}

/* Report dialog */
.report-link { background: none; border: 0; padding: 0; color: var(--ink-faint); font-size: 14px; text-decoration: underline; cursor: pointer; font-family: inherit; }
.report-link:hover { color: var(--ink); }
.report-overlay { position: fixed; inset: 0; background: rgba(29, 26, 22, .45); display: grid; place-items: center; padding: 20px; z-index: 50; overflow-y: auto; }
.report-box { background: var(--card); border-radius: 18px; padding: 28px; width: min(520px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.report-box h2 { font-size: 24px; }
.report-box fieldset { border: 0; padding: 0; margin: 14px 0; }
.report-box legend { font-weight: 600; margin-bottom: 8px; }
.report-box fieldset label { display: flex; gap: 10px; align-items: center; padding: 5px 0; font-size: 15px; cursor: pointer; }
.report-box .field-label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
.report-box textarea, .report-box input[type=email] { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line, #d8ccb6); border-radius: 10px; background: var(--field, #fff); font: inherit; font-size: 15px; }
.report-msg { min-height: 1.4em; color: #9b2c2c; font-size: 14px; margin: 10px 0 0; }
.report-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.report-actions .btn { margin-left: 0; }

/* Reader accounts */
.acct a { margin-left: 22px; }
header.site nav { display: flex; align-items: center; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--paper-deep); }
.auth-tabs button { background: none; border: 0; padding: 8px 12px; font: inherit; font-weight: 600; color: var(--ink-faint); border-bottom: 2px solid transparent; cursor: pointer; }
.auth-tabs button.on { color: var(--ink); border-bottom-color: var(--green-text, var(--green)); }
.report-box input:not([type=radio]):not([type=checkbox]) { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line, #d8ccb6); border-radius: 10px; background: var(--field, #fff); font: inherit; font-size: 15px; }
.lib-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--green); color: var(--on-dark, var(--paper)); padding: 12px 20px; border-radius: 999px; font-size: 15px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 60; max-width: 90vw; text-align: center; }
.lib-toast.show { opacity: 1; transform: translate(-50%, 0); }
.reader-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.btn-small { padding: 9px 16px; font-size: 14px; }
.btn.on { background: var(--paper-deep); }

/* Comments */
.comments { margin: 10px 0 70px; }
.comments h2 { font-size: 24px; }
.comment { border-top: 1px solid var(--paper-deep); padding: 14px 0; }
.comment .who { font-weight: 600; font-size: 15px; }
.comment .when { color: var(--ink-faint); font-size: 13px; margin-left: 8px; }
.comment .text { white-space: pre-line; margin: 6px 0 4px; }
.comment .tools button { background: none; border: 0; padding: 0; margin-right: 14px; color: var(--ink-faint); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
/* Paragraph comments (reader): a small round button in the right margin of each paragraph. */
.prose > p { position: relative; }
.pc { position: absolute; right: -46px; top: 2px; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 99px; border: 1.5px solid var(--line, #d8ccb6); background: var(--card); color: var(--ink-soft); font: 600 13px/1 var(--sans); cursor: pointer; opacity: 0; transition: opacity .15s; }
.pc.has { opacity: 1; background: var(--paper-deep); color: var(--ink); }
.prose > p:hover .pc, .prose > p.tapped .pc, .pc:focus-visible, .pc[aria-expanded="true"] { opacity: 1; }
.pc:hover { border-color: var(--green-text, var(--green)); color: var(--green-text, var(--green)); }
html.paras-off .pc, html.paras-off .para-hint { display: none; }
.para-thread { position: relative; margin: 4px 0 22px; padding: 12px 16px 4px; border-left: 3px solid var(--gold); background: var(--card); border-radius: 0 12px 12px 0; font-size: 16px; }
.para-thread .comment:first-of-type { border-top: 0; }
.para-close { position: absolute; right: 6px; top: 4px; background: none; border: 0; font-size: 22px; line-height: 1; color: var(--ink-faint); cursor: pointer; padding: 4px 8px; }
.aa-paras { align-items: center; }
.aa-paras span { font-size: 13px; color: var(--ink-faint); margin-right: 4px; }
@media (max-width: 860px) {
  .pc { position: static; display: inline-block; vertical-align: 1px; margin-left: 6px; height: 22px; min-width: 26px; font-size: 12px; display: none; }
  .pc.has, .prose > p.tapped .pc, .pc[aria-expanded="true"] { display: inline-block; opacity: 1; }
}
html.theme-night .pc, html.theme-night .para-thread { background: #1d2024; border-color: #3a3e45; color: var(--ink); }
html.theme-night .para-thread { border-left-color: var(--gold); }
.comment-form textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line, #d8ccb6); border-radius: 12px; background: var(--card); font: inherit; font-size: 16px; min-height: 90px; }
.comment-form .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }

/* Covers */
.book-card.with-cover { flex-direction: row; gap: 16px; align-items: flex-start; }
.book-card .card-text { display: flex; flex-direction: column; min-width: 0; flex: 1; align-self: stretch; }
.cover { width: 92px; height: 138px; object-fit: cover; border-radius: 6px; flex: none; box-shadow: 0 4px 12px rgba(60, 45, 20, .18); }
/* Designed cover for books without one: genre colour, gold frame, title, gold rule, pen name. Sizes follow font-size. */
.cover-blank { background-color: var(--c, var(--green)); background-image: linear-gradient(150deg, rgba(255, 255, 255, .13), transparent 45%, rgba(0, 0, 0, .18)); color: #f6efe3;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .7em; padding: 1.1em .9em; text-align: center; font-family: var(--serif); font-weight: 700;
  font-size: 13px; line-height: 1.18; overflow: hidden; position: relative; box-shadow: inset .3em 0 0 rgba(0, 0, 0, .2), 0 4px 12px rgba(60, 45, 20, .18); }
.cover-blank::after { content: ""; position: absolute; inset: .55em .55em .55em .85em; border: 1px solid rgba(226, 196, 143, .55); border-radius: 2px; pointer-events: none; }
.cover-blank span { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cover-blank span::after { content: ""; display: block; width: 2em; height: 2px; background: #e2c48f; margin: .6em auto 0; }
.cover-blank em { font-style: normal; font-weight: 600; font-family: var(--sans); font-size: .62em; letter-spacing: .12em; text-transform: uppercase; color: #e8cd96; }
.cover-blank[style*="#b9853a"] em { color: #3a2a12; }
.cover-mini.cover-blank em, .cover-mini.cover-blank span::after, .cover.cover-blank em { display: none; }

/* The Library shelf: a grid of covers, title and author underneath (like a bookshop's front table). */
.shelf.tiles { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 36px 24px; }
.tile { text-decoration: none; display: flex; flex-direction: column; min-width: 0; }
.tile-cover { position: relative; border-radius: 3px 8px 8px 3px; box-shadow: 0 10px 24px rgba(60, 45, 20, .18); transition: transform .2s, box-shadow .2s; }
.tile:hover .tile-cover { transform: translateY(-4px); box-shadow: 0 18px 34px rgba(60, 45, 20, .25); }
.tile-img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: inherit; font-size: 17px; box-shadow: none; }
.tile-img.cover-blank { display: flex; box-shadow: inset .3em 0 0 rgba(0, 0, 0, .2); }
/* Badges sit under the cover, never on it: covers carry their own title and author name. */
/* Same height with or without badges, so titles in a row line up. */
.tile-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; min-height: 24px; }
.tile-badges + h3 { margin-top: 8px; }
.tile h3 { font-family: var(--serif); font-size: 18px; line-height: 1.22; margin: 14px 0 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile:hover h3 { color: var(--green-text, var(--green)); }
.tile .by { font-size: 14px; color: var(--ink-soft); }
.tile .rating-line { margin: 2px 0 0; font-size: 13px; }
.tile-meta { font-size: 13px; color: var(--ink-faint); margin: 2px 0 8px; }
.tile .tag-ai { align-self: flex-start; }
.tile-blurb { font-size: 14px; color: var(--ink-soft); margin: 8px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 600px) {
  .shelf.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .tile h3 { font-size: 16px; } .tile-img { font-size: 14px; } .tile-blurb { display: none; }
}

/* Book page as a storefront: big cover on the left, the essentials and "Start reading" on the right. */
.book-head.store { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0 36px; align-items: start; padding-top: 34px; }
.store-cover { width: 220px; height: 330px; border-radius: 3px 10px 10px 3px; object-fit: cover; font-size: 24px; box-shadow: 0 22px 44px rgba(60, 45, 20, .3), 0 3px 8px rgba(60, 45, 20, .15); }
.store-cover.cover-blank { box-shadow: inset .3em 0 0 rgba(0, 0, 0, .2), 0 22px 44px rgba(60, 45, 20, .3); }
.store-info h1 { font-size: clamp(32px, 4.6vw, 48px); margin-bottom: 8px; }
.store-stats { display: flex; flex-wrap: wrap; gap: 0; margin: 4px 0 22px; padding: 0; list-style: none; }
.store-stats li { padding: 0 18px; border-left: 1px solid var(--paper-deep); line-height: 1.25; }
.store-stats li:first-child { padding-left: 0; border-left: 0; }
.store-stats b { display: block; font-family: var(--serif); font-size: 22px; }
.store-stats span { font-size: 13px; color: var(--ink-faint); }
.book-head.store .cta-row .btn-main { padding: 14px 30px; font-size: 16px; }
.book-head.store .tag-links { margin: 0 0 22px; }
.book-head.store .blurb-full { grid-column: 1 / -1; font-size: 18px; line-height: 1.7; margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--paper-deep); }
@media (max-width: 640px) {
  .book-head.store { grid-template-columns: 1fr; padding-top: 20px; }
  .store-cover { width: 170px; height: 255px; font-size: 19px; margin: 0 auto 26px; }
  .store-stats li { padding: 0 12px; } .store-stats b { font-size: 19px; }
}
.cover-large { float: right; width: 200px; height: 300px; object-fit: cover; border-radius: 8px; margin: 6px 0 20px 30px; box-shadow: 0 12px 30px rgba(60, 45, 20, .22); }
@media (max-width: 600px) { .cover-large { float: none; display: block; margin: 0 0 20px; width: 160px; height: 240px; } }
.panel { clear: both; }

/* Library filters */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; align-items: center; }
.chip { border: 1.5px solid var(--line, #d8ccb6); background: var(--card); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink-soft); }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.on { background: var(--green); border-color: var(--green-text, var(--green)); color: var(--on-dark, var(--paper)); }
.chip-gap { width: 14px; }

@media (max-width: 600px) { .acct a { margin-left: 14px; } }

/* Reader comfort: sizes, themes, progress */
html.size-s .prose { font-size: 17px; }
html.size-l .prose { font-size: 23px; }
html.size-xl .prose { font-size: 26px; }
html.theme-sepia { --paper: #f1e4c8; --paper-deep: #e2d2b0; --card: #f7ecd5; --ink: #3b2f22; --ink-soft: #5c4a36; --ink-faint: #8a7660; }
html.theme-night { --paper: #15171a; --paper-deep: #2a2d33; --card: #1d2024; --ink: #e6e1d8; --ink-soft: #b8b2a7; --ink-faint: #8a857c; --green: #2f6355; --green-text: #8fcfb6; --on-dark: #f6efe3; --line: #3a3e45; --field: #1d2024; --tint-soft: #1b2a26; --tint-green: #1f3a32; --tint-gold: #3a3020; --tint-gold-ink: #e8cd96; color-scheme: dark; }
/* Dark mode everywhere else: follows the device setting. The reader keeps its own Light / Sepia / Night choice. */
@media (prefers-color-scheme: dark) {
  html:not(.theme-light):not(.theme-sepia) { --paper: #15171a; --paper-deep: #2a2d33; --card: #1d2024; --ink: #e6e1d8; --ink-soft: #b8b2a7; --ink-faint: #8a857c; --green: #2f6355; --green-text: #8fcfb6; --on-dark: #f6efe3; --line: #3a3e45; --field: #1d2024; --tint-soft: #1b2a26; --tint-green: #1f3a32; --tint-gold: #3a3020; --tint-gold-ink: #e8cd96; color-scheme: dark; }
  html:not(.theme-light):not(.theme-sepia) header.site { background: rgba(21, 23, 26, .86); border-bottom-color: #2a2d33; }
  html:not(.theme-light):not(.theme-sepia) .launch-note { filter: brightness(.85); }
}
html.theme-night .btn-main { background: #2f6b5c; }
html.theme-night .tag { background: #2a2d33; color: #cfc8bc; }
html.theme-night .tag-ai { background: #1f3d36; color: #cfe6dc; }
html.theme-night .tag-explicit { background: #6b2737; color: #f6efe3; }
html.theme-night .buy-box { background: #2b2618; color: var(--ink); }
html.theme-night .comment-form textarea { background: #1d2024; color: var(--ink); border-color: #3a3e45; }
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--gold); z-index: 40; transition: width .1s linear; }
.reader-bar { position: relative; float: right; display: flex; gap: 6px; align-items: flex-start; }
/* Listen: the paragraph being read aloud, and the player pinned to the bottom of the screen */
.listen-btn { width: auto; padding: 0 12px; font-size: 14px; }
.prose p.reading-now { background: color-mix(in srgb, var(--gold) 16%, transparent); border-radius: 6px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 16%, transparent); }
.listen-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  width: min(620px, calc(100% - 24px)); padding: 10px 14px; background: var(--card); color: var(--ink); border: 1px solid var(--line, #d8ccb6); border-radius: 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, .22); font-size: 14px; }
.lb-btn { border: 0; background: var(--paper-deep); color: var(--ink); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 15px; }
.lb-play { background: var(--green); color: var(--on-dark, #f6efe3); width: 42px; height: 42px; }
.lb-close { margin-left: auto; background: none; }
.lb-pos { color: var(--ink-faint); min-width: 54px; }
.lb-rate, .lb-voice { border: 1px solid var(--line, #d8ccb6); background: var(--field, #fff); color: var(--ink); border-radius: 999px; padding: 6px 10px; font: inherit; font-size: 13px; }
.lb-voice { max-width: 200px; }
body.listening main { padding-bottom: 110px; }
.lb-end { width: 100%; padding-top: 4px; color: var(--ink-soft); }
.lb-end a { color: var(--green-text, var(--green)); font-weight: 600; }
@media (max-width: 600px) { .lb-voice { max-width: 100%; flex: 1 1 100%; order: 9; } }
.aa { border: 1.5px solid var(--paper-deep); background: var(--card); color: var(--ink); border-radius: 999px; padding: 4px 12px; font-family: var(--serif); font-size: 16px; cursor: pointer; }
.aa-panel { position: absolute; right: 0; top: 38px; background: var(--card); border: 1px solid var(--paper-deep); border-radius: 14px; padding: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .15); z-index: 30; width: 230px; }
.aa-row { display: flex; gap: 6px; }
.aa-row + .aa-row { margin-top: 8px; }
.aa-row button { flex: 1; border: 1.5px solid var(--paper-deep); background: none; color: var(--ink); border-radius: 10px; padding: 6px 0; cursor: pointer; font-family: var(--serif); }
.aa-row button.on { border-color: var(--green-text, var(--green)); box-shadow: 0 0 0 1px var(--green); }
.aa-row .a-s { font-size: 13px; } .aa-row .a-l { font-size: 19px; } .aa-row .a-xl { font-size: 23px; }
.sw-light { background: #f6efe3 !important; color: #1d1a16 !important; }
.sw-sepia { background: #f1e4c8 !important; color: #3b2f22 !important; }
.sw-night { background: #15171a !important; color: #e6e1d8 !important; }

/* Library sorting and badges */
.sortbar { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; color: var(--ink-soft); }
.sortbar select { border: 1.5px solid var(--line, #d8ccb6); background: var(--card); border-radius: 999px; padding: 5px 12px; font: inherit; color: var(--ink); }
.tag-new { background: var(--tint-gold, #f2e2c4); color: var(--tint-gold-ink, #7a5520); }

/* Accessibility */
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--green); color: var(--on-dark, var(--paper)); padding: 10px 16px; border-radius: 999px; z-index: 100; text-decoration: none; }
.skip:focus { left: 12px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Serial schedule and author updates */
.next-up { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--tint-gold, #f2e2c4); color: #5c3f15; font-size: 15px; }
.posts { display: grid; gap: 14px; margin: 18px 0 40px; }
.post { background: var(--card); border: 1px solid var(--paper-deep); border-radius: 14px; padding: 18px 20px; }
.post p { margin: 0 0 8px; white-space: pre-line; overflow-wrap: anywhere; }
.post .post-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 14px; color: var(--ink-faint); }
.post .post-meta a { color: var(--green-text, var(--green)); font-weight: 600; }
.post .post-by { font-weight: 600; color: var(--ink); }
.composer { background: var(--card); border: 1px solid var(--paper-deep); border-radius: 14px; padding: 16px; margin: 18px 0 0; }
.composer textarea { width: 100%; min-height: 90px; padding: 12px 14px; border: 1.5px solid var(--line, #d8ccb6); border-radius: 10px; background: var(--field, #fff); font: inherit; font-size: 16px; color: var(--ink); }
.composer .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 10px; }
.composer select { border: 1.5px solid var(--line, #d8ccb6); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; background: var(--field, #fff); max-width: 100%; }
html.theme-night .post, html.theme-night .composer { background: #1d2024; border-color: #3a3e45; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Reviews and stars */
.stars { color: #d6c9b0; letter-spacing: 1px; white-space: nowrap; }
.stars i { font-style: normal; }
.stars i.on { color: var(--gold); }
.stars i.half { background: linear-gradient(90deg, var(--gold) 50%, #d6c9b0 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stars-sm { font-size: 14px; }
.rating-num { font-weight: 600; font-size: 14px; }
.rating-line { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; }
.reviews { margin: 10px 0 30px; }
.reviews h2 { font-size: 24px; }
.review-summary { display: flex; flex-wrap: wrap; gap: 18px 36px; align-items: center; background: var(--card); border: 1px solid var(--paper-deep); border-radius: 14px; padding: 18px 22px; margin: 6px 0 18px; }
.review-summary .big { display: grid; justify-items: center; gap: 2px; }
.review-summary .big b { font-family: var(--serif); font-size: 42px; line-height: 1; }
.review-summary .big .stars { font-size: 20px; }
.review-summary .dist { flex: 1; min-width: 200px; display: grid; gap: 4px; }
.review-summary .dist div { display: grid; grid-template-columns: 28px 1fr 30px; gap: 8px; align-items: center; font-size: 14px; }
.review-summary .bar { height: 8px; border-radius: 99px; background: var(--paper-deep); overflow: hidden; }
.review-summary .bar i { display: block; height: 100%; background: var(--gold); }
.review { border-top: 1px solid var(--paper-deep); padding: 14px 0; }
.review .head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.review .who { font-weight: 600; font-size: 15px; }
.review .when { color: var(--ink-faint); font-size: 13px; }
.review .text { white-space: pre-line; margin: 6px 0 4px; overflow-wrap: anywhere; }
.review .reply { margin: 8px 0 4px 16px; padding: 10px 14px; border-left: 3px solid var(--green); background: var(--tint-soft, #f1f6f3); border-radius: 0 10px 10px 0; font-size: 15px; }
.review .tools button { background: none; border: 0; padding: 0; margin-right: 14px; color: var(--ink-faint); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.review-form, .reply-form { margin: 6px 0 16px; }
.review-form textarea, .reply-form textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line, #d8ccb6); border-radius: 12px; background: var(--card); font: inherit; font-size: 16px; min-height: 90px; color: var(--ink); }
.review-form .row, .reply-form .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.star-pick { display: flex; gap: 2px; margin-bottom: 8px; }
.star-pick button { background: none; border: 0; padding: 2px; font-size: 30px; line-height: 1; color: #d6c9b0; cursor: pointer; }
.star-pick button.on { color: var(--gold); }
.star-pick:hover button { color: var(--gold); }
.star-pick button:hover ~ button { color: #d6c9b0; }
html.theme-night .review-summary { background: #1d2024; border-color: #3a3e45; }
html.theme-night .review .reply { background: #1f2a27; }
html.theme-night .review-form textarea, html.theme-night .reply-form textarea { background: #1d2024; border-color: #3a3e45; }

/* Author profiles */
.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 4px 14px rgba(60, 45, 20, .15); }
.avatar-blank { display: grid; place-items: center; background: linear-gradient(160deg, var(--green), #2c5a4f); color: var(--on-dark, var(--paper)); font-family: var(--serif); font-size: 34px; font-weight: 700; }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; box-shadow: none; }
.author-head { display: flex; gap: 22px; align-items: center; margin-bottom: 14px; }
.author-head h1 { margin: 0 0 4px; }
.author-bio { white-space: pre-line; max-width: 62ch; color: var(--ink-soft); font-size: 17px; margin: 0 0 12px; overflow-wrap: anywhere; }
.author-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 16px; font-size: 15px; }
.author-links a { color: var(--green-text, var(--green)); font-weight: 600; text-decoration: none; }
.author-links a:hover { text-decoration: underline; }
.profile-form { background: var(--card); border: 1px solid var(--paper-deep); border-radius: 14px; padding: 18px; margin: 10px 0 20px; }
.profile-form label.f { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
.profile-form textarea, .profile-form input[type=text], .profile-form input[type=url] { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line, #d8ccb6); border-radius: 10px; background: var(--field, #fff); font: inherit; font-size: 15px; color: var(--ink); }
.profile-form .link-row { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-bottom: 8px; }
.profile-form .pic { display: flex; gap: 14px; align-items: center; }
.by-line { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 600px) { .author-head { gap: 14px; } .avatar:not(.avatar-sm) { width: 72px; height: 72px; } .profile-form .link-row { grid-template-columns: 1fr; } }

/* Story status and tags */
.tag-status { background: #e4e0f0; color: #3d3466; }
.tag-completed { background: var(--tint-green, #dbe8e2); color: var(--green-text, var(--green)); }
.tag-hiatus { background: #eee6d8; color: #6b5a3a; }
.tag-links { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 10px 0 0; }
.tag-link { color: var(--green-text, var(--green)); font-size: 14px; font-weight: 600; text-decoration: none; }
.tag-link:hover { text-decoration: underline; }
.tag-ideas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-ideas button { border: 1.5px solid var(--line, #d8ccb6); background: var(--card); border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.tag-ideas button:hover { border-color: var(--green-text, var(--green)); color: var(--green-text, var(--green)); }
.tag-ideas button.on { background: var(--green); border-color: var(--green-text, var(--green)); color: var(--on-dark, var(--paper)); }

/* Reading lists */
.cover-strip { display: flex; gap: 6px; margin-bottom: 14px; }
.cover-mini { width: 54px; height: 81px; font-size: 9px; padding: 4px; box-shadow: 0 2px 8px rgba(60, 45, 20, .15); }
.cover-empty { background: var(--paper-deep); box-shadow: none; }
.list-card { background: var(--card); border: 1px solid var(--paper-deep); border-radius: 16px; padding: 20px; text-decoration: none; display: block; transition: transform .15s, box-shadow .15s; }
.list-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(60, 45, 20, .1); }
.list-card h3 { font-family: var(--serif); font-size: 21px; margin: 0 0 4px; line-height: 1.2; }
.list-card p { margin: 6px 0 0; color: var(--ink-soft); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin: 22px 0 70px; }
.list-picks { display: grid; gap: 6px; margin: 10px 0 6px; max-height: 260px; overflow-y: auto; }
.list-pick { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1.5px solid #e2d7c2; border-radius: 10px; cursor: pointer; }
.list-pick input { accent-color: var(--green-text, var(--green)); }
.new-list { display: flex; gap: 8px; }
.new-list input { flex: 1; min-width: 0; padding: 10px 12px; border: 1.5px solid var(--line, #d8ccb6); border-radius: 10px; background: var(--field, #fff); font: inherit; font-size: 15px; }
.list-item { display: flex; gap: 16px; align-items: flex-start; padding: 16px 0; border-top: 1px solid var(--paper-deep); }
.list-item .cover { width: 70px; height: 105px; }
.list-item .info { flex: 1; min-width: 0; }
.list-item h3 { font-family: var(--serif); font-size: 20px; margin: 0 0 2px; }
.list-item h3 a { text-decoration: none; }
.list-item .note { margin: 8px 0 0; padding: 8px 12px; background: var(--tint-soft, #f1f6f3); border-radius: 10px; font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.list-item .tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.list-item .tools button { background: none; border: 1.5px solid var(--line, #d8ccb6); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-soft); }
.list-edit { background: var(--card); border: 1px solid var(--paper-deep); border-radius: 14px; padding: 18px; margin: 10px 0 20px; }
.list-edit input[type=text], .list-edit textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line, #d8ccb6); border-radius: 10px; background: var(--field, #fff); font: inherit; font-size: 15px; color: var(--ink); }
.by-line span:empty { display: none; }

/* Blog */
.blog-list { display: grid; gap: 14px; margin: 26px 0 70px; }
.blog-card { display: block; text-decoration: none; background: var(--card); border: 1px solid var(--paper-deep); border-radius: 16px; padding: 22px 24px; transition: transform .15s, box-shadow .15s; }
.blog-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(60, 45, 20, .1); }
.blog-card h2 { font-size: 26px; margin: 4px 0 6px; }
.blog-card p { margin: 0; color: var(--ink-soft); }
.post-meta { color: var(--ink-faint); font-size: 15px; margin: 0 0 30px; }
.post-body { font-family: var(--serif); font-size: 20px; line-height: 1.7; }
.post-body h2 { font-size: 30px; margin: 40px 0 12px; }
.post-body h3 { font-size: 23px; margin: 30px 0 10px; }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 20px; }
.post-body li { margin-bottom: 6px; }
.post-body a { color: var(--green-text, var(--green)); }
.post-body blockquote { margin: 0 0 22px; padding: 4px 0 4px 20px; border-left: 4px solid var(--gold); color: var(--ink-soft); font-style: italic; }
.post-end { margin: 46px 0 70px; padding: 24px; background: var(--card); border: 1px solid var(--paper-deep); border-radius: 16px; font-size: 17px; }
@media (max-width: 600px) { .post-body { font-size: 18px; } .post-body h2 { font-size: 25px; } }

/* Staff picks */
.tag-pick { background: var(--gold); color: #1d1a16; }
.tag-hot { background: #7c2f3a; color: #f6efe3; }
.tag-founding { background: linear-gradient(135deg, #e2c48f, #b9853a); color: #1d1a16; }
.tag-short { background: #24314a; color: #f6efe3; }
.tag-explicit { background: #6b2737; color: #f6efe3; }
.gate { border: 1px solid var(--line); border-left: 4px solid #6b2737; border-radius: 12px; padding: 22px 24px; margin: 26px 0; background: var(--card); }
.gate h2 { margin: 12px 0 8px; }
.gate ul { margin: 6px 0 16px; padding-left: 20px; }
.gate li { margin: 4px 0; }
.gate-check { display: flex; gap: 8px; align-items: center; margin: 12px 0 0; font-size: 15px; }
.tile .tag-founding { align-self: flex-start; margin: 0 0 6px; font-size: 11px; }
.staff-pick { margin: 10px 0 0; font-size: 15px; color: var(--ink-soft); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.staff-pick span:not(.tag) { font-style: italic; }
.pick-admin { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; padding: 10px 12px; border: 1.5px dashed var(--gold); border-radius: 12px; }
.pick-admin input { flex: 1; min-width: 200px; padding: 8px 10px; border: 1.5px solid var(--line, #d8ccb6); border-radius: 8px; font: inherit; font-size: 14px; background: var(--field, #fff); }
.picks-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 320px); gap: 16px; overflow-x: auto; padding: 4px 2px 14px; margin: 14px 0 26px; }
.pick-card { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--paper-deep); border-radius: 14px; padding: 14px; text-decoration: none; }
.pick-card .cover { width: 70px; height: 105px; }
.pick-card h3 { font-family: var(--serif); font-size: 18px; margin: 0 0 2px; line-height: 1.2; }
.pick-card p { margin: 6px 0 0; font-size: 14px; font-style: italic; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Writing contests */
.contest-list { display: grid; gap: 14px; margin: 22px 0 40px; }
.contest-card { display: block; text-decoration: none; background: var(--card); border: 1px solid var(--paper-deep); border-radius: 16px; padding: 20px 22px; transition: transform .15s, box-shadow .15s; }
.contest-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(60, 45, 20, .1); }
.contest-card h3 { font-family: var(--serif); font-size: 24px; margin: 6px 0 4px; }
.contest-card p { margin: 0; color: var(--ink-soft); }
.contest-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-faint); }
.tag-open { background: var(--green); color: #f6efe3; }
.tag-soon { background: #2e3f5c; color: #f6efe3; }
.tag-closed { background: var(--paper-deep); color: var(--ink-soft); }
.tag-win { background: var(--gold); color: #1d1a16; }
.contest-hero { background: var(--green); color: #f6efe3; border-radius: 20px; padding: 30px 32px; margin: 10px 0 26px; }
.contest-hero h1 { color: #f6efe3; margin: 8px 0 8px; }
.contest-hero p { color: #e7dcc8; margin: 0; }
.contest-hero .count { font-family: var(--serif); font-size: 26px; color: #f6efe3; margin-top: 16px; }
.contest-hero .small { color: #cfc3ad; }
.enter-box { background: var(--card); border: 1.5px solid var(--gold); border-radius: 16px; padding: 20px 22px; margin: 0 0 26px; }
.enter-box h2 { margin-top: 0; font-size: 22px; }
.entry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 14px 0 30px; }
.winner-admin { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.winner-admin select, .winner-admin input { padding: 6px 8px; border: 1.5px solid var(--line, #d8ccb6); border-radius: 8px; font: inherit; font-size: 13px; background: var(--field, #fff); }
.winner-admin input { flex: 1; min-width: 120px; }
@media (max-width: 600px) { .contest-hero { padding: 22px 20px; } }
/* Phones and small tablets: menu items wrap as whole items (like the homepage), never word by word. */
@media (max-width: 720px) {
  header.site nav { flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; }
  header.site nav a, .acct a { white-space: nowrap; }
}
