:root {
  --ink: #19252b;
  --muted: #667078;
  --paper: #f2eee3;
  --surface: #fffdf8;
  --line: #d4d9d8;
  --teal: #246e72;
  --teal-dark: #164c50;
  --warm: #b86a35;
  --danger: #9b3636;
  --shadow: 0 18px 50px rgba(25, 37, 43, .12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0, rgba(255,255,255,.86), transparent 34%),
    var(--paper);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
a { color: var(--teal-dark); }
.reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(242,238,227,.94);
}
.reader-brand { display: grid; gap: 3px; }
.reader-brand strong { font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.reader-brand span { color: var(--muted); font-size: 12px; }
.reader-nav { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.reader-nav a, .reader-nav button, .button {
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.button.primary { border-color: var(--teal); background: var(--teal); color: #fff; }
.button.danger { color: var(--danger); }
.page {
  width: min(1080px, calc(100% - 32px));
  margin: 38px auto 60px;
}
.page.narrow { width: min(540px, calc(100% - 32px)); }
.hero { margin-bottom: 24px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { margin: 0 0 10px; font-size: clamp(34px, 6vw, 54px); line-height: 1.02; }
h2 { margin: 0; font-size: 25px; }
.lead { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.65; }
.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,253,248,.92);
  box-shadow: var(--shadow);
}
.auth-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.auth-tabs button {
  flex: 1;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.auth-tabs button[aria-selected="true"] {
  border-color: var(--teal);
  background: #e5f0ef;
  color: var(--teal-dark);
}
.auth-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; }
.field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #aeb8ba;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.hint, .status { color: var(--muted); font-size: 12px; line-height: 1.5; }
.status { min-height: 18px; margin: 4px 0 0; }
.status.error { color: var(--danger); }
.status.success { color: var(--teal-dark); }
.account-summary { display: none; gap: 15px; align-items: center; justify-content: space-between; }
.account-summary.visible { display: flex; }
.bookmark-list { display: grid; gap: 13px; }
.bookmark-empty {
  padding: 28px;
  border: 1px dashed #aeb8ba;
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}
.bookmark-row {
  display: grid;
  grid-template-columns: minmax(90px,.25fr) minmax(220px,1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.bookmark-row:last-child { border-bottom: 0; }
.chapter-number { color: var(--warm); font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.bookmark-topic { display: grid; gap: 5px; }
.bookmark-topic strong { font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.bookmark-topic span { color: var(--muted); font-size: 12px; }
.bookmark-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
@media (max-width: 700px) {
  .reader-header { align-items: flex-start; padding: 13px 16px; }
  .page { margin-top: 25px; }
  .panel { padding: 18px; }
  .bookmark-row { grid-template-columns: 1fr; gap: 8px; }
  .bookmark-actions { justify-content: flex-start; }
}
