/* The Hollow Veil — review app. Palette from therusticpoet.com (main.css). */
:root {
  --bg: #e8d5b0;
  --bg-2: #dcc497;
  --paper: #fbf8f2;
  --paper-2: #f5f1e8;
  --paper-deep: #ece3d2;
  --ink: #231a13;
  --muted: #6a5e50;
  --accent: #7a5a39;
  --accent-ink: #5a3e1e;
  --plum: #4c3346;
  --gold: #c8a667;
  --rule: rgba(122, 90, 57, .22);
  --glass: rgba(252, 247, 236, .93);
  --glass-border: rgba(140, 100, 55, .2);
  --glass-shadow: 0 4px 28px rgba(100, 65, 20, .14), inset 0 1px 0 rgba(255, 255, 255, .6);
  --page-shadow: 0 1px 2px rgba(60, 35, 10, .08), 0 14px 40px rgba(60, 35, 10, .14);
  --field: #fffdf8;
  --bar: #f8f0df;
  --danger: #a33;
  --ok: #4a7c59;
  --hl-alpha: .30;
  --serif: "EB Garamond", "Garamond", "Iowan Old Style", Georgia, serif;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --ui: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --fs: 20px;
  --measure: 34em;
  --radius: 10px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #16110d;
  --bg-2: #0f0b08;
  --paper: #221b15;
  --paper-2: #1c1611;
  --paper-deep: #2c231b;
  --ink: #eadfca;
  --muted: #a8977e;
  --accent: #d6b27c;
  --accent-ink: #e8c893;
  --plum: #d4b0cb;
  --gold: #c8a667;
  --rule: rgba(214, 178, 124, .18);
  --glass: rgba(30, 24, 18, .95);
  --glass-border: rgba(214, 178, 124, .16);
  --glass-shadow: 0 6px 30px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04);
  --page-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 50px rgba(0, 0, 0, .45);
  --field: #1a140f;
  --bar: #1d1712;
  --danger: #e27b6f;
  --ok: #8fc49b;
  --hl-alpha: .26;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--ui); font-size: 15px; line-height: 1.5;
  background: var(--bg) radial-gradient(ellipse at 50% -10%, rgba(255, 246, 225, .55), transparent 60%) fixed;
  overflow-x: hidden;
}
:root[data-theme="dark"] body { background: var(--bg) radial-gradient(ellipse at 50% -10%, rgba(120, 86, 50, .18), transparent 60%) fixed; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.glass {
  background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
}
.kicker { font-family: var(--ui); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin: 0; font-weight: 600; }

/* ---------------------------------------------------------------- buttons & fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px;
  border-radius: 999px; border: 1px solid var(--glass-border); background: var(--paper); color: var(--ink);
  font-family: var(--ui); font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--plum); border-color: var(--plum); color: #fbf3e4; }
:root[data-theme="dark"] .btn.primary { background: #6b4a63; border-color: #6b4a63; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
input[type=text], input[type=password], input:not([type]), select, textarea {
  width: 100%; border: 1px solid var(--glass-border); border-radius: 8px; background: var(--field); padding: 9px 11px; font-size: 16px;
}
select { width: auto; padding: 6px 28px 6px 10px; font-size: 13px; -webkit-appearance: none; appearance: none;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a5a39'/%3E%3C/svg%3E") no-repeat right 10px center; }
textarea { resize: vertical; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); }
label.chk { display: flex; align-items: center; gap: 7px; font-weight: 400; }
label.chk input { width: 16px; height: 16px; accent-color: var(--plum); margin: 0; }
.stack { display: grid; gap: 14px; }
.alert { background: rgba(170, 51, 51, .1); border: 1px solid rgba(170, 51, 51, .3); color: var(--danger); padding: 9px 12px; border-radius: 8px; margin: 0; font-size: 14px; }
.notice { background: rgba(74, 124, 89, .12); border: 1px solid rgba(74, 124, 89, .35); color: var(--ok); padding: 9px 12px; border-radius: 8px; margin: 0 0 16px; font-size: 14px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.inline { display: inline; margin: 0; }

/* ---------------------------------------------------------------- login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 420px); gap: 48px; align-items: center; justify-content: center; padding: 40px 16px; }
.login-cover img { width: 100%; height: auto; display: block; border-radius: 4px; box-shadow: 0 30px 60px rgba(60, 35, 10, .35), 0 2px 4px rgba(60, 35, 10, .2); }
.login-card { border-radius: 16px; padding: 32px 30px; }
.login-card h1 { font-family: var(--display); font-weight: 600; font-size: 40px; line-height: 1.05; margin: 8px 0 6px; color: var(--ink); }
.login-sub { font-family: var(--serif); font-size: 19px; color: var(--muted); margin: 0 0 22px; }
.login-card .home-link { display: inline-block; margin-bottom: 18px; }
.login-card .btn { width: 100%; margin-top: 4px; }
.fine { font-size: 12px; color: var(--muted); margin: 18px 0 0; }
@media (max-width: 760px) {
  .login-wrap { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 20px; }
  .login-cover { max-width: 180px; margin: 0 auto; }
  .login-card { padding: 24px 20px; }
  .login-card h1 { font-size: 32px; }
}

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 40; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  min-height: 56px; padding: 6px max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left));
  background: var(--bar); border-bottom: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
}
.tb-left, .tb-right, .tb-nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tb-right, .tb-nav { justify-content: flex-end; }
.home-link { font-size: 13px; color: var(--muted); text-decoration: none; white-space: nowrap; margin-right: 6px; }
.home-link:hover { color: var(--accent); }
.tb-title { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--ink); min-width: 0; text-align: center; }
.tb-title .bk { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: .02em; white-space: nowrap; }
.tb-title .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.tb-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; min-width: 38px; padding: 0 12px; border-radius: 999px;
  border: 1px solid transparent; background: transparent; cursor: pointer; font-size: 14px; color: var(--ink); white-space: nowrap;
}
.tb-btn:hover, .tb-btn[aria-expanded="true"], .tb-btn.on { background: rgba(122, 90, 57, .12); border-color: var(--glass-border); }
.tb-btn.icon { padding: 0; justify-content: center; font-size: 22px; line-height: 1; }
.tb-btn:disabled { opacity: .35; cursor: default; }
.tb-btn .aa { font-family: var(--display); font-size: 17px; }
.tb-btn .count { font-size: 11px; font-weight: 600; background: var(--plum); color: #fbf3e4; border-radius: 999px; padding: 1px 7px; }
.tb-btn .count:empty { display: none; }
.tb-nav a { color: var(--ink); text-decoration: none; padding: 7px 12px; border-radius: 999px; font-size: 14px; }
.tb-nav a:hover { background: rgba(122, 90, 57, .12); }
.tb-nav a[aria-current] { background: rgba(122, 90, 57, .16); font-weight: 600; }
.tb-nav .linkish { color: var(--muted); font-size: 14px; padding: 7px 10px; text-decoration: none; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; background: var(--c, var(--plum)); }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; border-radius: 12px; padding: 6px; display: grid; z-index: 60; }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; background: none; border: 0; cursor: pointer; font-size: 14px; }
.menu-list a:hover, .menu-list button:hover { background: rgba(122, 90, 57, .12); }
.menu-list form { margin: 0; border-top: 1px solid var(--rule); margin-top: 4px; padding-top: 4px; }

#progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; pointer-events: none; }
#progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--accent)); transition: width .15s linear; }

/* ---------------------------------------------------------------- drawer / popovers */
#scrim { position: fixed; inset: 0; background: rgba(35, 26, 19, .28); z-index: 44; }
.drawer, .popover, .menu-list, .composer { background: var(--paper-2) !important; }
.drawer {
  position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; width: min(380px, 92vw); overflow-y: auto; overscroll-behavior: contain;
  border-radius: 0 16px 16px 0; padding: 18px 16px 40px; padding-left: max(16px, env(safe-area-inset-left));
}
.drawer-head { position: sticky; top: -18px; z-index: 2; margin: -18px -16px 8px; padding: 18px 16px 10px; background: var(--paper-2); border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.drawer-sum { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.x { border: 0; background: rgba(122, 90, 57, .1); width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink); flex: none; }
.toc-group { margin: 14px 0 4px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 600; padding: 0 8px; }
.toc-item {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 17px; line-height: 1.25;
}
.toc-item:hover { background: rgba(122, 90, 57, .1); }
.toc-item.here { background: rgba(122, 90, 57, .16); }
.toc-item .n { font-family: var(--ui); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.toc-item .st { display: flex; gap: 5px; align-items: center; font-family: var(--ui); font-size: 11px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 3px; font-family: var(--ui); font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: rgba(122, 90, 57, .12); color: var(--accent); white-space: nowrap; }
.pill.read { background: transparent; color: var(--muted); font-weight: 500; }
.pill.done { background: rgba(74, 124, 89, .15); color: var(--ok); }
.pill.notes { background: var(--plum); color: #fbf3e4; }
:root[data-theme="dark"] .pill.notes { background: #6b4a63; }
.toc-soon { font-size: 13px; color: var(--muted); padding: 8px; font-style: italic; font-family: var(--serif); }

.popover { position: fixed; z-index: 55; top: 62px; right: 16px; border-radius: 14px; padding: 14px; width: min(320px, calc(100vw - 32px)); display: grid; gap: 12px; }
.aa-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--glass-border); border-radius: 999px; padding: 2px; background: var(--paper); align-items: center; }
.seg button { border: 0; background: none; padding: 6px 11px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--plum); color: #fbf3e4; }
.seg output { min-width: 34px; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- reader layout */
#stage { padding: 28px 16px 120px; }
.layout { display: flex; justify-content: center; align-items: flex-start; gap: 28px; }
.page {
  --pad: clamp(22px, 6vw, 76px);
  position: relative; width: min(100%, calc(var(--measure) + 2 * var(--pad))); min-width: 0; flex: 0 1 auto;
  background: var(--paper); border-radius: 4px; box-shadow: var(--page-shadow);
  padding: clamp(36px, 7vw, 84px) var(--pad) clamp(40px, 7vw, 80px);
  font-family: var(--serif); font-size: var(--fs); line-height: 1.62; color: var(--ink);
  font-kerning: normal; font-variant-ligatures: common-ligatures; font-feature-settings: "kern", "liga", "onum";
}
.page::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(90deg, rgba(122, 90, 57, .05), transparent 6%, transparent 94%, rgba(122, 90, 57, .05)); }
.loading { text-align: center; color: var(--muted); font-style: italic; }
.page p { margin: 0; text-align: justify; -webkit-hyphens: auto; hyphens: auto; hanging-punctuation: first; orphans: 2; widows: 2; }
.page .blk + .blk.p { text-indent: 1.5em; }
.page .blk.p.first, .page .break + .blk.p, .page .plate + .blk.p, .page .quote + .blk.p, .page .part + .blk.p { text-indent: 0; }
.page .blk.p.first { display: flow-root; }
.page .blk.p.first::first-letter {
  font-family: var(--display); font-weight: 600; float: left; font-size: 3.55em; line-height: .82; padding: .07em .09em 0 0; margin-top: .04em; color: var(--plum);
}
:root[data-theme="dark"] .page .blk.p.first { display: flow-root; }
.page .blk.p.first::first-letter { color: var(--gold); }
.page .blk.p.first::first-line { font-variant: small-caps; letter-spacing: .04em; }
.page .break + .blk.p::first-line { font-variant: small-caps; letter-spacing: .03em; }
.break { text-align: center; color: var(--gold); font-size: 1.1em; letter-spacing: .4em; margin: 1.3em 0 1.1em; padding-left: .4em; user-select: none; -webkit-user-select: none; }
.quote {
  font-family: var(--ui); font-size: .76em; line-height: 1.45; text-align: left !important; text-indent: 0 !important;
  max-width: 30em; margin: .55em 0 .55em 1.2em !important; padding: .5em .9em; border-radius: 14px 14px 14px 4px;
  background: var(--paper-deep); border: 1px solid var(--rule); width: fit-content;
}
.quote strong { color: var(--accent); font-weight: 600; }
.quote + .quote { margin-top: .2em !important; }
.part { display: none; }

/* chapter opening */
.ch-head { text-align: center; margin: 0 0 2.6em; }
.page .ch-head p { text-align: center; }
.ch-part { font-family: var(--ui); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); margin: 0 0 3.2em; font-weight: 600; }
.ch-part::before, .ch-part::after { content: ""; display: inline-block; width: 36px; height: 1px; background: var(--gold); vertical-align: middle; margin: 0 12px; }
.ch-num { font-family: var(--ui); font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); margin: 0; }
.ch-head h1 { font-family: var(--display); font-weight: 600; font-size: clamp(34px, 2.3em, 54px); line-height: 1.08; margin: .3em 0 .35em; letter-spacing: .005em; text-wrap: balance; }
.ch-meta { font-family: var(--serif); font-style: italic; font-size: .82em; color: var(--muted); margin: 0; text-align: center !important; }
.ornament { color: var(--gold); font-size: 22px; margin-top: 1em; line-height: 1; }

/* plates */
.plate { margin: 1.8em calc(-1 * min(var(--pad), 44px)); }
.plate img { display: block; width: 100%; height: auto; border-radius: 3px; box-shadow: 0 8px 24px rgba(40, 25, 10, .18); }
.plate figcaption { font-family: var(--serif); font-style: italic; font-size: .78em; line-height: 1.45; color: var(--muted); margin: .8em auto 0; max-width: 36em; text-align: center; padding: 0 1em; }
.place { display: block; font-family: var(--ui); font-style: normal; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: .45em; }

/* end of chapter */
.ch-end { margin-top: 3em; padding-top: 2em; border-top: 1px solid var(--rule); font-family: var(--ui); font-size: 14px; text-align: center; }
.ch-end .fin { font-family: var(--display); font-style: italic; color: var(--gold); font-size: 22px; margin: 0 0 1em; text-align: center !important; }
.reviewed-toggle { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--paper-2); cursor: pointer; font-size: 14px; color: var(--ink); }
.reviewed-toggle input { width: 18px; height: 18px; accent-color: var(--ok); margin: 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 1.6em; }
.pager a { display: block; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--glass-border); text-decoration: none; color: var(--ink); background: var(--paper-2); text-align: left; min-width: 0; }
.pager a.next { text-align: right; grid-column: 2; }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pager span { display: block; font-family: var(--serif); font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* front & back matter */
.sec-front, .sec-back { text-align: center; }
.sec-front p, .sec-back p { text-align: center; text-indent: 0 !important; }
.fm-cover { padding: 0 !important; background: #111; overflow: hidden; }
.fm-cover .cover-img { display: block; width: 100%; height: auto; }
.fm-half .fm-halftitle { font-family: var(--display); font-size: 1.9em; margin: 30vh 0; }
.fm-titlepage .fm-title { font-family: var(--display); font-weight: 600; font-size: 2.9em; line-height: 1; margin: 14vh 0 .5em; }
.fm-titlepage .fm-subtitle { font-family: var(--serif); font-style: italic; font-size: 1.5em; margin: .2em 0 12vh; }
.fm-titlepage .fm-author { font-family: var(--display); font-size: 1.35em; letter-spacing: .16em; text-transform: uppercase; margin: 0; }
.fm-press { font-family: var(--ui); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-top: 8px !important; }
.press-logo { display: block; width: 76px; height: auto; margin: 6vh auto 6px; }
:root[data-theme="dark"] .press-logo { filter: invert(1) sepia(.3); }
.fm-copyright p { font-size: .72em; line-height: 1.55; text-align: left !important; margin: 0 0 .7em; }
.fm-copyright .press-logo { width: 56px; margin: 2em auto 0; }
.fm-dedication { padding-top: 16vh !important; padding-bottom: 16vh !important; }
.fm-dedication p { font-style: italic; font-size: 1.1em; max-width: 24em; margin: 0 auto .8em; }
.fm-dedication p strong { font-style: normal; font-family: var(--display); letter-spacing: .2em; text-transform: uppercase; font-size: .9em; }
.fm-epigraph { padding-top: 14vh !important; padding-bottom: 14vh !important; }
.fm-epigraph p { margin: 0 auto 1.4em; max-width: 24em; }
.fm-epigraph .ro { font-size: 1.12em; font-style: italic; }
.fm-epigraph .en { color: var(--muted); }
.fm-epigraph .by { font-size: .8em; color: var(--muted); }
.fm-also { padding-top: 12vh !important; padding-bottom: 12vh !important; }
.fm-also .fm-kicker { font-family: var(--ui); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 2em; }
.fm-genre { font-family: var(--ui); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin: 1.5em 0 .4em; }
.fm-book { font-size: 1.15em; margin: .2em 0; }
.fm-kicker { font-family: var(--ui); font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.fm-contents ol { list-style: none; padding: 0; margin: 0 auto; max-width: 24em; text-align: left; }
.fm-contents li a { display: grid; grid-template-columns: 2.2em 1fr; gap: 4px; padding: .22em 0; color: var(--ink); text-decoration: none; }
.fm-contents li a:hover { color: var(--accent); }
.fm-contents li a span { font-family: var(--ui); font-size: .62em; color: var(--muted); padding-top: .45em; }
.fm-contents li.grp { font-family: var(--ui); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin: 1.4em 0 .3em; font-weight: 600; }
.fm-contents li.soon { font-style: italic; color: var(--muted); font-size: .85em; padding-left: 2.6em; }
.bm-prose p { text-align: justify !important; margin: 0 0 .9em; }
.bm-prose .author-photo { display: block; width: min(240px, 60%); height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; margin: 0 auto 1.6em; }
.bm-colophon p { margin: .3em 0; }
.fm-pressname { font-family: var(--display); font-size: 1.3em; letter-spacing: .16em; text-transform: uppercase; }
.todo { background: rgba(200, 166, 103, .22); border: 1px dashed var(--gold); padding: 0 .3em; border-radius: 3px; font-style: normal; }
.term { text-align: left !important; padding: .55em 0; border-bottom: 1px solid var(--rule); }
.term-t { display: block; font-family: var(--display); font-weight: 600; font-size: 1.02em; color: var(--accent); }
.term-d { font-size: .92em; }
.cast { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 22px 18px; text-align: left; margin: 0 calc(-1 * min(var(--pad), 30px)); }
.cast figure { margin: 0; }
.cast img { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 6px 18px rgba(40, 25, 10, .16); }
.cast figcaption { font-size: .74em; line-height: 1.45; color: var(--muted); margin-top: .7em; }
.cast figcaption strong { display: block; font-family: var(--display); font-size: 1.25em; color: var(--ink); font-weight: 600; }
.cast figcaption .say { display: block; font-style: italic; margin: .1em 0 .5em; }

/* ---------------------------------------------------------------- highlights */
mark.hl { background: rgba(var(--hl), var(--hl-alpha)); color: inherit; border-radius: 2px; cursor: pointer; box-shadow: 0 1.5px 0 rgba(var(--hl), .75); transition: background .15s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
mark.hl.suggest { background: transparent; box-shadow: none; text-decoration: line-through; text-decoration-color: rgba(var(--hl), .95); text-decoration-thickness: 2px; background-image: linear-gradient(rgba(var(--hl), .16), rgba(var(--hl), .16)); }
mark.hl.resolved { background: transparent; box-shadow: none; border-bottom: 1.5px dashed rgba(var(--hl), .6); border-radius: 0; text-decoration: none; background-image: none; }
mark.hl.focus { background: rgba(var(--hl), .55); box-shadow: 0 0 0 2px rgba(var(--hl), .55); }
mark.hl.pending { --hl: 200, 166, 103; background: rgba(200, 166, 103, .45); }
.ins-inline { font-family: var(--serif); color: var(--ok); text-decoration: underline; text-decoration-style: dotted; }
.page ::selection { background: rgba(200, 166, 103, .45); }

/* ---------------------------------------------------------------- margin notes */
.margin { width: 330px; flex: none; position: relative; align-self: stretch; }
.margin-head { position: relative; z-index: 2; display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-border); margin-bottom: 12px; }
.mh-row { display: flex; align-items: center; gap: 8px; }
.mh-row strong { font-family: var(--display); font-size: 17px; }
.mh-row .muted { font-size: 12px; flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filters label.chk { font-size: 12px; color: var(--muted); }
.sheet-grip, .sheet-x { display: none; }
.cards { position: relative; }
.card {
  position: absolute; left: 0; right: 0; background: var(--paper); border: 1px solid var(--glass-border); border-left: 4px solid rgb(var(--hl)); border-radius: 10px;
  padding: 10px 12px; font-size: 13.5px; box-shadow: 0 2px 10px rgba(60, 35, 10, .08); transition: top .25s ease, box-shadow .2s, transform .2s; cursor: pointer;
}
.card.static { position: relative; margin-bottom: 10px; }
.card.focus { box-shadow: 0 8px 28px rgba(60, 35, 10, .22); z-index: 3; transform: translateX(-6px); }
.card.resolved { opacity: .72; }
.card.resolved.focus { opacity: 1; }
.card .c-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.card .c-who { font-weight: 600; }
.card .c-time { color: var(--muted); font-size: 12px; }
.card .c-tags { margin-left: auto; display: flex; gap: 4px; }
.tag { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; background: rgba(122, 90, 57, .12); color: var(--accent); }
.tag.resolved { background: rgba(74, 124, 89, .15); color: var(--ok); }
.tag.accepted { background: rgba(74, 124, 89, .9); color: #fff; }
.tag.rejected { background: rgba(170, 51, 51, .85); color: #fff; }
.tag.orphan { background: rgba(176, 119, 0, .18); color: #9a6a00; }
.tag.new { background: var(--gold); color: #2b1d0e; }
.c-quote { font-family: var(--serif); font-size: 15px; line-height: 1.4; color: var(--muted); border-left: 2px solid var(--rule); margin: 7px 0; padding: 0 0 0 9px; font-style: italic; overflow-wrap: anywhere; }
.c-quote.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.c-quote del { color: var(--danger); text-decoration-thickness: 1.5px; }
.c-quote ins { color: var(--ok); text-decoration: none; font-style: normal; background: rgba(74, 124, 89, .12); border-radius: 2px; padding: 0 2px; }
.c-quote .arrow { font-style: normal; color: var(--muted); margin: 0 4px; }
.c-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 0; color: var(--ink); line-height: 1.45; }
.card:not(.focus) .c-body.long { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.replies { margin: 8px 0 0; padding: 0 0 0 10px; border-left: 2px solid var(--rule); display: grid; gap: 8px; }
.reply .c-head { font-size: 12.5px; }
.reply .c-body { font-size: 13px; }
.more { font-size: 12px; color: var(--muted); margin-top: 6px; }
.c-actions { display: none; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--rule); }
.card.focus .c-actions, .card.static .c-actions { display: flex; }
.c-actions button { background: none; border: 0; padding: 3px 0; color: var(--accent); cursor: pointer; font-size: 12.5px; font-weight: 500; }
.c-actions button:hover { text-decoration: underline; }
.c-actions button.warn { color: var(--danger); }
.mini-actions { display: inline-flex; gap: 8px; margin-left: auto; }
.mini-actions button { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-size: 11.5px; }
.reply-form { margin-top: 8px; display: grid; gap: 6px; }
.reply-form textarea { font-size: 15px; min-height: 64px; }
.empty-cards { color: var(--muted); font-size: 13px; text-align: center; padding: 20px 8px; font-style: italic; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: rgb(var(--hl)); flex: none; }
.group-label { position: relative; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 4px 2px 8px; }

/* reviewer colours: rgb triplets */
.c0 { --hl: 200, 150, 60; }  .c1 { --hl: 132, 84, 124; }  .c2 { --hl: 86, 140, 96; }  .c3 { --hl: 70, 122, 176; }
.c4 { --hl: 196, 96, 60; }   .c5 { --hl: 50, 146, 140; }  .c6 { --hl: 192, 82, 110; } .c7 { --hl: 128, 128, 48; }
.c-1 { --hl: 140, 140, 140; }
.avatar.c0, .avatar.c1, .avatar.c2, .avatar.c3, .avatar.c4, .avatar.c5, .avatar.c6, .avatar.c7, .avatar.c-1 { background: rgb(var(--hl)); }

/* ---------------------------------------------------------------- selection popover, FAB, composer */
.sel-pop { position: fixed; z-index: 58; display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: #2b1f28; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.sel-pop::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #2b1f28; }
.sel-pop button { background: none; border: 0; color: #f6ead6; padding: 7px 11px; border-radius: 8px; cursor: pointer; font-size: 13.5px; white-space: nowrap; }
.sel-pop button:hover { background: rgba(255, 255, 255, .12); }
.fab {
  position: fixed; z-index: 58; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); border: 0; border-radius: 999px;
  background: var(--plum); color: #fbf3e4; padding: 13px 20px; font-size: 15px; font-weight: 600; box-shadow: 0 8px 24px rgba(40, 20, 30, .35); cursor: pointer;
}
.composer {
  position: fixed; z-index: 70; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 16px; padding: 20px;
}
.composer form { display: grid; gap: 12px; }
.composer h2 { font-family: var(--display); font-size: 22px; margin: 0; }
.composer .c-quote { max-height: 140px; overflow-y: auto; font-size: 16px; }
.composer textarea { font-family: var(--serif); font-size: 17px; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #2b1f28; color: #f6ead6; padding: 10px 18px; border-radius: 999px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); max-width: calc(100vw - 32px); }

/* ---------------------------------------------------------------- narrower screens: notes become a bottom sheet */
body.notes-off .margin { display: none; }
@media (max-width: 1180px) {
  .margin, body.notes-off .margin {
    display: block; position: fixed; z-index: 46; left: 0; right: 0; bottom: 0; width: auto; max-height: 78vh; overflow-y: auto; overscroll-behavior: contain;
    background: var(--paper-2); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(40, 25, 10, .25); padding: 0 12px calc(24px + env(safe-area-inset-bottom));
    transform: translateY(105%); transition: transform .28s ease; visibility: hidden;
  }
  .margin.open, body.notes-off .margin.open { transform: none; visibility: visible; }
  .margin-head { position: sticky; top: 0; margin: 0 -12px 10px; border-radius: 18px 18px 0 0; padding: 8px 14px 12px; background: var(--paper-2); border: 0; border-bottom: 1px solid var(--rule); }
  .sheet-grip { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--rule); margin: 0 auto 4px; }
  .sheet-x { display: block; }
  .card { position: relative !important; top: auto !important; margin-bottom: 10px; transform: none !important; }
  .card .c-actions { display: flex; }
  .margin-inner-note { display: none; }
}
@media (max-width: 720px) {
  .topbar { grid-template-columns: auto 1fr auto; gap: 4px; padding-left: 10px; padding-right: 10px; }
  .reader-bar .tb-title { visibility: hidden; width: 0; }
  .tb-btn .lbl { display: none; }
  .tb-btn { padding: 0 9px; }
  #btn-prev-top, #btn-next-top { display: none; }
  .home-link { font-size: 12px; margin-right: 0; }
  #stage { padding: 0 0 100px; }
  .layout { display: block; }
  .page { width: 100%; border-radius: 0; box-shadow: none; --pad: 20px; padding-top: 34px; line-height: 1.58; }
  .page::before { display: none; }
  .plate { margin-left: -20px; margin-right: -20px; }
  .plate img { border-radius: 0; box-shadow: none; }
  .cast { margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .quote { margin-left: 0 !important; }
  .tb-nav a { padding: 6px 8px; font-size: 13px; }
  .composer { top: auto; bottom: 0; left: 0; right: 0; transform: none; width: auto; border-radius: 18px 18px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); max-height: 88vh; }
  .popover { right: 10px; }
}
@media (max-width: 520px) {
  .page p { text-align: left; }
}
@media (max-width: 400px) {
  .home-link .long { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------------------------------------------------------------- app pages (notes, admin, account) */
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 16px 80px; }
.wrap.narrow { max-width: 560px; }
.panel { border-radius: 14px; padding: 22px; margin-bottom: 22px; }
.panel h1, .panel h2, .wrap > h1 { font-family: var(--display); font-weight: 600; margin: 0 0 14px; line-height: 1.15; }
.wrap > h1 { font-size: 34px; margin-bottom: 6px; }
.panel h2 { font-size: 22px; }
.lede { color: var(--muted); margin: 0 0 22px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.inactive td { opacity: .7; }
.user-cell { display: flex; align-items: center; gap: 9px; }
.user-cell small { display: block; color: var(--muted); font-size: 12px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
details.edit > summary { list-style: none; cursor: pointer; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit[open] { grid-column: 1 / -1; }
.edit-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; padding: 12px; margin-top: 8px; background: var(--paper-2); border-radius: 10px; border: 1px solid var(--rule); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.grid-prog { font-size: 12px; }
.grid-prog th, .grid-prog td { padding: 6px 5px; text-align: center; }
.grid-prog th:first-child, .grid-prog td:first-child { text-align: left; position: sticky; left: 0; background: var(--paper); z-index: 1; }
.cell { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.cell.rv { background: rgba(74, 124, 89, .9); color: #fff; }
.cell.rd { background: rgba(200, 166, 103, .35); color: var(--accent); }
.cell.no { background: rgba(122, 90, 57, .07); color: transparent; }
.cell.at { box-shadow: 0 0 0 2px var(--accent, #7a5a39); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; align-items: center; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.panel.glass { background: var(--glass); }
.solid { background: var(--paper); border: 1px solid var(--glass-border); box-shadow: var(--page-shadow); }

.notes-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; padding: 12px; border-radius: 12px; }
.notes-filters input[type=search] { width: auto; flex: 1 1 200px; font-size: 14px; padding: 7px 11px; }
.nsec { margin-bottom: 26px; }
.nsec h2 { font-family: var(--display); font-size: 22px; margin: 0 0 10px; display: flex; align-items: baseline; gap: 10px; }
.nsec h2 small { font-family: var(--ui); font-size: 12px; color: var(--muted); font-weight: 400; }
.ncard { display: block; text-decoration: none; color: var(--ink); background: var(--paper); border: 1px solid var(--glass-border); border-left: 4px solid rgb(var(--hl)); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; font-size: 14px; }
.ncard:hover { border-color: var(--accent); border-left-color: rgb(var(--hl)); }
.ncard .c-quote { font-size: 16px; }
.ncard .c-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ncard .c-tags { margin-left: auto; display: flex; gap: 4px; }
.ncard .replies { margin-top: 8px; }
.ncard.hide { display: none; }
@media (max-width: 720px) {
  .tb-nav .hide-sm { display: none; }
  .site .topbar { grid-template-columns: auto 1fr; }
  .site .topbar .tb-title { display: none; }
  .site .tb-nav { flex-wrap: wrap; gap: 2px; }
  .wrap > h1 { font-size: 28px; }
  .panel { padding: 16px; }
}

/* ---------------------------------------------------------------- library (hub) */
.hub-wrap { max-width: 1040px; }
.hub-head { text-align: center; margin: 8px 0 26px; }
.hub-head h1 { font-family: var(--display); font-weight: 600; font-size: clamp(34px, 6vw, 52px); margin: 6px 0 6px; line-height: 1.05; }
.hub-head .lede { margin: 0; }
.row-start { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.hub-feature { display: grid; grid-template-columns: minmax(150px, 240px) 1fr; gap: 28px; align-items: center; }
.hub-cover img { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 14px 34px rgba(40, 25, 10, .32); transition: transform .2s; }
.hub-cover:hover img { transform: translateY(-3px); }
.hub-info h2 { font-family: var(--display); font-size: clamp(28px, 4vw, 38px); margin: 4px 0 6px; }
.hub-info h2 a { color: inherit; text-decoration: none; }
.hub-meta { color: var(--muted); margin: 0 0 16px; }
.hub-prog .bar { position: relative; height: 8px; border-radius: 5px; background: rgba(122, 90, 57, .12); overflow: hidden; }
.hub-prog .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.hub-prog .bar i.rd { background: rgba(200, 166, 103, .6); }
.hub-prog .bar i.rv { background: var(--ok); }
.hub-prog p { font-size: 13.5px; color: var(--muted); margin: 8px 0 0; }
.hub-info .fine { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.hub-series { margin-top: 38px; }
.hub-series-head h2 { font-family: var(--display); font-weight: 600; font-size: 28px; margin: 0 0 6px; }
.hub-series-head p { margin: 0 0 18px; max-width: 46em; }
.hub-overview { display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: inherit; background: var(--paper); border: 1px solid var(--glass-border); padding: 16px 20px; }
.hub-overview strong { font-family: var(--display); font-size: 20px; font-weight: 600; }
.hub-overview:hover { border-color: var(--accent); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.bookcard { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--paper); border: 1px solid var(--glass-border); border-radius: 14px; overflow: hidden; box-shadow: var(--page-shadow); transition: transform .2s, border-color .2s; }
a.bookcard:hover { transform: translateY(-3px); border-color: var(--accent); }
.bookcard.locked { opacity: .72; }
.bookcard.locked .bc-cover { filter: grayscale(.55) brightness(.85); }
.bc-cover { aspect-ratio: 4 / 5; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 22px 16px; color: #f3e6cc;
  background: radial-gradient(120% 80% at 50% 20%, rgba(200, 166, 103, .28), transparent 60%), linear-gradient(160deg, #3b2636, #1e1319 70%); position: relative; }
.bc-cover::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(200, 166, 103, .45); border-radius: 4px; pointer-events: none; }
.bc-cover.b3 { background: radial-gradient(120% 80% at 50% 20%, rgba(170, 200, 214, .25), transparent 60%), linear-gradient(160deg, #26343b, #121a1e 70%); }
.bc-cover.b4 { background: radial-gradient(120% 80% at 50% 20%, rgba(200, 150, 103, .3), transparent 60%), linear-gradient(160deg, #3b2c20, #1c140e 70%); }
.bc-cover.b5 { background: radial-gradient(120% 80% at 50% 20%, rgba(214, 190, 150, .32), transparent 60%), linear-gradient(160deg, #40313a, #17111a 70%); }
.bc-series { font-family: var(--ui); font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
.bc-num { font-family: var(--serif); font-style: italic; font-size: 15px; opacity: .85; }
.bc-title { font-family: var(--display); font-size: 24px; line-height: 1.1; font-weight: 600; }
.bc-by { font-family: var(--serif); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; opacity: .75; margin-top: 6px; }
.bc-body { padding: 14px 16px 16px; }
.bc-body h3 { font-family: var(--display); font-size: 19px; margin: 4px 0 2px; }
.bc-body .muted { margin: 0; font-size: 13px; }
.bc-foot { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hub-admin { background: var(--paper-2); border: 1px dashed var(--glass-border); margin-top: 20px; font-size: 14px; }
.hub-admin p { margin: 0 0 6px; }
.share-form { display: flex; flex-direction: column; gap: 8px; }
.share-row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
@media (max-width: 640px) {
  .hub-feature { grid-template-columns: 1fr; text-align: center; }
  .hub-cover { max-width: 200px; margin: 0 auto; }
  .hub-info .row-start { justify-content: center; }
  .hub-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .bc-title { font-size: 19px; }
  .bc-body { padding: 10px 12px 12px; }
}

/* ---------------------------------------------------------------- outline pages */
.sec-outline .blk.p { text-indent: 0 !important; }
.sec-outline .blk.p.first::first-letter { all: unset; }
.sec-outline .blk.p.first::first-line { font-variant: normal; letter-spacing: normal; }
.sec-outline .ol-item, .sec-outline .ol-bullet { margin: 0 0 1em; padding-left: 1em; border-left: 2px solid var(--rule); }
.sec-outline .ol-k { display: block; font-family: var(--ui); font-size: .62em; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: .2em; }
.sec-outline .ol-bullet::before { content: "· "; color: var(--gold); }
.sec-outline .ol-p { margin: 0 0 1em; }
.sec-outline .ol-h { font-family: var(--display); font-weight: 600; font-size: 1.2em; margin: 1.6em 0 .6em; text-align: center; }
.sec-outline.ol-notes .ch-head .ch-num { color: var(--danger); }

/* ---------------------------------------------------------------- map + lightbox */
.page figure img { cursor: zoom-in; }
body.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(12, 8, 6, .94); display: flex; flex-direction: column; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); color: #d9c9a8; font-size: 13px; }
.lb-x { background: none; border: 0; color: #f3e6cc; font-size: 34px; line-height: 1; cursor: pointer; padding: 0 8px; min-width: 44px; min-height: 44px; }
.lb-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; display: flex; touch-action: pinch-zoom pan-x pan-y; }
.lb-scroll img { margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.lightbox.zoomed .lb-scroll img { max-width: none; max-height: none; width: auto; cursor: zoom-out; }
.lightbox.zoomed .lb-scroll { display: block; }
.lb-cap { color: #d9c9a8; font-family: var(--serif); font-style: italic; text-align: center; margin: 0; padding: 10px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); font-size: 15px; }

/* ---------------------------------------------------------------- approvals (author only) */
.appr-wrap { max-width: 860px; }
.appr-sum { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.appr-sum .hub-prog { flex: 1 1 260px; }
.appr-settled { font-size: 13.5px; margin: 0 0 18px; }
.appr-group { font-family: var(--display); font-size: 24px; margin: 30px 0 10px; }
.appr-intro { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.appr-item { padding: 16px 18px; margin-bottom: 12px; border-left: 4px solid var(--gold); }
.appr-item.approved { border-left-color: var(--ok); }
.appr-item.rejected { border-left-color: var(--danger); }
.appr-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.appr-n { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--accent); min-width: 1.4em; }
.appr-what { font-family: var(--serif); font-size: 18px; line-height: 1.5; margin: 0 0 8px; }
.appr-call { font-size: 14px; margin: 0 0 10px; color: var(--ink); }
.appr-call span { color: var(--muted); }
.appr-form textarea { width: 100%; font-size: 15px; }
.appr-form .row-start { margin-top: 8px; }
.btn.on { outline: 2px solid var(--gold); outline-offset: 2px; }
.small { font-size: 12px; }
.appr-item { scroll-margin-top: 84px; }
.contact-line { font-size: 13.5px; color: var(--muted); margin: 14px 0 0; }
.contact-line a { color: var(--accent-ink); font-weight: 600; }
.hub-foot { text-align: center; margin-top: 34px; }
.user-cell small a { color: var(--accent); }
/* password show/hide */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 48px !important; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; padding: 0; }
.pw-eye:hover, .pw-eye[aria-pressed=true] { color: var(--accent-ink); }
.pw-eye:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
/* signature, synopses, detail maps */
.page .raw .signature { display: block; width: min(300px, 70%); height: auto; margin: 1.6em 0 0 auto; }
:root[data-theme="dark"] .page .raw .signature { filter: invert(1) sepia(.35) brightness(1.1); }
.sec-outline .ol-hook { font-style: italic; font-size: 1.08em; text-align: center; margin: 0 0 1.4em; color: var(--accent-ink); }
.sec-outline .ol-spoil { font-family: var(--ui); font-size: .72em; letter-spacing: .06em; text-transform: uppercase; color: var(--danger); text-align: center; margin: 0 0 1em; }
.sec-outline .ol-q { margin: 0 0 .9em; padding-left: 2.2em; position: relative; }
.sec-outline .ol-qn { position: absolute; left: 0; top: 0; font-family: var(--display); font-weight: 600; color: var(--gold); }
.sec-outline .ol-item a { color: inherit; }
.bm-map .plate, .fm-map .plate { margin-top: .6em; }

/* ---------------------------------------------------------------- "Mark my place" bookmark */
.tb-btn .mk-ico { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.tb-btn.has-mark .mk-ico { fill: currentColor; }
.menu-list .mk-menu { display: grid; margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--rule); }
.menu-list .mk-menu button[hidden] { display: none; }
.menu-list .mk-menu small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.mk-layer { position: absolute; left: 0; top: 0; width: var(--pad); height: 0; z-index: 3; pointer-events: none; }
.mk-btn {
  position: absolute; left: 0; width: 100%; padding: 0; margin: 0; border: 0; background: none; color: var(--accent);
  display: flex; align-items: flex-start; justify-content: center; cursor: pointer; pointer-events: auto;
  font: inherit; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.mk-btn .mk-ico { width: 18px; height: 20px; margin-top: calc((1.6 * var(--fs) - 20px) / 2); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; opacity: 0; transition: opacity .12s; flex: none; }
.mk-btn.hot .mk-ico { opacity: .7; }
.mk-btn:hover .mk-ico, .mk-btn:focus-visible .mk-ico { opacity: .95; }
.mk-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 4px; }
.mk-btn.on { color: var(--plum); }
.mk-btn.on .mk-ico { opacity: 1; fill: currentColor; }
@media (pointer: coarse) { .mk-btn:not(.on) .mk-ico { opacity: .3; } }
.page .mk-marked { margin-top: 36px; }
.mk-flag { position: absolute; left: var(--pad); display: flex; align-items: center; gap: 12px; height: 26px; pointer-events: none; font-family: var(--ui); font-size: 12.5px; line-height: 1; }
.mk-flag[hidden] { display: none; }
.mk-tag {
  display: inline-flex; align-items: center; height: 26px; padding: 0 20px 0 11px; background: var(--plum); color: #fbf3e4; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 50%, 100% 100%, 0 100%); -webkit-clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 50%, 100% 100%, 0 100%);
}
:root[data-theme="dark"] .mk-tag { color: #2a1a26; }
.mk-x { pointer-events: auto; background: none; border: 0; padding: 6px 4px; font: inherit; font-size: 12.5px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.mk-x:hover { color: var(--ink); }
.where-h { font-family: var(--display); font-size: 17px; margin: 22px 0 8px; }
.where-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.where-list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.where-list li.inactive { opacity: .6; }
.where-body { display: grid; gap: 3px; min-width: 0; }
.where-line { overflow-wrap: anywhere; }
.where-line.mark b { color: var(--plum); }
.where-line a { color: var(--accent); white-space: nowrap; }

/* hub: how to keep your place */
.hub-howto { margin-top: 22px; }
.hub-howto h2 { margin: 0 0 8px; font-size: 1.15rem; }
.hub-howto p { margin: 0 0 10px; line-height: 1.55; }
.hub-howto ul { margin: 0 0 12px; padding-left: 1.2em; }
.hub-howto li { margin: 0 0 6px; line-height: 1.5; }

/* notes panel: how to mark your spot */
.mark-tip { margin: 12px 0 0; font-size: .82rem; line-height: 1.5; color: var(--muted, #6b5d4d); }
.mark-tip strong { display: block; color: inherit; margin-bottom: 2px; }

/* Admin: per-reader access (outlines, own notes only) */
.edit-box fieldset { border: 1px solid var(--line, rgba(0,0,0,.14)); border-radius: 10px; padding: 10px 12px; margin: 0; min-width: 0; }
.edit-box fieldset legend { padding: 0 6px; font-size: .8rem; font-weight: 600; color: var(--muted, #6b5d4d); }

/* Colophon: small type at the foot of the copyright page */
.fm-copyright .fm-colophon-block { margin-top: 2.4em; padding-top: 1.4em; border-top: 1px solid var(--line, rgba(0,0,0,.14)); text-align: center; }
.fm-copyright .fm-colophon-block p { font-size: .6em; line-height: 1.5; text-align: center !important; margin: .25em 0; color: var(--muted, #6b5d4d); }
.fm-copyright .fm-colophon-block .press-logo { width: 38px; margin: 0 auto .5em; display: block; }
.fm-copyright .fm-colophon-block .fm-pressname { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.fm-copyright .fm-colophon-block .fm-press { font-size: .6em; letter-spacing: .16em; }

/* author-only marks: scenes written new in the edit (only sent to Scott's login) */
.blk.am-new { background: rgba(196, 160, 72, .07); box-shadow: inset 3px 0 0 rgba(176, 138, 52, .32); border-radius: 2px; }
.am-tag { font-size: .62em; letter-spacing: .14em; text-transform: uppercase; color: rgba(150, 115, 40, .75); margin: 1.4em 0 .35em; }
:root[data-theme="dark"] .blk.am-new { background: rgba(220, 180, 90, .06); box-shadow: inset 3px 0 0 rgba(220, 180, 90, .3); }
:root[data-theme="dark"] .am-tag { color: rgba(220, 180, 90, .7); }

/* ---------------------------------------------------------------- workroom (Oct 11 2026) */
.wr-wrap { max-width: 920px; }
.wr-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 22px; padding: 4px; border: 1px solid var(--glass-border); border-radius: 999px; background: var(--paper); width: fit-content; max-width: 100%; }
.wr-tabs a { color: var(--ink); text-decoration: none; padding: 7px 14px; border-radius: 999px; font-family: var(--ui); font-size: 14px; }
.wr-tabs a:hover { background: rgba(122, 90, 57, .12); }
.wr-tabs a[aria-current] { background: var(--plum); color: #fbf3e4; font-weight: 600; }
.wr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.wr-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); border-top: 4px solid var(--gold); margin: 0; transition: transform .15s ease, box-shadow .15s ease; }
.wr-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.wr-launch { border-top-color: var(--plum); }
.wr-big { font-family: var(--display); font-size: 46px; font-weight: 600; line-height: 1; color: var(--plum); }
.wr-big small { font-size: 22px; color: var(--muted); font-weight: 500; }
.wr-cap { font-family: var(--ui); font-size: 13.5px; color: var(--muted); }
.wr-next { font-family: var(--ui); font-size: 13px; background: rgba(200, 166, 103, .18); border-radius: 8px; padding: 6px 9px; }
.wr-go { margin-top: auto; padding-top: 8px; font-family: var(--ui); font-size: 13px; font-weight: 600; color: var(--accent); }
.wr-card .hub-prog { margin: 4px 0; }
.wr-archive { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px 16px; border-radius: 12px; border: 1px dashed var(--glass-border); color: var(--muted); text-decoration: none; font-family: var(--ui); font-size: 14px; }
.wr-archive:hover { color: var(--ink); border-color: var(--accent); }
.wr-filter { margin: 0 0 18px; }
.wr-filter a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); font-family: var(--ui); font-size: 13px; }
.wr-filter a.on { background: var(--plum); color: #fbf3e4; }
.wr-fix { padding: 14px 16px; margin-bottom: 12px; border-left: 4px solid var(--gold); }
.wr-fix.fixed { border-left-color: var(--ok); }
.wr-fix.kept { border-left-color: var(--muted); }
.wr-fix .c-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wr-fix .c-tags { margin-left: auto; display: flex; gap: 4px; }
.wr-fix .row-start { margin-top: 10px; }
.wr-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.wr-jump a { font-family: var(--ui); font-size: 13px; padding: 5px 11px; border-radius: 999px; background: rgba(122, 90, 57, .1); color: var(--accent-ink); text-decoration: none; }
.wr-jump a:hover { background: rgba(122, 90, 57, .2); }
.wr-part { scroll-margin-top: 80px; }
.wr-ch-title { font-family: var(--display); font-size: 20px; font-weight: 600; }
.wr-when { font-style: italic; color: var(--muted); margin: 6px 0 4px; }
.wr-place, .wr-image { font-size: 15px; margin: 4px 0; }
.wr-place span, .wr-image span { font-family: var(--ui); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-right: 6px; }
.wr-image { color: var(--muted); }
.wr-threads { margin: 8px 0 4px; font-size: 14px; color: var(--muted); }
.wr-threads summary { cursor: pointer; font-family: var(--ui); font-size: 13px; color: var(--accent); }
.wr-ch, .appr-item[id] { scroll-margin-top: 80px; }
.wr-count { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; text-align: center; }
.wr-count > div { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.wr-line { list-style: none; margin: 8px 0 0; padding: 0 0 0 22px; border-left: 2px solid var(--rule); }
.wr-m { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin: 0 0 10px; background: var(--paper); border: 1px solid var(--glass-border); border-radius: 12px; scroll-margin-top: 80px; }
.wr-dot { position: absolute; left: -31px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--paper); border: 2px solid var(--gold); }
.wr-m.done .wr-dot { background: var(--ok); border-color: var(--ok); }
.wr-m.next { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200, 166, 103, .25); }
.wr-m.next .wr-dot { background: var(--gold); }
.wr-m.late .wr-dot { border-color: var(--danger); }
.wr-m.big strong { font-family: var(--display); font-size: 19px; }
.wr-m.done strong { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(106, 94, 80, .5); }
.wr-m-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.wr-date { font-family: var(--ui); font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--accent); }
.wr-m form { margin: 0; }
.nstats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.nstat { background: var(--paper); border: 1px solid var(--glass-border); border-radius: 12px; padding: 12px 10px; text-align: center; }
.nstat strong { display: block; font-family: var(--display); font-size: 28px; font-weight: 600; color: var(--plum); line-height: 1.1; }
.nstat span { font-family: var(--ui); font-size: 12px; color: var(--muted); }
.nspark { display: flex; align-items: flex-end; gap: 3px; height: 54px; padding: 10px 12px 0; margin: 0 0 4px; background: var(--paper); border: 1px solid var(--glass-border); border-radius: 12px 12px 0 0; border-bottom: 0; }
.nspark a { flex: 1; min-width: 4px; background: rgba(122, 90, 57, .14); border-radius: 3px 3px 0 0; position: relative; align-self: stretch; }
.nspark a i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 3px 3px 0 0; background: var(--gold); }
.nspark a i.op { background: var(--plum); }
.nspark a:hover { outline: 2px solid var(--accent); }
.nspark-cap { display: flex; justify-content: space-between; font-family: var(--ui); font-size: 11.5px; color: var(--muted); padding: 5px 12px 7px; margin: 0 0 18px; background: var(--paper); border: 1px solid var(--glass-border); border-top: 0; border-radius: 0 0 12px 12px; }
.nspark-cap b { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: -1px; }
@media (max-width: 760px) {
  .wr-grid, .wr-count { grid-template-columns: 1fr; }
  .nstats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wr-m { flex-wrap: wrap; }
  .wr-big { font-size: 40px; }
}

/* pictures: place & date on the picture, description below at the picture's width (Oct 13 2026) */
.plate .shot { position: relative; }
.plate .shot .place.on-pic { position: absolute; left: 0; right: 0; top: 0; margin: 0; padding: 10px 14px 22px; color: #fff8ec;
  background: linear-gradient(rgba(24, 14, 4, .74), rgba(24, 14, 4, .42) 62%, rgba(24, 14, 4, 0)); border-radius: 3px 3px 0 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55); font-size: 10.5px; line-height: 1.45; text-align: left; pointer-events: none; }
.plate figcaption { max-width: none; margin: .75em 0 0; padding: 0; text-align: left; }
.castcard .place.place-row { display: flex; align-items: flex-end; min-height: 4.2em; margin: 0 0 .45em; font-size: 9.5px; line-height: 1.4; }
@media (max-width: 700px) { .castcard .place.place-row { min-height: 5.6em; } }
.cast figure { display: flex; flex-direction: column; }
@media (max-width: 700px) {
  .plate .shot .place.on-pic { border-radius: 0; padding: 8px 20px 18px; font-size: 9.5px; }
  .plate figcaption { padding: 0 20px; }
}
