/*
  Designed for e-ink: the screen is paper, so white is paper and black is ink.
  Greys dither on most panels, so they are kept to secondary text and hairlines.
  No transitions or animation anywhere: e-ink redraws every frame as a flicker.
  Feedback is the Kindle's own: a pressed control inverts.
  CSS stays conservative (no flex gap, :is, clamp, nesting) for older Kindle browsers.
*/

@font-face { font-family: "Literata"; font-style: normal; font-weight: 400; font-display: fallback;
  src: url(/fonts/literata-latin-400-normal.woff2) format("woff2"), url(/fonts/literata-latin-400-normal.woff) format("woff"); }
@font-face { font-family: "Literata"; font-style: italic; font-weight: 400; font-display: fallback;
  src: url(/fonts/literata-latin-400-italic.woff2) format("woff2"), url(/fonts/literata-latin-400-italic.woff) format("woff"); }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 600; font-display: fallback;
  src: url(/fonts/literata-latin-600-normal.woff2) format("woff2"), url(/fonts/literata-latin-600-normal.woff) format("woff"); }
@font-face { font-family: "Literata"; font-style: italic; font-weight: 600; font-display: fallback;
  src: url(/fonts/literata-latin-600-italic.woff2) format("woff2"), url(/fonts/literata-latin-600-italic.woff) format("woff"); }

:root {
  --ink: #000;
  --ink-2: #333;
  --ink-3: #5a5a5a;
  --hair: #8c8c8c;
  --paper: #fff;
  /* On a Kindle these resolve to the device's own reading and UI faces. */
  --serif: "Bookerly", "Literata", Georgia, "Times New Roman", serif;
  --sans: "Amazon Ember", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: Menlo, Consolas, "Courier New", monospace;
  --gutter: 16px;
  --radius: 8px;
}

html { font-size: 19px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.size-s { font-size: 17px; }
html.size-m { font-size: 19px; }
html.size-l { font-size: 22px; }
html.size-xl { font-size: 26px; }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.5;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-font-smoothing: antialiased;
}
body.flash { background: var(--ink); }
body.flash * { visibility: hidden; }

a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button, a, .field { touch-action: manipulation; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.glyph { display: inline-block; width: 22px; height: 22px; vertical-align: middle; flex-shrink: 0; }
.glyph-sm { width: 18px; height: 18px; }
.mark { display: inline-block; width: 24px; height: 24px; vertical-align: middle; }

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

/* ---------- The bar: the device's top strip, in its own sans ---------- */

.bar {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  height: 56px;
  padding: 0 6px 0 var(--gutter);
  border-bottom: 1px solid var(--ink);
  font-family: var(--sans);
  -webkit-user-select: none; user-select: none;
}
.wordmark {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-flex: 1; -webkit-flex: 1; flex: 1;
  min-height: 44px;
  text-decoration: none;
  font-size: 19px; font-weight: 700; letter-spacing: -0.01em;
}
.wordmark .mark { margin-right: 9px; }
.bar-title {
  -webkit-box-flex: 1; -webkit-flex: 1; flex: 1;
  min-width: 0;
  margin: 0 8px;
  font-size: 15px; font-weight: 600; line-height: 1.2; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-btn {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  min-width: 48px; height: 44px;
  padding: 0 10px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 16px; font-weight: 600;
}
.bar-btn.back { padding-left: 2px; margin-left: -8px; }
.bar-btn.back .glyph { margin-right: 2px; }
.aa-btn { font-family: var(--serif); font-size: 21px; font-weight: 400; letter-spacing: -0.02em; }
.bar-btn:active, .bar-btn.on { background: var(--ink); color: var(--paper); }

/* ---------- Aa: settings open in place under the bar ---------- */

.aa { border-bottom: 1px solid var(--ink); font-family: var(--sans); }
.aa-row {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: justify; -webkit-justify-content: space-between; justify-content: space-between;
  min-height: 64px;
  margin: 0;
  padding: 8px var(--gutter);
}
.aa-row + .aa-row { border-top: 1px solid var(--hair); min-height: 56px; }
.aa-label { font-size: 15px; font-weight: 600; }
.aa-sizes { display: -webkit-box; display: -webkit-flex; display: flex; }
.aa-opt {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: end; -webkit-align-items: flex-end; align-items: flex-end;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  width: 52px; height: 48px;
  margin-left: 8px;
  padding-bottom: 9px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--serif); line-height: 1; text-decoration: none;
}
.aa-s { font-size: 14px; }
.aa-m { font-size: 18px; }
.aa-l { font-size: 23px; }
.aa-xl { font-size: 29px; }
.aa-opt.on, .aa-opt:active { background: var(--ink); color: var(--paper); }
.link-btn {
  min-height: 44px; padding: 0 12px; margin-right: -12px;
  border: 0; background: none;
  font-family: var(--sans); font-size: 16px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn.armed { background: var(--ink); color: var(--paper); text-decoration: none; border-radius: var(--radius); }

/* ---------- Composer: always at the top, where the keyboard can't cover it ---------- */

.compose {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-wrap: wrap; flex-wrap: wrap;
  -webkit-box-align: start; -webkit-align-items: flex-start; align-items: flex-start;
  padding: 14px var(--gutter);
}
.compose-wrap { border-bottom: 2px solid var(--ink); }
.page-library .compose { padding-top: 12px; padding-bottom: 18px; }
.compose-error { margin: -8px var(--gutter) 14px; width: auto; }

/* Ask | Write a book: two tabs, the current one underlined in ink. */
.tabs {
  display: -webkit-box; display: -webkit-flex; display: flex;
  padding: 0 var(--gutter);
  font-family: var(--sans);
}
.tab {
  display: block;
  min-height: 44px;
  margin-right: 22px;
  padding: 12px 0 8px;
  border-bottom: 3px solid transparent;
  font-size: 16px; font-weight: 600; line-height: 20px; color: var(--ink-2);
  text-decoration: none;
}
.tab.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }
.tab:active { background: var(--ink); color: var(--paper); }

.compose-book { display: block; }
.compose-book .compose-field { width: 100%; min-height: 100px; font-size: 20px; margin-bottom: 12px; }
.lengths {
  display: -webkit-box; display: -webkit-flex; display: flex;
  margin: 12px 0 0; padding: 0; border: 0;
}
.pick { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; display: block; cursor: pointer; }
.pick + .pick { margin-left: 10px; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick span {
  display: block;
  min-height: 48px;
  padding: 7px 12px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--sans); font-size: 14px; line-height: 17px; color: var(--ink-2);
}
.pick b { display: block; font-size: 16px; line-height: 19px; color: var(--ink); }
.pick input:checked + span { border-width: 3px; padding: 5px 10px; color: var(--ink); }
.pick input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.style-line { margin: 12px 0; font-family: var(--sans); font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.style-now { color: var(--ink); font-weight: 700; }
.style-line a { font-weight: 700; color: var(--ink); text-underline-offset: 3px; margin-left: 4px; }
.btn-wide { display: block; width: 100%; }
.fine { margin: 10px 0 0; font-family: var(--sans); font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.fine a { color: var(--ink); font-weight: 700; }

/* The free counter in the bar: a small ink chip; it fills in when the allowance is gone. */
.chip {
  display: block;
  margin-right: 4px;
  padding: 6px 10px;
  border: 1px solid var(--ink);
  border-radius: 14px;
  font-family: var(--sans); font-size: 13px; font-weight: 700; line-height: 14px;
  text-decoration: none; white-space: nowrap;
}
.chip-ink, .chip:active { background: var(--ink); color: var(--paper); }
.bar-pad { min-width: 48px; }

.notice {
  margin: 0; padding: 12px var(--gutter);
  border-bottom: 1px solid var(--ink);
  font-family: var(--sans); font-size: 15px; font-weight: 700; line-height: 1.4;
}
.notice-ok { background: var(--ink); color: var(--paper); }
.compose-reply { border-bottom: 1px solid var(--ink); padding-top: 10px; padding-bottom: 10px; }
.field {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 13px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  font-family: var(--serif); font-size: 18px; line-height: 1.4;
  -webkit-appearance: none; appearance: none;
}
.field::-webkit-input-placeholder { color: var(--ink-3); opacity: 1; }
.field::placeholder { color: var(--ink-3); opacity: 1; }
.field:focus { border-width: 3px; padding: 9px 12px; }
.compose-field { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; width: auto; min-width: 0; resize: none; overflow: hidden; }
.page-library .compose-field { min-height: 76px; font-size: 20px; }
.compose-reply .compose-field { font-size: 17px; }
.compose-reply.is-busy .field { border-style: dashed; border-color: var(--hair); }

.btn {
  display: inline-block;
  min-height: 48px;
  padding: 12px 20px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans); font-size: 17px; font-weight: 700; line-height: 20px;
  text-align: center; text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.btn:active { background: var(--paper); color: var(--ink); }
.btn[disabled] { background: var(--paper); color: var(--ink-3); border-color: var(--hair); border-style: dashed; }
.btn-quiet { background: var(--paper); color: var(--ink); }
.btn-quiet:active { background: var(--ink); color: var(--paper); }
.compose-btn { margin-left: 10px; }
.page-library .compose-btn { min-height: 76px; padding-left: 24px; padding-right: 24px; font-size: 18px; }
.field-error {
  width: 100%;
  margin: 10px 0 0;
  font-family: var(--sans); font-size: 15px; font-weight: 700;
}

/* ---------- Library ---------- */

.shelf-h {
  margin: 0;
  padding: 16px var(--gutter) 10px;
  font-family: var(--sans); font-size: 15px; font-weight: 700; letter-spacing: 0;
  border-bottom: 1px solid var(--ink);
}
.shelf-n { color: var(--ink-3); font-weight: 600; margin-left: 4px; }
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  position: relative;
  display: block;
  min-height: 72px;
  padding: 13px 48px 13px var(--gutter);
  border-bottom: 1px solid var(--hair);
  text-decoration: none;
}
.row-title {
  display: block;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 1rem; line-height: 1.3;
}
.row-meta { display: block; margin-top: 5px; font-family: var(--sans); font-size: 14px; line-height: 18px; color: var(--ink-2); }
.row-meta em { font-style: normal; font-weight: 700; color: var(--ink); }
.row-chev { position: absolute; right: 14px; top: 50%; margin-top: -9px; height: 18px; line-height: 0; }
.row:active { background: var(--ink); color: var(--paper); }
.row-book { padding-left: calc(var(--gutter) + 30px); }

/* ⋯ on each shelf row: opens Delete in place under the row (never a side sheet or a dialog). */
.shelf-item { position: relative; }
.shelf-item .row { padding-right: 60px; }
.row-more {
  position: absolute; right: 6px; top: 12px;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  width: 48px; height: 48px;
  border-radius: var(--radius);
  text-decoration: none;
}
.row-more:active, .row-more.on { background: var(--ink); color: var(--paper); }
.row-menu {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  padding: 10px var(--gutter) 12px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--sans);
}
.shelf-item.open .row { border-bottom: 0; }
.row-menu form { margin: 0 10px 0 0; }
.row-act {
  display: block;
  min-height: 44px; padding: 11px 16px;
  border: 1px solid var(--ink); border-radius: var(--radius); background: var(--paper);
  font-family: var(--sans); font-size: 15px; font-weight: 700; line-height: 20px; text-decoration: none;
  cursor: pointer;
}
.row-del { border-width: 2px; padding: 10px 15px; }
.row-act:active, .row-act.armed { background: var(--ink); color: var(--paper); }
.row-glyph { position: absolute; left: var(--gutter); top: 15px; line-height: 0; }
.row-toc { min-height: 56px; padding-left: calc(var(--gutter) + 34px); }
.row-toc .row-title { -webkit-line-clamp: 2; }
.toc-n { position: absolute; left: var(--gutter); top: 15px; width: 26px; font-family: var(--sans); font-size: 14px; font-weight: 700; color: var(--ink-2); }
.row-toc:active .toc-n { color: var(--paper); }
.starter-kind { display: block; margin-bottom: 2px; font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.row:active .row-meta, .row:active .row-meta em { color: var(--paper); }

.pager {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: justify; -webkit-justify-content: space-between; justify-content: space-between;
  padding: 4px 6px;
  font-family: var(--sans);
}
.pager-btn {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  min-height: 48px; padding: 0 10px;
  border-radius: var(--radius);
  font-size: 15px; font-weight: 700; text-decoration: none;
}
.pager-btn:active { background: var(--ink); color: var(--paper); }
.pager-btn.off { color: var(--hair); }
.pager-at { font-size: 14px; font-weight: 600; color: var(--ink-2); }

/* ---------- Empty and unlock: an etched plate, like a sleep screen ---------- */

.plate-art { display: block; width: 72%; max-width: 360px; height: auto; margin: 0 auto 18px; }
.empty { padding: 22px var(--gutter) 28px; text-align: center; }
.empty .plate-art { width: 62%; max-width: 330px; margin-bottom: 14px; }
.empty-title { margin: 0 0 4px; font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
.empty-line { margin: 0 0 18px; font-family: var(--sans); font-size: 15px; color: var(--ink-2); }
.starters { list-style: none; margin: 0 auto; padding: 0; max-width: 520px; text-align: left; }
.starters li { margin-bottom: 10px; }
.starter {
  display: block; width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  font-family: var(--serif); font-size: 0.95rem; line-height: 1.35; text-align: left;
  cursor: pointer;
}
.starter:active { background: var(--ink); color: var(--paper); }

.unlock { max-width: 460px; margin: 0 auto; padding: 36px 24px 40px; text-align: center; }
.unlock-name {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  margin: 0 0 6px;
  font-family: var(--sans); font-size: 30px; font-weight: 700; letter-spacing: -0.02em;
}
.unlock-name .mark { width: 30px; height: 30px; margin-right: 10px; }
.unlock-line { margin: 0 0 28px; font-style: italic; font-size: 1.05rem; color: var(--ink-2); }
.unlock-form { text-align: left; }
.field-label { display: block; margin: 0 0 8px; font-family: var(--sans); font-size: 15px; font-weight: 700; }
.field-row { display: -webkit-box; display: -webkit-flex; display: flex; }
.field-row .field { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; width: auto; min-width: 0; font-family: var(--sans); font-size: 20px; letter-spacing: 0.04em; }
.field-row .btn { margin-left: 10px; }
.field-code { letter-spacing: 0.3em; font-size: 24px !important; }
.unlock-reason { margin: 0 0 24px; padding: 12px 14px; border: 2px solid var(--ink); border-radius: var(--radius); font-family: var(--sans); font-size: 15px; line-height: 1.45; text-align: left; }
.resend { margin-top: 18px; text-align: left; }
.resend .link-btn { margin-left: -12px; }

/* ---------- Account and plans: a plain sheet of settings ---------- */

.sheet { max-width: 720px; margin: 0 auto; padding: 0 0 40px; }
.sect { padding: 20px var(--gutter) 22px; border-bottom: 1px solid var(--ink); }
.sect-h { margin: 0 0 8px; font-family: var(--sans); font-size: 17px; font-weight: 700; }
.sect-line { margin: 0 0 14px; font-family: var(--sans); font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.sect-line b { color: var(--ink); }
.sect .field { margin-bottom: 12px; font-size: 17px; }
.sect textarea.field { resize: vertical; }
.panel { padding: 14px 16px; border: 2px solid var(--ink); border-radius: var(--radius); }
.panel-title { margin: 0 0 4px; font-family: var(--sans); font-size: 17px; font-weight: 700; }
.panel-line { margin: 0 0 12px; font-family: var(--sans); font-size: 15px; line-height: 1.45; }
.link-left { margin: 0 0 0 -12px; }
.presets { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 0 10px; }
.preset {
  min-height: 44px; margin: 0 8px 8px 0; padding: 0 14px;
  border: 1px solid var(--ink); border-radius: 22px; background: var(--paper);
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.preset.on, .preset:active { background: var(--ink); color: var(--paper); }
.aa-row.flat { padding-left: 0; padding-right: 0; min-height: 48px; }

.offer { padding: 26px var(--gutter) 10px; }
.eyebrow { margin: 0 0 8px; font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.price { margin: 0 0 14px; font-size: 1.2rem; }
.price-n { font-size: 3rem; font-weight: 600; line-height: 1; margin-right: 4px; }
.ticks { margin: 0 0 22px; padding: 0; list-style: none; }
.ticks li { position: relative; padding: 9px 0 9px 28px; border-top: 1px solid var(--hair); font-size: 1rem; }
.ticks li:last-child { border-bottom: 1px solid var(--hair); }
.ticks li:before { content: ""; position: absolute; left: 3px; top: 15px; width: 12px; height: 6px; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); -webkit-transform: rotate(-45deg); transform: rotate(-45deg); }
.shortlink { margin: 18px 0; padding: 18px 12px; border: 2px solid var(--ink); border-radius: var(--radius); font-family: var(--sans); font-size: 26px; font-weight: 700; text-align: center; letter-spacing: 0.02em; word-break: break-all; }

/* ---------- A book ---------- */

.book { padding-bottom: 32px; }
.book-head { display: -webkit-box; display: -webkit-flex; display: flex; padding: 20px var(--gutter) 16px; }
.book-cover { width: 104px; height: auto; -webkit-flex-shrink: 0; flex-shrink: 0; border: 1px solid var(--ink); margin-right: 16px; }
.book-title { margin: 0 0 6px; font-size: 1.3rem; font-weight: 600; line-height: 1.22; }
.book-sub { margin: 0 0 8px; font-style: italic; line-height: 1.35; color: var(--ink-2); }
.book-meta { margin: 0; font-family: var(--sans); font-size: 14px; color: var(--ink-2); }
.book .notice { border-top: 1px solid var(--ink); }
.actions { padding: 6px var(--gutter) 0; }
.actions .btn, .actions form { margin-bottom: 10px; }
.book > .fine { padding: 0 var(--gutter); margin: 2px 0 22px; }
.toc-h { border-top: 1px solid var(--ink); }
.book-wait { padding: 30px var(--gutter); }
.book-wait .book-title { margin-bottom: 18px; }
.keep { margin: 1.2em 0 0; }
.remember { margin: 4px var(--gutter) 18px; padding: 14px 16px; border: 2px solid var(--ink); border-radius: var(--radius); }
.remember-q { margin: 0 0 6px; font-family: var(--sans); font-size: 16px; font-weight: 700; }
.memory { margin: 0 0 12px; font-style: italic; line-height: 1.4; }
.remember-row { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; -webkit-align-items: center; align-items: center; }
.remember-row .btn { margin-right: 14px; }
.keep-link {
  display: -webkit-inline-box; display: -webkit-inline-flex; display: inline-flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  min-height: 44px; padding: 0 12px 0 10px;
  border: 1px solid var(--ink); border-radius: var(--radius); background: var(--paper);
  font-family: var(--sans); font-size: 15px; font-weight: 700; text-decoration: none;
  cursor: pointer;
}
.keep-link .glyph { margin-right: 8px; }
.keep-link:active { background: var(--ink); color: var(--paper); }

/* ---------- The reader ---------- */

.reader { max-width: 720px; margin: 0 auto; padding: 0 24px 32px; }
.turn { padding-top: 24px; }
.turn + .turn { margin-top: 32px; border-top: 1px solid var(--ink); }

.q { font-style: italic; font-size: 1.06rem; line-height: 1.42; }
.q p { margin: 0 0 0.45em; }
.q p:last-child { margin-bottom: 0; }
.q-rule { width: 40px; height: 0; margin: 16px 0 18px; border: 0; border-top: 2px solid var(--ink); }

.a { font-size: 1rem; line-height: 1.52; orphans: 2; widows: 2; }
.a p { margin: 0 0 0.75em; }
.a.dropcap > p:first-child::first-letter {
  float: left;
  margin: 0.07em 0.09em 0 0;
  font-size: 3.05em; line-height: 0.86; font-weight: 600;
}
.a h1, .a h2, .a h3, .a h4 { margin: 1.1em 0 0.35em; font-weight: 600; line-height: 1.25; break-after: avoid; -webkit-column-break-after: avoid; page-break-after: avoid; }
.a > :first-child { margin-top: 0; }
.a h1 { font-size: 1.3rem; }
.a h2 { font-size: 1.17rem; }
.a h3 { font-size: 1.06rem; }
.a h4 { font-size: 1rem; font-style: italic; }
.a ul, .a ol { margin: 0 0 0.8em; padding-left: 1.35em; }
.a li { margin: 0 0 0.3em; }
.a li > p { margin: 0 0 0.3em; }
.a strong { font-weight: 600; }
.a a { text-decoration-thickness: 1px; text-underline-offset: 2px; }
.a blockquote { margin: 0 0 0.8em; padding: 0 0 0 14px; border-left: 3px solid var(--ink); font-style: italic; }
.a hr { width: 30%; height: 0; margin: 1.3em auto; border: 0; border-top: 1px solid var(--ink); }
.a code { font-family: var(--mono); font-size: 0.86em; padding: 0 0.2em; border: 1px solid var(--hair); border-radius: 3px; }
.a pre {
  margin: 0 0 0.9em;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.45;
  white-space: pre-wrap; word-wrap: break-word;
}
.a pre code { padding: 0; border: 0; font-size: inherit; }
.a .table { margin: 0 0 0.9em; overflow-x: auto; }
.a table { border-collapse: collapse; font-size: 0.86rem; line-height: 1.35; }
.a th, .a td { padding: 6px 8px; border: 1px solid var(--ink); text-align: left; vertical-align: top; }
.a th { font-weight: 600; }

.chapter-no { margin: 0 0 4px; font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.chapter-title { margin: 0 0 18px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); font-size: 1.4rem; font-weight: 600; line-height: 1.22; }
.state { padding: 2px 0; }
.state-title { margin: 0 0 6px; font-style: italic; }
.state-title .quill { margin-right: 8px; vertical-align: -2px; }
.state-note { margin: 0 0 14px; font-family: var(--sans); font-size: 15px; line-height: 1.45; color: var(--ink-2); }

/* Paged: the conversation is set in columns one page wide, turned like a book.
   Each exchange opens on a fresh page, as a chapter would. */
html.paged, html.paged .page-chat { height: 100%; overflow: hidden; }
html.paged .reader { padding-top: 20px; padding-bottom: 0; overflow: hidden; }
html.paged .turn { padding-top: 4px; }
html.paged .flow {
  overflow: hidden;
  -webkit-column-count: 1; -moz-column-count: 1; column-count: 1;
  -webkit-column-gap: 48px; -moz-column-gap: 48px; column-gap: 48px;
  -webkit-column-fill: auto; -moz-column-fill: auto; column-fill: auto;
}
html.paged .turn + .turn { margin-top: 0; border-top: 0; -webkit-column-break-before: always; break-before: column; }
html.paged .a pre, html.paged .a blockquote, html.paged .a .table { -webkit-column-break-inside: avoid; break-inside: avoid; }

.pagebar {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  height: 56px;
  max-width: 720px; margin: 0 auto;
  padding: 0 6px;
  border-top: 1px solid var(--ink);
  font-family: var(--sans);
  -webkit-user-select: none; user-select: none;
}
.turn-btn {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  width: 56px; height: 46px;
  padding: 0; border: 0; border-radius: var(--radius); background: none;
  cursor: pointer;
}
.turn-btn:active { background: var(--ink); color: var(--paper); }
.turn-btn[disabled] { color: var(--hair); background: none; }
.progress {
  position: relative;
  -webkit-box-flex: 1; -webkit-flex: 1; flex: 1;
  height: 6px;
  margin: 0 12px 0 6px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ink); }
.page-at { min-width: 64px; margin-right: 4px; font-size: 14px; font-weight: 700; text-align: right; white-space: nowrap; }

@media (min-width: 700px) {
  :root { --gutter: 24px; }
  .bar { padding-left: var(--gutter); }
}

/* Wide screens (Scribe): rules stay full-bleed like the device's own UI, but every
   control and row aligns to the reading measure (720 px column, 24 px inset). */
@media (min-width: 768px) {
  .bar, .aa-row, .compose, .shelf-h, .pager, .empty, .tabs, .notice, .book-head, .actions, .book-wait {
    padding-left: calc(50% - 336px);
    padding-right: calc(50% - 336px);
  }
  .bar { padding-right: calc(50% - 346px); }
  .row { padding-left: calc(50% - 336px); padding-right: calc(50% - 300px); }
  .row-book, .row-toc { padding-left: calc(50% - 302px); }
  .row-glyph, .toc-n { left: calc(50% - 336px); }
  .row-more { right: calc(50% - 352px); }
  .row-menu { padding-left: calc(50% - 336px); padding-right: calc(50% - 336px); }
  .book > .fine { padding-left: calc(50% - 336px); padding-right: calc(50% - 336px); }
  .compose-error { margin-left: calc(50% - 336px); margin-right: calc(50% - 336px); }
  .row-chev { right: calc(50% - 340px); }
  .pagebar { max-width: none; padding-left: calc(50% - 346px); padding-right: calc(50% - 346px); }
}
