:root {
  color-scheme:light;
  --ink:#3c291d;
  --muted:#705c49;
  --gold:#9c722e;
  --line:#d6c8b0;
  --paper:#fffdf7;
  --ground:#f0eadf;
  font-family:Georgia,'Times New Roman',serif;
  color:var(--ink);
  background:var(--ground)}
* {
  box-sizing:border-box}
body {
  margin:0}
button,input,summary {
  font:inherit}
button,a,summary {
  -webkit-tap-highlight-color:transparent}
button,summary {
  cursor:pointer}
button {
  min-height:44px;
  border:1px solid var(--line);
  border-radius:4px;
  background:var(--paper);
  padding:.65rem 1rem;
  color:var(--ink);
  line-height:1.25}
button:hover {
  border-color:var(--gold);
  background:#f9f1df}
button:disabled {
  opacity:.55;
  cursor:default}
button.primary {
  background:var(--ink);
  color:var(--paper);
  border-color:var(--ink)}
button.primary:hover {
  background:#573c27}
a {
  color:inherit;
  text-underline-offset:4px}
a:focus-visible,button:focus-visible,input:focus-visible,summary:focus-visible,[tabindex]:focus-visible {
  outline:3px solid var(--gold);
  outline-offset:4px}
[hidden] {
  display:none!important}
.skip-link {
  position:absolute;
  left:20px;
  top:-80px;
  background:var(--paper);
  padding:1rem;
  z-index:5}
.skip-link:focus {
  top:12px}
.masthead {
  min-height:112px;
  padding:22px max(24px,calc((100% - 1280px)/2));
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  gap:24px;
  background:#f8f3e9}
.brand {
  display:flex;
  align-items:center;
  gap:15px;
  text-decoration:none;
  font-size:1.05rem;
  max-width:340px;
  line-height:1.35}
.brand-mark {
  font-size:3rem;
  color:var(--gold)}
.masthead-label {
  margin-left:auto;
  text-transform:uppercase;
  font-size:.7rem;
  letter-spacing:.17em;
  color:var(--muted)}
.account {
  margin-left:auto;
  display:flex;
  gap:12px;
  align-items:center}
.account+ .masthead-label {
  display:none}
.account[hidden]+ .masthead-label {
  display:block}
.account details {
  position:relative}
.account summary {
  padding:12px}
.account-menu {
  position:absolute;
  right:0;
  top:100%;
  z-index:4;
  background:var(--paper);
  border:1px solid var(--line);
  padding:8px;
  min-width:235px;
  box-shadow:0 12px 30px #3c291d15;
  display:grid;
  gap:8px}
main {
  max-width:1280px;
  margin:auto;
  padding:24px 32px 64px;
  min-height:calc(100vh - 210px)}
#status {
  max-width:900px;
  margin:0 auto;
  color:var(--ink);
  line-height:1.5}
#status:not(:empty) {
  padding:16px 20px;
  border-left:3px solid var(--gold);
  background:#fff9ec;
  margin-bottom:24px}
.login-layout {
  display:grid;
  grid-template-columns:1.15fr 1fr;
  gap:8%;
  align-items:center;
  padding:60px 24px}
.eyebrow {
  font-size:.72rem;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--muted);
  margin:0 0 20px}
h1,h2,p {
  overflow-wrap:anywhere}
h1 {
  font-size:clamp(2rem,4vw,3.8rem);
  font-weight:400;
  line-height:1.12;
  margin:0 0 24px;
  letter-spacing:-.025em}
h2 {
  font-size:1.7rem;
  font-weight:400;
  margin:0 0 32px}
.login-intro>p:not(.eyebrow) {
  max-width:410px;
  font-size:1.12rem;
  line-height:1.8;
  color:var(--muted)}
.botanical {
  display:block;
  color:var(--gold);
  font-size:6rem;
  line-height:1.2;
  margin:16px 0}
.login-intro .reading-note {
  font-style:italic;
  font-size:.95rem!important;
  max-width:350px}
.login-paper {
  padding:48px 40px;
  background:var(--paper);
  border:1px solid var(--line);
  border-top:4px solid var(--gold);
  box-shadow:6px 7px 0 #e5dccd}
label {
  display:block;
  font-size:1rem;
  margin-bottom:10px}
input {
  border:1px solid #aa987e;
  border-radius:3px;
  padding:13px 12px;
  background:#fff;
  color:var(--ink);
  width:100%;
  min-height:48px}
#code {
  letter-spacing:.2em;
  font-size:1.5rem}
.hint {
  font-size:.9rem;
  line-height:1.6;
  color:var(--muted);
  margin:12px 0 24px}
.login-paper .primary {
  width:100%;
  padding:15px}
.code-actions {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:16px}
.code-actions button {
  flex:1;
  font-size:.85rem}
.section-heading {
  padding:40px 0 28px}
.section-heading>p:last-child {
  color:var(--muted)}
#library-list {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:24px;
  margin-bottom:30px}
.subscription-management {
  max-width:760px;
  margin:8px 0 30px;
  padding:28px 30px;
  border:1px solid var(--line);
  border-left:5px solid var(--gold);
  background:#fbf7ee}
.subscription-management h2 {
  margin:0 0 12px;
  font-size:1.45rem}
.subscription-offer,.subscription-meta,.subscription-note,.subscription-empty,.subscription-status {
  margin:0;
  color:var(--muted);
  line-height:1.6}
.subscription-offer { max-width:650px; }
#subscription-list { display:grid; gap:12px; margin-top:20px; }
.subscription-entry {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px 18px;
  padding-top:16px;
  border-top:1px solid var(--line)}
.subscription-entry .subscription-button { margin-left:auto; }
.subscription-note { font-style:italic; flex-basis:100%; }
.subscription-status:not(:empty) { margin-top:16px; color:var(--ink); }
.book-entry {
  text-align:left;
  background:var(--paper);
  border:1px solid var(--line);
  border-left:5px solid var(--gold);
  padding:30px;
  max-width:560px;
  display:grid;
  gap:18px}
.book-entry h2 {
  margin:0;
  font-size:1.8rem}
.book-entry p {
  margin:0;
  color:var(--muted);
  line-height:1.5}
.book-entry .open-label {
  margin-top:12px;
  color:var(--ink);
  text-decoration:underline;
  text-underline-offset:5px}
.empty-panel {
  padding:40px;
  background:var(--paper);
  border:1px solid var(--line);
  line-height:1.8;
  margin:40px 0}
.empty-panel h1 {
  font-size:2rem}
.reading-heading {
  text-align:center;
  padding:24px 0}
.reading-heading .eyebrow {
  margin-bottom:12px}
.reading-heading h1 {
  font-size:clamp(1.4rem,2.5vw,2.2rem);
  margin-bottom:4px}
.toolbar {
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:16px;
  align-items:center;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  padding:16px 0;
  margin-bottom:24px}
.mode-controls,.zoom-controls {
  display:flex;
  align-items:center;
  gap:4px}
.toolbar button {
  font-size:.9rem}
button[aria-pressed=true] {
  background:var(--ink);
  color:var(--paper);
  border-color:var(--ink)}
#zoom-value {
  width:58px;
  text-align:center;
  font-size:.9rem}
.reading-scroll {
  overflow:auto;
  max-width:100%;
  padding:0 0 16px;
  overscroll-behavior-x:contain}
#reader-page {
  width:100%;
  max-width:880px;
  margin:auto;
  background:var(--paper);
  min-height:180px;
  border:1px solid var(--line);
  box-shadow:0 4px 14px #3c291d0a}
#reader-page.zoom-125 {
  width:125%;
  max-width:1100px}
#reader-page.zoom-150 {
  width:150%;
  max-width:1320px}
#reader-page.zoom-175 {
  width:175%;
  max-width:1540px}
#reader-page.zoom-200 {
  width:200%;
  max-width:1760px}
#page-image {
  display:block;
  width:100%;
  height:auto}
#page-text {
  padding:clamp(24px,5vw,64px);
  font-size:1.15rem;
  line-height:1.85;
  white-space:pre-wrap}
#reader-page.zoom-125 #page-text {
  font-size:1.4375rem}
#reader-page.zoom-150 #page-text {
  font-size:1.725rem}
#reader-page.zoom-175 #page-text {
  font-size:2.0125rem}
#reader-page.zoom-200 #page-text {
  font-size:2.3rem}
#page-text h2 {
  font-size:1.6em;
  line-height:1.35}
#page-text p {
  margin:0 0 1.2em}
.page-nav {
  display:flex;
  justify-content:center;
  align-items:center;
  gap:20px;
  padding-top:14px}
.page-nav form {
  display:flex;
  align-items:center;
  gap:10px}
.page-nav label {
  margin:0;
  font-size:.9rem}
#page-number {
  width:72px;
  padding:9px}
#page-count {
  white-space:nowrap;
  font-size:.9rem}
.progress-status {
  text-align:center;
  font-size:.8rem;
  color:var(--muted);
  min-height:24px}
.reader-footer {
  padding:28px 32px;
  border-top:1px solid var(--line);
  display:flex;
  gap:20px;
  justify-content:space-between;
  font-size:.85rem;
  color:var(--muted)}
@media(max-width:700px) {
  .masthead {
  padding:16px 20px;
  gap:12px;
  min-height:90px}
.brand {
  font-size:.85rem;
  gap:8px;
  max-width:225px}
.brand-mark {
  font-size:2.4rem}
.masthead-label {
  font-size:.6rem;
  max-width:75px;
  line-height:1.7}
.account {
  gap:0}
.account #back-library {
  font-size:.8rem;
  padding:10px}
.account summary {
  font-size:.8rem}
main {
  padding:20px 16px 40px}
.login-layout {
  grid-template-columns:1fr;
  gap:32px;
  padding:24px 4px}
.login-intro h1 {
  font-size:2.65rem;
  max-width:400px}
.login-intro>p:not(.eyebrow) {
  font-size:1rem}
.botanical {
  display:none}
.login-intro .reading-note {
  margin-bottom:0}
.login-paper {
  padding:28px 24px}
.eyebrow {
  margin-bottom:14px}
.toolbar {
  gap:10px}
.toolbar button {
  padding:10px;
  font-size:.85rem}
.page-nav {
  gap:8px;
  flex-wrap:wrap}
.page-nav form {
  gap:6px}
.page-nav label {
  display:none}
.page-nav>button {
  font-size:.85rem;
  padding:10px}
.reader-footer {
  padding:24px 20px;
  font-size:.8rem;
  flex-direction:column;
  gap:12px}
.empty-panel {
  padding:24px}
.subscription-management { padding:24px; }
.subscription-entry .subscription-button { width:100%; margin-left:0; }
#page-text {
  line-height:1.7}
.section-heading {
  padding-top:20px}
}

@media(max-width:700px) {
  .masthead {
  flex-wrap:wrap}
.masthead:has(.account:not([hidden])) .brand {
  flex-basis:100%;
  max-width:none}
.account:not([hidden]) {
  width:100%;
  margin-left:0;
  justify-content:flex-end;
  border-top:1px solid var(--line);
  padding-top:8px}
.account #back-library {
  margin-right:auto}
}


/* Horizontal page gestures preserve native vertical scrolling and pinch zoom. */
#reader-page.gesture-enabled { touch-action:pan-y pinch-zoom; cursor:grab; }
#reader-page.is-dragging { cursor:grabbing; user-select:none; will-change:transform; }
#page-image { -webkit-user-drag:none; user-select:none; }

.reading-scroll.is-zoomed { max-height:75svh; overflow:auto; touch-action:auto; cursor:grab; }
.reading-scroll.is-panning { cursor:grabbing; user-select:none; }
