/* ==========================================================================
   Talelo design system: DUSK
   One night, every screen. Deep violet melting into ember and dusty rose; content screens sit on a near-black violet
   so covers glow. Ember is the single action colour (CTAs, active tab). Cream carries text.
   Type: Young Serif (headlines, story titles, reading, wordmark) and Satoshi (UI). Both self-hosted.
   ========================================================================== */
@font-face { font-family: "Young Serif"; src: url("assets/fonts/YoungSerif-Variable.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Young Serif"; src: url("assets/fonts/YoungSerif-Italic-Variable.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("assets/fonts/Satoshi-Variable.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
:root {
  /* Dusk palette */
  --dusk-violet: #241239; --dusk-plum: #4a2358; --dusk-cream: #fbf3e4; --dusk-ember: #ff7a45; --dusk-rose: #e890b0; --dusk-night: #140b20;
  /* roles */
  --bg: var(--dusk-night);
  --bg-2: #1d1230;
  --surface: #22153a;
  --surface-2: #2b1a46;
  --line: #3d2a5c;
  --ink: var(--dusk-cream);
  --ink-2: #e3d6d6;
  --muted: #b8a9c6;
  --action: var(--dusk-ember); /* the single action colour: CTAs, active tab, links */
  --accent: var(--action);
  --accent-ink: var(--dusk-violet);
  --accent-soft: #3a1d2e;
  --rose: var(--dusk-rose);
  --focus: var(--dusk-rose);
  --good: #7ed3a3;
  --warn: var(--dusk-ember);
  --danger: #ff9a8a;
  --scrim: rgba(8, 4, 14, .72);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 8px 24px -6px rgba(0, 0, 0, .55);
  --shadow-cover: 0 1px 2px rgba(0, 0, 0, .55), 0 10px 22px -8px rgba(0, 0, 0, .7), 0 0 0 1px rgba(251, 243, 228, .04);
  --glow-top: radial-gradient(1100px 520px at 50% -12%, rgba(74, 35, 88, .55), rgba(36, 18, 57, .18) 55%, transparent 75%);

  /* type */
  --f-read: "Young Serif", ui-serif, Georgia, serif;
  --f-ui: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  /* one type scale: 12 caption / 14 small / 16 body / 20 subtitle / 28 title / 36 display */
  --t-xs: 12px; --t-sm: 14px; --t-base: 16px; --t-md: 16px; --t-lg: 20px; --t-xl: 28px; --t-2xl: 36px; --t-3xl: 36px; --h1: 28px;

  /* space, radius, motion */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r-sm: 4px; --r-md: 6px; --r-lg: 8px; --r-xl: 12px; --r-pill: 999px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --d-fast: 140ms; --d-med: 260ms; --d-slow: 520ms;

  --nav-h: 64px;
  --rail-w: 88px;
  color-scheme: dark;
}
@media (min-width: 768px) { :root { --h1: 36px; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--glow-top), var(--bg); color: var(--ink); font-family: var(--f-ui); font-size: var(--t-base); line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.ic { width: 22px; height: 22px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: var(--t-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.h-display { font-family: var(--f-read); font-weight: 600; font-size: var(--t-xl); letter-spacing: -.01em; line-height: 1.1; text-wrap: balance; margin: 0; }
.muted { color: var(--muted); }
.tabnum { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }

/* ---------- app frame ---------- */
#app { position: fixed; inset: 0; display: grid; grid-template-columns: 1fr; }
.main { position: relative; overflow-y: auto; overflow-x: hidden; height: 100%; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); scroll-behavior: smooth; overscroll-behavior: contain; }
.main.no-scroll { overflow: hidden; }
.page { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: var(--s4); padding-block: var(--s4) var(--s7); }
@media (min-width: 768px) {
  #app { grid-template-columns: var(--rail-w) 1fr; }
  .main { padding-bottom: 0; }
  .page { padding-inline: var(--s6); padding-block: var(--s6) var(--s8); }
}

/* bottom nav (mobile) */
.bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; align-items: stretch; height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--bg); border-top: 1px solid var(--line); }
.bnav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 600; min-height: 48px; transition: color var(--d-fast); }
.bnav button[aria-current="page"] { color: var(--ink); }
.bnav .bubble { width: 48px; height: 28px; border-radius: var(--r-pill); display: grid; place-items: center; color: inherit; transition: background var(--d-fast), color var(--d-fast); }
.bnav button[aria-current="page"] .bubble { background: var(--accent); color: var(--accent-ink); }
.bnav .bubble .ic { width: 22px; height: 22px; }
.bnav.hidden-nav { transform: translateY(110%); }
@media (min-width: 768px) { .bnav { display: none; } }

/* rail (tablet / desktop) */
.rail { display: none; }
@media (min-width: 768px) {
  .rail { display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: 76px 0 var(--s4); border-right: 1px solid var(--line); background: var(--bg); height: 100%; z-index: 20; }
  .rail .nav-item { width: 68px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 8px; border-radius: var(--r-md); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.2; transition: background var(--d-fast), color var(--d-fast); }
  .rail .nav-item:hover { background: var(--bg-2); color: var(--ink); }
  .rail .nav-item[aria-current="page"] { color: var(--ink); background: transparent; }
  .rail .nav-item .bubble { width: 48px; height: 32px; border-radius: 12px; display: grid; place-items: center; color: inherit; transition: background var(--d-fast), color var(--d-fast); }
  .rail .nav-item[aria-current="page"] .bubble { background: var(--accent); color: var(--accent-ink); }
  .rail .nav-item .ic { width: 22px; height: 22px; }
  .rail .spacer { flex: 1; }
}

/* brand mark */
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer; border-radius: var(--r-md); }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-family: var(--f-read); font-weight: 700; font-size: 20px; line-height: 1; position: relative; }
.brand .mark::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); top: 5px; right: 5px; }
.brand .word { font-family: var(--f-read); font-weight: 700; font-size: 20px; letter-spacing: -.01em; }

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-md); font-weight: 600; font-size: var(--t-base); transition: transform var(--d-fast) var(--ease), background var(--d-fast), opacity var(--d-fast), box-shadow var(--d-fast); white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { box-shadow: 0 6px 22px -6px rgba(255, 122, 69, .6); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { box-shadow: 0 6px 22px -6px rgba(255, 122, 69, .6); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ghost:hover { background: var(--line); }
.btn-line { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.btn-line:hover { border-color: var(--muted); }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: var(--t-md); }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: var(--t-sm); }
.btn[disabled] { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.btn-block { width: 100%; }
.icon-btn { width: 44px; height: 44px; border-radius: var(--r-lg); display: inline-grid; place-items: center; color: var(--ink); transition: background var(--d-fast), transform var(--d-fast); flex: none; }
.icon-btn:hover { background: var(--bg-2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.on { color: var(--accent); }
.link { color: var(--accent); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.follow-btn { min-height: 32px; padding: 0 14px; border-radius: var(--r-md); font-size: var(--t-sm); font-weight: 600; background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-2); transition: background var(--d-fast), color var(--d-fast); }
.follow-btn.is-following { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); transition: background var(--d-fast), box-shadow var(--d-fast), color var(--d-fast); }
.chip:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--dusk-violet); box-shadow: none; }
.chip .ic { width: 16px; height: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--s4) * -1); padding-inline: var(--s4); }
.chips.scroll::-webkit-scrollbar { display: none; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; letter-spacing: .02em; background: var(--bg-2); color: var(--ink-2); }
.pill .ic { width: 13px; height: 13px; }
.pill-good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.pill-warn { background: var(--accent-soft); color: var(--accent); }
.seg { display: inline-flex; padding: 3px; background: var(--bg-2); border-radius: var(--r-md); gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { min-height: 34px; padding: 0 14px; border-radius: var(--r-md); font-size: var(--t-sm); font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg .count { color: var(--muted); font-weight: 600; margin-left: 4px; }

/* avatars */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--dusk-cream); font-weight: 600; font-size: 12px; letter-spacing: .02em; flex: none; background: hsl(var(--h, 24) 45% 42%); background-image: linear-gradient(135deg, hsl(var(--h, 24) 60% 58%), hsl(calc(var(--h, 24) + 40) 45% 32%)); }
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }
.avatar.lg { width: 84px; height: 84px; font-size: 28px; }
.creator-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.creator-link .name { font-weight: 600; font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.creator-link:hover .name { text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   COVERS. A cover is a full-bleed photograph (or the procedural fallback) with real title and storyteller text
   over it. Each treatment (.tx-*) is its own type design: family x weight x case x tracking x size x alignment x
   colour x scrim. These stacks are system fonts and belong to covers only; they never reach the app UI.
   ========================================================================== */
.cover { --cv-serif: Georgia, "Times New Roman", serif; --cv-didot: Didot, "Bodoni 72", "Bodoni MT", Georgia, serif; --cv-old: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --cv-garamond: Garamond, "EB Garamond", "Hoefler Text", Baskerville, Georgia, serif; --cv-bask: Baskerville, "Baskerville Old Face", "Hoefler Text", Georgia, serif; --cv-script: "Snell Roundhand", "Apple Chancery", "URW Chancery L", "Palatino Linotype", Georgia, serif;
  --cv-slab: Rockwell, "Rockwell Nova", "Roboto Slab", "Courier New", serif; --cv-impact: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif; --cv-cond: "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --cv-grot: "Helvetica Neue", Helvetica, Arial, sans-serif; --cv-humanist: Optima, Candara, "Gill Sans", "Gill Sans MT", "Trebuchet MS", sans-serif; --cv-geo: Futura, "Century Gothic", "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
  --cv-round: ui-rounded, "Arial Rounded MT Bold", "Avenir Next Rounded", "Trebuchet MS", sans-serif; --cv-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace; --cv-type: "American Typewriter", "Courier New", Courier, monospace;
  --cv-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  position: relative; aspect-ratio: 2 / 3; border-radius: 3px; overflow: hidden; background: #17151f; box-shadow: var(--shadow-cover); max-width: 100%; container-type: inline-size; isolation: isolate; color: #fff; }
.cover::after { content: ""; position: absolute; inset: 0; z-index: 5; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), inset 2px 0 0 rgba(255, 255, 255, .08); pointer-events: none; }
.cover.mini { border-radius: 2px; box-shadow: var(--shadow-1); }
.cover.tiny { width: 28px; }
.bk-art { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.bk-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--cv-pos, 50% 50%); }
.bk-art::after { content: ""; position: absolute; inset: 0; background: var(--cv-scrim, none); }
.is-fallback .bk-art::before { content: ""; position: absolute; inset: 0; z-index: 1; background: rgba(10, 8, 20, .3); }
.bk-type { position: absolute; z-index: 2; left: var(--cv-pad, 9cqi); right: var(--cv-pad, 9cqi); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--cv-gap, 3cqi); text-align: var(--cv-align, left); top: var(--cv-top, auto); bottom: var(--cv-bottom, 9cqi); transform: var(--cv-shift, none); }
.bk-title { font-family: var(--tf, var(--cv-serif)); font-weight: var(--tw, 600); font-style: var(--tst, normal); text-transform: var(--tc, none); letter-spacing: var(--tl, 0); font-variant: var(--tv, normal); font-size: calc(var(--tz, 10cqi) * var(--k, 1) * var(--wf, 1)); line-height: var(--tlh, 1.04); color: var(--ti, #fff); text-shadow: var(--tsh, none); text-wrap: balance; overflow-wrap: break-word; hyphens: manual; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.bk-by { font-family: var(--bf, var(--cv-ui)); font-weight: var(--bw, 600); font-style: var(--bst, normal); text-transform: var(--bc, uppercase); letter-spacing: var(--bl, .14em); font-size: var(--bz, 3.8cqi); color: var(--bi, var(--ti, #fff)); text-shadow: var(--tsh, none); opacity: .92; order: var(--bo, 2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk.t-s { --k: 1.18; } .bk.t-m { --k: 1; } .bk.t-l { --k: .86; } .bk.t-xl { --k: .74; }

/* Dark photographs: type sits on a dark scrim */
.tx-ninth { --tf: var(--cv-serif); --tw: 700; --tc: uppercase; --tl: .02em; --tz: 9.5cqi; --ti: #f6f1e8; --cv-top: 9cqi; --cv-bottom: auto; --bo: -1; --cv-scrim: linear-gradient(to bottom, rgba(6, 5, 10, .78), rgba(6, 5, 10, 0) 55%); }
.tx-understudy { --tf: var(--cv-serif); --tw: 700; --tc: uppercase; --tl: .02em; --tz: 9.5cqi; --ti: #f6f1e8; --cv-scrim: linear-gradient(to top, rgba(6, 5, 10, .82), rgba(6, 5, 10, 0) 55%); }
.tx-salt { --tf: var(--cv-ui); --tw: 600; --tc: uppercase; --tl: .16em; --tz: 6.2cqi; --tlh: 1.3; --ti: #eef0f6; --cv-align: center; --cv-pad: 12cqi; --cv-top: 50%; --cv-bottom: auto; --cv-shift: translateY(-50%); --bl: .24em; --bz: 3.2cqi; --cv-scrim: rgba(4, 6, 14, .38); }
.tx-salt::before { content: ""; position: absolute; inset: 5cqi; z-index: 3; border: 1px solid rgba(238, 240, 246, .55); pointer-events: none; }
.tx-stair { --tf: var(--cv-serif); --tw: 400; --tc: lowercase; --tl: -.02em; --tz: 12cqi; --tlh: .98; --ti: #f1e9e0; --bi: #d9a39a; --cv-scrim: linear-gradient(to top, rgba(8, 4, 5, .9), rgba(8, 4, 5, .1) 62%); }
.tx-lighthouse { --tf: var(--cv-garamond); --tw: 600; --tv: small-caps; --tl: .1em; --tz: 10cqi; --tlh: 1.1; --ti: #f6e9d0; --cv-align: center; --cv-top: 9cqi; --cv-bottom: auto; --bo: 2; --cv-scrim: linear-gradient(to bottom, rgba(10, 6, 14, .66), rgba(10, 6, 14, 0) 50%); --tsh: 0 1px 12px rgba(0, 0, 0, .45); }
.tx-lighthouse .bk-type { padding-block: 3.5cqi; border-block: 1px solid rgba(246, 233, 208, .55); }
.tx-lost { --tf: var(--cv-humanist); --tw: 600; --tc: uppercase; --tl: .2em; --tz: 7.6cqi; --tlh: 1.4; --ti: #f8e9c8; --tsh: 0 1px 10px rgba(0, 0, 0, .6); --cv-align: center; --cv-scrim: linear-gradient(to top, rgba(12, 8, 4, .9), rgba(12, 8, 4, 0) 66%); --bl: .28em; --bz: 3.4cqi; }
.tx-ninety { --tf: var(--cv-impact); --tw: 400; --tc: uppercase; --tl: .005em; --tz: 13cqi; --tlh: .92; --ti: #f7c948; --bi: #ffffff; --tsh: 0 2px 0 rgba(0, 0, 0, .4); --cv-top: 8cqi; --cv-bottom: auto; --cv-scrim: linear-gradient(to bottom, rgba(8, 6, 10, .72), rgba(8, 6, 10, 0) 52%); --bo: 2; }
.tx-ferry { --tf: var(--cv-serif); --tw: 700; --tst: italic; --tz: 11cqi; --tlh: 1; --ti: #fff4e2; --tsh: 0 2px 14px rgba(60, 20, 0, .6); --cv-scrim: linear-gradient(to top, rgba(30, 10, 4, .72), rgba(30, 10, 4, 0) 58%); --bl: .2em; --bz: 3.4cqi; }
.tx-glass { --tf: var(--cv-round); --tw: 700; --tc: lowercase; --tz: 11.5cqi; --tlh: 1; --tl: -.01em; --ti: #ffffff; --tsh: 0 2px 18px rgba(20, 10, 40, .6); --cv-align: center; --cv-top: 50%; --cv-bottom: auto; --cv-shift: translateY(-50%); --cv-scrim: radial-gradient(ellipse at 50% 50%, rgba(8, 6, 20, .5), rgba(8, 6, 20, .12) 75%); --bl: .1em; }
.tx-orbit { --tf: var(--cv-geo); --tw: 400; --tc: uppercase; --tl: .42em; --tz: 5.6cqi; --tlh: 1.6; --ti: #d6e4ff; --cv-align: center; --cv-top: 10cqi; --cv-bottom: auto; --cv-scrim: linear-gradient(to bottom, rgba(2, 4, 14, .62), rgba(2, 4, 14, 0) 50%); --bl: .5em; --bz: 3cqi; }
.tx-house { --tf: var(--cv-garamond); --tw: 400; --tst: italic; --tz: 12cqi; --tlh: 1.04; --ti: #f2dba8; --cv-align: center; --cv-scrim: linear-gradient(to top, rgba(8, 5, 3, .86), rgba(8, 5, 3, 0) 62%); --bl: .24em; --bz: 3.4cqi; }
.tx-train { --tf: var(--cv-cond); --tw: 800; --tc: uppercase; --tz: 15cqi; --tlh: .92; --tl: .005em; --ti: #ffffff; --bi: #f7d34a; --cv-scrim: linear-gradient(to top, rgba(6, 6, 10, .84), rgba(6, 6, 10, 0) 60%); --bl: .2em; }
.tx-train .bk-title { font-stretch: condensed; }
.tx-auction { --tf: var(--cv-didot); --tw: 600; --tc: uppercase; --tl: .14em; --tz: 8cqi; --tlh: 1.15; --ti: #ead39c; --cv-align: center; --cv-top: 9cqi; --cv-bottom: auto; --cv-scrim: linear-gradient(to bottom, rgba(14, 10, 6, .76), rgba(14, 10, 6, 0) 52%); --bo: 2; --bl: .28em; --bz: 3.2cqi; }
.tx-tide { --tf: var(--cv-bask); --tw: 400; --tz: 13cqi; --tlh: 1.02; --tl: -.01em; --ti: #ffffff; --tsh: 0 1px 14px rgba(0, 0, 0, .5); --cv-scrim: linear-gradient(to top, rgba(8, 10, 12, .66), rgba(8, 10, 12, 0) 55%); --bst: italic; --bc: none; --bl: .04em; --bz: 4.6cqi; --bf: var(--cv-bask); --bw: 400; }
.tx-clock { --tf: var(--cv-slab); --tw: 800; --tc: uppercase; --tz: 10.5cqi; --tlh: 1; --ti: #ffffff; --tsh: 0 2px 10px rgba(0, 0, 0, .6); --cv-top: 9cqi; --cv-bottom: auto; --cv-scrim: linear-gradient(to bottom, rgba(10, 6, 4, .7), rgba(10, 6, 4, 0) 56%); --bo: 2; }
.tx-bakery { --tf: var(--cv-round); --tw: 700; --tz: 10.5cqi; --tlh: 1.02; --ti: #fff2dc; --cv-align: center; --cv-scrim: linear-gradient(to top, rgba(18, 8, 2, .8), rgba(18, 8, 2, 0) 60%); --bl: .16em; --bz: 3.4cqi; }
.tx-moon { --tf: var(--cv-mono); --tw: 600; --tc: lowercase; --tl: .1em; --tz: 7.4cqi; --tlh: 1.45; --ti: #ffffff; --tsh: 0 1px 12px rgba(0, 0, 0, .75); --cv-align: center; --cv-top: 50%; --cv-bottom: auto; --cv-shift: translateY(-50%); --cv-scrim: rgba(4, 4, 8, .5); --bf: var(--cv-mono); --bw: 600; --bc: lowercase; --bl: .1em; --bz: 4cqi; }
.tx-echo { --tf: var(--cv-grot); --tw: 800; --tc: uppercase; --tl: .04em; --tz: 11cqi; --tlh: 1; --ti: #ffffff; --bi: #ffffff; --tsh: 0 1px 12px rgba(0, 24, 30, .7); --cv-scrim: linear-gradient(to top, rgba(2, 20, 24, .8), rgba(2, 20, 24, 0) 62%); }
.tx-echo .bk-title { -webkit-text-stroke: max(1px, .6cqi) #ffffff; -webkit-text-fill-color: rgba(255, 255, 255, .18); }

/* Light photographs: dark ink on a pale scrim */
.tx-snow { --tf: var(--cv-old); --tw: 400; --tst: italic; --tz: 11cqi; --tlh: 1.08; --ti: #1b2a46; --bi: #36486b; --cv-align: center; --cv-scrim: linear-gradient(to top, rgba(238, 244, 252, .94), rgba(238, 244, 252, 0) 58%); --bl: .22em; }
.tx-postcards { --tf: var(--cv-script); --tw: 600; --tst: italic; --tz: 12cqi; --tlh: 1.04; --ti: #4a1f35; --bi: #6a3a52; --cv-align: center; --cv-scrim: linear-gradient(to top, rgba(252, 234, 236, .95), rgba(252, 234, 236, 0) 60%); --bl: .2em; }
.tx-seed { --tf: var(--cv-geo); --tw: 700; --tz: 11.5cqi; --tlh: .96; --tl: -.02em; --ti: #ffffff; --tsh: 0 1px 12px rgba(0, 30, 34, .5); --cv-scrim: linear-gradient(to top, rgba(4, 36, 40, .8), rgba(4, 36, 40, 0) 56%); --bl: .16em; }
.tx-orchard { --tf: var(--cv-grot); --tw: 300; --tc: lowercase; --tl: .04em; --tz: 9.5cqi; --tlh: 1.12; --ti: #1f2f4c; --bi: #3a4d70; --cv-scrim: linear-gradient(to top, rgba(234, 241, 252, .94), rgba(234, 241, 252, 0) 52%); --bl: .22em; --bw: 400; }
.tx-unsent { --tf: var(--cv-type); --tw: 400; --tl: 0; --tz: 8.6cqi; --tlh: 1.22; --ti: #2a2016; --bi: #4a3a28; --cv-top: 9cqi; --cv-bottom: auto; --cv-scrim: linear-gradient(to bottom, rgba(252, 244, 226, .95), rgba(252, 244, 226, 0) 58%); --bf: var(--cv-type); --bw: 400; --bc: lowercase; --bl: .02em; --bz: 4.4cqi; --bo: 2; }

/* Small covers drop the byline and let the title carry */
.cover.mini .bk-by { display: none; }
.cover.mini .bk-title { -webkit-line-clamp: 5; letter-spacing: 0; font-size: calc(var(--tz, 10cqi) * var(--k, 1) * var(--wf, 1) * 1.05); }
.cover.mini::before, .cover.mini .bk-type { border: 0; }
.cover.tiny .bk-type { display: none; }

/* ---------- top bars ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: env(safe-area-inset-top, 0px) var(--s4) 0; background: color-mix(in srgb, var(--bg) 90%, transparent); }
.topbar h1 { font-family: var(--f-read); font-weight: 600; font-size: var(--t-lg); margin: 0; flex: 1; }
.topbar .bar-spacer { flex: 1; }
.topbar .brand .word { display: inline; }
.page-title { font-family: var(--f-read); font-weight: 600; font-size: var(--t-xl); line-height: 1.15; margin: 0 0 var(--s5); }
@media (min-width: 768px) { .topbar { padding-inline: max(var(--s6), calc((100% - 1120px) / 2 + var(--s6))); min-height: 68px; } .topbar h1 { font-size: var(--t-xl); } }

/* ==========================================================================
   DISCOVER
   ========================================================================== */
.discover { height: 100%; display: flex; flex-direction: column; }
.disc-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; padding: calc(env(safe-area-inset-top, 0px) + 6px) var(--s4) 6px; gap: var(--s2); }
.disc-top .tabs { justify-self: center; }
.disc-top .right { justify-self: end; }

.tabs { display: inline-flex; gap: 4px; }
.tabs button { position: relative; padding: 8px 12px; white-space: nowrap; font-weight: 600; font-size: var(--t-base); color: var(--muted); transition: color var(--d-fast); }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px; background: var(--ink); }
.disc-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; position: relative; }
.stage { position: relative; min-height: 0; overflow: hidden; touch-action: pan-x; }
.rec { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 4px var(--s4) var(--s3); gap: var(--s3); will-change: transform, opacity; }
.rec .art { position: relative; flex: 1 1 auto; min-height: 150px; overflow: hidden; background: transparent; cursor: pointer; container-type: size; display: grid; place-items: center; }
.rec .art .bk-hero { height: min(100cqh, 150cqw); width: auto; max-width: none; box-shadow: 0 2px 4px rgba(20, 16, 40, .3), 0 14px 28px -12px rgba(20, 16, 40, .5); transition: transform 600ms var(--ease-out); }
.rec.settled .art .bk-hero { transform: translateY(-2px); }
.rec .info { flex: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); min-width: 0; width: 100%; }
.rec .hook { font-family: var(--f-read); font-size: var(--t-base); line-height: 1.45; color: var(--ink-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rec .byline { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.rec .byline .creator-link { flex: 1; }
.rec .byline .sub { font-size: var(--t-xs); color: var(--muted); font-weight: 600; }
.rec .actions { display: flex; align-items: center; gap: 2px; }
.rec .actions .btn-read { flex: 1; margin-right: var(--s2); }
.rec .count { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: -6px; margin-right: 4px; min-width: 2ch; }
.rec .info .title-lg { font-family: var(--f-read); font-weight: 600; font-size: var(--h1); line-height: 1.1; margin: 0; text-wrap: balance; }
.rec .info .meta-row { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: var(--t-sm); color: var(--muted); font-weight: 600; }
.rec .info .meta-row span + span::before { content: "·"; margin-right: 8px; }
.rec .info .taste { font-size: var(--t-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.swipe-hint { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 3; pointer-events: none; }
.swipe-hint .dot { width: 4px; height: 4px; border-radius: 4px; background: var(--ink); opacity: .22; transition: height var(--d-med), opacity var(--d-med); }
.swipe-hint .dot.on { height: 16px; opacity: .85; }
.up-next { display: none; }
.disc-keys { display: none; }
.rec-enter-up { animation: recUp var(--d-slow) var(--ease-out) both; }
.rec-enter-down { animation: recDown var(--d-slow) var(--ease-out) both; }
.rec-leave-up { animation: leaveUp 340ms var(--ease) both; }
.rec-leave-down { animation: leaveDown 340ms var(--ease) both; }
@keyframes recUp { from { transform: translateY(14%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes recDown { from { transform: translateY(-14%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes leaveUp { to { transform: translateY(-22%) scale(.96); opacity: 0; } }
@keyframes leaveDown { to { transform: translateY(22%) scale(.96); opacity: 0; } }

@media (min-width: 768px) { .disc-top { padding: var(--s4) var(--s6) var(--s2); } }
@media (min-width: 768px) {
  .rec { padding: var(--s3) var(--s6) var(--s5); flex-direction: row; align-items: center; justify-content: center; gap: var(--s6); }
  .rec .art { flex: none; height: min(100%, 720px); aspect-ratio: 2 / 3; width: auto; max-width: 50%; }
  .rec .info { flex: 1; min-width: 0; max-width: 460px; gap: var(--s4); }
  .rec .hook { -webkit-line-clamp: 5; font-size: var(--t-base); }
}
@media (min-width: 1024px) { .rec { padding-right: 88px; } }
@media (min-width: 1180px) {
  .disc-body { grid-template-columns: 1fr 300px; }
  .up-next { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s3) var(--s6) var(--s5) 0; min-height: 0; overflow: hidden; }
  .up-next .item { display: grid; grid-template-columns: 52px 1fr; gap: var(--s3); align-items: center; padding: 8px; border-radius: var(--r-md); text-align: left; transition: background var(--d-fast); }
  .up-next .item:hover { background: var(--bg-2); }
  .up-next .item .t { font-family: var(--f-read); font-size: 16px; line-height: 1.1; }
  .up-next .item .s { font-size: var(--t-xs); color: var(--muted); }
  .disc-keys { display: flex; gap: var(--s4); color: var(--muted); font-size: var(--t-xs); margin-top: auto; padding: 0 8px; }
  .kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line), 0 1px 0 var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); margin-right: 4px; }
}
.nav-arrows { display: none; }
@media (min-width: 1024px) {
  .nav-arrows { display: flex; flex-direction: column; gap: 8px; position: absolute; right: var(--s4); top: 50%; transform: translateY(-50%); z-index: 4; }
  .nav-arrows .icon-btn { background: var(--surface); box-shadow: var(--shadow-1); }
}

/* empty states */
.empty { display: grid; justify-items: center; text-align: center; gap: var(--s3); padding: var(--s7) var(--s4); max-width: 420px; margin: 0 auto; }
.empty .glyph { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty .glyph .ic { width: 28px; height: 28px; }
.empty h3 { font-family: var(--f-read); font-weight: 600; font-size: var(--t-lg); margin: 0; }
.empty p { margin: 0; color: var(--muted); }
.suggest-creators { display: grid; gap: var(--s2); width: 100%; margin-top: var(--s3); }
.suggest-creators .row { display: flex; align-items: center; gap: var(--s3); padding: 10px 12px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1); text-align: left; }
.suggest-creators .row .creator-link { flex: 1; }

/* ==========================================================================
   READER
   ========================================================================== */
.reader { --r-bg: #160c24; --r-ink: #f3eadb; --r-muted: #b8a9c6; --r-line: #33224d; --r-accent: var(--dusk-ember); --r-surface: #1f1331; --r-hl: rgba(255, 122, 69, .22);
  position: fixed; inset: 0; z-index: 50; background: var(--r-bg); color: var(--r-ink); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; animation: readerIn var(--d-slow) var(--ease-out) backwards; }
.reader.theme-warm { --r-bg: #2a1534; --r-ink: #f6e9da; --r-muted: #c9b2c4; --r-line: #47294f; --r-accent: var(--dusk-ember); --r-surface: #331b40; --r-hl: rgba(232, 144, 176, .24); }
.reader.theme-dark { --r-bg: #160c24; --r-ink: #f3eadb; --r-muted: #b8a9c6; --r-line: #33224d; --r-accent: var(--dusk-ember); --r-surface: #1f1331; --r-hl: rgba(255, 122, 69, .22); color-scheme: dark; }
.reader.theme-light { --r-bg: var(--dusk-cream); --r-ink: var(--dusk-violet); --r-muted: #5e4a6b; --r-line: #e6d6c4; --r-accent: #b5431a; --r-surface: #fffaf1; --r-hl: #f8d9c6; color-scheme: light; }
@keyframes readerIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.reader.leaving { animation: readerOut 220ms var(--ease) both; }
@keyframes readerOut { to { opacity: 0; transform: translateY(12px); } }
.r-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 3; background: transparent; }
.r-progress i { display: block; height: 100%; width: 0; background: var(--r-accent); transition: width 120ms linear; border-radius: 0 3px 3px 0; }
.r-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 4px; padding: calc(env(safe-area-inset-top, 0px) + 6px) 8px 6px; background: var(--r-bg); transition: transform var(--d-med) var(--ease), box-shadow var(--d-med); }
.r-bar.scrolled { box-shadow: 0 1px 0 var(--r-line); }
.r-bar.tuck { transform: translateY(-100%); }
.r-bar .r-title { flex: 1; min-width: 0; text-align: center; font-weight: 600; font-size: var(--t-sm); opacity: 0; transition: opacity var(--d-med); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-bar.scrolled .r-title { opacity: 1; }
.reader .icon-btn { color: var(--r-ink); }
.reader .icon-btn:hover { background: color-mix(in srgb, var(--r-ink) 8%, transparent); }
.reader .icon-btn.on { color: var(--r-accent); }
.r-pct { font-size: var(--t-xs); font-weight: 600; color: var(--r-muted); min-width: 3.2ch; text-align: right; margin-right: 4px; }
.r-wrap { max-width: 36rem; margin: 0 auto; padding: var(--s5) 22px calc(var(--s8) + env(safe-area-inset-bottom, 0px)); }
.r-head { display: grid; gap: var(--s4); padding-bottom: var(--s6); margin-bottom: var(--s6); border-bottom: 1px solid var(--r-line); }
.r-head .r-meta { font-size: var(--t-xs); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--r-muted); display: flex; flex-wrap: wrap; gap: 8px; }
.r-head .r-meta span + span::before { content: "·"; margin-right: 8px; }
.r-head h1 { font-family: var(--f-read); font-weight: 600; font-size: var(--h1); line-height: 1.08; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
.r-head .r-hook { font-family: var(--f-read); font-style: italic; color: var(--r-muted); font-size: var(--t-lg); line-height: 1.4; margin: 0; }
.r-head .r-by { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.r-head .r-by .creator-link .name { font-size: var(--t-base); }
.reader .follow-btn { background: transparent; color: var(--r-ink); box-shadow: inset 0 0 0 1px var(--r-line); }
.reader .follow-btn.is-following { background: transparent; color: var(--r-muted); box-shadow: inset 0 0 0 1px var(--r-line); }
.r-cover-band { display: grid; grid-template-columns: 92px 1fr; gap: var(--s4); align-items: end; }
.made-banner { display: flex; gap: var(--s3); align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--r-surface); box-shadow: inset 0 0 0 1px var(--r-line); font-size: var(--t-sm); animation: fadeUp var(--d-slow) var(--ease-out) both; }
.made-banner .ic { color: var(--r-accent); }
.made-banner b { display: block; font-size: var(--t-base); }
.r-body { font-family: var(--f-read); font-size: var(--r-size, 20px); line-height: 1.7; max-width: 34em; font-optical-sizing: auto; hanging-punctuation: first; }
.r-body p { margin: 0 0 1.05em; transition: background 1.6s var(--ease); border-radius: 4px; }
.r-body .lead { font-variant: small-caps; letter-spacing: .04em; }
.r-body p:first-child::first-letter { font-family: var(--f-read); float: left; font-size: 3.4em; line-height: .9; padding: .06em .08em 0 0; color: var(--r-ink); font-weight: 600; }
.r-body p.changed { background: var(--r-hl); box-shadow: -10px 0 0 var(--r-hl), 10px 0 0 var(--r-hl); }
.r-body[contenteditable="true"], .r-body [contenteditable="true"] { outline: none; }
.r-body.editing p { box-shadow: inset 2px 0 0 var(--r-line); padding-left: 12px; margin-left: -14px; }
.r-body.editing p:focus { box-shadow: inset 2px 0 0 var(--r-accent); }
.r-fin { text-align: center; margin: var(--s7) 0 var(--s5); color: var(--r-muted); font-family: var(--f-read); font-size: 20px; letter-spacing: .3em; }
.r-end { display: grid; gap: var(--s5); padding: var(--s5); border-radius: var(--r-lg); background: var(--r-surface); box-shadow: inset 0 0 0 1px var(--r-line); animation: fadeUp var(--d-slow) var(--ease-out) both; }
.r-end h3 { font-family: var(--f-read); font-weight: 600; font-size: var(--t-lg); margin: 0; text-align: center; }
.react-row { display: flex; justify-content: center; gap: var(--s2); flex-wrap: wrap; }
.react { display: grid; justify-items: center; gap: 4px; width: 72px; padding: 10px 0 8px; border-radius: var(--r-md); color: var(--r-muted); font-size: var(--t-xs); font-weight: 600; transition: background var(--d-fast), color var(--d-fast), transform var(--d-fast); }
.react:hover { background: color-mix(in srgb, var(--r-ink) 6%, transparent); }
.react[aria-pressed="true"] { color: var(--r-accent); background: color-mix(in srgb, var(--r-accent) 12%, transparent); }
.react[aria-pressed="true"] .ic { animation: pop 380ms var(--ease-out); }
@keyframes pop { 40% { transform: scale(1.3); } }
.end-actions { display: flex; justify-content: center; gap: var(--s2); flex-wrap: wrap; }
.reader .btn-line { background: transparent; border-color: var(--r-line); color: var(--r-ink); }
.reader .btn-primary { background: var(--r-accent); color: var(--dusk-violet); }
.related { display: grid; grid-template-columns: 76px 1fr; gap: var(--s4); align-items: center; text-align: left; padding: var(--s3); border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--r-line); }
.related:hover { box-shadow: inset 0 0 0 1px var(--r-muted); }
.related .t { font-family: var(--f-read); font-size: 20px; line-height: 1.1; }
.related .h { font-size: var(--t-sm); color: var(--r-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.creator-dock { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 140%); z-index: 4; display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: var(--r-pill); background: var(--r-ink); color: var(--r-bg); box-shadow: 0 14px 40px rgba(0, 0, 0, .3); transition: transform var(--d-slow) var(--ease-out); max-width: calc(100% - 24px); }
.creator-dock.show { transform: translate(-50%, 0); }
.creator-dock button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: var(--r-md); font-weight: 600; font-size: var(--t-sm); white-space: nowrap; color: inherit; }
.creator-dock button:hover { background: color-mix(in srgb, var(--r-bg) 14%, transparent); }
.creator-dock .publish { background: var(--r-accent); color: var(--dusk-violet); }
.reader .creator-dock .publish { color: var(--dusk-violet); }
.creator-dock .ic { width: 18px; height: 18px; }
.creator-dock .lbl-long { display: none; }
@media (min-width: 560px) { .creator-dock .lbl-long { display: inline; } }
.edit-bar { position: sticky; top: 60px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 10px 14px; margin: 0 0 var(--s5); border-radius: var(--r-md); background: var(--r-surface); box-shadow: inset 0 0 0 1px var(--r-accent); font-size: var(--t-sm); }
.title-edit { outline: none; border-radius: 6px; }
.title-edit:focus { box-shadow: 0 2px 0 var(--r-accent); }

/* reader settings popover */
.popover { position: fixed; z-index: 70; min-width: 260px; padding: var(--s4); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); border: 1px solid var(--line); animation: fadeUp var(--d-med) var(--ease-out) both; }
.popover h4 { margin: 0 0 var(--s2); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.size-row { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s4); }
.size-row .bar { flex: 1; display: flex; gap: 4px; }
.size-row .bar i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.size-row .bar i.on { background: var(--ink); }
.theme-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.theme-row button { height: 56px; border-radius: var(--r-md); display: grid; place-items: center; font-weight: 600; font-size: var(--t-sm); box-shadow: inset 0 0 0 1px var(--line); }
.theme-row button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.theme-row .t-light { background: var(--dusk-cream); color: var(--dusk-violet); }
.theme-row .t-warm { background: #2a1534; color: #f6e9da; }
.theme-row .t-dark { background: #160c24; color: #f3eadb; }
.menu { display: grid; gap: 2px; min-width: 220px; padding: 6px; }
.menu button { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); font-weight: 600; text-align: left; }
.menu button:hover { background: var(--bg-2); }
.menu button.danger { color: var(--danger); }
.react-pop { display: flex; gap: 4px; padding: 6px; }
.react-pop .react { color: var(--muted); width: 64px; }
.react-pop .react[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }

/* ==========================================================================
   SHEETS / DIALOGS / TOASTS
   ========================================================================== */
.scrim { position: fixed; inset: 0; z-index: 80; background: var(--scrim); animation: fade var(--d-med) both; display: flex; align-items: flex-end; justify-content: center; }
.scrim.closing { animation: fadeOut 200ms both; }
.sheet { position: relative; width: 100%; max-height: 92%; overflow-y: auto; background: var(--surface); color: var(--ink); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: var(--s3) var(--s5) calc(var(--s5) + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow-2); animation: sheetIn var(--d-slow) var(--ease-out) both; }
.scrim.closing .sheet { animation: sheetOut 220ms var(--ease) both; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto var(--s4); }
.sheet h2 { font-family: var(--f-read); font-weight: 600; font-size: var(--t-xl); line-height: 1.1; margin: 0 0 var(--s2); text-wrap: balance; }
.sheet .lede { color: var(--muted); margin: 0 0 var(--s5); }
.sheet .close { position: absolute; top: 10px; right: 10px; }
.sheet-actions { display: flex; gap: var(--s2); margin-top: var(--s5); flex-wrap: wrap; }
.sheet-actions .btn { flex: 1; }
@media (min-width: 768px) {
  .scrim { align-items: center; padding: var(--s5); }
  .sheet { max-width: 480px; border-radius: var(--r-xl); padding: var(--s6); max-height: 88vh; }
  .sheet .grab { display: none; }
  .sheet.wide { max-width: 640px; }
}
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheetOut { to { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.field { display: grid; gap: 6px; margin-bottom: var(--s4); }
.field label { font-size: var(--t-sm); font-weight: 600; }
.input, .textarea { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); outline: none; transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.input:focus, .textarea:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
/* Placeholders on the shared fields (Change something note, bio, Bring your story paste): the browser default grey failed AA
   on --surface-2; --muted is ~7:1. The Create idea box keeps its own placeholder rules (.spark-box). */
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 1; }
.radio-list { display: grid; gap: 4px; }
.radio-list label { display: flex; align-items: center; gap: var(--s3); min-height: 46px; padding: 0 12px; border-radius: var(--r-md); cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.radio-list label:has(input:checked) { box-shadow: inset 0 0 0 2px var(--ink); }
.radio-list input { accent-color: var(--ink); width: 18px; height: 18px; }
.check { display: flex; gap: var(--s3); align-items: flex-start; font-size: var(--t-sm); cursor: pointer; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; margin-top: 2px; flex: none; }

.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px); z-index: 120; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
@media (min-width: 768px) { .toasts { bottom: 24px; } }
@media (max-width: 767px) { .on-discover .toasts { top: calc(env(safe-area-inset-top, 0px) + 58px); bottom: auto; } }
.reader-open .toasts { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 80px); }
.toast { display: flex; align-items: center; gap: var(--s3); padding: 12px 14px 12px 16px; border-radius: var(--r-md); background: #2f1d4a; color: var(--ink); box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line); font-size: var(--t-sm); font-weight: 600; pointer-events: auto; animation: toastIn var(--d-med) var(--ease-out) both; }
.toast .ic { width: 18px; height: 18px; color: var(--accent); }
.toast .t { flex: 1; }
.toast button { color: var(--accent); font-weight: 600; padding: 4px 6px; }
.toast.out { animation: toastOut 220ms var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
.banner-offline { position: fixed; top: env(safe-area-inset-top, 0px); left: 50%; transform: translateX(-50%); z-index: 110; margin-top: 8px; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-pill); background: var(--ink); color: var(--bg); font-size: var(--t-sm); font-weight: 600; box-shadow: var(--shadow-2); animation: fadeUp var(--d-med) both; max-width: calc(100% - 24px); }
.banner-offline .ic { width: 16px; height: 16px; }

/* ==========================================================================
   CREATE
   ========================================================================== */
.create { min-height: 100%; display: flex; flex-direction: column; }
.create .page { flex: 1; display: flex; flex-direction: column; }
.spark { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: var(--s5); width: 100%; max-width: none; margin: 0; padding-block: var(--s5); }
.spark h1 { font-family: var(--f-read); font-weight: 600; font-size: var(--h1); line-height: 1; margin: 0; letter-spacing: -.015em; text-wrap: balance; }
.spark .sub { font-size: var(--t-md); color: var(--muted); margin: -8px 0 0; }
.spark-box { position: relative; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line); padding: var(--s5) var(--s5) var(--s4); transition: box-shadow var(--d-med); }
.spark-box:focus-within { box-shadow: var(--shadow-2), inset 0 0 0 2px var(--ink); }
.spark-box textarea { width: 100%; border: 0; outline: 0; resize: none; background: transparent; font-family: var(--f-ui); font-size: var(--t-lg); line-height: 1.4; min-height: 3.2em; color: var(--ink); }
.spark-box textarea::placeholder { color: var(--muted); opacity: .7; font-style: italic; }
.spark-box .row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s3); flex-wrap: wrap; }
.spark-box .hint { font-size: var(--t-xs); color: var(--muted); }
@media (max-width: 560px) { .spark-box .row .btn { flex: 1; } .spark-box .hint { display: none; } }
.spark-box .err { font-size: var(--t-sm); color: var(--danger); font-weight: 600; }
.spark-box .count-line { font-size: var(--t-xs); color: var(--muted); margin-right: auto; font-variant-numeric: tabular-nums; }
.create.dusk .spark-box .count-line { color: var(--cream-2); }
.spark-box .count-line .cl-short { display: none; }
/* Phones: the counter has its own fixed column and wraps inside it, and the row never wraps, so "Bring it to life" keeps
   its line and its width whatever the counter says. */
@media (max-width: 560px) {
  .create.dusk .launch .spark-box .row { flex-wrap: nowrap; }
  .create.dusk .launch .spark-box .count-line { flex: 0 0 6.5rem; min-width: 0; margin-right: 0; line-height: 1.35; overflow-wrap: anywhere; }
  .spark-box .count-line .cl-full { display: none; }
  .spark-box .count-line .cl-short { display: inline; }
  .spark-box .count-line .nw { white-space: nowrap; }
}
.examples .eyebrow { margin-bottom: var(--s3); }
.examples .chips { display: grid; gap: 2px; }
.example { display: block; width: 100%; min-height: 40px; padding: 9px 4px; background: none; border: 0; border-radius: var(--r-sm); font-family: var(--f-read); font-style: italic; font-size: var(--t-base); line-height: 1.4; color: var(--ink-2); text-align: inherit; transition: color var(--d-fast); }
.example:hover, .example:focus-visible { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rose); text-underline-offset: 4px; }
.recent-made { display: flex; align-items: center; gap: var(--s3); font-size: var(--t-sm); color: var(--muted); }

.dir-head { display: grid; gap: var(--s2); margin-bottom: var(--s5); }
.dir-head .spark-quote { font-family: var(--f-read); font-style: italic; font-size: var(--t-md); color: var(--ink-2); }
.dir-head h1 { font-family: var(--f-read); font-weight: 600; font-size: var(--h1); line-height: 1.05; margin: 0; }
.dirs { display: grid; gap: var(--s4); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .dirs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dir { position: relative; display: flex; flex-direction: row; align-items: flex-start; text-align: left; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); transition: transform var(--d-med) var(--ease), box-shadow var(--d-med); animation: fadeUp var(--d-slow) var(--ease-out) both; }
.dir:nth-child(2) { animation-delay: 90ms; } .dir:nth-child(3) { animation-delay: 180ms; }
.dir:hover { transform: translateY(-2px); box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line); }
.dir[aria-pressed="true"] { box-shadow: var(--shadow-2), inset 0 0 0 2px var(--ink); }
.dir .band { position: static; padding: var(--s4) 0 var(--s4) var(--s4); flex: none; }
.dir .band .cover { width: 64px; }
@media (min-width: 560px) { .dir .band .cover { width: 76px; } }
.dir .band .tick { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; transform: scale(0); transition: transform var(--d-med) var(--ease-out); }
.dir[aria-pressed="true"] .band .tick { transform: scale(1); }
.dir .band .tick .ic { width: 16px; height: 16px; }
.dir .body { container-type: inline-size; padding: var(--s4) var(--s4) var(--s4) var(--s3); display: grid; gap: var(--s2); min-width: 0; flex: 1; }
.dir .body .meta { display: flex; flex-wrap: nowrap; gap: 6px; height: 24px; overflow: hidden; align-items: center; }
.dir .body .meta .pill { flex: none; white-space: nowrap; }
.dir .body .meta .pill-genre { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 22px; }
.dir .body h3 { font-family: var(--f-read); font-weight: 600; font-size: var(--t-lg); line-height: 1.15; margin: 4px 0 0; text-wrap: balance; }
.dir .body p { margin: 0; font-family: var(--f-read); font-size: var(--t-base); color: var(--ink-2); line-height: 1.5; }
.dir .body .promise { font-family: var(--f-ui); font-size: var(--t-sm); color: var(--accent); font-weight: 600; display: flex; gap: 6px; align-items: flex-start; }
.dir .body .promise .ic { width: 16px; height: 16px; margin-top: 2px; }
.dir-tools { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin: var(--s5) 0 var(--s3); flex-wrap: wrap; }
.make-bar { position: sticky; bottom: 0; margin-top: var(--s5); padding: var(--s3) 0 var(--s4); display: flex; justify-content: flex-end; gap: var(--s3); background: linear-gradient(to top, var(--bg) 70%, transparent); align-items: center; flex-wrap: wrap; }
.make-bar .picked { flex: 1; min-width: 0; font-size: var(--t-sm); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 767px) { .make-bar { bottom: calc(var(--nav-h) * 0); } }
.interpreting { flex: 1; display: grid; place-items: center; text-align: center; gap: var(--s4); min-height: 50vh; }
.ink-dots { display: inline-flex; gap: 8px; }
.ink-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: inkDot 1.2s var(--ease) infinite; }
.ink-dots i:nth-child(2) { animation-delay: .15s; } .ink-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes inkDot { 0%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-8px); opacity: 1; } }

/* studio */
.studio { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: var(--bg); padding: var(--s5) var(--s4); animation: fade var(--d-slow) both; overflow-y: auto; }
.studio-inner { width: 100%; max-width: 420px; display: grid; gap: var(--s6); justify-items: center; text-align: center; }
.studio .forming { width: min(200px, 48vw); position: relative; }
.studio .forming .forming-cv { transition: filter 1.4s var(--ease), transform 1.4s var(--ease); }
.studio .forming .cover img { transition: opacity 1.2s var(--ease); }
.studio .forming .glow { display: none; }
@keyframes breathe { 50% { transform: scale(1.1); opacity: .6; } }
.studio .s-title { font-family: var(--f-read); font-size: var(--t-xl); line-height: 1.05; margin: 0; text-wrap: balance; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; text-align: left; width: 100%; max-width: 280px; }
.steps li { display: flex; align-items: center; gap: var(--s3); font-weight: 600; color: var(--muted); transition: color var(--d-med); }
.steps li .st { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line); display: grid; place-items: center; flex: none; transition: background var(--d-med), box-shadow var(--d-med); }
.steps li .st .ic { width: 14px; height: 14px; opacity: 0; transform: scale(.4); transition: all var(--d-med) var(--ease-out); }
.steps li.active { color: var(--ink); }
.steps li.active .st { box-shadow: inset 0 0 0 2px var(--accent); animation: ring 1.1s ease-in-out infinite; }
.steps li.done { color: var(--ink-2); }
.steps li.done .st { background: var(--ink); box-shadow: none; color: var(--bg); }
.steps li.done .st .ic { opacity: 1; transform: none; }
@keyframes ring { 50% { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent); } }
.studio .whisper { font-family: var(--f-ui); color: var(--muted); min-height: 1.5em; transition: opacity var(--d-med); }

/* ==========================================================================
   LIBRARY & SEARCH
   ========================================================================== */
.lib-search { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 48px; padding: 0 var(--s4); border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-weight: 600; text-align: left; margin-bottom: var(--s6); }
.lib-search:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.section { margin-bottom: var(--s7); }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.section-h h2 { font-family: var(--f-read); font-weight: 600; font-size: var(--t-lg); margin: 0; }
.shelf { display: grid; align-items: start; grid-auto-flow: column; grid-auto-columns: 132px; gap: var(--s4); overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--s4) * -1); padding: 4px var(--s4) var(--s3); scroll-snap-type: x mandatory; scroll-padding-inline: var(--s4); }
.shelf::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .shelf { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-inline: 0; padding-inline: 0; overflow: visible; gap: var(--s5); } }
.book { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; align-content: start; gap: 8px; text-align: left; scroll-snap-align: start; min-width: 0; }
.book .cover { transition: transform var(--d-med) var(--ease); }
.book:hover .cover { transform: translateY(-3px); }
.book .bt { font-family: var(--f-read); font-weight: 600; font-size: var(--t-base); line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.book .bs { font-size: var(--t-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.cont-grid { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 768px) { .cont-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s4); } }
@media (min-width: 1180px) { .cont-grid { grid-template-columns: repeat(3, 1fr); } }
.cont { display: grid; grid-template-columns: 64px 1fr; gap: var(--s4); align-items: center; padding: var(--s3); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); text-align: left; transition: box-shadow var(--d-fast), transform var(--d-fast); min-width: 0; }
.cont:hover { box-shadow: var(--shadow-2); }
.cont .t { font-family: var(--f-read); font-size: 16px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cont .s { font-size: var(--t-xs); color: var(--muted); margin: 2px 0 8px; }
.cont .p { display: flex; align-items: center; gap: var(--s2); font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.cont .p .prog { flex: 1; }
.cont > div { min-width: 0; }
.mine-list { display: grid; gap: var(--s2); }
.mine { display: grid; grid-template-columns: 52px 1fr auto; gap: var(--s4); align-items: center; padding: 10px; border-radius: var(--r-md); text-align: left; transition: background var(--d-fast); min-width: 0; }
.mine:hover { background: var(--surface); }
.mine .t { font-family: var(--f-read); font-size: 16px; line-height: 1.15; }
.mine .s { font-size: var(--t-xs); color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.mine > div { min-width: 0; }
.new-tile { display: flex; align-items: center; gap: var(--s3); padding: 12px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink-2); font-weight: 600; border: 0; }
.new-tile:hover { box-shadow: inset 0 0 0 1.5px var(--muted); }
.new-tile .plus { width: 52px; height: 52px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-2); }
.recent-list { display: grid; gap: 2px; }
.recent-row { display: grid; grid-template-columns: 40px 1fr auto; gap: var(--s3); align-items: center; padding: 8px; border-radius: var(--r-md); text-align: left; min-width: 0; }
.recent-row:hover { background: var(--surface); }
.recent-row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-row .s { font-size: var(--t-xs); color: var(--muted); }
.recent-row > div { min-width: 0; }
.mini-empty { padding: var(--s5); border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: flex; align-items: center; gap: var(--s4); color: var(--muted); font-size: var(--t-sm); }
.mini-empty .ic { color: var(--accent); width: 26px; height: 26px; }
.mini-empty b { color: var(--ink); display: block; font-size: var(--t-base); }

.search-head { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--s4) var(--s3); display: grid; gap: var(--s3); }
@media (min-width: 768px) { .search-head { padding: var(--s5) var(--s6) var(--s3); } }
.search-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 4px 0 var(--s3); border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.search-field:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: var(--t-base); min-height: 42px; }
.search-field > .ic { color: var(--muted); }
.search-field .icon-btn { width: 36px; height: 36px; }
.search-field .icon-btn .ic { color: var(--ink); width: 20px; height: 20px; }
.search-head > div:first-child { max-width: 640px; }
.filters { display: grid; gap: var(--s2); }
.res-count { font-size: var(--t-sm); color: var(--muted); margin: var(--s2) 0 var(--s4); }
.cat { display: grid; gap: var(--s2); }
.cat-row { display: grid; grid-template-columns: 64px 1fr; gap: var(--s4); padding: var(--s3); border-radius: var(--r-md); text-align: left; transition: background var(--d-fast); min-width: 0; align-items: start; }
.cat-row:hover { background: var(--surface); }
.cat-row .t { font-family: var(--f-read); font-size: 20px; line-height: 1.12; }
.cat-row .by { font-size: var(--t-sm); color: var(--ink-2); margin: 2px 0 6px; }
.cat-row .h { font-size: var(--t-sm); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; }
.cat-row > div { min-width: 0; }
mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 2px; }
.cat-row mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 2px; }
@media (min-width: 1024px) { .cat { grid-template-columns: repeat(2, 1fr); column-gap: var(--s5); } }
.creator-cards { display: flex; gap: var(--s3); overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-bottom: var(--s5); }
.creator-card { flex: none; width: 168px; display: grid; justify-items: center; gap: 8px; padding: var(--s4) var(--s3); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); text-align: center; }
.creator-card .n { font-weight: 600; font-size: var(--t-sm); }
.creator-card .g { font-size: var(--t-xs); color: var(--muted); }
.genre-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
@media (min-width: 768px) { .genre-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); } }
.genre-tile { position: relative; display: grid; align-content: end; justify-items: start; gap: 2px; height: 104px; padding: var(--s3) var(--s4); border-radius: var(--r-lg); overflow: hidden; text-align: left; color: var(--dusk-cream); background: linear-gradient(135deg, var(--gt), color-mix(in srgb, var(--gt) 62%, var(--dusk-night))); transition: transform var(--d-fast) var(--ease); }
.genre-tile:active { transform: scale(.97); }
.genre-tile .ic { position: absolute; top: var(--s3); right: var(--s3); width: 28px; height: 28px; opacity: .9; }
.genre-tile em { font-style: normal; font-size: var(--t-xs); opacity: .9; }
.genre-tile span { font-family: var(--f-read); font-weight: 600; font-size: var(--t-base); line-height: 1.2; }

/* ==========================================================================
   PROFILE
   ========================================================================== */
.prof { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
@media (min-width: 900px) { .prof { grid-template-columns: 320px minmax(0, 1fr); gap: var(--s7); align-items: start; } .prof-side { position: sticky; top: var(--s5); } }
.prof-main { min-width: 0; }
.prof-head { display: grid; gap: var(--s4); justify-items: start; margin-bottom: var(--s6); }
.prof-head .who { display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap; }
.prof-head h1, .prof-head h2 { font-family: var(--f-read); font-weight: 600; font-size: var(--h1); line-height: 1.05; margin: 0; }
.prof-head .handle { color: var(--muted); font-weight: 600; font-size: var(--t-sm); }
.prof-head .bio { margin: 0; max-width: 56ch; color: var(--ink-2); font-size: var(--t-md); line-height: 1.5; }
.prof-head .stats { display: flex; gap: var(--s5); font-size: var(--t-sm); color: var(--muted); flex-wrap: wrap; }
.prof-head .stats b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.prof-head .acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s5) var(--s4); }
.app-card { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: var(--s4); align-items: center; padding: var(--s4); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); text-align: left; margin-bottom: var(--s6); }
.app-card .ic { color: var(--accent); width: 28px; height: 28px; }
.app-card b { display: block; }
.app-card span { font-size: var(--t-sm); color: var(--muted); }
.set-list { display: grid; gap: 2px; margin-bottom: var(--s6); }
.set-row { display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: 0 var(--s3); border-radius: var(--r-md); text-align: left; }
.set-row:hover { background: var(--surface); }
.set-row .l { flex: 1; min-width: 0; }
.set-row .l b { display: block; font-weight: 600; }
.set-row .l span { font-size: var(--t-xs); color: var(--muted); }
.switch { width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; flex: none; transition: background var(--d-fast); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--dusk-cream); box-shadow: var(--shadow-1); transition: transform var(--d-med) var(--ease-out); }
.switch[aria-checked="true"] { background: var(--good); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.demo-box { padding: var(--s4); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px dashed var(--line); background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--line) 30%, transparent) 10px 11px); }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.demo-grid .btn { white-space: normal; text-align: center; line-height: 1.2; padding-block: 8px; min-height: 52px; }
pre.state { max-height: 260px; overflow: auto; font-size: 12px; line-height: 1.45; background: var(--bg-2); padding: var(--s3); border-radius: var(--r-md); white-space: pre-wrap; word-break: break-word; }

/* ==========================================================================
   ONBOARDING / INVITE / PUBLISH
   ========================================================================== */
.onboard { position: fixed; inset: 0; z-index: 100; background: var(--bg); overflow-y: auto; display: flex; flex-direction: column; animation: fade var(--d-slow) both; }
.onboard .ob-inner { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + var(--s4)) var(--s4) calc(env(safe-area-inset-bottom, 0px) + var(--s5)); display: flex; flex-direction: column; gap: var(--s5); }
.ob-top { display: flex; justify-content: space-between; align-items: center; }
.ob-hero { flex: 1; display: grid; gap: var(--s6); align-content: center; }
@media (min-width: 860px) { .ob-hero { grid-template-columns: 1.1fr 1fr; align-items: center; } }
.ob-fan { position: relative; height: 300px; display: grid; place-items: center; }
.ob-fan .cover { position: absolute; width: 150px; animation: fanIn 900ms var(--ease-out) both; }
.ob-fan .cover:nth-child(1) { transform: rotate(-12deg) translate(-70px, 14px); animation-delay: 80ms; }
.ob-fan .cover:nth-child(2) { transform: rotate(10deg) translate(70px, 18px); animation-delay: 180ms; }
.ob-fan .cover:nth-child(3) { transform: translateY(-6px); z-index: 2; width: 168px; animation-delay: 300ms; }
@keyframes fanIn { from { opacity: 0; translate: 0 30px; } }
@media (min-width: 860px) { .ob-fan { height: 420px; order: 2; } .ob-fan .cover { width: 190px; } .ob-fan .cover:nth-child(3) { width: 214px; } }
.ob-copy h1 { font-family: var(--f-read); font-weight: 700; font-size: var(--h1); line-height: 1.04; letter-spacing: -.02em; margin: 0 0 var(--s4); text-wrap: balance; }
.ob-copy h1 em { font-style: normal; color: var(--accent); }
.ob-copy p { font-size: var(--t-md); color: var(--ink-2); margin: 0 0 var(--s5); max-width: 40ch; }
.ob-copy .btn { min-width: 220px; }
.ob-pick h2 { font-family: var(--f-read); font-weight: 600; font-size: var(--h1); line-height: 1.02; margin: 0 0 var(--s2); }
.ob-pick .lede { color: var(--muted); margin: 0 0 var(--s5); }
.pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
@media (min-width: 640px) { .pick-grid { grid-template-columns: repeat(3, 1fr); } }
.pick { position: relative; height: 84px; border-radius: var(--r-lg); overflow: hidden; text-align: left; color: var(--dusk-cream); background: linear-gradient(135deg, var(--gt), color-mix(in srgb, var(--gt) 62%, var(--dusk-night))); transition: transform var(--d-fast) var(--ease); }
.pick > .ic { position: absolute; left: 18px; top: 14px; width: 22px; height: 22px; opacity: .9; }
.pick span { position: absolute; left: 18px; bottom: 12px; z-index: 1; font-family: var(--f-read); font-weight: 600; font-size: 20px; }
.pick .tick { position: absolute; top: 10px; right: 10px; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .25); }
.pick .tick .ic { width: 15px; height: 15px; opacity: 0; }
.pick[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.pick[aria-pressed="true"] .tick { background: var(--accent); color: var(--accent-ink); }
.pick[aria-pressed="true"] .tick .ic { opacity: 1; }
.pick:active { transform: scale(.97); }
.mood-row { margin-top: var(--s5); }
.ob-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0 0; background: linear-gradient(to top, var(--bg) 75%, transparent); }

.phone-art { width: 120px; height: 200px; margin: 0 auto var(--s4); border-radius: 22px; background: var(--ink); padding: 8px; box-shadow: var(--shadow-2); position: relative; }
.phone-art .scr { width: 100%; height: 100%; border-radius: 15px; overflow: hidden; background: var(--bg); display: grid; grid-template-rows: 1fr auto; }
.phone-art .scr .cover { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.phone-art .scr .bar { height: 18px; background: var(--surface); display: flex; justify-content: space-around; align-items: center; }
.phone-art .scr .bar i { width: 6px; height: 6px; border-radius: 2px; background: var(--line); }
.phone-art .badge { position: absolute; top: 26px; right: -18px; padding: 6px 10px; border-radius: var(--r-md); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); font-size: 12px; font-weight: 600; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.phone-art .badge .ic { width: 14px; height: 14px; color: var(--accent); }
.benefits { list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; gap: var(--s3); }
.benefits li { display: flex; gap: var(--s3); align-items: flex-start; }
.benefits li .ic { color: var(--accent); margin-top: 1px; }
.benefits li b { display: block; }
.benefits li span { font-size: var(--t-sm); color: var(--muted); }
.fine { font-size: var(--t-xs); color: var(--muted); text-align: center; margin: var(--s3) 0 0; }

.pub-review { display: grid; grid-template-columns: 96px 1fr; gap: var(--s4); align-items: start; padding: var(--s3); border-radius: var(--r-lg); background: var(--surface-2); margin-bottom: var(--s4); }
.pub-review .t { font-family: var(--f-read); font-size: 20px; line-height: 1.1; }
.pub-review .s { font-size: var(--t-sm); color: var(--muted); margin-top: 4px; }
.checklist { list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; gap: 8px; font-size: var(--t-sm); }
.checklist li { display: flex; gap: 10px; align-items: center; }
.checklist .ic { width: 18px; height: 18px; color: var(--good); }
.pub-stage { display: grid; justify-items: center; text-align: center; gap: var(--s4); padding: var(--s5) 0 var(--s3); }
.pub-orb { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.pub-orb .ic { width: 32px; height: 32px; }
.pub-orb.spin { background: conic-gradient(from 0deg, var(--accent), transparent 70%); animation: spin 1s linear infinite; position: relative; }
.pub-orb.spin::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.pub-orb.done { background: var(--good); color: var(--dusk-cream); animation: pop 500ms var(--ease-out); }
@keyframes spin { to { transform: rotate(360deg); } }
.pub-steps { display: flex; gap: 6px; justify-content: center; }
.pub-steps i { width: 26px; height: 4px; border-radius: 2px; background: var(--line); transition: background var(--d-med); }
.pub-steps i.on { background: var(--accent); }
.cover-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.cover-pick button { border-radius: var(--r-md); }
.cover-pick button[aria-pressed="true"] .cover { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }
.refining { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: color-mix(in srgb, var(--r-bg, var(--bg)) 70%, transparent); animation: fade var(--d-med) both; }
.refining .card { display: grid; justify-items: center; gap: var(--s3); padding: var(--s5) var(--s6); border-radius: var(--r-xl); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); text-align: center; max-width: 320px; }
.refining .card b { font-family: var(--f-read); font-weight: 600; font-size: var(--t-lg); }
.refining .card span { color: var(--muted); font-size: var(--t-sm); }
.err-card { display: grid; justify-items: center; gap: var(--s3); text-align: center; max-width: 360px; }
.err-card h2 { font-family: var(--f-read); font-weight: 600; font-size: var(--t-xl); margin: 0; }
.err-card p { color: var(--muted); margin: 0; }

/* ==========================================================================
   V2 additions: curation, provenance, feeling, share card, shelf variant
   ========================================================================== */
/* curation label on covers */
.cur-label { position: absolute; top: 14px; left: 14px; z-index: 2; display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--r-pill); background: rgba(12, 10, 22, .55); color: var(--dusk-cream); font-size: 12px; font-weight: 600; letter-spacing: .01em; max-width: calc(100% - 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* variant C: opening preview */
.preview { min-width: 0; position: relative; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.preview p { margin: 0 0 6px; font-family: var(--f-read); font-size: 16px; line-height: 1.55; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.preview .link { font-size: var(--t-sm); }
@media (max-width: 1023px) {
  [data-variant="C"] .rec .hook { display: none; }
  [data-variant="C"] .rec .preview p { -webkit-line-clamp: 3; font-size: 16px; }
  [data-variant="C"] .rec { gap: 10px; }
}
/* variant B: discovery shelf */
.shelf-feed { flex: 1; min-height: 0; overflow-y: auto; padding: 4px var(--s4) var(--s6); position: relative; }
@media (min-width: 768px) { .shelf-feed { padding: var(--s2) var(--s6) var(--s7); } }
.sf-intro { font-family: var(--f-read); font-weight: 600; font-size: var(--t-lg); margin: 4px 0 var(--s4); }
.sf-grid { display: grid; gap: var(--s5) var(--s4); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); width: 100%; }
@media (min-width: 768px) { .sf-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--s6) var(--s5); } }
.sf-card { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; gap: var(--s3); align-content: start; padding: 0; background: none; box-shadow: none; border: 0; min-width: 0; }
.sf-cover { display: block; width: 100%; border-radius: 3px; }
.sf-cover .cover { width: 100%; }
.sf-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; height: 100%; }
.sf-label { justify-self: start; font-size: var(--t-xs); font-weight: 600; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.sf-body h3 { margin: 0; font-family: var(--f-read); font-weight: 600; font-size: var(--t-base); line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.sf-body h3 a { color: inherit; text-decoration: none; }
.sf-body h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sf-hook { display: none; margin: 0; font-family: var(--f-read); font-size: var(--t-sm); color: var(--ink-2); line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 768px) { .sf-hook { display: -webkit-box; } }
.sf-meta { font-size: var(--t-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-acts { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s2) 0; margin-top: auto; padding-top: var(--s2); }
.sf-acts .sf-read { flex: 1 1 100%; }
.sf-acts .icon-btn { width: 36px; height: 36px; }
.sf-acts .icon-btn .ic { width: 20px; height: 20px; }
.sf-end { text-align: center; color: var(--muted); font-size: var(--t-sm); padding: var(--s6) 0 var(--s4); }
.sf-empty { position: relative; min-height: 60vh; }

/* feeling step */
.chosen-dir { display: flex; align-items: center; gap: var(--s3); padding: 8px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); justify-self: start; max-width: 100%; }
.chosen-dir .cover { width: 44px; flex: none; }
.chosen-dir .t { font-family: var(--f-read); font-size: 16px; line-height: 1.1; }
.chosen-dir .s { font-size: var(--t-xs); color: var(--muted); }
.chosen-dir > div { min-width: 0; padding-right: 8px; }
.feels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
@media (min-width: 900px) { .feels { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); } }
.feel { position: relative; display: grid; gap: 6px; align-content: start; justify-items: start; min-height: 0; padding: var(--s4); border-radius: var(--r-lg); text-align: left; color: var(--dusk-cream); overflow: hidden; background: var(--f2); box-shadow: none; transition: transform var(--d-med) var(--ease), box-shadow var(--d-med); }
.feel::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .18); }
.feel > * { position: relative; z-index: 1; }
.feel .orb { position: relative; width: 36px; height: 36px; margin-bottom: 4px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .22); }
.feel .fl { font-family: var(--f-read); font-weight: 600; font-size: var(--t-lg); line-height: 1.1; }
.feel .fs { font-size: var(--t-sm); opacity: .92; line-height: 1.35; }
.feel:hover { transform: translateY(-2px); }
.feel[aria-checked="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent), var(--shadow-2); }
.feel[aria-checked="true"] .orb { background: var(--dusk-cream); color: var(--dusk-violet); }

/* submit path */
.path { list-style: none; counter-reset: p; padding: 0; margin: 0 0 var(--s4); display: grid; gap: 10px; }
.path li { counter-increment: p; display: grid; grid-template-columns: 26px 1fr; column-gap: 12px; font-size: var(--t-sm); }
.path li::before { content: counter(p); grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); font-weight: 600; font-size: 12px; color: var(--ink-2); }
.path li b { font-size: var(--t-base); }
.path li span { color: var(--muted); }

/* provenance */
.prov { position: relative; padding: 14px 16px 14px 20px; background: color-mix(in srgb, var(--r-surface, var(--surface)) 70%, transparent); border-radius: var(--r-md); overflow: hidden; }
.prov::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--r-accent, var(--accent)); }
.prov-k { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--r-muted, var(--muted)); }
.prov blockquote { margin: 6px 0; font-family: var(--f-read); font-style: italic; font-size: var(--t-base); line-height: 1.45; }
.prov-s { font-size: var(--t-sm); color: var(--r-muted, var(--muted)); }
.prov-s i { font-style: normal; font-weight: 600; color: var(--r-ink, var(--ink)); }
.made-banner.note .ic { color: var(--r-accent); }

/* share card */
.share-card { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 5; max-height: 420px; width: 100%; color: var(--dusk-cream); box-shadow: var(--shadow-cover); isolation: isolate; text-align: left; }
.share-card.big { max-height: 560px; }
.share-card .sc-bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.share-card .sc-bg .cover { position: absolute; left: 0; top: 50%; width: 100%; transform: translateY(-50%); border-radius: 0; box-shadow: none; }
.share-card .sc-bg .bk-type { display: none; }
.share-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, rgba(8, 6, 16, .35), rgba(8, 6, 16, .2) 35%, rgba(8, 6, 16, .82)); }
.sc-in { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; padding: 20px; }
.sc-top { position: absolute; top: 18px; left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; }
.sc-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-read); font-size: 16px; font-weight: 700; }
.sc-brand .mark { width: 22px; height: 22px; border-radius: 7px; background: var(--dusk-cream); color: var(--dusk-violet); display: grid; place-items: center; font-size: 14px; }
.sc-min { padding: 4px 10px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .18); }
.sc-title { font-family: var(--f-read); font-size: var(--h1); line-height: .98; text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; text-shadow: 0 2px 16px rgba(0, 0, 0, .35); }
.share-card.big .sc-title { font-size: var(--h1); }
.sc-origin span { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; opacity: .8; margin-bottom: 4px; }
.sc-origin q { font-family: var(--f-read); font-style: italic; font-size: 16px; line-height: 1.35; quotes: "“" "”"; }
.sc-by { font-weight: 600; font-size: var(--t-base); }
.sc-cta { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--r-pill); background: var(--dusk-cream); color: var(--dusk-violet); font-weight: 600; font-size: var(--t-sm); margin-top: 4px; }
.sc-cta .ic { width: 16px; height: 16px; }

/* shared landing */
.shared-hero { display: grid; gap: var(--s5); margin-bottom: var(--s7); }
@media (min-width: 860px) { .shared-hero { grid-template-columns: minmax(0, 420px) 1fr; align-items: center; gap: var(--s7); } }
.sc-wrap { display: block; width: 100%; border-radius: var(--r-lg); }
.shared-copy { display: grid; gap: var(--s4); justify-items: start; }
.r-hook-like { margin: 0; font-family: var(--f-read); font-style: italic; font-size: 20px; line-height: 1.45; color: var(--ink-2); max-width: 36ch; }
.idea-cta { padding: var(--s5); border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: var(--s3); justify-items: start; }
.idea-cta h2 { font-family: var(--f-read); font-weight: 600; font-size: var(--t-lg); margin: 0; }
.idea-cta p { margin: 0; color: var(--muted); max-width: 52ch; }

/* landing */
.ob-lines { font-family: var(--f-ui); font-size: 20px!important; line-height: 1.5; color: var(--ink-2); }
.ob-ctas { display: flex; flex-wrap: wrap; gap: var(--s3); }
.ob-ctas .btn { min-width: 0; }
@media (max-width: 520px) { .ob-ctas .btn { flex: 1 1 100%; } }
.ob-picks { display: grid; gap: var(--s3); }
.ob-pick-row { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 760px) { .ob-pick-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ob-story { display: grid; grid-template-columns: 64px 1fr; gap: var(--s3); align-items: start; text-align: left; padding: var(--s3); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); min-width: 0; }
.ob-story > div { min-width: 0; }
.ob-story .t { font-family: var(--f-read); font-size: 16px; line-height: 1.1; }
.ob-story .h { font-size: var(--t-sm); color: var(--ink-2); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ob-story .m { font-size: var(--t-xs); color: var(--muted); margin-top: 6px; }
.ob-make { padding: var(--s5); border-radius: var(--r-lg); background: var(--bg-2); display: grid; gap: var(--s3); justify-items: start; margin-bottom: var(--s4); }
.ob-make h2 { font-family: var(--f-read); font-weight: 600; font-size: var(--t-xl); margin: 0; }
.ob-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; color: var(--ink-2); font-size: var(--t-md); }
.ob-steps li::marker { color: var(--accent); font-weight: 600; }

/* founder controls */
.demo-sec { padding: var(--s4) 0; border-top: 1px solid var(--line); }
.demo-sec > b { display: block; margin-bottom: 4px; }
.demo-sec > p { margin: 0 0 10px; color: var(--muted); font-size: var(--t-sm); }
.demo-sec .set-row { padding: 0; }
.mt-wrap { overflow-x: auto; margin-top: 10px; }
.mt { border-collapse: collapse; width: 100%; font-size: var(--t-sm); }
.mt th, .mt td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--line); }
.mt th:first-child, .mt td:first-child { text-align: left; color: var(--ink-2); }
.rv-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 8px 0; flex-wrap: wrap; font-weight: 600; }

/* ---------- V3: two entry paths + Bring your story ---------- */
.seg.paths { align-self: flex-start; }
.seg.paths button { display: inline-flex; align-items: center; gap: 6px; }
.seg.paths .ic { width: 16px; height: 16px; }
.mine-acts { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.pill-origin { background: color-mix(in srgb, var(--accent) 12%, var(--bg-2)); color: var(--accent); }
.spark.import { justify-content: flex-start; gap: var(--s4); }
.drop { display: grid; justify-items: center; gap: 6px; padding: var(--s6) var(--s4); border-radius: var(--r-xl); border: 1.5px dashed var(--line); background: var(--surface); text-align: center; cursor: pointer; transition: border-color var(--d-fast), background var(--d-fast); }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--ink-2); background: var(--surface-2); }
.drop .ic { width: 28px; height: 28px; color: var(--accent); }
.drop b { font-weight: 600; }
.drop span { font-size: var(--t-sm); color: var(--muted); }
.drop.reading { cursor: progress; }
.or { display: flex; align-items: center; gap: var(--s3); color: var(--muted); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.imp-field { margin: 0; }
.imp-text { min-height: 220px; font-family: var(--f-read); font-size: var(--t-md); line-height: 1.55; }
.imp-row { display: flex; justify-content: flex-end; }
.imp-count { font-size: var(--t-xs); color: var(--muted); }
.imp-err { display: flex; gap: var(--s2); align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); color: var(--danger); font-size: var(--t-sm); font-weight: 600; }
.imp-err .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.imp-preview { max-width: 1040px; width: 100%; margin: 0 auto; padding-top: var(--s5); }
.imp-note { display: flex; gap: var(--s2); align-items: flex-start; padding: 12px 14px; margin-bottom: var(--s4); border-radius: var(--r-md); background: var(--bg-2); font-size: var(--t-sm); color: var(--ink-2); }
.imp-note.warn { background: var(--accent-soft); }
.imp-note .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--accent); }
.imp-grid { display: grid; gap: var(--s5); grid-template-columns: 1fr; }
@media (min-width: 900px) { .imp-grid { grid-template-columns: 320px 1fr; align-items: start; } .imp-meta { position: sticky; top: var(--s4); } }
.lbl-f { font-size: var(--t-sm); font-weight: 600; }
.imp-meta .chips { gap: var(--s2); }
.imp-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.imp-facts .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-doc { max-height: 440px; overflow-y: auto; padding: var(--s5); border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-family: var(--f-read); font-size: 16px; line-height: 1.65; color: var(--ink); }
.imp-doc p { margin: 0 0 1em; max-width: 66ch; }
.imp-doc-t { font-family: var(--f-read); font-size: var(--t-xl); line-height: 1.1; margin-bottom: var(--s4); }
.imp-rights { margin-top: var(--s5); padding: var(--s4); border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.prov.brought .prov-s { margin-top: 4px; }
#my-stories .section-h { flex-wrap: wrap; align-items: center; row-gap: var(--s2); }
#my-stories .section-h h2 { white-space: nowrap; }

/* ==========================================================================
   V3.2 type roles: story titles in lists are reading serif 600 / 16
   ========================================================================== */
.book .bt, .cont .t, .mine .t, .cat-row .t, .recent-row .t, .up-next .item .t, .related .t, .chosen-dir .t, .ob-story .t, .pub-review .t { font-family: var(--f-read); font-weight: 600; font-size: var(--t-base); line-height: 1.25; }

/* narrow direction cards keep the genre chip whole instead of cutting the mood mid-word */
@container (max-width: 300px) { .dir .body .meta .mood { display: none; } }
@media (min-width: 900px) { .prof-main .book-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }

.chips.scroll .chip { flex: none; white-space: nowrap; }

/* Creator readership signal: four numbers per published story (readers, finishes, saves, follows) */
.signal { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 10px; }
.signal .sg { display: grid; gap: 2px; text-align: left; }
.signal b { font-family: var(--f-ui); font-size: var(--t-base); font-weight: 600; line-height: 1.2; color: var(--ink); }
.signal i { font-style: normal; font-size: var(--t-xs); line-height: 1.2; color: var(--muted); }
.signal.in-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin-top: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.signal-note { margin: 0 0 var(--s4); max-width: 60ch; font-size: var(--t-sm); color: var(--muted); }
.book:has(.signal) { align-content: start; }

/* ==========================================================================
   DUSK: the Create launch screen. Twilight violet melting into ember and dusty rose, a faded artwork drifting behind it.
   Palette: deep violet #241239, plum #4A2358, cream #FBF3E4, ember #FF7A45, dusty rose #E890B0.
   ========================================================================== */
.create.dusk { --violet: var(--dusk-violet); --plum: var(--dusk-plum); --cream: var(--dusk-cream); --ember: var(--action); --rose: var(--dusk-rose); --cream-2: rgba(251, 243, 228, .78);
  position: relative; isolation: isolate; overflow: clip; color: var(--cream);
  background: linear-gradient(172deg, #1c0d2e 0%, var(--violet) 30%, #34184a 52%, var(--plum) 70%, #6a2b55 86%, #a8445a 100%); }
.dusk-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.dusk-img { position: absolute; inset: -6%; background-size: cover; background-position: center; opacity: .15; filter: saturate(1.25); animation: duskDrift 46s ease-in-out infinite alternate; }
.dusk-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 70% at 50% 108%, rgba(255, 122, 69, .32), rgba(232, 144, 176, .12) 42%, transparent 70%); }
.dusk-glow { position: absolute; left: 50%; top: 22%; width: min(92vw, 760px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(232, 144, 176, .22), rgba(255, 122, 69, .08) 55%, transparent 75%); animation: duskBreathe 11s ease-in-out infinite; }
.dusk-motes i { position: absolute; bottom: -8px; width: 3px; height: 3px; border-radius: 50%; background: var(--cream); opacity: 0; animation: duskMote 28s linear infinite; }
.dusk-motes i:nth-child(3n) { width: 2px; height: 2px; }
@keyframes duskDrift { from { transform: scale(1.04) translate3d(-1.5%, -1%, 0); } to { transform: scale(1.12) translate3d(1.5%, 1.2%, 0); } }
@keyframes duskBreathe { 0%, 100% { opacity: .75; transform: translate(-50%, -50%) scale(.96); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); } }
@keyframes duskMote { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: .5; } 80% { opacity: .35; } 100% { transform: translateY(-105vh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dusk-img, .dusk-glow, .dusk-motes i { animation: none; } .dusk-motes { display: none; } }
.create.dusk .page { position: relative; }
.create.dusk .spark { max-width: 680px; margin: 0 auto; align-items: center; text-align: center; padding-block: var(--s6) var(--s7); }
.create.dusk .spark > * { width: 100%; }
.create.dusk .spark .seg.paths { width: auto; align-self: center; background: rgba(251, 243, 228, .08); box-shadow: inset 0 0 0 1px rgba(251, 243, 228, .14); }
.create.dusk .seg.paths button { color: var(--cream-2); }
.create.dusk .seg.paths button[aria-selected="true"] { background: rgba(251, 243, 228, .16); color: var(--cream); box-shadow: none; }
.create.dusk .spark h1 { color: var(--cream); font-weight: 600; text-shadow: 0 2px 24px rgba(20, 6, 34, .5); }
.create.dusk .spark-box { text-align: left; background: rgba(28, 13, 46, .55); box-shadow: inset 0 0 0 1px rgba(251, 243, 228, .2), 0 18px 48px -18px rgba(10, 2, 20, .7); }
.create.dusk .spark-box:focus-within { box-shadow: inset 0 0 0 2px rgba(251, 243, 228, .7), 0 18px 48px -18px rgba(10, 2, 20, .7); }
.create.dusk .spark-box textarea { color: var(--cream); caret-color: var(--ember); }
.create.dusk .spark-box textarea::placeholder { color: rgba(251, 243, 228, .62); opacity: 1; }
.create.dusk .spark-box .hint { color: var(--cream-2); }
.create.dusk .spark-box .err { color: var(--danger); }
.create.dusk .btn-accent { background: var(--ember); color: var(--violet); }
.create.dusk .btn-accent:hover { box-shadow: 0 6px 22px -6px rgba(255, 122, 69, .7); }
.create.dusk .examples .eyebrow { color: var(--cream-2); }
.create.dusk .examples .chips { justify-items: center; }
.create.dusk .example { color: var(--cream-2); text-align: center; width: auto; }
.create.dusk .example:hover, .create.dusk .example:focus-visible { color: var(--cream); }
.create.dusk .recent-made { justify-content: center; color: var(--cream-2); }
.create.dusk .recent-made .link { color: var(--cream); text-decoration: underline; text-decoration-color: var(--rose); text-underline-offset: 3px; }
.create.dusk .interpreting { color: var(--cream); }
.create.dusk .interpreting .muted { color: var(--cream-2); }
.create.dusk .ink-dots i { background: var(--ember); }
/* the sticky app bar on the Dusk screen */
.topbar.on-dusk { background: rgba(28, 13, 46, .9); }
.topbar.on-dusk .brand .mark { background: var(--dusk-cream); color: var(--dusk-violet); }
.topbar.on-dusk .brand .word { color: var(--dusk-cream); }
.create.dusk { min-height: 100%; }
.create.dusk .spark { min-height: calc(100vh - 56px - var(--nav-h)); justify-content: center; }
@media (min-width: 768px) { .create.dusk .spark { min-height: calc(100vh - 68px); } }
/* Discover preferences, shown in place of the feed on the first Discover visit */
.prefs .ob-pick { max-width: 860px; }
.prefs .ob-foot { max-width: 860px; position: sticky; bottom: 0; margin-top: var(--s5); padding-bottom: var(--s4); }
/* the Dusk backdrop runs under the translucent bottom nav on phones instead of stopping above it */
@media (max-width: 767px) { .create.dusk { margin-bottom: calc(-1 * (var(--nav-h) + env(safe-area-inset-bottom, 0px))); padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); } }

/* ==========================================================================
   LAUNCH INTRO: on a cold load a pen writes the wordmark on the Dusk sky with an ink flourish, then the
   wordmark glides into the header and the page fades in (about 3.7s; any tap or key skips). Driven by js/main.js.
   ========================================================================== */
.launch-intro { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; cursor: default; }
.launch-intro .intro-sky { position: absolute; inset: 0; background: radial-gradient(90% 60% at 50% 110%, rgba(255, 122, 69, .28), transparent 60%), linear-gradient(172deg, #1c0d2e, var(--dusk-violet) 45%, var(--dusk-plum)); }
.launch-intro .brand { position: relative; z-index: 1; opacity: 0; cursor: default; transform-origin: 0 0; }
.launch-intro .brand .mark { background: var(--dusk-cream); color: var(--dusk-violet); opacity: 0; }
.launch-intro .brand .word { color: var(--dusk-cream); display: inline-block; clip-path: inset(-20% 100% -20% 0); }
.intro-wordwrap { position: relative; display: inline-block; }
.intro-pen { position: absolute; left: -2px; bottom: 3px; width: 9px; height: 27px; opacity: 0; transform-origin: 50% 98%; rotate: 32deg; translate: 0 0; filter: drop-shadow(0 2px 4px rgba(10, 2, 20, .5)); overflow: visible; }
.intro-ink { position: absolute; left: -4%; top: 92%; width: 108%; height: 7px; overflow: visible; }
.intro-ink path { fill: none; stroke: var(--dusk-ember); stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; vector-effect: non-scaling-stroke; }
body.intro #main .page, body.intro #main .disc-body, body.intro #main .shelf-feed, body.intro #main .disc-top .tabs, body.intro #main .disc-top .right, body.intro #main .topbar > :not(.brand), body.intro .bnav, body.intro .rail { opacity: 0; }
body.intro-out #main .page, body.intro-out #main .disc-body, body.intro-out #main .shelf-feed, body.intro-out #main .disc-top .tabs, body.intro-out #main .disc-top .right, body.intro-out #main .topbar > :not(.brand), body.intro-out .bnav, body.intro-out .rail { transition: opacity 560ms var(--ease-out); }
body.intro #main .brand { visibility: hidden; }

/* ==========================================================================
   LAUNCH PAGE: a headline and the Talelo mantra, one idea box, one ember button. The darkness and the empty space do
   the pulling; everything else is a whisper.
   ========================================================================== */
.create.dusk .dusk-img { opacity: .12; }
.dusk-bg { box-shadow: inset 0 0 200px 60px rgba(8, 3, 16, .6); }
.create.dusk .spark.launch { max-width: 640px; padding-block: var(--s5) var(--s4); gap: 0; justify-content: space-between;
  /* Vertical rhythm, tuned per breakpoint below: headline -> mantra -> idea box -> Bring your story. */
  --mantra-size: var(--t-lg); --mantra-gap: 8px; --head-gap: 28px; --bring-gap: 16px; --lift: 2vh; }
@media (min-width: 480px) { .create.dusk .spark.launch { --mantra-gap: 10px; --head-gap: 32px; } }
@media (min-width: 768px) { .create.dusk .spark.launch { --mantra-gap: 12px; --head-gap: 36px; --bring-gap: 20px; --lift: 5vh; } }
@media (min-width: 1200px) { .create.dusk .spark.launch { --mantra-gap: 14px; --head-gap: 40px; --lift: 7vh; } }
@media (min-width: 1680px) { .create.dusk .spark.launch { --head-gap: 44px; --lift: 9vh; } }
/* Short landscape screens (tablet landscape, 1366x768 laptops): tighten so everything sits above the fold. */
@media (min-width: 768px) and (max-height: 820px) { .create.dusk .spark.launch { --head-gap: 30px; --lift: 3vh; } }
/* Tablet and up: the launch column fills the viewport inside the page padding (32px top, 64px bottom), so the privacy
   footer sits above the fold instead of 32px under it. */
@media (min-width: 768px) { .create.dusk .spark.launch { min-height: calc(100vh - 68px - 96px); } }
.launch-core { margin-block: auto; display: grid; gap: 0; justify-items: center; padding-top: var(--s5); padding-bottom: var(--lift); }
.launch-head { display: grid; gap: var(--mantra-gap); justify-items: center; margin-bottom: var(--head-gap); }
/* The mantra: the read face, upright, a step under the headline (and never smaller than the idea text below it), in a
   rose-tinted cream. Editorial, not instructional. */
.create.dusk .launch-mantra { margin: 0; max-width: 28ch; font-family: var(--f-read); font-weight: 400; font-style: normal; font-size: var(--mantra-size);
  line-height: 1.35; letter-spacing: .005em; color: #f3c9ce; /* 42% Dusk rose into cream */ text-wrap: balance; text-shadow: 0 1px 18px rgba(20, 6, 34, .65); }
.create.dusk .launch-core h1 { margin: 0; color: var(--cream); font-weight: 600; font-size: var(--h1); line-height: 1.12; text-wrap: balance; text-shadow: 0 2px 28px rgba(20, 6, 34, .6); }
.create.dusk .launch .spark-box { width: 100%; padding: var(--s4) var(--s4) var(--s3); animation: duskWait 6s ease-in-out infinite; }
.create.dusk .launch .spark-box:focus-within { animation: none; }
.create.dusk .launch .spark-box .row { justify-content: flex-end; margin-top: var(--s2); }
@media (max-width: 560px) { .create.dusk .launch .spark-box .row .btn { flex: 1; } }
@keyframes duskWait { 0%, 100% { box-shadow: inset 0 0 0 1px rgba(251, 243, 228, .18), 0 0 0 0 rgba(255, 122, 69, 0), 0 18px 48px -18px rgba(10, 2, 20, .7); }
  50% { box-shadow: inset 0 0 0 1px rgba(255, 122, 69, .38), 0 0 44px -6px rgba(255, 122, 69, .22), 0 18px 48px -18px rgba(10, 2, 20, .7); } }
.launch-err { margin: var(--s3) 0 0; font-size: var(--t-sm); font-weight: 600; color: var(--danger); }
/* Example ideas rotate as the box's placeholder (create.js), crossfading while the box is empty. */
.create.dusk .launch .spark-box textarea::placeholder { transition: color 600ms ease; }
.create.dusk .launch .spark-box textarea.ph-out::placeholder { color: transparent; }
.launch-foot { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding-top: var(--s7); font-size: var(--t-xs); color: rgba(251, 243, 228, .7); }
.launch-bring { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--bring-gap); padding: 8px 10px; border-radius: var(--r-md); font-size: var(--t-sm); font-weight: 600; color: rgba(251, 243, 228, .8); transition: color var(--d-fast), background var(--d-fast); }
.launch-bring .ic { width: 16px; height: 16px; }
.launch-bring:hover, .launch-bring:focus-visible { color: var(--cream); background: rgba(251, 243, 228, .08); }
@media (prefers-reduced-motion: reduce) { .create.dusk .launch .spark-box { animation: none; } }

/* Launch screen on phones: 100vh is the *largest* iOS viewport (browser toolbars hidden), so the old full-height column pushed the
   headline down and the footer under the tab bar on first load. On phones the column is content-height and starts near the top,
   so headline, idea box, Bring your story and the two footer lines are all visible without scrolling. */
@media (max-width: 767px) {
  .create.dusk .spark.launch { min-height: 0; justify-content: flex-start; padding-block: var(--s2) var(--s5); }
  .launch-core { margin-block: 0; padding-top: var(--s4); padding-bottom: 0; }
  .launch-foot { padding-top: var(--s5); }
}
/* The privacy line and the preview allowance are always two lines, one under the other. */
.launch-foot { flex-direction: column; text-align: center; gap: 6px; }
.launch-foot .access-note { margin-top: 0; }

/* ---------- W27 creator prototype additions ---------- */
.land-row { display: flex; align-items: center; justify-content: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); padding-bottom: var(--s4); border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent); }
.land-row > span { width: 100%; text-align: center; font-weight: 600; font-size: var(--t-sm); }
.land-row .react { width: auto; min-width: 96px; padding: 10px 16px; grid-auto-flow: column; align-items: center; gap: 6px; }
.launch-foot .access-note { display: block; margin-top: 6px; }

/* feedback menu (links styled like .menu buttons) */
.menu a.fb-opt { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); font-weight: 600; color: inherit; text-decoration: none; }
.menu a.fb-opt:hover, .menu a.fb-opt:focus-visible { background: var(--bg-2); }
.disc-top .right { display: flex; align-items: center; }
/* Phones: the feedback icon joins the right group (still 44px tall, 40px wide) and the tab labels give back a little padding, so nothing overflows or crowds "Following" */
@media (max-width: 767px) { .disc-top { gap: var(--s2); } .disc-top .tabs { gap: 0; } .disc-top .tabs button { padding-inline: 9px; } .disc-top .tabs button[aria-selected="true"]::after { left: 9px; right: 9px; } .disc-top .right .fb-btn { width: 40px; } }
/* Desktop: out of flow beside Search so the centred tabs keep their exact position */
@media (min-width: 768px) { .disc-top .right { position: relative; } .disc-top .right .fb-btn { position: absolute; right: 100%; top: 50%; transform: translateY(-50%); } .disc-top .right .fb-btn:active { transform: translateY(-50%) scale(.92); } }
/* compact feedback menu: narrower, tighter rows, small book / pen icons */
.popover.fb-pop { min-width: 0; width: 184px; } .fb-pop .menu { min-width: 0; padding: 4px; gap: 0; }
.menu a.fb-opt { min-height: 38px; gap: 10px; padding: 0 10px; font-size: 14px; }
.menu a.fb-opt .ic { width: 18px; height: 18px; flex: none; opacity: .72; }
.fb-pop .fb-head { padding: 6px 10px 4px; font-size: var(--t-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
