/* OWL — the night library. Dusk-first (2026-07-11, beige retired by decree).
   Night is when the reading happens: deep warm ink ground, parchment text,
   candlelight accent. Scans and page thumbs stay paper-white — they're the
   lit objects in the room. Structure per design-handoff ui-design-refinement. */
:root {
  --bg: #1E1912;
  --bg-deep: #16120D;
  --paper: #2A241B;
  --paper-raised: #322B20;
  --border: #3A3226;
  --border-strong: #5A4E3B;
  --ink: #F2EBD9;
  --ink-2: #B0A489;
  --ink-3: #7E7460;
  --accent: #E8A33D;          /* candlelight */
  --accent-deep: #DA702C;     /* flame — hovers, hot states */
  --accent-soft: rgba(232, 163, 61, 0.13);
  --green: #7FAE62;
  --green-soft: rgba(127, 174, 98, 0.16);
  --red: #D98A80;
  --red-soft: rgba(217, 138, 128, 0.14);
  --parchment: #E8DFC0;       /* the owl's paper — plates, lit surfaces */
  --display: 'Epilogue', sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Inter', sans-serif;  /* 07-21: native stack first — Charlie's font verdict */
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --serif: 'Spectral', Georgia, serif;
  --shadow: 0 1px 2px rgba(0,0,0,0.25), 0 4px 14px rgba(0,0,0,0.28);
  --shadow-lift: 0 2px 4px rgba(0,0,0,0.3), 0 12px 32px rgba(0,0,0,0.42);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); line-height: 1.55; font-size: 15px; }
main { max-width: 1060px; margin: 0 auto; padding: 28px 24px 100px; }
main.wide { max-width: 1280px; }
@media (max-width: 720px) { main { padding: 20px 16px 90px; } }

/* ---------- topbar ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--bg);
  position: sticky; top: 0; z-index: 40; }
.wordmark { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 20px;
  text-decoration: none; color: var(--ink); letter-spacing: -0.01em;
  display: inline-flex; align-items: baseline; gap: 9px; }
.wordmark-dot { color: var(--accent); margin: 0 -2px; }
.wordmark-sub { font-family: var(--mono); font-style: normal; font-weight: 400; font-size: 10.5px;
  color: var(--ink-2); letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--border); border-radius: 3px; padding: 1px 6px; }
.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar nav a { color: var(--ink-2); text-decoration: none; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.topbar nav a:hover { color: var(--ink); }
.topbar .who { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
/* App-grammar mobile bar: wordmark + two links, nothing colliding */
@media (max-width: 720px) {
  .topbar { padding: 12px 16px; gap: 10px; }
  .wordmark { font-size: 18px; }
  .wordmark-sub, .topbar .who { display: none; }
  .topbar nav { gap: 14px; overflow-x: auto; scrollbar-width: none; }
  .topbar nav::-webkit-scrollbar { display: none; }
}

/* ---------- type ---------- */
h1 { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.025em; margin: 14px 0 4px; }
h2 { font-family: var(--display); font-weight: 600; margin: 34px 0 12px;
  text-transform: uppercase; font-size: 12.5px; letter-spacing: 0.1em; color: var(--ink-2); }
.meta { font-family: var(--body); font-size: 13px; color: var(--ink-2); }  /* helper prose is prose, not terminal */
.serif { font-family: var(--serif); }
a { color: var(--accent); }
.crumb { font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  letter-spacing: 0.08em; text-transform: uppercase; }
.crumb a { color: var(--ink-3); text-decoration: none; }
.crumb a:hover { color: var(--ink-2); }

/* ---------- buttons + forms ---------- */
button, .btn { font-family: var(--body); font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--paper-raised); color: var(--ink); border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 10px 18px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  justify-content: center;
  transition: transform 0.06s ease, box-shadow 0.12s ease, background 0.12s ease; }
/* Native file pickers never appear raw — a label-button hosts them (app grammar) */
.filebtn input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.filebtn { position: relative; display: inline-flex; margin: 0; }
label.btn { text-transform: none; font-size: 14px; letter-spacing: 0; margin: 0;
  color: var(--ink); font-weight: 600; }  /* .btn beats the form-label styling */
button:hover, .btn:hover { box-shadow: var(--shadow); }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #1E1912; }
button.primary:hover, .btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #FFF8E7; }
button.good, .btn.good { background: var(--green); border-color: var(--green); color: #16120D; }
button.quiet, .btn.quiet { background: var(--paper); color: var(--ink); border: 1px solid var(--border-strong); font-weight: 500; }
button.ghost, .btn.ghost { background: transparent; color: var(--ink-2); border: none; padding: 6px 8px; }
button.ghost:hover, .btn.ghost:hover { color: var(--ink); box-shadow: none; }
button:disabled { opacity: 0.45; cursor: default; }
input[type=text], input[type=email], input[type=password], select, textarea { font: 14px var(--body); width: 100%;
  padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg-deep); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
form.stack { display: grid; gap: 12px; max-width: 480px; }
form.row { display: flex; gap: 10px; align-items: center; }
label { font-size: 12px; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------- library ---------- */
.libhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.hero-actions { display: flex; gap: 10px; margin: 20px 0 8px; align-items: center; flex-wrap: wrap; }
/* Mobile: one primary action, full-width; secondaries share a row beneath */
@media (max-width: 720px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions form { margin: 0; }
  .hero-actions .btn, .hero-actions button, .hero-actions .filebtn label { width: 100%; min-height: 50px; font-size: 16px; }
  .hero-actions .secondary-row { display: flex; gap: 10px; }
  .hero-actions .secondary-row > * { flex: 1; }
  .bookgrid { grid-template-columns: 1fr; gap: 14px; }
}
.byhand { border: 1px dashed var(--border-strong); border-radius: 14px; padding: 18px 20px;
  margin: 18px 0 0; background: var(--paper); }
.bookgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 18px; }
.bookcard { display: grid; grid-template-columns: 86px 1fr; gap: 16px; border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; background: var(--paper); text-decoration: none; color: inherit;
  box-shadow: var(--shadow); transition: box-shadow 0.15s ease, border-color 0.15s ease; }
.bookcard:hover { border-color: var(--accent); box-shadow: var(--shadow-lift); }
.bookcard .thumb { width: 86px; height: 118px; border-radius: 4px; border: 1px solid var(--border);
  background: var(--bg-deep); object-fit: cover; display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--ink-3); overflow: hidden; }
.bookcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.bookcard .title { font-family: var(--serif); font-weight: 600; font-size: 16.5px; line-height: 1.3; }
.bookcard .author { font-family: var(--serif); font-style: italic; font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.bookcard .stats { margin-top: 8px; }
.minibar { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; margin: 8px 0 4px; }
.minibar i { display: block; height: 100%; background: var(--green); }

/* ---------- status chips + stepper ---------- */
.chip { display: inline-block; font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 9px; border-radius: 999px; }
.chip.scanning, .chip.ocr { background: var(--accent-soft); color: var(--accent); }
.chip.review { background: rgba(139, 126, 200, 0.18); color: #B0A6E3; }
.chip.typeset, .chip.published, .chip.done { background: var(--green-soft); color: var(--green); }
.chip.wanted, .chip.sourcing { background: var(--paper-raised); color: var(--ink-2); }

/* ---------- book page ---------- */
.bookhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.bookhead h1 { font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.15; margin: 8px 0 2px; }
.byline { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink-2); }
.headmeta { text-align: right; }
.headmeta .counts { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.statrow { display: flex; gap: 26px; margin: 16px 0 4px; flex-wrap: wrap; }
.stat .n { font-family: var(--display); font-size: 22px; font-weight: 700; }
.stat .l { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.actionbar { display: flex; gap: 10px; align-items: center; margin: 18px 0; flex-wrap: wrap;
  padding: 14px 16px; background: var(--paper); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
@media (max-width: 720px) {
  .actionbar { flex-direction: column; align-items: stretch; }
  .actionbar form { margin: 0 !important; width: 100%; }
  .actionbar .btn, .actionbar button, .actionbar .filebtn label { width: 100%; min-height: 48px; font-size: 15px; }
  .workstrip { flex-direction: column; align-items: stretch; }
  .workstrip form { margin: 0 !important; }
  .workstrip .btn, .workstrip button { width: 100%; min-height: 46px; }
}

/* the two doors — card treatment per the handoff */
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 26px 0 10px; }
@media (max-width: 720px) { .doors { grid-template-columns: 1fr; } }
.door { background: var(--paper); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
  color: inherit; text-decoration: none; position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.door:hover { border-color: var(--accent); box-shadow: var(--shadow-lift); }
.door .eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); }
.door .door-verb { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.door .door-sub { font-size: 14px; color: var(--ink-2); margin: 0; }
.door .door-cta { display: flex; gap: 12px; align-items: center; margin-top: auto; padding-top: 10px; }
.door .door-cta a.minor { font-size: 13px; color: var(--ink-2); }
.door .door-owl { width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  position: absolute; top: 20px; right: 22px;
  box-shadow: 0 0 0 1px rgba(232,163,61,0.5); transition: transform 0.25s ease; }
.door:hover .door-owl { transform: rotate(-4deg) scale(1.05); }

/* "or work on it right here" strip */
.workstrip { border: 1px dashed var(--border-strong); border-radius: 14px; padding: 16px 20px;
  margin: 16px 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--paper); }
.workstrip .lead { flex: 1; min-width: 220px; }
.workstrip .lead b { font-family: var(--display); font-size: 14px; font-weight: 700; }
.workstrip .lead .sub { font-size: 13px; color: var(--ink-2); }

.pagehead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 0 12px; }
.pagehead h2 { margin: 0; }
.pagegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin-top: 12px; }
.pagecell { position: relative; display: block; border: 1px solid var(--border); border-radius: 6px;
  overflow: hidden; background: var(--paper); box-shadow: var(--shadow); transition: box-shadow 0.12s, transform 0.12s; }
.pagecell:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.pagecell img { width: 100%; height: 156px; object-fit: cover; display: block; }
.pagecell .tag { position: absolute; bottom: 0; left: 0; right: 0; font-family: var(--mono);
  font-size: 10px; padding: 3px 7px; background: rgba(22,18,13,0.88); border-top: 1px solid var(--border);
  color: var(--ink-2); }
.pagecell.done .tag { color: var(--green); }
.pagecell.pending .tag { color: var(--ink-2); }
.pagecell.failed .tag, .pagecell.batch_unsplit .tag { color: var(--red); }
.pagecell .approved { position: absolute; top: 6px; right: 7px; width: 20px; height: 20px;
  background: var(--green); color: #16120D; border-radius: 50%; font-size: 11px;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }

.progress { height: 7px; background: var(--border); border-radius: 4px; overflow: hidden; margin: 10px 0; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width 0.4s; }

details.fold { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 2px; }
details.fold summary { cursor: pointer; font-family: var(--body); font-weight: 600;
  font-size: 14.5px; color: var(--ink-2); padding: 12px 0; min-height: 44px;
  display: flex; align-items: center; }
details.fold summary:hover { color: var(--ink); }

/* ---------- capture ---------- */
.capture-layout { display: grid; grid-template-columns: 1fr 280px; gap: 22px; align-items: start; }
@media (max-width: 980px) { .capture-layout { grid-template-columns: 1fr; } }
.viewfinder { position: relative; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lift); background: #14130f; }
.viewfinder video { width: 100%; display: block; }
.motion-hud { position: absolute; top: 12px; left: 12px; right: 12px; display: flex;
  justify-content: space-between; align-items: center; pointer-events: none; }
.motion-state { display: flex; gap: 8px; align-items: center; font-family: var(--mono); font-size: 12px;
  font-weight: 500; letter-spacing: 0.05em; background: rgba(22,18,13,0.82); color: var(--ink);
  border-radius: 999px; padding: 6px 14px; box-shadow: var(--shadow); }
.motion-state .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.motion-state .dot.turning { background: var(--accent-deep); animation: pulse 0.9s infinite; }
.motion-state .dot.stable { background: var(--green); }
@keyframes pulse { 50% { opacity: 0.3; } }
.shot-counter { font-family: var(--mono); font-size: 12px; background: rgba(22,18,13,0.82); color: var(--ink);
  border-radius: 999px; padding: 6px 14px; box-shadow: var(--shadow); }
.motion-meter { position: absolute; bottom: 12px; left: 12px; right: 12px; height: 5px;
  background: rgba(242,235,217,0.3); border-radius: 3px; overflow: hidden; }
.motion-meter i { display: block; height: 100%; width: 0%; background: var(--accent-deep); transition: width 0.08s linear; }
.motion-meter .mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: rgba(242,235,217,0.9); }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flashgo 0.28s ease-out; }
@keyframes flashgo { 0% { opacity: 0.85; } 100% { opacity: 0; } }

.capture-side { display: grid; gap: 14px; }
.panelbox { background: var(--paper); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; box-shadow: var(--shadow); }
.panelbox h3 { margin: 0 0 10px; font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--ink-2); font-weight: 500; }
.sliderrow { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin: 8px 0; font-size: 13px; }
.sliderrow input[type=range] { width: 100%; accent-color: var(--accent-deep); }
.sliderrow .v { font-family: var(--mono); font-size: 11px; color: var(--ink-2); min-width: 38px; text-align: right; }
.filmstrip { display: flex; gap: 8px; flex-wrap: wrap; }
.filmstrip .shot { position: relative; width: 58px; height: 78px; border-radius: 4px; overflow: hidden;
  border: 1px solid var(--border); }
.filmstrip .shot img { width: 100%; height: 100%; object-fit: cover; }
.filmstrip .shot .pn { position: absolute; bottom: 0; right: 0; font-family: var(--mono); font-size: 9px;
  background: rgba(22,18,13,0.85); color: var(--ink); padding: 1px 4px; border-radius: 3px 0 0 0; }
.capture-actions { display: flex; gap: 10px; margin-top: 16px; align-items: center; flex-wrap: wrap; }
.bigshutter { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-deep); border: 4px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent-deep), var(--shadow-lift); cursor: pointer; }
.bigshutter:active { transform: scale(0.94); }

/* ---------- review: sticky pager + labeled panes + fixed approve bar ---------- */
.pagerbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  position: sticky; top: 59px; z-index: 30; background: var(--bg); margin: 0 -4px 10px;
  padding: 8px 4px 10px; border-bottom: 1px solid var(--border); }
.pagerbar .backlink { justify-self: start; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pagerbar .pagepos { display: flex; flex-direction: column; gap: 4px; align-items: center; justify-self: center; }
.pagerbar .pagepos .where { font-family: var(--display); font-weight: 700; font-size: 15px; }
.pagerbar .pagepos .where .of { color: var(--ink-3); font-weight: 500; }
.pagerbar .pagepos .strip { height: 4px; width: 180px; background: var(--border); border-radius: 2px; overflow: hidden; }
.pagerbar .pagepos .strip i { display: block; height: 100%; background: var(--green); }
.pagerbar .pagenav { justify-self: end; display: flex; gap: 8px; align-items: center; }
.navdisabled { opacity: 0.3; pointer-events: none; }
.review { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .review { grid-template-columns: 1fr; } }
.panelabel { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-top: 8px; text-align: center; }
.review-fixed { height: calc(100vh - 240px); min-height: 420px; }
.review-fixed > div { height: 100%; display: flex; flex-direction: column; }
.review-fixed .scan { flex: 1; min-height: 0; display: flex; align-items: flex-start; justify-content: center;
  background: var(--bg-deep); border: 1px solid var(--border); border-radius: 8px; overflow: auto; }
.review-fixed .scan img { max-width: 100%; max-height: 100%; width: auto; object-fit: contain; }
.review-fixed .ocr { height: 100%; display: flex; flex-direction: column; gap: 10px; }
.review-fixed textarea { flex: 1; min-height: 0; resize: none; font-family: var(--mono); font-size: 13px;
  line-height: 1.6; border-radius: 8px; box-shadow: var(--shadow); background: var(--bg-deep); }
.unsplit-note { color: var(--red); margin: 0; }
.approvebar-fixed { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(30,25,18,0.94); border-top: 1px solid var(--border);
  backdrop-filter: blur(6px); padding: 12px 24px;
  display: flex; justify-content: center; align-items: center; gap: 16px; }
.kbd { font-family: var(--mono); font-size: 10.5px; border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; background: var(--paper); color: var(--ink-2); }

/* ---------- connect: numbered steps ---------- */
.connect-head { display: flex; gap: 18px; align-items: center; margin-top: 10px; }
.connect-head h1 { margin: 0; }
.stepgrid { display: grid; grid-template-columns: 44px 1fr; gap: 16px; margin-top: 32px; }
.stepnum { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #1E1912;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 16px; }
.steptitle { font-family: var(--display); font-size: 17px; font-weight: 700; margin: 6px 0 4px; }
.tokenrow { display: flex; align-items: center; gap: 10px; background: var(--paper);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.tokenrow code { font-family: var(--mono); font-size: 13px; flex: 1; overflow-x: auto; white-space: nowrap; }
.codeblock { position: relative; background: var(--bg-deep); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px; }
.codeblock pre { margin: 0; overflow-x: auto; font-size: 12.5px; line-height: 1.7;
  font-family: var(--mono); color: var(--ink); }
.codeblock .copybtn, .tokenrow .copybtn { font-family: var(--body); font-size: 12px; font-weight: 600;
  cursor: pointer; background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(232,163,61,0.4); border-radius: 7px; padding: 6px 12px; white-space: nowrap; }
.codeblock .copybtn { position: absolute; top: 10px; right: 10px; }
.asklist { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px;
  font-family: var(--serif); font-style: italic; font-size: 15.5px; color: var(--ink); }

/* ---------- landing: the literal two doors ---------- */
.landing-hero { max-width: 880px; margin: 0 auto; padding: 72px 28px 40px; text-align: center; }
.landing-hero .est { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.landing-hero h1 { font-family: var(--display); font-size: clamp(38px, 6vw, 60px); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.05; margin: 0; }
.landing-hero p { font-size: 19px; color: var(--ink-2); max-width: 560px; margin: 22px auto 0; }
.doorsplit { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border-strong);
  border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lift); }
@media (max-width: 780px) { .doorsplit { grid-template-columns: 1fr; } }
.doorsplit .d1 { background: var(--parchment); color: #1C1B1A; padding: 44px 44px 40px;
  display: flex; flex-direction: column; gap: 14px; }
.doorsplit .d1 .eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: #8A6A28; }
.doorsplit .d1 h2 { font-family: var(--display); font-size: 30px; font-weight: 800;
  letter-spacing: -0.02em; margin: 0; text-transform: none; color: #1C1B1A; }
.doorsplit .d1 p { margin: 0; color: #5C5647; font-size: 15.5px; }
.doorsplit .d1 li { color: #1C1B1A; }
.doorsplit .d2 { background: var(--bg-deep); padding: 44px 44px 40px;
  display: flex; flex-direction: column; gap: 14px; }
.doorsplit .d2 .eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-2); }
.doorsplit .d2 h2 { font-family: var(--display); font-size: 30px; font-weight: 800;
  letter-spacing: -0.02em; margin: 0; text-transform: none; color: var(--ink); }
.doorsplit .d2 p { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.doorsplit ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14.5px; }
.doorsplit ul li { display: flex; gap: 10px; align-items: baseline; }
.doorsplit ul li .n { font-family: var(--mono); color: var(--accent-deep); }
.doorsplit .cta { margin-top: auto; padding-top: 20px; }
.termcard { background: #14110C; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
  color: var(--parchment); margin-top: 6px; }
.termcard .pr { color: var(--green); }
.howgrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 28px; text-align: left;
  border-top: 1px solid var(--border); padding-top: 36px; }
@media (max-width: 700px) { .howgrid { grid-template-columns: 1fr; } }
.howgrid .stepk { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  color: var(--accent); text-transform: uppercase; }
.howgrid .stept { font-family: var(--display); font-weight: 700; font-size: 17px; margin: 6px 0 4px; }
.howgrid p { margin: 0; font-size: 14px; color: var(--ink-2); }
.landfoot { border-top: 1px solid var(--border); padding: 20px 28px; display: flex;
  justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- tables, logs, misc ---------- */
.eventlog { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); list-style: none; padding: 0; }
.eventlog li { padding: 4px 0; border-bottom: 1px dotted var(--border); display: flex; gap: 12px; }
.eventlog .verb { color: var(--ink); font-weight: 500; min-width: 130px; }
table.plain { border-collapse: collapse; width: 100%; font-size: 13px; }
table.plain td, table.plain th { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--border); }
code.invite { font-family: var(--mono); font-size: 12px; background: var(--paper);
  border: 1px solid var(--border); padding: 3px 8px; border-radius: 5px; }
.empty { text-align: center; padding: 60px 20px; color: var(--ink-2); }
.empty .big { font-size: 40px; }
pre.codeblock { overflow-x: auto; background: var(--bg-deep); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px; font-size: 12px; font-family: var(--mono); color: var(--ink); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--parchment);
  color: #1C1B1A; font-size: 13px; padding: 9px 18px; border-radius: 999px; box-shadow: var(--shadow-lift);
  opacity: 0; transition: opacity 0.25s; z-index: 90; pointer-events: none; }
.toast.show { opacity: 1; }

/* ---------- job-based UX ---------- */
.hero-job { margin: 26px 0; padding: 26px; background: var(--paper); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); }
.hero-job .progress { margin: 12px 0; }
.pending-title { color: var(--ink-3); animation: titlepulse 1.6s ease-in-out infinite; }
@keyframes titlepulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.failbanner { margin: 14px 0; padding: 12px 16px; border: 1px solid rgba(217,138,128,0.4);
  background: var(--red-soft); border-radius: 10px; color: var(--red); font-size: 14px; }
.failbanner .btn { margin-left: 10px; }
.notebanner { margin: 14px 0; padding: 12px 16px; border: 1px solid var(--border);
  background: var(--paper); border-radius: 10px; color: var(--ink-2); font-size: 14px; }
.cardwrap { position: relative; }
.carddelete { position: absolute; top: 10px; right: 10px; margin: 0; }
.carddelete button { border: none; background: var(--paper-raised); color: var(--ink-3); width: 30px; height: 30px;
  border-radius: 50%; cursor: pointer; font-size: 13px; line-height: 1; padding: 0; justify-content: center; min-height: 0; }
.carddelete button:hover { background: var(--red-soft); color: var(--red); }
.cardpdf { position: absolute; bottom: 10px; right: 10px; font-family: var(--body); font-weight: 600; font-size: 12px;
  padding: 6px 12px; border-radius: 10px; background: var(--paper-raised); color: var(--ink-2);
  text-decoration: none; }
.cardpdf:hover { color: var(--accent); }
.cardverb { margin-top: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--accent); }
.nextline { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }

/* ---------- night shift accent layer ----------
   The dusk hero panel now sits on a dusk page — it earns its light instead:
   candlelit border, slightly raised ground. The owl lives in three slots only. */
:root { --dusk: #2A241B; --dusk-2: #3A3226; --dusk-ink: #F2EBD9; --dusk-ink-2: #B0A489; --candle: #E8A33D; }
.hero-job.dusk { background: var(--paper); border-color: rgba(232,163,61,0.35); color: var(--ink);
  box-shadow: 0 0 34px rgba(232,163,61,0.07), var(--shadow);
  display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.hero-job.dusk .meta { color: var(--ink-2); }
.hero-job.dusk .progress { background: rgba(242,235,217,0.12); }
.hero-job.dusk .progress span { background: var(--candle); }
.hero-job.dusk #jobline { color: var(--ink); font-family: var(--serif); font-style: italic; }
.owl-plate { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none;
  box-shadow: 0 0 0 1px rgba(232,163,61,0.55), 0 0 24px rgba(232,163,61,0.2); }
@media (max-width: 560px) { .hero-job.dusk { grid-template-columns: 1fr; } .owl-plate { width: 72px; height: 72px; } }

/* the live puppet — ported from the course videos' Avatar (night-shift-lesson1) */
.owl-live { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; position: relative;
  flex: none; background: var(--parchment);
  box-shadow: 0 0 0 1px rgba(232,163,61,0.55), 0 0 24px rgba(232,163,61,0.2);
  animation: owl-bob 4.4s ease-in-out infinite alternate; }
.owl-live img { position: absolute; width: 260%; height: auto; left: -80%; top: -54%;
  max-width: none; opacity: 0; }
.owl-live img.base { opacity: 1; }
.owl-live.quietring { box-shadow: 0 0 0 1px var(--border-strong); }
@keyframes owl-bob {
  from { transform: translateY(-2px) rotate(-1.2deg); }
  to   { transform: translateY(2.5px) rotate(1.2deg); } }
@media (prefers-reduced-motion: reduce) {
  .owl-live { animation: none; }
  .door:hover .door-owl { transform: none; } }

/* the empty library: the desk, waiting — parchment plate glows in the dark */
.empty img.night-desk { width: min(360px, 80%); border-radius: 10px;
  box-shadow: 0 0 0 1px var(--border), 0 0 40px rgba(232,163,61,0.08); }

/* ---------- pre-flight staging ---------- */
.stagebar { display: flex; gap: 22px; align-items: center; margin: 18px 0 14px; flex-wrap: wrap;
  padding: 16px 18px; background: var(--paper); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); }
.stagecount { font-family: var(--display); font-size: 17px; font-weight: 700; }
.stagecount .meta { font-weight: 400; margin-left: 6px; }
.canarybox { margin: 6px 0 16px; padding: 16px 18px; background: var(--paper);
  border: 1px solid var(--border); border-left: 3px solid var(--candle); border-radius: 10px; }
.canarytext { font-size: 14px; line-height: 1.65; max-height: 220px; overflow-y: auto; white-space: pre-wrap; }
.stagecell { cursor: default; }
.stagecell .stagex { position: absolute; top: 6px; right: 7px; width: 22px; height: 22px; padding: 0;
  border: none; border-radius: 50%; background: rgba(22,18,13,0.85); color: var(--ink-2);
  font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); }
.stagecell .stagex:hover { background: var(--red-soft); color: var(--red); }
.stagecell.excluded img { opacity: 0.25; filter: grayscale(1); }
.stagecell.excluded .stagex { background: var(--red); color: #16120D; }
.stagecell.was-read img { opacity: 0.6; }
.pagecell .flag { font-style: normal; color: var(--ink-3); margin-left: 5px; }
.pagecell .flag.warn { color: var(--accent); font-weight: 600; }
.pagecell.excluded .tag { color: var(--ink-3); text-decoration: line-through; }
