/* `hidden` must win over any display rule below (the offer popup is display:grid). */
[hidden]{display:none!important}

/* FableForge — vintage press UI.
   Hand-written, no CDN, no build step.

   The visual system is printed matter, not software: hierarchy comes from rules,
   small caps and spacing rather than from shadows, pills and elevation. There is
   almost no box-shadow in this file on purpose — ink on paper has no z-axis.
   Book art is the only saturated colour on any page. */

/* ================================================================= tokens */
:root{
  /* Aged-newsprint stock. Panels step lighter than the ground and fields lighter
     than the panels, so nothing disappears into what sits behind it. */
  --bg:#e5decb; --surface:#f2eddd; --surface-2:#dad2bb; --surface-3:#ccc3a9;
  --field:#fbf7ec;

  /* sepia ink */
  --ink:#2a2620; --ink-soft:#463e2f; --muted:#5e5439; --dim:#645740;

  /* rules */
  --line:#cfc5ab; --line-soft:#ded7c3; --line-strong:#b6a98b;

  /* accent: Prussian ink blue — antique maps, ledgers, engineering plates */
  --brand:#33506b; --brand-deep:#22384d; --brand-soft:#8fa5bb;
  --brand-tint:#e7ecf2; --brand-tint-2:#ccd9e5;

  /* oxblood — the house ink: brand mark, avatar and the primary button.
     Blue stays for links, navigation and state, so the two inks never overlap
     in meaning: red is identity and action, blue is where you are and how it went. */
  --btn:#7d3a33; --btn-deep:#5e2a25;

  /* states — four separate period hues, never a pastel.
     "Ready" reuses the house blue: finishing a book IS the success state here. */
  --ok:#33506b;   --ok-tint:#e7ecf2;   --ok-line:#b6c6d6;
  --info:#74540f; --info-tint:#f2e9d1; --info-line:#cbb384;   /* ochre — in flight */
  --warn:#7a5423; --warn-tint:#f4ecdb; --warn-line:#d9c093;   /* umber — caution */
  --bad:#8b3730;  --bad-tint:#f6e6e2;  --bad-line:#dcb6ad;    /* oxblood — failed */

  /* the one shadow in the system, for the lifted panel on the sign-in page */
  --shadow-panel:0 18px 40px -24px rgba(42,38,32,.45);

  --sidebar:262px; --topbar:62px;

  --serif:"Hoefler Text",Baskerville,"Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,Helvetica,Arial,sans-serif;
  --mono:ui-monospace,SFMono-Regular,"JetBrains Mono",Menlo,Consolas,monospace;

  /* one tile of fractal noise, used at very low opacity as paper grain */
  --grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--ink);
  font-family:var(--serif); font-size:16px; line-height:1.62;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
  font-variant-numeric:oldstyle-num;
}
a{color:var(--brand);text-decoration:none;border-bottom:1px solid rgba(51,80,107,.32)}
a:hover{color:var(--brand-deep);border-bottom-color:var(--brand-deep);text-decoration:none}
h1,h2,h3,h4{font-weight:600;line-height:1.22;margin:0 0 .5rem;letter-spacing:-.004em;color:var(--ink)}
p{margin:0 0 1rem}
code{font-family:var(--mono);font-size:.8em;background:var(--surface-2);
  border:1px solid var(--line);padding:.06em .34em;color:var(--ink-soft)}
::selection{background:var(--brand-tint-2)}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}

/* paper grain, over the page and inert to the pointer */
.app-body::before,.auth-stage::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:1;
  background-image:var(--grain);opacity:.028;mix-blend-mode:multiply;
}
.app-body > *,.auth-stage > *{position:relative;z-index:2}

/* ------------------------------------------------- vintage type devices */
.smallcaps,.eyebrow,.nav-section,.badge,.btn,.data-table th,.proj-tag,.crumb,
.metric-label,.pg .no,.stamp{
  font-variant:small-caps;letter-spacing:.13em;
}
.eyebrow{font-size:.86rem;color:var(--brand);font-weight:600;margin:0 0 .3rem}
.muted{color:var(--muted)}
.small{font-size:.85rem}

/* rules and ornaments */
.rule{border:0;border-top:1px solid var(--line);margin:1.5rem 0}
.rule-double{border:0;border-top:3px double var(--line-strong);margin:1.5rem 0}
.fleuron{
  display:flex;align-items:center;gap:1rem;margin:2rem 0;color:var(--line-strong);
  font-size:1.1rem;
}
.fleuron::before,.fleuron::after{content:"";flex:1;border-top:1px solid var(--line)}

/* ============================================================== app shell */
.app-body{
  min-height:100vh;background:var(--bg);
  display:grid;grid-template-columns:var(--sidebar) 1fr;
  grid-template-rows:var(--topbar) 1fr;
  grid-template-areas:"side topbar" "side content";
}

/* --- sidebar: a bookplate, not a nav bar --- */
.sidebar{
  grid-area:side;background:var(--surface);
  border-right:3px double var(--line-strong);
  padding:1.3rem 1rem;display:flex;flex-direction:column;gap:.5rem;
  position:sticky;top:0;height:100vh;overflow-y:auto;scrollbar-width:none;
}
.sidebar::-webkit-scrollbar{display:none}

.brand-row{
  display:flex;align-items:center;gap:.7rem;padding:.2rem .3rem 1rem;
  border-bottom:1px solid var(--line);border-radius:0;
}
.brand-row,.brand-row:hover{border-bottom:1px solid var(--line);text-decoration:none}
.brand-mark{
  display:inline-grid;place-items:center;width:38px;height:38px;
  border:1px solid var(--btn-deep);background:var(--btn);color:#fbf7ec;
  flex-shrink:0;
}
.brand-title{display:block;font-weight:600;color:var(--ink);line-height:1.2;font-size:1.05rem}
.brand-sub{display:block;color:var(--muted);font-size:.78rem;font-style:italic;line-height:1.3}

.nav{display:flex;flex-direction:column;gap:0}
.nav-section{
  margin:1.15rem 0 .35rem;padding:0 0 .25rem;
  font-size:.78rem;font-weight:600;color:var(--dim);border-bottom:1px solid var(--line-soft);
}
.nav-item{
  position:relative;display:flex;align-items:center;gap:.6rem;
  padding:.42rem .55rem;color:var(--ink-soft);font-size:.98rem;
  text-decoration:none;border:0;border-left:2px solid transparent;
  transition:background .15s,color .15s,border-color .15s;
}
.nav-item:hover{background:var(--surface-2);color:var(--ink);border-bottom:0;text-decoration:none}
.nav-item.active{background:var(--brand-tint);color:var(--brand-deep);
  border-left-color:var(--brand);font-weight:600}
.nav-icon{width:18px;display:grid;place-items:center;flex-shrink:0;color:var(--dim)}
.nav-item.active .nav-icon{color:var(--brand)}
.nav-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.sidebar-foot{margin-top:auto;padding-top:1rem}
.credit-pill{
  display:flex;justify-content:space-between;align-items:baseline;
  border:1px solid var(--line-strong);border-top:3px double var(--line-strong);
  background:var(--surface-2);padding:.6rem .75rem;
}
.credit-label{color:var(--muted);font-size:.82rem;font-variant:small-caps;letter-spacing:.11em}
.credit-val{font-size:1.3rem;font-weight:600;color:var(--brand-deep)}

/* --- topbar: a running head --- */
.topbar{
  grid-area:topbar;display:flex;align-items:center;justify-content:space-between;
  padding:0 1.9rem;border-bottom:3px double var(--line-strong);
  background:var(--surface);position:sticky;top:0;z-index:30;
}
.crumb{color:var(--muted);font-size:.92rem}
.crumb-sep{color:var(--line-strong);margin:0 .5rem}
.crumb > :last-child{color:var(--ink)}
.topbar-actions{display:flex;align-items:center;gap:.8rem}
.hello{color:var(--muted);font-size:.9rem;font-style:italic}
.avatar{
  width:30px;height:30px;display:grid;place-items:center;
  border:1px solid var(--btn-deep);background:var(--btn);color:#fbf7ec;
  font-size:.82rem;font-weight:600;flex-shrink:0;
}
.hamburger{display:none;background:var(--surface);border:1px solid var(--line-strong);
  padding:.28rem .5rem;cursor:pointer;color:var(--ink-soft);font-family:inherit}

/* --- content --- */
.content{grid-area:content;padding:2rem 2.4rem 5rem;min-width:0;max-width:1320px}
.section{margin:0 0 2.5rem}
.section-head{
  display:flex;justify-content:space-between;align-items:baseline;gap:1rem;
  margin:0 0 1.1rem;padding-bottom:.5rem;border-bottom:1px solid var(--line);
}
.section-head h2{margin:0;font-size:1.4rem;font-weight:600}

.studio{
  display:grid;
  grid-template-columns:minmax(0,1fr) 340px;
  gap:2rem;
  align-items:start;
}
.studio-rail{
  position:sticky;top:calc(var(--topbar) + 1.5rem);
  display:flex;flex-direction:column;gap:1rem;
  max-height:calc(100vh - var(--topbar) - 3rem);overflow-y:auto;
  scrollbar-width:none;
}
.studio-rail::-webkit-scrollbar{display:none}
.studio-rail .card{margin:0;padding:1.1rem 1.25rem}
.studio-rail .card-title{font-size:1rem}
.studio-rail .field{margin-bottom:.85rem}
.studio-rail label{font-size:.82rem}

/* ---------------------------------------------------------- the flipbook */
.flip{display:flex;align-items:center;gap:.75rem;justify-content:center}
.flip-book{
  position:relative;flex:1;max-width:900px;
  aspect-ratio:calc(2 / var(--page-ratio));
  background:var(--surface-3);
  box-shadow:0 24px 44px -26px rgba(42,38,32,.55);
}
.flip-spread{position:absolute;inset:0;display:grid;grid-template-columns:1fr 1fr;opacity:0;
  pointer-events:none;transition:opacity .18s ease}
.flip-spread.on{opacity:1;pointer-events:auto}
.flip-side{position:relative;overflow:hidden;background:var(--surface)}

/* The gutter: paper curving into the spine, drawn on both inner edges. */
.flip-side.left::after,.flip-side.right::after{
  content:"";position:absolute;top:0;bottom:0;width:8%;pointer-events:none;z-index:3;
}
.flip-side.left::after{right:0;background:linear-gradient(to right,rgba(42,38,32,0),rgba(42,38,32,.20))}
.flip-side.right::after{left:0;background:linear-gradient(to left,rgba(42,38,32,0),rgba(42,38,32,.20))}

.flip-nav{
  flex-shrink:0;width:2.4rem;height:2.4rem;border:1px solid var(--line-strong);
  background:var(--surface);color:var(--ink-soft);font-size:1.3rem;line-height:1;
  cursor:pointer;font-family:var(--serif);transition:background .15s,color .15s;
}
.flip-nav:hover{background:var(--ink-soft);color:var(--surface)}

.flip-bar{
  display:flex;justify-content:space-between;align-items:baseline;gap:1rem;flex-wrap:wrap;
  margin:.9rem auto 0;max-width:900px;font-size:.82rem;color:var(--muted);
}
.flip-count{font-variant:small-caps;letter-spacing:.12em}
.flip-hint{font-style:italic}

/* ------------------------------------------------------------- one page */
.page{position:relative;width:100%;height:100%;overflow:hidden;background:var(--surface)}
.page img{width:100%;height:100%;object-fit:cover;display:block}
.page-plain,.page-blank{background:var(--surface)}
/* Publishing's own phrase, set faint so it reads as an annotation, not
   content: the print file really is blank here (KDP's 24-page minimum and
   even-count rule), and customers kept asking whether it was a bug. */
.page-blank{position:relative}
.page-blank::after{content:'This page is intentionally blank';
  position:absolute;top:50%;left:0;right:0;transform:translateY(-50%);
  text-align:center;font-family:var(--serif);font-style:italic;
  font-size:.68rem;color:var(--muted);opacity:.55}
.page-void::after{content:none}
/* A narrow centred column, half the page wide, as a picture book sets it.
   The exact left edge and width are written in by the flipbook script from the
   quiet box measured on the artwork; these are the values before it runs. */
.page-text{
  position:absolute;left:25%;width:50%;
  font-family:var(--serif);color:#2a2620;text-align:center;
  text-shadow:0 0 3px #fffcf4,0 0 3px #fffcf4,0 0 6px #fffcf4;
}
/* Sizes are ems of a base the script sets in px from the container width, so a
   preview page wraps its lines where the printed page will - 12pt body and
   16.5pt heading on the real trim, scaled to whatever size the page renders. */
.page-text b{display:block;text-align:center;font-size:1.375em;font-weight:600;margin-bottom:.45em;line-height:1.27}
.page-text p{margin:0;text-indent:0;line-height:1.5;font-size:1em;text-align:var(--body-align,center)}
/* A cover title prints as display type - 30pt on a 14pt body, print's exact
   ratio - so the preview has to show the same thing, two-line wrap and all.
   It used to render covers like body pages, and the first thing a customer
   did was download the file and ask why the title had doubled in size. */
.page-text-title b,.proof-title b{font-size:2.143em;line-height:1.2;margin-bottom:.4em}
.page-text-title p,.proof-title p{line-height:1.43}

/* ------------------------------------------------------- a prose page */
.page-prose{
  display:flex;flex-direction:column;justify-content:center;align-items:center;
  gap:5%;padding:8% 11%;background:var(--surface);
}
.page-prose.vig-top{flex-direction:column-reverse}
.prose-body{font-family:var(--serif);color:#2a2620;width:100%}
.prose-body b{display:block;text-align:center;font-size:1.36em;font-weight:600;
  margin-bottom:.35em;line-height:1.35}
.prose-body b::after{content:"";display:block;width:2.2em;height:1px;margin:.5em auto 0;
  background:currentColor;opacity:.5}
.prose-body p{margin:0;line-height:1.52;font-size:1em;text-align:var(--body-align,left)}
/* A frame with the plate cropped inside it. The crop is deliberately tight:
   a prose page usually faces the very picture it borrows from, and the whole
   scene printed twice in one spread reads as a mistake, where a detail of it
   reads as bookmaking. */
.page-prose .prose-vignette{width:62%;aspect-ratio:1/.70;flex:none;display:block;
  overflow:hidden;border:1px solid rgba(42,38,32,.55)}
.page-prose .prose-vignette img{width:100%;height:100%;object-fit:cover;display:block;
  transform-origin:center}
.page-flagged{outline:2px solid var(--warn);outline-offset:-2px}
.page-warn{
  position:absolute;top:4%;left:0;z-index:5;background:var(--warn);color:var(--surface);
  font-family:var(--sans);font-size:.62rem;letter-spacing:.1em;text-transform:uppercase;
  padding:.12rem .5rem;
}
.folio-num{position:absolute;bottom:3%;left:0;right:0;text-align:center;
  font-family:var(--serif);font-size:.72rem;color:var(--muted)}

/* ------------------------------------------- front matter & paper pages */
.pp-block{position:absolute;left:11%;right:11%;font-family:var(--serif);
  color:#2a2620;line-height:1.35;text-align:center}
.pp-block b{font-weight:700}
.pp-l{text-align:left}
.pp-i{font-style:italic}
.pp-pre{white-space:pre-line;line-height:1.55}
.pp-rule{left:40%;right:40%;border-top:1px solid rgba(42,38,32,.75);height:0}
.pp-toc-item{margin-bottom:.45em}
.pp-rule-wide{left:28%;right:28%}
.pp-frame{position:absolute;border:1px solid rgba(42,38,32,.75)}

/* a page is a link into its editor */
a.page-link{display:block;position:absolute;inset:0;z-index:4}

.rail-stat{display:flex;justify-content:space-between;align-items:baseline;
  padding:.35rem 0;border-top:1px solid var(--line-soft);font-size:.86rem}
.rail-stat:first-child{border-top:0}
.rail-stat b{font-weight:600}

@media (max-width:1100px){
  .studio{grid-template-columns:1fr}
  .studio-rail{position:static;max-height:none;order:-1}
  .spread{grid-template-columns:1fr}
}

.proof-paper{background:var(--surface)}
.proof-paper .page-prose{position:absolute;inset:0}
.proof{
  position:relative;width:100%;max-width:520px;margin:0 auto;
  aspect-ratio:1 / var(--page-ratio);
  border:1px solid var(--line-strong);background:var(--surface-2);
  overflow:hidden;user-select:none;
}
.proof img{width:100%;height:100%;object-fit:cover;display:block}
.proof-band{
  position:absolute;pointer-events:none;
  border:1px dashed rgba(53,80,107,.55);
  background:rgba(231,236,242,.14);
}
.proof-text{
  position:absolute;left:25%;width:50%;
  cursor:grab;font-family:var(--serif);color:#2a2620;text-align:center;
  text-shadow:0 0 3px #fffcf4, 0 0 3px #fffcf4, 0 0 6px #fffcf4;
}
.proof-text:active{cursor:grabbing}
.proof-text b{display:block;text-align:center;font-size:1.375em;font-weight:600;margin-bottom:.45em;line-height:1.27}
.proof-text p{margin:0;text-indent:0;line-height:1.5;font-size:1em;text-align:var(--body-align,center)}

/* ------------------------------------------------ building a book */
/* The bar alone reads as "something is happening, unclear how long". The
   clock and the four stages answer the question a waiting reader actually
   has: is this worth staying for. */
.eta{display:flex;align-items:baseline;gap:.4rem;margin:.9rem 0 .2rem}
.eta-time{font-size:1.6rem;font-weight:600;color:var(--brand);
  font-variant-numeric:tabular-nums;line-height:1}
.eta-label{font-size:.82rem;color:var(--muted);font-style:italic}

.steps{list-style:none;margin:.9rem 0 0;padding:0;display:flex;flex-direction:column;gap:.5rem}
.steps li{display:flex;align-items:center;gap:.6rem;font-size:.85rem;color:var(--muted);
  transition:color .3s}
.steps .dot{width:9px;height:9px;flex:none;border-radius:50%;
  border:1px solid var(--line-strong);background:var(--surface);transition:all .3s}
.steps li.done{color:var(--ink)}
.steps li.done .dot{background:var(--brand);border-color:var(--brand)}
.steps li.now{color:var(--btn);font-weight:600}
.steps li.now .dot{background:var(--btn);border-color:var(--btn);
  animation:pulse 1.4s ease-in-out infinite}
@keyframes pulse{
  0%,100%{box-shadow:0 0 0 0 rgba(125,58,51,.5)}
  50%    {box-shadow:0 0 0 6px rgba(125,58,51,0)}
}

/* The bar itself gets a slow sheen, so a long stage still looks alive. */
.progress-bar{position:relative;overflow:hidden}
.progress-bar::after{content:'';position:absolute;inset:0;
  background:linear-gradient(100deg,transparent 30%,rgba(255,255,255,.45) 50%,transparent 70%);
  animation:sheen 2.2s ease-in-out infinite}
@keyframes sheen{0%{transform:translateX(-100%)}100%{transform:translateX(200%)}}

@media (prefers-reduced-motion:reduce){
  .steps li.now .dot{animation:none}
  .progress-bar::after{animation:none}
}

/* The running cost, printed beside the field that sets it. It changes colour
   the moment the shape gets expensive, and again when it stops being
   affordable - a warning a screen away from its cause is a warning nobody
   reads. */
.costbox{margin:.55rem 0 .2rem;padding:.55rem .7rem;background:var(--field);
  border:1px solid var(--line-strong);border-left:3px solid var(--line-strong);
  transition:background .2s, border-color .2s}
.costbox-n{font-size:1.35rem;font-weight:600;color:var(--brand);
  font-variant-numeric:tabular-nums;line-height:1}
.costbox-l{font-size:.8rem;color:var(--muted);margin-left:.35rem}
.costbox-msg{margin:.4rem 0 0;font-size:.78rem;line-height:1.4}
.costbox-msg:empty{display:none}
.costbox.warn{background:#faf3e2;border-color:var(--btn);border-left-color:var(--btn)}
.costbox.warn .costbox-msg{color:var(--btn);font-weight:600}
.costbox.warn .costbox-n{color:var(--btn)}
.costbox.over{background:#fbeee9;border-color:var(--warn);border-left-color:var(--warn)}
.costbox.over .costbox-msg{color:var(--warn);font-weight:700}
.costbox.over .costbox-n{color:var(--warn)}

/* A caution the reader must read before spending, not an error after. */
.hint.warn-text{color:var(--btn);font-style:normal}
.hint.neg{color:var(--warn);font-weight:600;font-style:normal}

input[type=range]{accent-color:var(--brand);width:100%}

/* ------------------------------------------- alignment button group */
.seg{display:flex;border:1px solid var(--line-strong);background:var(--surface)}
.seg button{flex:1;padding:.5rem 0;background:none;border:0;border-left:1px solid var(--line);
  color:var(--muted);cursor:pointer;font-size:1rem;line-height:1;transition:background .15s}
.seg button:first-child{border-left:0}
.seg button:hover{background:var(--brand-tint)}
.seg button.on{background:var(--brand);color:var(--surface)}
.seg svg{width:18px;height:14px;display:inline-block;vertical-align:middle}

/* ========================================================== title block */
.hero,.title-block{
  margin:0 0 1.9rem;padding:0 0 1.2rem;
  border-bottom:3px double var(--line-strong);
  display:flex;justify-content:space-between;align-items:flex-end;gap:2rem;flex-wrap:wrap;
}
.hero-title{font-size:2.5rem;margin:.1rem 0 .45rem;font-weight:600;letter-spacing:-.012em}
.hero-sub{color:var(--ink-soft);margin:0;font-size:1rem;max-width:60ch;font-style:italic}
.hero-actions{display:flex;gap:.55rem;flex-wrap:wrap;align-items:center}

.onboard-banner{
  background:var(--surface);border-top:1px solid var(--line-strong);
  border-bottom:1px solid var(--line-strong);
  padding:.75rem 1.1rem;margin-bottom:1.6rem;
  display:flex;align-items:center;gap:.7rem;font-size:.92rem;color:var(--ink-soft);font-style:italic;
}
.onboard-banner b{color:var(--brand-deep);font-style:normal;font-variant:small-caps;letter-spacing:.1em}

/* ================================================================ figures */
.metric-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:0 0 2.2rem;
  border:1px solid var(--line-strong);background:var(--surface)}
.metric-card{padding:1rem 1.15rem;border-left:1px solid var(--line)}
.metric-card:first-child{border-left:0}
.metric-label{margin:0;color:var(--muted);font-size:.8rem;font-weight:600}
.metric-value{font-size:2.3rem;font-weight:600;margin:.15rem 0 .1rem;color:var(--ink);line-height:1}
.metric-foot{margin:0;color:var(--dim);font-size:.82rem;font-style:italic}

/* ================================================================== cards */
.card{
  background:var(--surface);border:1px solid var(--line-strong);
  padding:1.4rem 1.6rem;margin:0 0 1.4rem;
}
.card-title{font-size:1.15rem;margin:0 0 .25rem;font-weight:600}
.panel-sub{color:var(--muted);font-size:.9rem;margin:0 0 1.1rem;font-style:italic;line-height:1.5}
.two-col{display:grid;grid-template-columns:1.1fr .9fr;gap:1.4rem;align-items:start}

/* ====================================================== plates (book tiles) */
.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(214px,1fr));gap:1.3rem}
.proj-card{
  background:var(--surface);border:1px solid var(--line-strong);
  padding:.5rem .5rem .2rem;display:flex;flex-direction:column;
  color:var(--ink);text-decoration:none;border-bottom:1px solid var(--line-strong);
  transition:border-color .15s,background .15s;
}
.proj-card:hover{border-color:var(--brand);background:#faf6e9;text-decoration:none}
.proj-cover{aspect-ratio:1;position:relative;overflow:hidden;display:block;
  background:var(--surface-3);border:1px solid var(--line)}
.proj-cover img{width:100%;height:100%;object-fit:cover;display:block}
.proj-cover.empty-cover{display:grid;place-items:center;font-size:.88rem;font-style:italic;
  text-align:center;padding:1rem;color:var(--muted);background:var(--surface-2)}
.proj-meta{padding:.7rem .35rem .8rem;display:flex;flex-direction:column;text-align:center}
.proj-tag{
  display:block;font-size:.72rem;font-weight:600;color:var(--muted);
  margin-bottom:.35rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.proj-title{font-size:1.06rem;font-weight:600;margin:0;line-height:1.28}
.proj-author{color:var(--muted);font-size:.85rem;margin:.2rem 0 0;font-style:italic}
.proj-status{color:var(--muted);margin:.55rem 0 0;font-size:.8rem;
  display:flex;align-items:center;justify-content:center;gap:.4rem;
  padding-top:.5rem;border-top:1px solid var(--line-soft)}
.status-dot{display:inline-block;width:7px;height:7px;background:var(--dim);flex-shrink:0;
  transform:rotate(45deg)}
.status-dot.ready{background:var(--ok)}
.status-dot.work{background:var(--info)}
.status-dot.fail{background:var(--bad)}

/* rubber stamp, used sparingly for a finished book */
.stamp{
  display:inline-block;border:2px solid currentColor;padding:.15rem .6rem;
  font-size:.82rem;font-weight:600;color:var(--ok);
  transform:rotate(-2.5deg);opacity:.85;
}
.stamp.fail{color:var(--bad)}

/* ========================================================= quick actions */
.quick-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(266px,1fr));gap:0;
  border:1px solid var(--line-strong);background:var(--surface)}
.quick{
  display:flex;gap:.9rem;align-items:center;padding:1.05rem 1.2rem;
  border-left:1px solid var(--line);color:var(--ink);text-decoration:none;
  transition:background .15s;
}
.quick:first-child{border-left:0}
.quick:hover{background:var(--brand-tint);text-decoration:none}
.quick-icon{width:38px;height:38px;border:1px solid var(--line-strong);background:var(--surface-2);
  color:var(--brand);display:grid;place-items:center;font-size:1.15rem;flex-shrink:0}
.quick-icon.ochre{color:var(--info)}
.quick-icon.oxblood{color:var(--bad)}
.quick-text b{display:block;font-size:1rem;font-weight:600}
.quick-text span{color:var(--muted);font-size:.85rem;font-style:italic}

/* ================================================================== forms */
label{display:block;font-size:.88rem;font-weight:600;color:var(--ink-soft);margin:0 0 .3rem;
  font-variant:small-caps;letter-spacing:.09em}
input[type=text],input[type=email],input[type=password],input[type=number],select,textarea{
  width:100%;padding:.5rem .7rem;font:inherit;font-size:1rem;color:var(--ink);
  background:var(--field);border:1px solid var(--line-strong);border-radius:0;
  transition:border-color .15s,background .15s;
}
input::placeholder{color:var(--dim);font-style:italic}
input:hover,select:hover,textarea:hover{border-color:var(--muted)}
input:focus,select:focus,textarea:focus{
  outline:none;border-color:var(--brand);background:#fffdf6;
  box-shadow:inset 0 -2px 0 var(--brand);
}
.field{margin-bottom:1.1rem}
.form-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:1rem}
.hint{font-size:.85rem;color:var(--muted);margin-top:.3rem;line-height:1.45;font-style:italic}

/* letterpress buttons: flat, ruled, small caps, inverted on hover */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.4rem;
  font-family:var(--serif);font-size:.95rem;font-weight:600;line-height:1;
  padding:.58rem 1.05rem;border:1px solid var(--ink-soft);border-radius:0;
  background:transparent;color:var(--ink-soft);cursor:pointer;text-decoration:none;
  transition:background .15s,color .15s,border-color .15s;
}
.btn:hover{background:var(--ink-soft);color:var(--surface);border-color:var(--ink-soft);text-decoration:none}
.btn.primary{background:var(--btn);color:#fbf7ec;border-color:var(--btn-deep)}
.btn.primary:hover{background:var(--btn-deep);color:#fbf7ec}
.btn.ghost{border-color:var(--line-strong);color:var(--muted)}
.btn.ghost:hover{background:var(--surface-2);color:var(--ink);border-color:var(--muted)}
.btn.danger{border-color:var(--bad-line);color:var(--bad)}
.btn.danger:hover{background:var(--bad-tint);color:var(--bad);border-color:var(--bad)}
.btn.small{padding:.32rem .7rem;font-size:.85rem}
.btn.block{width:100%}
.btn:disabled{opacity:.45;cursor:not-allowed}
.link-arrow{font-size:.92rem;font-weight:600;color:var(--brand);border-bottom:0}
.link-arrow:hover{border-bottom:0}

.preset{
  display:flex;align-items:center;justify-content:space-between;gap:1.5rem;flex-wrap:wrap;
  background:var(--surface);border:1px solid var(--line-strong);
  border-top:3px double var(--line-strong);border-bottom:3px double var(--line-strong);
  padding:1rem 1.25rem;margin:0 0 1.5rem;
}
.preset b{display:block;font-size:1.05rem;margin-bottom:.1rem}
.preset span{display:block;color:var(--muted);font-size:.88rem;font-style:italic;max-width:62ch}

.radio-row{
  display:flex;gap:.6rem;align-items:flex-start;margin:0 0 .55rem;padding:.55rem .7rem;
  border:1px solid var(--line);background:var(--surface);cursor:pointer;
  font-variant:normal;letter-spacing:0;text-transform:none;font-weight:400;
  transition:border-color .15s,background .15s;
}
.radio-row:hover{border-color:var(--muted)}
.radio-row:has(input:checked){border-color:var(--brand);background:var(--brand-tint)}
.radio-row input{margin-top:.35rem;flex-shrink:0;accent-color:var(--brand)}
.radio-row b{display:block;font-size:.95rem;color:var(--ink)}

.hint.pos{color:var(--ok)}
.hint.neg{color:var(--bad)}

/* =========================================================== style picker */
.style-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(152px,1fr));gap:.7rem}
.style-card{position:relative}
.style-card input{position:absolute;opacity:0;pointer-events:none}
.style-card label{
  display:block;cursor:pointer;padding:.35rem;margin:0;border:1px solid var(--line-strong);
  background:var(--surface);font-variant:normal;letter-spacing:0;
  transition:border-color .15s,background .15s;
}
.style-card label:hover{background:#faf6e9;border-color:var(--muted)}
.style-card input:checked + label{border:2px solid var(--brand);padding:calc(.35rem - 1px)}
.style-card input:disabled + label{opacity:.42;cursor:not-allowed}
.sw{display:flex;height:38px;border:1px solid var(--line)}
.sw i{flex:1}
.style-card .nm{display:block;padding:.45rem .2rem .3rem;font-size:.82rem;font-weight:600;
  color:var(--ink);text-align:center;line-height:1.25;
  min-height:2.5em;                    /* two lines, so the grid rows stay level */
  display:flex;flex-direction:column;align-items:center;justify-content:center}
.style-card .lk{font-size:.72rem;color:var(--brand);font-weight:600;
  font-variant:small-caps;letter-spacing:.1em}

/* =================================================================== misc */
.badge{
  display:inline-block;padding:.05rem .45rem;border:1px solid currentColor;
  font-size:.8rem;font-weight:600;background:transparent;color:var(--muted);
}
.badge.ready{color:var(--ok)}
.badge.work{color:var(--info)}
.badge.fail{color:var(--bad)}
.badge.gold{color:var(--brand-deep)}

.alert{padding:.8rem 1.05rem;font-size:.92rem;margin:0 0 1.2rem;line-height:1.55;
  border:1px solid;border-left-width:4px}
.alert.warn{background:var(--warn-tint);border-color:var(--warn-line);border-left-color:var(--warn);color:var(--warn)}
.alert.error{background:var(--bad-tint);border-color:var(--bad-line);border-left-color:var(--bad);color:var(--bad)}
.alert.ok{background:var(--ok-tint);border-color:var(--ok-line);border-left-color:var(--ok);color:var(--ok)}
.alert.info{background:var(--info-tint);border-color:var(--info-line);border-left-color:var(--info);color:var(--info)}
.alert b{font-variant:small-caps;letter-spacing:.08em}
.alert code{background:rgba(255,255,255,.55);border-color:currentColor;color:inherit}

.progress-bar-wrap{height:12px;background:var(--surface-2);border:1px solid var(--line-strong);overflow:hidden}
.progress-bar{display:block;height:100%;transition:width .5s ease;
  background:repeating-linear-gradient(45deg,var(--brand),var(--brand) 5px,var(--brand-deep) 5px,var(--brand-deep) 10px)}
.stat-row{display:flex;gap:2.4rem;flex-wrap:wrap;margin-top:1.1rem}
.stat-block .stat-number{display:block;font-size:1.7rem;font-weight:600;color:var(--ink);line-height:1}
.stat-block .stat-label{font-size:.84rem;color:var(--muted);font-style:italic}

/* tables set like a printed table of contents */
.data-table{width:100%;border-collapse:collapse;font-size:.95rem}
.data-table th{
  text-align:left;font-size:.82rem;color:var(--muted);font-weight:600;
  padding:0 1rem .45rem 0;white-space:nowrap;border-bottom:1px solid var(--line-strong);
}
.data-table td{padding:.68rem 1rem .68rem 0;border-bottom:1px solid var(--line-soft);
  vertical-align:middle;color:var(--ink-soft)}
.data-table tr:last-child td{border-bottom:0}
.data-table th:last-child,.data-table td:last-child{padding-right:0;text-align:right}

/* leader-dot rows, the classic contents-page device */
.ledger{list-style:none;margin:0;padding:0}
.ledger li{display:flex;align-items:baseline;gap:.5rem;padding:.42rem 0}
.ledger li + li{border-top:1px solid var(--line-soft)}
.ledger .k{color:var(--ink-soft);white-space:nowrap}
.ledger .lead{flex:1;border-bottom:1px dotted var(--line-strong);transform:translateY(-.28em);min-width:1.5rem}
.ledger .v{color:var(--ink);font-weight:600;white-space:nowrap}
.ledger .v.pos{color:var(--ok)}
.ledger .v.neg{color:var(--bad)}

.kv-list{list-style:none;margin:0;padding:0}
.kv-list li{padding:.6rem 0;border-top:1px solid var(--line-soft)}
.kv-list li:first-child{border-top:0;padding-top:0}
.kv-list b{display:block;font-size:.95rem;font-weight:600;color:var(--ink);font-family:var(--mono);
  font-size:.85rem;letter-spacing:-.01em}
.kv-list span{display:block;font-size:.85rem;color:var(--muted);font-style:italic}

.empty{text-align:center;padding:3.2rem 2rem;background:var(--surface);
  border:1px solid var(--line-strong);border-top:3px double var(--line-strong);
  border-bottom:3px double var(--line-strong)}
.empty h3{margin:0 0 .35rem;font-size:1.3rem}
.empty p{color:var(--muted);margin:0 0 1.3rem;font-style:italic}
.empty::before{content:"\2766";display:block;font-size:1.6rem;color:var(--line-strong);margin-bottom:.8rem}

/* Download buttons: the letterpress bars the mock called variant A - one
   full-width bar per file, stacked; label set like pressed type on the left,
   the file's vitals in italic on the right; on hover the ink rolls in and the
   bar lifts, on press it sinks. */
.dl{display:flex;flex-direction:column;gap:.55rem}
.dl a{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem;
  padding:.7rem .9rem;min-width:0;
  background:linear-gradient(var(--field),var(--surface));color:var(--btn-deep);
  border:1px solid var(--btn);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55), 0 2px 0 rgba(94,42,37,.30);
  transition:background .2s, color .2s, transform .12s, box-shadow .12s}
.dl a:hover{background:var(--btn);color:#fbf7ec;border-color:var(--btn-deep);
  text-decoration:none;transform:translateY(-1px);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.15), 0 3px 0 var(--btn-deep)}
.dl a:hover .k{text-shadow:none}
.dl a:hover .m{color:#e8ddc4}
.dl a:active{transform:translateY(1px);box-shadow:inset 0 1px 2px rgba(0,0,0,.25)}
.dl .k{font-weight:700;font-size:.78rem;letter-spacing:.08em;text-transform:uppercase;
  text-shadow:0 1px 0 rgba(255,255,255,.5)}
.dl .m{font-size:.74rem;color:var(--muted);font-style:italic;white-space:nowrap}

/* page thumbnails, presented as numbered plates */
.pages{display:grid;grid-template-columns:repeat(auto-fill,minmax(172px,1fr));gap:1.1rem}
.pg{border:1px solid var(--line-strong);background:var(--surface);padding:.45rem}
.pg .im{aspect-ratio:1;width:100%;object-fit:cover;display:block;
  background:var(--surface-3);border:1px solid var(--line)}
.pg .ph{aspect-ratio:1;display:grid;place-items:center;color:var(--dim);font-size:.82rem;
  font-style:italic;border:1px solid var(--line);background:var(--surface-2)}
.pg .tx{padding:.6rem .35rem .3rem;font-size:.85rem;color:var(--muted);line-height:1.45;
  text-align:center;font-style:italic}
.pg .no{display:block;font-size:.76rem;color:var(--ink-soft);font-weight:600;
  font-style:normal;margin-bottom:.25rem}

/* ========================================================= auth + landing */
.auth-stage{
  min-height:100vh;display:grid;grid-template-columns:1.05fr .95fr;align-items:center;gap:3.5rem;
  padding:3rem 4rem;background:var(--bg);
}
.auth-pitch{max-width:36rem;justify-self:end}
.auth-headline{font-size:3.3rem;line-height:1.08;letter-spacing:-.015em;margin:.5rem 0 1.1rem;font-weight:600}
.auth-headline em{font-style:italic;font-weight:600;color:var(--brand)}
.auth-lead{color:var(--ink-soft);font-size:1.05rem;margin:0 0 1.6rem;max-width:50ch}
.auth-bullets{list-style:none;padding:0;margin:0;color:var(--ink-soft);font-size:.96rem;
  border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.auth-bullets li{padding:.45rem 0 .45rem 1.6rem;position:relative}
.auth-bullets li + li{border-top:1px solid var(--line-soft)}
.auth-bullets li::before{content:"\2767";position:absolute;left:.1rem;top:.45rem;
  color:var(--brand-soft);font-size:.9rem}
.auth-foot{margin-top:2rem;color:var(--dim);font-size:.85rem;font-style:italic}
.auth-panel{
  background:var(--surface);border:1px solid var(--line-strong);
  border-top:3px double var(--line-strong);border-bottom:3px double var(--line-strong);
  padding:2rem;max-width:26rem;width:100%;box-shadow:var(--shadow-panel);
}

/* ============================================================= responsive */
@media (max-width:1180px){
  .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .metric-card:nth-child(3){border-left:0}
  .metric-card:nth-child(n+3){border-top:1px solid var(--line)}
  .two-col{grid-template-columns:1fr}
  .quick{border-left:0;border-top:1px solid var(--line)}
  .quick:first-child{border-top:0}
}
@media (max-width:1024px){
  .app-body{grid-template-columns:1fr;grid-template-areas:"topbar" "content"}
  .sidebar{position:fixed;left:0;top:0;bottom:0;width:var(--sidebar);z-index:60;
    transform:translateX(-100%);transition:transform .22s ease;box-shadow:var(--shadow-panel)}
  .app-body.nav-open .sidebar{transform:none}
  .app-body.nav-open::after{content:"";position:fixed;inset:0;background:rgba(42,38,32,.4);z-index:50}
  .hamburger{display:inline-block}
  .content{padding:1.5rem 1.2rem 3.5rem}
  .topbar{padding:0 1.2rem}
}
@media (max-width:820px){
  .auth-stage{grid-template-columns:1fr;padding:2rem 1.25rem;gap:2rem}
  .auth-pitch{justify-self:start}
  .auth-headline{font-size:2.2rem}
  .auth-panel{max-width:none}
  .hero-title{font-size:1.8rem}
  .metric-grid{grid-template-columns:1fr 1fr}
  .hello{display:none}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition-duration:.01ms !important;animation-duration:.01ms !important}
}

/* ========================================================= prompt studio
   The book's pictures are made in the reader's own ChatGPT. One card per
   picture: a plate for the thumbnail, the prompt to copy, a place to drop. */
.st-steps{margin:.2rem 0 1rem;padding-left:1.3rem}
.st-steps li{margin:.35rem 0;color:var(--ink-soft)}
.st-actions{display:flex;flex-wrap:wrap;gap:.55rem;align-items:center;margin:.9rem 0}
.st-details{margin:.8rem 0;border-top:1px solid var(--line-soft);padding-top:.6rem}
.st-details summary{cursor:pointer;color:var(--brand);font-weight:600}
.st-pre{white-space:pre-wrap;word-break:break-word;font-family:var(--mono);font-size:.76rem;line-height:1.5;
  max-height:22rem;overflow:auto;background:var(--field);border:1px solid var(--line);padding:.8rem;margin:.6rem 0 0}
.st-answer{width:100%;font-family:var(--mono);font-size:.8rem;min-height:12rem;resize:vertical}

.st-file{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;pointer-events:none}
.st-pick{position:relative}
.st-pick:focus-within,.st-drop:focus-within{outline:2px solid var(--brand);outline-offset:2px}

.st-drop{position:relative;display:flex;flex-direction:column;align-items:center;gap:.2rem;margin:.2rem 0 0;
  padding:1.2rem 1rem;border:1px dashed var(--line-strong);background:var(--field);cursor:pointer;text-align:center;
  font-variant:normal;letter-spacing:0;transition:border-color .15s,background .15s}
.st-drop:hover,.st-drop.over{border-color:var(--brand);background:var(--brand-tint)}
.st-drop b{color:var(--ink)}
.st-drop span{font-size:.85rem;color:var(--muted);font-style:italic;max-width:52ch}
.st-note{margin:.7rem 0 0;font-size:.88rem;color:var(--info)}
.st-note:empty{display:none}

.st-group{margin:1.8rem 0 0}
.st-group .section-head h3{font-size:1.1rem;margin:0}
.st-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:1rem}

.st-card{display:flex;flex-direction:column;min-width:0;background:var(--surface);border:1px solid var(--line-strong);
  transition:border-color .15s,background .15s}
.st-card.over{border-color:var(--brand);background:var(--brand-tint)}
.st-card[data-state="placed"]{border-color:var(--ok-line)}
.st-card[data-state="error"]{border-color:var(--bad-line)}

.st-thumb{position:relative;overflow:hidden;max-width:100%;background:var(--surface-2);border-bottom:1px solid var(--line)}
.st-thumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.st-ph{position:absolute;inset:0;display:grid;place-items:center;color:var(--dim);font-style:italic;font-size:.9rem;
  background:repeating-linear-gradient(135deg,transparent 0 9px,rgba(42,38,32,.045) 9px 10px)}
.st-badge{position:absolute;top:.45rem;left:.45rem;padding:.02rem .42rem;font-size:.74rem;font-weight:600;
  background:var(--surface);border:1px solid var(--btn);color:var(--btn);font-variant:small-caps;letter-spacing:.1em}
.st-card[data-state="processing"] .st-thumb::after,.st-card[data-state="sending"] .st-thumb::after{
  content:"";position:absolute;inset:0;background:rgba(242,237,221,.5)}

.st-body{display:flex;flex-direction:column;gap:.4rem;flex:1;padding:.6rem .7rem .7rem}
.st-title{margin:0;font-weight:600;font-size:.95rem;line-height:1.3}
.st-title span{font-weight:400;color:var(--muted);font-style:italic}
.st-text{margin:0;flex:1;font-size:.82rem;line-height:1.4;color:var(--muted)}
.st-row{display:flex;flex-wrap:wrap;gap:.4rem}
.st-row .btn{flex:1 1 auto}
.btn.done,.btn.done:hover{background:var(--ok);border-color:var(--ok);color:var(--surface)}
.st-state{margin:0;font-size:.78rem;font-style:italic;color:var(--dim)}
.st-card[data-state="processing"] .st-state,.st-card[data-state="sending"] .st-state{color:var(--info)}
.st-card[data-state="placed"] .st-state{color:var(--ok)}
.st-card[data-state="error"] .st-state{color:var(--bad);font-style:normal;font-weight:600}

/* ============================================================ the wizard
   Four steps, set like a contents page: numbers in ruled boxes, the current
   step in the house red. No rounded pills - the rest of the app is print. */
.wiz{list-style:none;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;
  margin:0 0 1.8rem;padding:0;border:1px solid var(--line-strong);background:var(--surface)}
.wiz-step{display:flex;align-items:center;gap:.6rem;min-width:0;padding:.7rem .9rem;
  border-left:1px solid var(--line);color:var(--muted)}
.wiz-step:first-child{border-left:0}
.wiz-n{flex:none;width:26px;height:26px;display:grid;place-items:center;
  border:1px solid var(--line-strong);background:var(--field);font-size:.85rem;font-weight:600;
  font-variant-numeric:lining-nums}
.wiz-t{min-width:0;display:flex;flex-direction:column;line-height:1.25}
.wiz-t b{font-size:.95rem;color:var(--ink-soft);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wiz-t span{font-size:.78rem;font-style:italic;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wiz-step.done .wiz-n{background:var(--brand);border-color:var(--brand);color:var(--surface)}
.wiz-step.done .wiz-t b{color:var(--ink)}
.wiz-step.now{background:var(--field)}
.wiz-step.now .wiz-n{background:var(--btn);border-color:var(--btn-deep);color:#fbf7ec}
.wiz-step.now .wiz-t b{color:var(--btn);font-weight:700}

.wiz-nav{display:flex;align-items:center;justify-content:space-between;gap:.6rem;
  padding:.7rem .9rem;border:1px solid var(--line-strong);background:var(--surface)}
.wiz-nav .wiz-at{font-size:.82rem;color:var(--muted);font-variant:small-caps;letter-spacing:.11em}
.wiz-nav .btn{flex:none}

.wiz-finish{border-top:3px double var(--line-strong);border-bottom:3px double var(--line-strong)}
.wiz-files{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.4rem}
.wiz-files .btn{flex:1 1 auto}
.st-steps li.neg{color:var(--bad);font-weight:600}

@media (max-width:820px){
  .wiz{grid-template-columns:repeat(2,minmax(0,1fr))}
  .wiz-step:nth-child(3){border-left:0}
  .wiz-step:nth-child(n+3){border-top:1px solid var(--line)}
}

/* ------------------------------------------------- the wizard's own forms
   One question a screen, in a column narrow enough to read in one pass. */
.wiz-wrap{max-width:720px;margin:0 auto}
.wiz-q{font-size:1.55rem;margin:0 0 .3rem;letter-spacing:-.008em}
.wiz-sub{color:var(--muted);font-style:italic;margin:0 0 1.3rem;font-size:.92rem}
.wiz-pane{background:var(--surface);border:1px solid var(--line-strong);
  border-top:3px double var(--line-strong);padding:1.6rem 1.7rem;margin:0 0 1rem}
.wiz-pane > .field:last-of-type{margin-bottom:0}

/* choices set as ruled plates rather than radio dots */
.choice-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:.6rem}
.choice-grid.three{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.choice{position:relative;display:block;padding:.75rem .9rem;cursor:pointer;
  border:1px solid var(--line-strong);background:var(--field);
  font-variant:normal;letter-spacing:0;transition:border-color .15s,background .15s}
.choice:hover{border-color:var(--muted)}
.choice input{position:absolute;opacity:0;width:1px;height:1px}
.choice > span{display:flex;flex-direction:column;gap:.15rem;min-width:0}
.choice b{font-size:.98rem;color:var(--ink);line-height:1.3}
.choice span span{font-size:.82rem;color:var(--muted);font-style:italic;line-height:1.42}
.choice:has(input:checked){border-color:var(--btn);border-left-width:3px;background:var(--surface)}
.choice:has(input:checked) b{color:var(--btn)}
.choice:has(input:focus-visible){outline:2px solid var(--brand);outline-offset:2px}
.choice.tight{padding:.6rem .75rem;text-align:center}
.choice.tight > span{align-items:center}
.choice.shape .shape-n{margin-top:.35rem;padding-top:.35rem;border-top:1px solid var(--line);
  font-style:normal;color:var(--ink-soft);font-variant-numeric:oldstyle-num}

/* one-tap subjects */
.chips-label{margin:.7rem 0 .35rem;font-size:.8rem;color:var(--muted);
  font-variant:small-caps;letter-spacing:.12em}
.chips{display:flex;flex-wrap:wrap;gap:.35rem}
.chip{font-family:var(--serif);font-size:.86rem;line-height:1;padding:.36rem .6rem;cursor:pointer;
  background:var(--surface);color:var(--ink-soft);border:1px solid var(--line-strong);
  transition:background .15s,color .15s,border-color .15s}
.chip:hover{background:var(--surface-2);border-color:var(--muted)}
.chip.hot::after{content:"\2022";color:var(--btn);margin-left:.35rem}
.chip.on{background:var(--btn);border-color:var(--btn-deep);color:#fbf7ec}
.chip.on::after{color:#fbf7ec}

/* the dials most readers never open */
.adv{margin-top:1.2rem;border-top:1px solid var(--line-soft);padding-top:.8rem}
.adv summary{cursor:pointer;color:var(--brand);font-weight:600;font-size:.92rem}
.adv[open] summary{margin-bottom:1rem}

/* four figures instead of a ledger */
.summary{list-style:none;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;
  margin:1.4rem 0 .6rem;padding:0;border:1px solid var(--line-strong);background:var(--field)}
.summary li{padding:.7rem .8rem;border-left:1px solid var(--line);text-align:center}
.summary li:first-child{border-left:0}
.summary b{display:block;font-size:1.5rem;font-weight:600;color:var(--ink);line-height:1.1;
  font-variant-numeric:oldstyle-num}
.summary span{font-size:.76rem;color:var(--muted);font-style:italic;line-height:1.3}

@media (max-width:640px){
  .wiz-pane{padding:1.2rem 1rem}
  .summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .summary li:nth-child(3){border-left:0}
  .summary li:nth-child(n+3){border-top:1px solid var(--line)}
}

/* the page a paste or a rail drop will land on */
.st-card.is-next{border-color:var(--btn);border-width:2px;background:var(--field)}
.st-card.is-next .st-thumb{border-bottom-color:var(--btn)}
.st-card.is-next .st-title::before{content:"\25B8";color:var(--btn);margin-right:.3rem}
.st-drop.compact{padding:.8rem .7rem}
.st-drop.compact b{font-size:.92rem}
.st-drop.compact span{font-size:.79rem}
kbd{font-family:var(--mono);font-size:.78em;padding:.05em .35em;background:var(--surface);
  border:1px solid var(--line-strong);color:var(--ink-soft)}

/* A page whose picture has not landed yet.
   It used to be indistinguishable from a finished prose page - same paper, and
   a crop of the neighbouring plate standing in for art the reader was still
   making. Hatched ground and a plain label say what is actually true. */
.page-awaiting{
  background-color:var(--surface);
  background-image:repeating-linear-gradient(135deg,transparent 0 10px,rgba(42,38,32,.05) 10px 11px);
}
.page-wait{
  position:absolute;top:4%;left:0;z-index:5;background:var(--surface-3);color:var(--ink-soft);
  font-family:var(--sans);font-size:.62rem;letter-spacing:.1em;text-transform:uppercase;
  padding:.12rem .5rem;
}
.page-wait.now{background:var(--info);color:var(--surface)}

/* ========================================================== the funnel
   Locks are quiet: a reader who has not bought an upgrade should see what
   exists without being shouted at on every screen. */
.nav-item.locked{color:var(--dim)}
.nav-item.locked .nav-icon{color:var(--line-strong)}
.nav-item.locked:hover{background:var(--surface-2);color:var(--ink-soft)}
.nav-lock{margin-left:auto;font-size:.76rem;font-variant:small-caps;letter-spacing:.08em;
  color:var(--btn);border:1px solid var(--line-strong);padding:0 .3rem;background:var(--field)}

.choice.locked{opacity:.62;cursor:pointer}
.choice.locked:hover{border-color:var(--btn)}
.lock-tag{position:absolute;top:.4rem;right:.4rem;z-index:2;font-size:.7rem;font-weight:600;
  font-variant:small-caps;letter-spacing:.1em;padding:.02rem .4rem;
  background:var(--field);border:1px solid var(--btn);color:var(--btn)}
.style-card[data-offer]{cursor:pointer}
.style-card[data-offer] label{position:relative}

/* the one dialog every lock opens */
.offer-veil{position:fixed;inset:0;z-index:80;display:grid;place-items:center;
  background:rgba(42,38,32,.45);padding:1.2rem}
.offer-box{max-width:30rem;width:100%;background:var(--surface);padding:1.6rem 1.7rem;
  border:1px solid var(--line-strong);border-top:3px double var(--line-strong);
  box-shadow:var(--shadow-panel)}
.offer-box .card-title{font-size:1.3rem;margin:0 0 .3rem}
.offer-actions{display:flex;gap:.55rem;flex-wrap:wrap;margin-top:1.2rem}
.offer-buy{margin-top:1rem;padding:1.2rem;border:1px dashed var(--line-strong);background:var(--field)}

/* the grant/revoke toggles in the Control Center */
.ent-row{display:flex;flex-wrap:wrap;gap:.25rem}
.ent-row form{display:inline}
.ent-pill{font-family:var(--serif);font-size:.74rem;font-variant:small-caps;letter-spacing:.08em;
  padding:.1rem .42rem;cursor:pointer;background:var(--surface);color:var(--dim);
  border:1px solid var(--line-strong)}
.ent-pill:hover{border-color:var(--muted);color:var(--ink)}
.ent-pill.on{background:var(--ok);border-color:var(--ok);color:var(--surface)}

/* the whole-tale shortcut, and the file-matching preview it opens */
.st-group .section-head{align-items:center}
.tale-tools{display:flex;gap:.4rem;flex-wrap:wrap;align-items:center}
.tale-tools .btn{white-space:nowrap}
.match-list{list-style:none;margin:.6rem 0 0;padding:0;font-size:.85rem}
.match-list li{display:flex;justify-content:space-between;gap:1rem;padding:.26rem 0;
  border-top:1px solid var(--line-soft)}
.match-list .file{font-family:var(--mono);font-size:.78rem;color:var(--muted);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.match-list .to{font-weight:600;color:var(--ink);white-space:nowrap}
.match-list .to.guess{color:var(--info);font-weight:400;font-style:italic}

/* the Publisher licence: imprint, seats, and the style club */
.seat-list{list-style:none;margin:.4rem 0 1rem;padding:0}
.seat-list li{display:flex;align-items:center;justify-content:space-between;gap:.8rem;
  padding:.45rem 0;border-top:1px solid var(--line-soft)}
.seat-list li:first-child{border-top:0}
.seat-list form{display:inline}
.once{font-family:var(--mono);font-size:.95rem;padding:.35rem .6rem;background:var(--field);
  border:1px dashed var(--btn);display:inline-block;margin-top:.3rem;user-select:all}

/* the Bestseller Subjects library */
.lib{margin-top:1rem;border:1px solid var(--line-strong);background:var(--field);padding:.6rem .8rem}
.lib summary{cursor:pointer;font-weight:600;color:var(--brand)}
.lib summary .muted{font-weight:400;font-style:italic}
.lib[open] summary{margin-bottom:.7rem}
.lib-bar{display:grid;grid-template-columns:1fr auto;gap:.5rem;margin-bottom:.6rem}
.lib-bar select{width:auto}
.lib-list{list-style:none;margin:0;padding:0;max-height:22rem;overflow-y:auto;
  border-top:1px solid var(--line-soft)}
.lib-item{display:flex;flex-direction:column;align-items:flex-start;gap:.1rem;width:100%;
  padding:.45rem .3rem;background:none;border:0;border-bottom:1px solid var(--line-soft);
  font-family:var(--serif);text-align:left;cursor:pointer;color:var(--ink)}
.lib-item:hover{background:var(--surface)}
.lib-item b{font-size:.95rem}
.lib-item span{font-size:.78rem;color:var(--muted);font-style:italic;line-height:1.35}
.lib-item.on{background:var(--surface);box-shadow:inset 3px 0 0 var(--btn)}
.lib-teaser{margin:.6rem 0 0;font-size:.86rem}
@media (max-width:640px){ .lib-bar{grid-template-columns:1fr} }

/* sign-in label with a link on the right */
.label-row{display:flex;justify-content:space-between;align-items:baseline;gap:1rem}
.label-row a{font-weight:400}

/* public sales pages */
.sale{max-width:46rem;margin:0 auto;padding:1.5rem 1.25rem 3rem;min-height:100vh}
.sale-top{display:flex;justify-content:space-between;align-items:center;padding-bottom:1rem;
  border-bottom:1px solid var(--line-soft)}
.sale-hero{text-align:center;padding:3rem 0 2rem}
.sale-title{font-size:clamp(2rem,6vw,3.2rem);line-height:1.08;margin:.4rem 0 1rem;font-weight:600}
.sale-lead{color:var(--ink-soft);font-size:1.1rem;max-width:40rem;margin:0 auto 1.6rem}
.sale-block{padding:2rem 0;border-top:1px solid var(--line-soft)}
.sale-block h2{margin:0 0 1rem}
.sale-placeholder{border:1px dashed var(--line-strong);padding:1.4rem;text-align:center;color:var(--muted);background:var(--field)}
.sale-foot{padding-top:1.5rem;border-top:1px solid var(--line-soft);text-align:center;color:var(--muted);font-size:.88rem}
.buy-pending{display:flex;flex-direction:column;align-items:center;gap:.25rem}
.buy-pending b{font-size:1.8rem;color:var(--brand)}
.buy-pending span{color:var(--muted);font-style:italic}
.skip-link{text-align:center;margin:.9rem 0 0;font-size:.88rem}
.skip-link a{color:var(--muted)}

/* Auto-Write */
.st-auto{border-left:3px solid var(--btn)}
.st-auto-row{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap}
.or-line{display:flex;align-items:center;gap:.8rem;margin:1rem 0;color:var(--muted);font-size:.85rem;font-style:italic}
.or-line::before,.or-line::after{content:"";flex:1;border-top:1px solid var(--line-soft)}
.sale-disclaimer{padding:1.5rem 0;border-top:1px solid var(--line-soft);font-size:.78rem;color:var(--muted)}
.offer-buy a img{max-width:100%;height:auto}
.offer-buy{text-align:center}
