/* ============================================================================
   StoryFlux library (getstoryflux.com/library) and story pages (/read/…)
   Built on styles.css: the plum night, the ribbon gradient, Courier Prime for
   titles and the script, Schibsted Grotesk for reading. Covers do the talking.
   ============================================================================ */

.lib, .story { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.top-nav a[aria-current="page"] { color: var(--text); }
.top-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- library hero ---------- */
.lib-hero { position: relative; padding-block: clamp(36px, 6vw, 72px) 28px; }
.lib-hero::before { content: ""; position: absolute; z-index: -1; inset: -40px calc(50% - 50vw) 0;
  background: radial-gradient(45% 70% at 80% 10%, rgba(211, 23, 95, 0.18), transparent 70%), radial-gradient(40% 60% at 10% 0%, rgba(253, 184, 19, 0.1), transparent 70%); }
.lib-hero h1 { font-family: var(--script); font-size: var(--step-4); letter-spacing: -0.02em; }
.lib-hero h1 em { font-style: normal; background: var(--ribbon); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lib-hero > p { color: var(--mist); max-width: 40em; margin-top: 14px; font-size: var(--step-1); }
.lib-search { display: flex; gap: 10px; margin-top: 28px; max-width: 720px; }
.lib-search-box { position: relative; flex: 1; }
.lib-search-box svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--mist); pointer-events: none; }
.lib-search input { width: 100%; padding: 15px 18px 15px 46px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--text); font: inherit; font-size: var(--step-0); }
.lib-search input::placeholder { color: #8c829b; }
.lib-search input:focus { outline: none; border-color: #6c5a86; background: rgba(255, 255, 255, 0.06); box-shadow: 0 0 0 4px rgba(160, 114, 254, 0.12); }

.lib-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); color: var(--mist); font: inherit; font-size: var(--step--1); font-weight: 500; text-decoration: none; cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.chip:hover { border-color: #57486e; color: var(--text); }
.chip.on { color: #1a0d14; background: var(--ribbon); border-color: transparent; font-weight: 700; }
.chip small { opacity: 0.7; font-size: 0.85em; }
.lib-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: var(--step--1); color: var(--mist); cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: #2f2640; position: relative; cursor: pointer; transition: background 0.2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #b5aac4; transition: transform 0.2s var(--ease-out), background 0.2s; }
.switch input:checked { background: var(--magenta); }
.switch input:checked::after { transform: translateX(14px); background: #fff; }

/* ---------- shelves ---------- */
.shelf { margin-top: clamp(36px, 5vw, 56px); }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.shelf-head h2 { font-size: var(--step-2); }
.shelf-head p { color: var(--mist); font-size: var(--step--1); margin-top: 4px; }
.shelf-head a { color: var(--mist); text-decoration: none; font-size: var(--step--1); font-weight: 600; white-space: nowrap; }
.shelf-head a:hover { color: var(--text); }
.shelf-row-wrap { position: relative; }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(150px, 17vw, 190px); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 2px 18px; scrollbar-width: none; }
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-row > * { scroll-snap-align: start; }
.shelf-arrow { position: absolute; top: calc(50% - 50px); z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(20, 16, 28, 0.9); color: var(--text); cursor: pointer; backdrop-filter: blur(8px); opacity: 0; transition: opacity 0.2s; }
.shelf-row-wrap:hover .shelf-arrow { opacity: 1; }
.shelf-arrow.prev { left: -18px; }
.shelf-arrow.next { right: -18px; }
.shelf-arrow[hidden] { display: none; }
@media (hover: none) { .shelf-arrow { display: none; } }

/* ---------- a story card ---------- */
.card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.cover { position: relative; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: var(--night-2) center / cover no-repeat;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05) inset; transition: transform 0.25s var(--ease-out), box-shadow 0.25s; }
.card:hover .cover { transform: translateY(-4px) rotate(-0.6deg); box-shadow: 0 22px 40px -16px rgba(211, 23, 95, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08) inset; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.blank { background: radial-gradient(120% 70% at 25% 10%, rgba(253, 184, 19, 0.35), transparent 60%), linear-gradient(165deg, #4a2134 0%, #2a1530 50%, #14101c 100%); }
.cover-type { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 14px; }
.cover-type b { font-family: var(--script); font-size: clamp(1.05rem, 0.9rem + 0.6vw, 1.35rem); line-height: 1.08; color: #fff4dd; overflow-wrap: anywhere; }
.cover-type i { font-style: normal; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(253, 184, 19, 0.85); }
.badge { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; color: #1a0d14; background: #fdb813; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35); }
.badge.done { background: #7ee0b0; }
.cover-icons { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 4px; }
.cover-icons span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(15, 12, 22, 0.75); color: #fff; backdrop-filter: blur(6px); }
.card-title { font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-author { font-size: var(--step--1); color: var(--mist); margin-top: -6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-genre { font-size: 0.75rem; color: #8c829b; margin-top: -6px; }

/* Featured: bigger, with the logline beside the cover */
.feature-row { display: grid; grid-auto-flow: column; grid-auto-columns: min(560px, 86vw); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 14px; scrollbar-width: none; }
.feature { scroll-snap-align: start; display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: end; padding: 20px; border-radius: 16px; text-decoration: none; color: inherit;
  background: linear-gradient(135deg, rgba(211, 23, 95, 0.14), rgba(106, 15, 90, 0.08)), var(--night-lift); border: 1px solid var(--line); transition: border-color 0.2s; }
.feature:hover { border-color: #6c4a74; }
.feature h3 { font-family: var(--script); font-size: var(--step-2); }
.feature p { color: var(--mist); font-size: var(--step--1); margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.feature .eyebrow { display: inline-block; margin-bottom: 10px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }

/* Results grid (search / genre / sort) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 28px 20px; margin-top: 28px; }
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 36px; }
.results-head h2 { font-size: var(--step-2); }
.sort { display: flex; gap: 6px; }
.more { display: flex; justify-content: center; margin-top: 36px; }

.empty { margin: 48px auto; max-width: 560px; text-align: center; padding: 36px 24px; border-radius: 20px; border: 1px dashed var(--line); background: rgba(255, 255, 255, 0.02); }
.empty h2 { font-size: var(--step-2); }
.empty p { color: var(--mist); margin: 12px 0 22px; }
.loading { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(150px, 17vw, 190px); gap: 18px; overflow: hidden; margin-top: 40px; }
.loading div { aspect-ratio: 2 / 3; border-radius: 10px; background: linear-gradient(100deg, var(--night-2) 30%, #2a2140 50%, var(--night-2) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.lib-error { margin: 40px 0; color: var(--mist); }

/* ---------- the story page ---------- */
.story-hero { position: relative; display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: clamp(24px, 5vw, 56px); align-items: end; padding-block: clamp(32px, 6vw, 72px) 28px; }
.story-hero::before { content: ""; position: absolute; z-index: -1; inset: -40px calc(50% - 50vw) 0; background: var(--story-glow, radial-gradient(50% 80% at 20% 30%, rgba(211, 23, 95, 0.2), transparent 70%)); }
.story-hero .cover { box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9); }
.story-hero .cover-type b { font-size: clamp(1.4rem, 1rem + 1.5vw, 2rem); }
.story-status { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: var(--step--1); font-weight: 700; color: #1a0d14; background: var(--gold); }
.story-status.done { background: #7ee0b0; }
.story-hero h1 { margin-top: 14px; font-family: var(--script); font-size: var(--step-4); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.story-by { margin-top: 8px; font-size: var(--step-1); color: var(--gold); }
.story-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.story-chips span, .story-chips a { padding: 4px 11px; border-radius: 999px; font-size: var(--step--1); color: var(--mist); background: rgba(255, 255, 255, 0.05); text-decoration: none; }
.story-chips a:hover { color: var(--text); }
.story-logline { margin-top: 16px; max-width: 44em; font-size: var(--step-1); line-height: 1.5; }
.story-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; align-items: center; }
.story-meta { margin-top: 12px; font-size: var(--step--1); color: #8c829b; }
.story-body { max-width: 860px; margin-inline: auto; }
.block { margin-top: clamp(32px, 5vw, 48px); }
.block h2 { display: flex; align-items: center; gap: 10px; font-family: var(--sans); font-size: var(--step--1); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mist); margin-bottom: 14px; }
.prose { font-size: var(--step-1); line-height: 1.7; color: #e6dff0; white-space: pre-wrap; }
.ask { display: flex; gap: 14px; padding: 18px 20px; border-radius: 16px; background: linear-gradient(135deg, rgba(253, 184, 19, 0.1), rgba(244, 91, 31, 0.05)); border: 1px solid rgba(253, 184, 19, 0.3); color: var(--gold); }
.ask strong { color: var(--text); display: block; }
.ask p { color: var(--mist); margin-top: 4px; }
.tracks { display: flex; flex-wrap: wrap; gap: 10px; }
.track { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--night-lift); color: var(--text); font: inherit; font-size: var(--step--1); cursor: pointer; }
.track em { color: #8c829b; font-style: normal; }
.track:hover, .track.on { border-color: var(--gold); color: var(--gold); }
.parts { display: flex; flex-wrap: wrap; gap: 8px; }
.parts a { padding: 9px 14px; border-radius: 12px; background: var(--night-lift); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: var(--step--1); }
.parts a span { color: #8c829b; }
.parts a:hover { border-color: #6c5a86; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; border-radius: 14px; background: var(--night-lift); border: 1px solid var(--line); }
.tile b { display: block; }
.tile i { display: block; margin-top: 2px; font-style: normal; font-size: 0.8rem; color: var(--gold); text-transform: capitalize; }
.tile p { margin-top: 8px; font-size: var(--step--1); color: var(--mist); line-height: 1.5; }

/* The script: white pages, standard layout */
.paper { background: var(--paper); color: var(--ink); border-radius: 6px; padding: clamp(28px, 6vw, 72px) clamp(20px, 7vw, 84px); box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9); font-family: var(--script); font-size: clamp(14px, 0.8rem + 0.3vw, 16px); line-height: 1.5; }
.sc { position: relative; margin-bottom: 2.4em; }
.sc-act { font-family: var(--sans); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: #8a6d1d; margin: 0 0 1.6em; display: flex; align-items: center; gap: 12px; }
.sc-act::after { content: ""; flex: 1; height: 1px; background: #e3d8bd; }
.sc-h { display: flex; gap: 12px; font-weight: 700; text-transform: uppercase; margin-bottom: 1em; }
.sc-h span { color: #9a8f7a; font-weight: 400; min-width: 2ch; }
.sc-a { margin-bottom: 1em; }
.sc-c { margin: 1em 0 0 37%; text-transform: uppercase; }
.sc-p { margin-left: 30%; margin-right: 25%; }
.sc-d { margin: 0 20% 1em 22%; }
.sc-t { text-align: right; text-transform: uppercase; margin-bottom: 1em; }
.next-part { text-align: center; margin-top: 22px; color: var(--gold); font-family: var(--script); font-size: var(--step-1); }
.copy { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; color: #8c829b; font-size: var(--step--1); }
@media (max-width: 640px) {
  .sc-c { margin-left: 28%; } .sc-p { margin-left: 18%; margin-right: 10%; } .sc-d { margin-left: 10%; margin-right: 6%; }
  .story-hero { grid-template-columns: 1fr; } .story-hero .cover { width: 180px; }
}

.notes-soon { display: flex; gap: 12px; align-items: center; padding: 16px 18px; border-radius: 14px; background: var(--night-lift); border: 1px solid var(--line); color: var(--mist); }

.cta-band { margin-top: clamp(56px, 8vw, 96px); padding: clamp(28px, 5vw, 48px); border-radius: 24px; text-align: center;
  background: radial-gradient(60% 90% at 50% 0%, rgba(244, 91, 31, 0.22), transparent 70%), var(--night-lift); border: 1px solid var(--line); }
.cta-band h2 { font-size: var(--step-3); }
.cta-band p { color: var(--mist); margin: 12px auto 22px; max-width: 34em; }

/* Report */
.link-report { background: none; border: 0; color: #8c829b; font: inherit; font-size: var(--step--1); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-report:hover { color: var(--text); }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(8, 6, 12, 0.72); backdrop-filter: blur(6px); }
.modal[hidden] { display: none; }
.modal-box { width: min(460px, 100%); padding: 24px; border-radius: 20px; background: var(--night-lift); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.modal-box h2 { font-family: var(--sans); font-size: var(--step-1); }
.modal-box p { color: var(--mist); font-size: var(--step--1); margin: 6px 0 14px; }
.modal-box label { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: var(--step--1); cursor: pointer; }
.modal-box input[type="radio"] { accent-color: #f45b1f; }
.modal-box textarea { width: 100%; margin-top: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--night); color: var(--text); font: inherit; font-size: var(--step--1); resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--ink); font-size: var(--step--1); font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }

/* The listen bar on the story page: fixed to the bottom while audio plays */
.listen-bar { position: fixed; left: 50%; bottom: 16px; z-index: 40; transform: translateX(-50%); width: min(760px, calc(100vw - 24px)); display: grid; gap: 6px; padding: 10px 14px 10px 12px; border-radius: 22px; background: rgba(26, 21, 37, 0.96); border: 1px solid var(--line); backdrop-filter: blur(12px); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); }
.listen-bar[hidden] { display: none; }
.lb-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lb-play { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--ribbon); color: #1a0d14; cursor: pointer; flex: none; }
.lb-skip { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; color: var(--mist); font-size: 14px; cursor: pointer; flex: none; }
.lb-skip:hover:not(:disabled) { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.lb-skip:disabled { opacity: 0.3; cursor: default; }
.lb-info { display: grid; flex: 1; min-width: 0; padding-left: 4px; }
.lb-title { font-size: var(--step--1); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-time { font-size: 0.72rem; color: #8c829b; font-variant-numeric: tabular-nums; }
.lb-bottom { display: flex; align-items: center; gap: 14px; padding-left: 4px; }
.lb-along { flex: none; font-size: 0.78rem; }
.lb-close { width: 30px; height: 30px; border-radius: 50%; border: 0; background: none; color: #8c829b; font-size: 20px; line-height: 1; cursor: pointer; flex: none; }
.lb-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.lb-prog { flex: 1; min-width: 0; height: 4px; margin: 0; appearance: none; -webkit-appearance: none; border-radius: 2px; background: #2f2640; cursor: pointer; accent-color: var(--gold); }
.lb-prog::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); }
.lb-prog::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--gold); }
body.has-listen-bar { padding-bottom: 110px; }
body.has-listen-bar .toast { bottom: 120px; }
.back-to-voice { position: fixed; left: 50%; bottom: 112px; z-index: 41; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(253, 184, 19, 0.5); background: #2a2036; color: #fdd36b; font: inherit; font-size: var(--step--1); font-weight: 700; cursor: pointer; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.back-to-voice[hidden] { display: none; }
.listen-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.listen-sub { margin: -4px 0 12px; color: #8c829b; font-size: var(--step--1); }
/* Read along: the line being spoken */
.paper .speaking { background: linear-gradient(90deg, rgba(253, 184, 19, 0.28), rgba(253, 184, 19, 0.12)); box-shadow: -10px 0 0 rgba(253, 184, 19, 0.28), 10px 0 0 rgba(253, 184, 19, 0.12); border-radius: 3px; transition: background 0.25s ease; }
@media (max-width: 560px) {
  .listen-bar { bottom: 10px; padding: 8px 10px; }
  .lb-time { display: none; }
  .back-to-voice { bottom: 98px; }
}

/* ---------- Community section on the home page ---------- */
.community .wall { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-top: 36px; perspective: 1200px; }
.community .wall .card:nth-child(odd) .cover { transform: rotate(-1.5deg); }
.community .wall .card:nth-child(even) .cover { transform: rotate(1.2deg) translateY(14px); }
.community .wall .card:hover .cover { transform: translateY(-6px) rotate(0); }
.community .wall .card-title, .community .wall .card-author { font-size: var(--step--1); }
.community-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.community .placeholder .cover { opacity: 0.55; }
@media (max-width: 900px) { .community .wall { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .community .wall { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .feature { grid-template-columns: 96px 1fr; gap: 14px; padding: 14px; }
  .feature h3 { font-size: var(--step-1); }
  .lib-toggles { margin-left: 0; }
}

/* ---------- Reader notes (under each scene, on the white page) ---------- */
.sc-notes { margin-top: -0.6em; font-family: var(--sans); }
.sc-notes-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid #e3dccb; background: #fffdf8; color: #8a7f6a; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.sc-notes-btn:hover { border-color: #f45b1f; color: #c24414; }
.sc-notes-btn.has { color: #b4430f; border-color: rgba(244, 91, 31, 0.45); background: #fff4ec; }
.sc-notes-btn[aria-expanded="true"] { background: #1b1820; color: #fff; border-color: #1b1820; }
.thread-panel { margin-top: 12px; padding: 14px; border-radius: 14px; background: #f4f1ea; border: 1px solid #e6e0d2; }
.thread-panel[hidden] { display: none; }
.note-list { display: grid; gap: 10px; }
.note-list:empty { display: none; }
.note { padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid #ebe5d8; }
.note.by-writer { border-color: rgba(244, 91, 31, 0.4); background: #fff8f2; }
.note-head { display: flex; align-items: baseline; gap: 8px; font-size: 0.85rem; color: #1b1820; }
.note-badge { padding: 1px 7px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; color: #fff; background: linear-gradient(100deg, #fdb813, #f45b1f); }
.note-time { margin-left: auto; font-size: 0.75rem; color: #9a8f7a; }
.note-body { margin-top: 4px; font-size: 0.92rem; line-height: 1.5; color: #2a2530; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-tools { display: flex; justify-content: flex-end; }
.note-tools button { border: 0; background: none; color: #a39a88; font: inherit; font-size: 0.72rem; cursor: pointer; padding: 2px 0; }
.note-tools button:hover { color: #1b1820; text-decoration: underline; }
.note-compose { margin-top: 12px; display: grid; gap: 8px; }
.note-list:empty + .note-compose { margin-top: 0; }
.note-compose textarea { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid #ddd5c4; background: #fff; color: #1b1820; font: inherit; font-size: 0.92rem; resize: vertical; }
.note-compose textarea:focus { outline: none; border-color: #f45b1f; box-shadow: 0 0 0 3px rgba(244, 91, 31, 0.15); }
.note-compose-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.note-who { font-size: 0.78rem; color: #8a7f6a; }
.notes-total { color: var(--gold); }
.account-line { margin-top: 10px; text-align: center; font-size: var(--step--1); color: var(--mist); }
.account-line:empty { display: none; }

/* Follow */
.follow-btn.on { border-color: var(--gold); color: var(--gold); }
.follow-btn[hidden] { display: none; }

/* Sign-in window */
.auth-box { display: grid; gap: 10px; }
.auth-box > p { margin: 0 0 4px; }
.auth-google { width: 100%; }
.auth-or { display: flex; align-items: center; gap: 10px; color: #8c829b; font-size: var(--step--1); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-form { display: grid; gap: 8px; }
.auth-form input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--night); color: var(--text); font: inherit; }
.auth-form input:focus { outline: none; border-color: #6c5a86; box-shadow: 0 0 0 3px rgba(160, 114, 254, 0.15); }
.auth-form input[hidden] { display: none; }
.auth-form .btn { width: 100%; margin-top: 4px; }
.auth-msg { min-height: 0; font-size: var(--step--1); color: var(--gold); }
.auth-msg:empty { display: none; }
.auth-swap { justify-self: center; border: 0; background: none; color: var(--mist); font: inherit; font-size: var(--step--1); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.auth-swap:hover { color: var(--text); }

/* Unfollow page */
.unfollow { max-width: 520px; margin: 80px auto; text-align: center; }

/* ---------- Notes on a single line ---------- */
.sc-line { position: relative; border-radius: 4px; transition: background 0.15s; }
.sc-line > .sc-a, .sc-line > .sc-d, .sc-line > .sc-t { margin-bottom: 1em; }
.sc-line:hover, .sc-line.sel, .sc-line.open { background: rgba(244, 91, 31, 0.06); box-shadow: -8px 0 0 rgba(244, 91, 31, 0.06), 8px 0 0 rgba(244, 91, 31, 0.06); }
.sc-line.has-notes { box-shadow: -3px 0 0 rgba(244, 91, 31, 0.35); }
.sc-line.has-notes:hover, .sc-line.has-notes.open { box-shadow: -3px 0 0 rgba(244, 91, 31, 0.6), 8px 0 0 rgba(244, 91, 31, 0.06); }
.line-note-btn { position: absolute; left: -46px; top: 0; display: inline-flex; align-items: center; gap: 3px; height: 26px; min-width: 26px; padding: 0 6px; border-radius: 999px; border: 1px solid #e3dccb; background: #fffdf8; color: #a39a88; font-family: var(--sans); font-size: 0.72rem; font-weight: 700; cursor: pointer; opacity: 0; transition: opacity 0.15s, color 0.15s, border-color 0.15s; }
.sc-line:hover .line-note-btn, .sc-line.sel .line-note-btn, .sc-line.open .line-note-btn, .sc-line.has-notes .line-note-btn, .line-note-btn:focus-visible { opacity: 1; }
.sc-line.has-notes .line-note-btn { color: #b4430f; border-color: rgba(244, 91, 31, 0.45); background: #fff4ec; }
.line-note-btn:hover, .sc-line.open .line-note-btn { color: #fff; background: #1b1820; border-color: #1b1820; }
.line-note-n:empty { display: none; }
.sc-line.is-speech .line-note-btn { top: 0.1em; }
@media (max-width: 760px) {
  .line-note-btn { left: auto; right: -14px; top: -10px; height: 22px; min-width: 22px; padding: 0 5px; }
}
@media (hover: none) { .sc-line:hover { background: none; box-shadow: none; } .sc-line:hover .line-note-btn { opacity: 0; } .sc-line.has-notes .line-note-btn, .sc-line.sel .line-note-btn { opacity: 1; } }

.line-panel { margin: -0.4em 0 1.2em; font-family: var(--sans); cursor: auto; }
.line-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 0.8rem; color: #8a7f6a; }
.line-panel-head b { color: #1b1820; }
.line-panel-head button { width: 26px; height: 26px; border-radius: 50%; border: 0; background: #e9e3d6; color: #1b1820; font-size: 1rem; cursor: pointer; }
.note-list:empty + .note-compose { margin-top: 0; }
.thread-hint { margin: 0 0 10px; font-size: 0.78rem; color: #8a7f6a; }
.note-quote { display: block; width: 100%; margin: 4px 0 2px; padding: 6px 10px; border: 0; border-left: 3px solid rgba(244, 91, 31, 0.5); border-radius: 0 8px 8px 0; background: #f7f3ea; color: #5c5446; font-family: var(--script); font-size: 0.82rem; text-align: left; cursor: pointer; }
.note-quote b { font-weight: 700; }
.note-quote:hover { background: #f1eadb; }
.note-quote:not([title]) { cursor: default; }
.note-moved { margin: 2px 0 0; font-size: 0.72rem; color: #a39a88; font-style: italic; }

/* ---------- Votes (end of each part) ---------- */
.part-vote { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin: -0.8em 0 2.6em; padding: 14px 16px; border-radius: 14px; border: 1px dashed #e3d8bd; background: #fffcf4; font-family: var(--sans); }
.part-vote[hidden] { display: none; }
.part-vote-end { width: 100%; text-align: center; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: #a3946e; }
.vote-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px; border: 1px solid #e3d8bd; background: #fff; color: #5c5446; font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: transform 0.15s, background 0.15s, color 0.15s, border-color 0.15s; }
.vote-btn:hover:not(:disabled) { transform: translateY(-1px); border-color: #fdb813; color: #1b1820; }
.vote-btn .vote-star { color: #d5c79b; font-size: 1.05rem; transition: color 0.15s, transform 0.25s; }
.vote-btn.on { background: linear-gradient(100deg, #fdb813, #f45b1f); border-color: transparent; color: #1a0d14; }
.vote-btn.on .vote-star { color: #fff; transform: scale(1.15) rotate(-8deg); }
.vote-btn:disabled { cursor: default; opacity: 0.8; }
.part-vote em { font-style: normal; font-size: 0.82rem; color: #8a7f6a; }
.votes-total { color: var(--gold); }

/* ---------- new scenes, reads, short character/world rows ---------- */
.badge.new { background: linear-gradient(135deg, #fdb813, #f26522); color: #1a0d14; }
.card-stats { font-size: 0.72rem; color: #a99bbd; margin-top: -8px; font-variant-numeric: tabular-nums; }
.new-scenes { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 7px 14px; border-radius: 999px; background: rgba(253, 184, 19, 0.12); border: 1px solid rgba(253, 184, 19, 0.35); color: #fdd36b; font-size: var(--step--1); font-weight: 600; text-decoration: none; }
.new-scenes:hover { background: rgba(253, 184, 19, 0.2); }
.new-dot { width: 7px; height: 7px; border-radius: 50%; background: #fdb813; box-shadow: 0 0 0 3px rgba(253, 184, 19, 0.25); }
.sc-h .sc-new { align-self: center; margin-left: 4px; padding: 2px 8px; border-radius: 999px; background: #b8860b; color: #fff; font-size: 0.62rem; font-style: normal; font-family: system-ui, sans-serif; letter-spacing: 0.08em; }
.parts a .part-new { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(253, 184, 19, 0.16); color: #fdd36b; font-size: 0.7rem; font-style: normal; font-weight: 700; }
.tile p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile.open p { display: block; -webkit-line-clamp: unset; }
.tile.can-open { cursor: pointer; }
.tile.can-open:hover { border-color: #6c5a86; }
.tile[hidden] { display: none; }
.tiles { align-items: start; }
.tiles-more { margin-top: 12px; padding: 8px 16px; border-radius: 999px; background: none; border: 1px solid var(--line); color: var(--text); font: inherit; font-size: var(--step--1); cursor: pointer; }
.tiles-more:hover { border-color: #6c5a86; }
.tiles-more[hidden] { display: none; }

/* ---------- writer profiles ---------- */
.story-by a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(253, 184, 19, 0.35); }
.story-by a:hover { border-bottom-color: currentColor; }
.writer-link { cursor: pointer; border-radius: 4px; }
.writer-link:hover, .writer-link:focus-visible { color: var(--text); text-decoration: underline; text-underline-offset: 3px; outline: none; }
.writer-hero { position: relative; display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 4vw, 44px); align-items: center; padding-block: clamp(32px, 6vw, 72px) 20px; }
.writer-hero::before { content: ""; position: absolute; z-index: -1; inset: -40px calc(50% - 50vw) 0; background: radial-gradient(45% 80% at 15% 35%, rgba(253, 184, 19, 0.13), transparent 70%), radial-gradient(40% 70% at 70% 10%, rgba(211, 23, 95, 0.14), transparent 70%); }
.writer-photo { width: clamp(108px, 16vw, 168px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; border: 3px solid rgba(253, 184, 19, 0.5); box-shadow: 0 24px 48px -18px rgba(0, 0, 0, 0.9); background: var(--night-lift); }
.writer-photo.blank { display: grid; place-items: center; font-family: var(--script); font-size: clamp(2rem, 1.4rem + 2vw, 3.2rem); font-weight: 700; color: #fdd36b; background: linear-gradient(140deg, #3a2347, #1d1526); }
.writer-id h1 { font-family: var(--script); font-size: var(--step-4); letter-spacing: -0.02em; overflow-wrap: anywhere; line-height: 1.05; }
.writer-handle { margin-top: 8px; color: var(--gold); font-weight: 600; }
.writer-handle span { color: #8c829b; font-weight: 400; }
.writer-bio { margin-top: 14px; max-width: 60ch; color: var(--mist); white-space: pre-line; overflow-wrap: anywhere; }
.writer-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.writer-links a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--night-lift); color: var(--text); text-decoration: none; font-size: var(--step--1); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.writer-links a:hover { border-color: #6c5a86; }
.writer-links a span { color: #8c829b; }
.writer-stats { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 16px; color: #a99bbd; font-size: var(--step--1); }
.writer-stats b { color: var(--text); font-size: var(--step-0); font-variant-numeric: tabular-nums; }
.writer-hero .story-actions { margin-top: 18px; }
.writer-pinned { max-width: 720px; align-items: center; }
.writer-pinned-go { display: inline-block; margin-top: 12px; color: var(--gold); font-weight: 600; font-size: var(--step--1); }
.writer-grid { margin-top: 8px; }
@media (max-width: 640px) {
  .writer-hero { grid-template-columns: 1fr; text-align: left; }
  .writer-photo { width: 104px; }
}
.writer-hero [hidden], .story-actions [hidden] { display: none !important; }

/* ---------- back link ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-top: clamp(16px, 3vw, 28px); padding: 6px 12px 6px 10px; border-radius: 999px; color: var(--mist); text-decoration: none; font-size: var(--step--1); font-weight: 600; border: 1px solid transparent; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-link:hover { color: var(--text); border-color: var(--line); background: var(--night-lift); }
.back-link + .story-hero, .back-link + .writer-hero { padding-top: clamp(16px, 3vw, 36px); }

/* ---------- sequences in the script, and the "where am I" bar ---------- */
.sc, .seq-head { scroll-margin-top: calc(var(--top-h, 64px) + 64px); }
.seq-head { margin: 0 0 1.8em; border-radius: 10px; border: 1px solid #e6dcc2; background: #f6efdd; font-family: var(--sans); }
.seq-toggle { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 14px; background: none; border: 0; color: #5c4a20; font: inherit; font-size: 0.85rem; cursor: pointer; text-align: left; }
.seq-toggle strong { letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem; color: #8a6d1d; }
.seq-toggle span { color: #8b7d5c; }
.seq-chev { margin-left: auto; transition: transform 0.2s ease; color: #a08850; }
.seq-head.open .seq-chev, .where.open .where-btn .seq-chev { transform: rotate(180deg); }
.seq-toggle .part-new, .where .part-new { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: #b8860b; color: #fff; font-size: 0.66rem; font-style: normal; font-weight: 700; letter-spacing: 0.04em; }
.seq-list { list-style: none; margin: 0; padding: 0 6px 8px; }
.seq-list[hidden] { display: none; }
.seq-list li { margin: 0; }
.scene-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: none; color: #3b3324; font: inherit; font-size: 0.85rem; text-align: left; cursor: pointer; }
.scene-link:hover, .scene-link:focus-visible { background: rgba(184, 134, 11, 0.12); outline: none; }
.scene-n { min-width: 2.2ch; color: #a08850; font-variant-numeric: tabular-nums; text-align: right; }
.scene-t { flex: 1; min-width: 0; font-family: var(--script); font-weight: 700; text-transform: uppercase; font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-link .sc-new { flex: none; padding: 2px 8px; border-radius: 999px; background: #b8860b; color: #fff; font-size: 0.62rem; font-style: normal; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-family: var(--sans); }
.where { position: sticky; top: calc(var(--top-h, 64px) + 8px); z-index: 6; margin: 0 0 14px; }
.where-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(24, 19, 34, 0.92); backdrop-filter: blur(10px); color: var(--text); font: inherit; font-size: var(--step--1); cursor: pointer; box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.8); text-align: left; }
.where-btn:hover { border-color: #6c5a86; }
.where-kicker { flex: none; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.where-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--mist); }
.where-label b { color: var(--text); }
.where-btn .seq-chev { color: var(--mist); }
.where-panel { position: absolute; left: 0; right: 0; top: calc(100% + 8px); max-height: min(60vh, 520px); overflow-y: auto; padding: 8px; border-radius: 16px; border: 1px solid var(--line); background: #faf6ec; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.85); overscroll-behavior: contain; }
.where-panel[hidden] { display: none; }
.where-group + .where-group { border-top: 1px solid #e6dcc2; margin-top: 4px; padding-top: 4px; }
.where-seq { display: flex; align-items: center; gap: 4px; width: 100%; padding: 8px 10px 4px; border: 0; background: none; font: inherit; font-size: 0.78rem; color: #8b7d5c; text-align: left; cursor: pointer; border-radius: 8px; }
.where-seq strong { letter-spacing: 0.08em; text-transform: uppercase; color: #8a6d1d; }
.where-seq:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.where-panel .seq-list { padding: 0 0 4px; }
.where-panel li.on .scene-link { background: rgba(184, 134, 11, 0.18); }
.where-panel li.on .scene-n::before { content: "▸ "; color: #b8860b; }

/* ---------- dossier cards and window ---------- */
button.tile { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
button.tile:hover, button.tile:focus-visible { border-color: #6c5a86; transform: translateY(-2px); outline: none; }
.tile-open { display: inline-block; margin-top: 10px; font-size: 0.75rem; font-weight: 700; color: var(--gold); opacity: 0.75; }
button.tile:hover .tile-open { opacity: 1; }
body.no-scroll { overflow: hidden; }
.dossier-modal { padding: 16px; }
.dossier { --role: #a99bbd; position: relative; display: flex; flex-direction: column; width: min(620px, 100%); max-height: min(86vh, 860px); border-radius: 22px; background: #1a1424; border: 1px solid var(--line); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.9); overflow: hidden; }
.dossier-scroll { overflow-y: auto; padding: 0 clamp(20px, 4vw, 32px) 24px; overscroll-behavior: contain; }
.dossier-x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: rgba(20, 16, 28, 0.8); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }
.dossier-x:hover { border-color: #6c5a86; }
.dossier-head { display: flex; align-items: center; gap: 18px; margin: 0 calc(-1 * clamp(20px, 4vw, 32px)); padding: 28px clamp(20px, 4vw, 32px) 22px; padding-right: 60px; background: linear-gradient(135deg, color-mix(in srgb, var(--role) 22%, transparent), transparent 70%); border-bottom: 1px solid var(--line); }
.dossier-head.role-hero { --role: #fbbf24; } .dossier-head.role-villain { --role: #ef4444; } .dossier-head.role-support { --role: #60a5fa; } .dossier-head.role-world { --role: #34d399; }
.dossier:has(.role-hero) { --role: #fbbf24; } .dossier:has(.role-villain) { --role: #ef4444; } .dossier:has(.role-support) { --role: #60a5fa; } .dossier:has(.role-world) { --role: #34d399; }
.dossier-avatar { flex: none; display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; border: 2px solid var(--role); background: color-mix(in srgb, var(--role) 18%, #1d1526); color: var(--role); font-family: var(--script); font-size: 1.5rem; font-weight: 700; }
.dossier-role { display: inline-block; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--role) 20%, transparent); color: var(--role); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.dossier-head h2 { margin-top: 6px; font-family: var(--script); font-size: var(--step-2); line-height: 1.1; overflow-wrap: anywhere; }
.dossier-meta { margin-top: 4px; color: var(--mist); font-size: var(--step--1); text-transform: capitalize; }
.dossier-quote { margin: 22px 0 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--role); font-family: var(--script); font-size: var(--step-1); font-style: italic; color: #f1e7d0; line-height: 1.45; }
.dossier-sec { margin-top: 22px; }
.dossier-sec h3 { font-family: var(--sans); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #8c829b; margin-bottom: 8px; }
.dossier-sec > p { color: #ddd5e8; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.dossier-want { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.dossier-want dt { font-size: 0.75rem; font-weight: 700; color: var(--role); padding-top: 2px; text-transform: uppercase; letter-spacing: 0.08em; }
.dossier-want dd { margin: 0; color: #ddd5e8; line-height: 1.55; }
.dossier-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.dossier-bar span { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--mist); }
.dossier-bar span b { color: var(--text); font-variant-numeric: tabular-nums; }
.dossier-bar i { display: block; height: 6px; margin-top: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.dossier-bar u { display: block; height: 100%; border-radius: 3px; background: var(--role); text-decoration: none; }
.dossier-traits { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 14px; }
.dossier-traits div { padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.dossier-traits b { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--role); }
.dossier-traits p { margin-top: 4px; color: #ddd5e8; font-size: var(--step--1); line-height: 1.5; }
.dossier-quirks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.dossier-quirks span { padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); font-size: 0.8rem; color: #ddd5e8; }
.dossier-scenes { padding: 6px; border-radius: 12px; background: #f6efdd; }
.dossier-none { color: #8c829b !important; font-size: var(--step--1); }
.dossier-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: #150f1e; }
.dossier-nav button { display: inline-flex; align-items: center; gap: 4px; max-width: 40%; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--text); font: inherit; font-size: var(--step--1); cursor: pointer; white-space: nowrap; overflow: hidden; }
.dossier-nav button span { overflow: hidden; text-overflow: ellipsis; }
.dossier-nav button:hover { border-color: #6c5a86; }
.dossier-nav em { font-style: normal; font-size: 0.75rem; color: #8c829b; }
@media (max-width: 560px) {
  .dossier-modal { padding: 0; place-items: end center; }
  .dossier { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; }
  .dossier-avatar { width: 54px; height: 54px; font-size: 1.2rem; }
  .dossier-bars { grid-template-columns: 1fr; }
}
/* Story and writer pages: "clip" instead of "hidden", so the header and the
   "where am I" bar can stay stuck to the top while reading */
body:has(main.story) { overflow-x: clip; }

/* ---------- loading placeholders shaped like each page ---------- */
.sk { --sk: linear-gradient(100deg, var(--night-2) 30%, #2a2140 50%, var(--night-2) 70%); }
.sk i, .sk b, .sk u, .sk-cover, .sk-photo, .sk-back, .sk-paper { display: block; background: var(--sk); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; border-radius: 8px; }
.sk i { height: 12px; margin-top: 12px; }
.sk b { height: 34px; width: 60%; margin-top: 16px; border-radius: 10px; }
.sk-back { width: 110px; height: 28px; margin-top: clamp(16px, 3vw, 28px); border-radius: 999px; }
.sk-hero { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: clamp(24px, 5vw, 56px); align-items: end; padding-block: clamp(16px, 3vw, 36px) 28px; }
.sk-cover { aspect-ratio: 2 / 3; border-radius: 12px; }
.sk-chips, .sk-btns { display: flex; gap: 8px; margin-top: 16px; }
.sk-chips u { width: 70px; height: 26px; border-radius: 999px; }
.sk-btns u { width: 120px; height: 42px; border-radius: 999px; }
.sk-block { max-width: 860px; margin: 24px auto 0; }
.sk-paper { max-width: 860px; margin: 36px auto 0; padding: 48px clamp(20px, 7vw, 84px); border-radius: 6px; background: #efe9dc; animation: none; }
.sk-paper i { background: linear-gradient(100deg, #e2dacb 30%, #f4efe4 50%, #e2dacb 70%); background-size: 300% 100%; }
.sk-paper .sk-dia { margin-left: 30%; }
.sk-whero { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 4vw, 44px); align-items: center; padding-block: clamp(16px, 3vw, 36px) 20px; }
.sk-photo { width: clamp(108px, 16vw, 168px); aspect-ratio: 1; border-radius: 50%; }
.sk-label { width: 120px; height: 12px; margin-top: 40px; }
.sk-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; margin-top: 18px; }
.sk-row u { aspect-ratio: 2 / 3; border-radius: 10px; }
.sk-writer .sk-row { max-width: 860px; }
@media (max-width: 640px) {
  .sk-hero { grid-template-columns: 1fr; } .sk-cover { width: 180px; }
  .sk-whero { grid-template-columns: 1fr; } .sk-photo { width: 104px; }
  .sk-row { grid-template-columns: repeat(2, 1fr); } .sk-row u:nth-child(n+3) { display: none; }
}

/* ---------- account menu in the header ---------- */
.acct { position: relative; }
.acct-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(253, 184, 19, 0.55); background: linear-gradient(140deg, #3a2347, #1d1526); color: #fdd36b; font: inherit; font-size: 0.8rem; font-weight: 800; cursor: pointer; }
.acct-btn:hover, .acct-btn[aria-expanded="true"] { border-color: var(--gold); }
.acct-btn.has-photo { overflow: hidden; padding: 0; }
.acct-btn.has-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; animation: acct-in 0.3s ease both; }
@keyframes acct-in { from { opacity: 0; } to { opacity: 1; } }
.acct-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; min-width: 220px; padding: 6px; border-radius: 14px; border: 1px solid var(--line); background: #1d1628; box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.85); }
.acct-menu[hidden] { display: none; }
.acct-who { display: grid; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.acct-who b { font-size: var(--step--1); }
.acct-who span { font-size: 0.75rem; color: #8c829b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-who .acct-tier { margin-top: 6px; padding: 0; font-size: 0.75rem; font-weight: 600; color: #b9aecb; text-decoration: none; }
.acct-who .acct-tier.paid { color: var(--gold, #fdb813); }
.acct-who .acct-tier:hover { text-decoration: underline; background: none; }
.acct-who .acct-tier[hidden] { display: none; }
.acct-menu a, .acct-menu button { display: block; width: 100%; padding: 9px 12px; border-radius: 8px; border: 0; background: none; color: var(--text); font: inherit; font-size: var(--step--1); text-align: left; text-decoration: none; cursor: pointer; }
.acct-menu a:hover, .acct-menu button:hover { background: rgba(255, 255, 255, 0.06); }
.acct-menu [hidden] { display: none; }
.top-actions [data-app="login"][hidden] { display: none; }

/* ---------- your place in a story ---------- */
.since-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; color: #fdd36b; font-size: var(--step--1); font-weight: 600; }
.since-note[hidden] { display: none; }
.link-inline { background: none; border: 0; padding: 0; font: inherit; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- My library ---------- */
.me-hero { padding-block: clamp(32px, 6vw, 64px) 8px; }
.me-hero h1 { font-family: var(--script); font-size: var(--step-4); letter-spacing: -0.02em; }
.me-hero p { margin-top: 8px; color: var(--mist); font-size: var(--step-1); }
.me-small { margin-top: 18px !important; font-size: var(--step--1); }
.me-small a { color: var(--gold); }
.me-shelf { margin-top: 36px; }
#me { padding-bottom: clamp(40px, 6vw, 72px); }
.me-shelf-head h2 { margin: 0; }
.me-shelf-head p { margin-top: 4px; color: #8c829b; font-size: var(--step--1); }
.me-grid { margin-top: 18px; }
.card-progress { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.55); overflow: hidden; }
.card-progress i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #fdb813, #f26522); }
.card-progress ~ .cover-icons { bottom: 22px; }
.card-place { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.75rem; color: #a99bbd; margin-top: -6px; }
.card-place em { padding: 1px 7px; border-radius: 999px; background: rgba(253, 184, 19, 0.16); color: #fdd36b; font-style: normal; font-weight: 700; font-size: 0.7rem; }
.me-writers { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 18px; }
.me-writer { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--night-lift); color: inherit; text-decoration: none; min-width: 0; }
.me-writer:hover { border-color: #6c5a86; }
.me-writer img, .me-writer-photo { flex: none; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(253, 184, 19, 0.45); }
.me-writer-photo { display: grid; place-items: center; background: linear-gradient(140deg, #3a2347, #1d1526); color: #fdd36b; font-weight: 800; font-size: 0.9rem; }
.me-writer-id { display: grid; min-width: 0; }
.me-char img, .me-char .me-sil { border-color: rgba(160, 114, 254, 0.6); object-position: center 22%; }
.me-char.protagonist img, .me-char.protagonist .me-sil { border-color: rgba(80, 160, 255, 0.7); }
.me-char.antagonist img, .me-char.antagonist .me-sil { border-color: rgba(255, 70, 90, 0.65); }
.me-sil { color: #b5aac4; background: var(--night-2); }
.me-sil svg { opacity: 0.55; }
.me-chats { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.me-chat time { flex: none; align-self: flex-start; margin-left: auto; color: #8c829b; font-size: 0.75rem; }
.me-chat .me-writer-id span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chat.gone { opacity: 0.6; }
.me-shelf-head { position: relative; }
.me-all { position: absolute; right: 0; top: 6px; color: var(--gold); font-weight: 600; font-size: var(--step--1); text-decoration: none; }
.me-all:hover { text-decoration: underline; }
@media (max-width: 600px) { .me-all { position: static; display: inline-block; margin-top: 8px; } }
.me-writer-id b, .me-writer-id span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-writer-id span { font-size: 0.78rem; color: #8c829b; }
.me-writer-new { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: rgba(253, 184, 19, 0.16); color: #fdd36b; font-style: normal; font-size: 0.7rem; font-weight: 700; }
.me-notes { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.me-note-link { display: block; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--night-lift); color: inherit; text-decoration: none; }
.me-note-link:hover { border-color: #6c5a86; }
.me-note-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: var(--step--1); }
.me-note-top span { color: #a99bbd; font-family: var(--script); font-size: 0.8rem; text-transform: uppercase; }
.me-note-top time { margin-left: auto; color: #8c829b; font-size: 0.75rem; }
.me-note-quote { display: block; margin-top: 8px; padding-left: 10px; border-left: 3px solid rgba(244, 91, 31, 0.5); color: #c9bfd6; font-family: var(--script); font-size: 0.85rem; quotes: "“" "”"; }
.me-note-link p { margin-top: 8px; color: #e7e0ef; line-height: 1.5; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.me-note-tags { display: flex; gap: 6px; margin-top: 8px; }
.me-note-tags:empty { display: none; }
.me-tag { padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: #a99bbd; font-size: 0.72rem; font-weight: 600; }
.me-tag.replied { background: rgba(126, 224, 176, 0.14); color: #7ee0b0; }
.sk { padding-bottom: 56px; }

/* ---------- header: reader sign-in and the bell ---------- */
.top-actions .reader-signin { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.top-actions .reader-signin[hidden] { display: none !important; }
@media (max-width: 760px) { .top-actions .reader-signin:not([hidden]) { display: inline; } }
.bell { position: relative; }
.chats-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--night-lift); color: var(--text); text-decoration: none; }
.chats-btn:hover, .chats-btn[aria-current="page"] { border-color: #6c5a86; }
.chats-btn[hidden] { display: none; }
.bell[hidden] { display: none; }
.bell-btn { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--night-lift); color: var(--text); cursor: pointer; }
.bell-btn:hover, .bell-btn[aria-expanded="true"] { border-color: #6c5a86; }
.bell-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #f45b1f; color: #fff; font-size: 0.66rem; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--night); }
.bell-badge[hidden] { display: none; }
.bell-panel { position: absolute; right: -54px; top: calc(100% + 10px); z-index: 30; width: min(380px, calc(100vw - 24px)); max-height: min(70vh, 520px); display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line); background: #1d1628; box-shadow: 0 30px 60px -18px rgba(0, 0, 0, 0.9); overflow: hidden; }
.bell-panel[hidden] { display: none; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: var(--step--1); }
.bell-head a { color: var(--gold); text-decoration: none; font-weight: 600; }
.bell-list { overflow-y: auto; padding: 6px; }
.bell-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: start; padding: 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: var(--step--1); line-height: 1.4; }
a.bell-item:hover { background: rgba(255, 255, 255, 0.05); }
.bell-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: transparent; }
.bell-item.unread { background: rgba(253, 184, 19, 0.06); }
.bell-item.unread .bell-dot { background: #fdb813; }
.bell-text { display: grid; gap: 2px; min-width: 0; }
.bell-text em { font-style: normal; color: #8c829b; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bell-item time { color: #8c829b; font-size: 0.72rem; padding-top: 2px; }
.bell-empty { padding: 18px 14px; color: #8c829b; font-size: var(--step--1); line-height: 1.5; }
@media (max-width: 560px) { .bell-panel { position: fixed; left: 12px; right: 12px; top: calc(var(--top-h, 64px) + 4px); width: auto; } }

/* ---------- support the writer ---------- */
.support-btn { gap: 7px; }
.support-btn .heart { color: #fb7185; font-size: 1.05em; }
.btn:not(.btn-ghost).support-btn .heart { color: #9f1239; }
.support-btn small { font-weight: 500; opacity: 0.7; margin-left: -3px; }
.support-band { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 20px 24px; border-radius: 18px; border: 1px solid rgba(251, 113, 133, 0.35); background: linear-gradient(135deg, rgba(251, 113, 133, 0.10), rgba(253, 184, 19, 0.06)); }
.support-band b { font-size: var(--step-1); }
.support-band p { margin-top: 4px; color: var(--mist); font-size: var(--step--1); max-width: 52ch; }
/* Buttons and links styled as buttons the same size side by side */
.story-actions button.btn { font-family: inherit; font-size: inherit; }

/* ── A novel: the book page ── */
.paper.book { font-family: "Literata", Georgia, serif; font-size: clamp(16px, 0.9rem + 0.35vw, 18.5px); line-height: 1.75; max-width: 46rem; margin-inline: auto; }
.paper.book .bk-p { margin: 0; text-indent: 1.6em; }
.paper.book .bk-p.bk-first { text-indent: 0; }
.paper.book em { font-style: italic; }
.paper.book .bk-ch { margin: 3.2em 0 1.8em; text-align: center; font: inherit; font-size: 0.78em; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: #6b7280; display: flex; flex-direction: column; align-items: center; gap: 0.4em; }
.paper.book .bk-ch span { font-size: 1.9em; letter-spacing: 0; text-transform: none; color: var(--ink); }
.paper.book .sc:first-child .bk-ch { margin-top: 0.4em; }
.paper.book .bk-break { margin: 1.2em 0; text-align: center; text-indent: 0; letter-spacing: 0.6em; color: #9ca3af; }
.paper.book .sc-line.bk-line > .bk-p { margin: 0; }
.paper.book .seq-head { font-family: var(--sans, inherit); font-size: 14px; line-height: 1.5; }

/* Pictures from the writer's Visual Bible (dossiers and cards) */
.dossier-portrait { flex: none; width: 92px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; border: 2px solid var(--role, #a78bfa); background: #1d1526; box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.dossier-portrait.wide { width: 168px; aspect-ratio: 16 / 9; }
.tile-pic { display: block; margin: -4px -6px 10px; border-radius: 10px; overflow: hidden; background: #1d1526; aspect-ratio: 4 / 3; }
.tile-pic.wide { aspect-ratio: 16 / 9; }
.tile-pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
button.tile.has-pic:hover .tile-pic img { transform: scale(1.03); }
@media (max-width: 560px) { .dossier-portrait { width: 72px; } .dossier-portrait.wide { width: 120px; } }

/* ---------- key moments: the writer's pictures beside their lines ---------- */
.script-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.script-head .km-switch { font-size: 0.85rem; }
.km-line { position: relative; }
.sc-h { position: relative; }
.km-col { position: absolute; right: -60px; top: -2px; display: flex; flex-direction: column; gap: 6px; z-index: 1; }
.sc-h .km-col { top: -6px; }
.km-thumb { width: 44px; height: 44px; padding: 0; border: 2px solid #fffdf8; border-radius: 9px; overflow: hidden; background: #e8e1d2; cursor: zoom-in; box-shadow: 0 2px 10px rgba(27, 24, 32, 0.25); opacity: 0.9; transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s; }
.km-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.km-thumb:hover, .km-thumb:focus-visible { opacity: 1; transform: scale(1.08); box-shadow: 0 4px 16px rgba(27, 24, 32, 0.35); outline: none; }
.km-note { align-self: center; margin-left: auto; font-family: var(--sans, system-ui, sans-serif); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; text-transform: none; color: #9a8f7a; }
.paper.book .bk-ch .km-note { margin: 0; font-size: 0.72rem; letter-spacing: 0.04em; }
.paper.no-km .km-col, .paper.no-km .km-note { display: none; }
/* narrow screens: no margin to sit in, so the picture tucks under its line, at the right */
@media (max-width: 1000px) {
  .km-col { position: static; flex-direction: row; justify-content: flex-end; margin: -0.5em 0 0.9em; }
  .sc-h .km-col { margin: 0 0 0 8px; }
  .km-thumb { width: 40px; height: 40px; }
}
/* the picture, full screen */
.km-view { position: fixed; inset: 0; z-index: 1000; background: rgba(10, 9, 14, 0.95); display: flex; align-items: center; justify-content: center; gap: 12px; padding: 24px; animation: km-in 0.18s ease-out; }
@keyframes km-in { from { opacity: 0; } to { opacity: 1; } }
.km-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: min(1400px, 92vw); }
.km-big { max-width: 100%; max-height: 78vh; border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); object-fit: contain; }
.km-fig figcaption { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #e9e3d6; text-align: center; }
.km-cap { margin: 0; font-family: "Literata", Georgia, serif; font-style: italic; font-size: 1.02rem; max-width: 60ch; }
.km-count { font-size: 0.75rem; color: #9a8f7a; letter-spacing: 0.08em; }
.km-nav, .km-close { border: 0; background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer; border-radius: 999px; display: grid; place-items: center; }
.km-nav { flex: none; width: 46px; height: 46px; font-size: 1.8rem; line-height: 1; }
.km-nav:hover, .km-close:hover { background: rgba(255, 255, 255, 0.18); }
.km-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; font-size: 1.5rem; }
@media (max-width: 640px) {
  .km-view { padding: 12px; }
  .km-nav { position: absolute; bottom: 20px; }
  .km-prev { left: 24px; } .km-next { right: 24px; }
  .km-big { max-height: 70vh; }
}

/* ---------- the banner at the top of the Library and World (banner.js) ---------- */
.sfb { position: relative; isolation: isolate; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: var(--night-deep); }
.sfb[hidden] { display: none; }
.sfb-track { display: grid; touch-action: pan-y; }
.sfb-slide { grid-area: 1 / 1; position: relative; min-height: clamp(340px, 34vw, 420px); display: flex; align-items: center; opacity: 0; visibility: hidden; transition: opacity 0.5s ease, visibility 0s linear 0.5s; }
.sfb-slide.on { opacity: 1; visibility: visible; z-index: 1; transition: opacity 0.5s ease; }
.sfb-art { position: absolute; inset: 0; overflow: hidden; }
.sfb-art > img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; display: block; }
.sfb-art.feature .sfb-blur { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(30px) brightness(0.45) saturate(1.25); }
.sfb-art.feature .sfb-pic { position: absolute; right: 7%; top: 50%; transform: translateY(-50%); height: 80%; width: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7); }
.sfb-art.feature.is-cover .sfb-pic { height: 72%; top: 45%; aspect-ratio: 2 / 3; border-radius: 10px; border-color: rgba(255, 255, 255, 0.12); }
.sfb-shade { position: absolute; inset: 0; background: linear-gradient(90deg, var(--night-deep) 0%, rgba(15, 12, 22, 0.82) 30%, rgba(15, 12, 22, 0) 62%), linear-gradient(0deg, rgba(15, 12, 22, 0.6), transparent 38%); }
.sfb-copy { position: relative; z-index: 1; box-sizing: border-box; max-width: min(560px, 56%); padding: 40px clamp(24px, 4vw, 48px) 76px; display: flex; flex-direction: column; gap: 14px; }
.sfb-kicker { font-size: var(--step--1); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.sfb-kicker.violet { color: #c4b5fd; }
.sfb-title { font-family: var(--script); font-size: clamp(1.8rem, 3.3vw, 2.6rem); line-height: 1.1; letter-spacing: -0.02em; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5); }
.sfb-title em { font-style: normal; color: var(--gold); }
.sfb-sub { color: #ddd4e8; font-size: var(--step-0); line-height: 1.5; max-width: 34em; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sfb-covers { display: flex; gap: 8px; }
.sfb-covers img { width: 42px; height: 60px; object-fit: cover; border-radius: 5px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55); }
.sfb-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.sfb-ctas .btn-ghost { background: rgba(15, 12, 22, 0.45); }
.sfb-nav { position: absolute; z-index: 2; left: clamp(24px, 4vw, 48px); right: 18px; bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; }
.sfb-nav > * { pointer-events: auto; }
.sfb.single .sfb-nav { display: none; }
.sfb-dots { display: flex; align-items: center; gap: 4px; }
.sfb-dot { width: 22px; height: 32px; padding: 0 4px; border: 0; background: none; cursor: pointer; display: grid; align-items: center; transition: width 0.3s var(--ease-out); }
.sfb-dot.on { width: 44px; }
.sfb-dot i { display: block; height: 4px; border-radius: 2px; background: linear-gradient(var(--gold), var(--gold)) no-repeat left / 0% 100%, rgba(243, 238, 247, 0.3); }
.sfb-dot:hover i, .sfb-dot:focus-visible i { background-color: rgba(243, 238, 247, 0.55); }
.sfb-dot.on i { animation: sfb-fill 7s linear forwards; }
.sfb.paused .sfb-dot.on i { animation-play-state: paused; }
@keyframes sfb-fill { to { background-size: 100% 100%; } }
.sfb-arrows { display: flex; align-items: center; gap: 8px; }
.sfb-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(243, 238, 247, 0.3); background: rgba(15, 12, 22, 0.55); color: var(--text); display: grid; place-items: center; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: border-color 0.2s, background 0.2s; }
.sfb-btn.small { width: 36px; height: 36px; }
.sfb-btn:hover, .sfb-btn:focus-visible { border-color: var(--gold); background: rgba(15, 12, 22, 0.8); }
.sfb-i { display: grid; }
@media (max-width: 640px) {
  .sfb { border-radius: 18px; }
  .sfb-slide { flex-direction: column; align-items: stretch; min-height: 0; }
  .sfb-art { position: relative; inset: auto; aspect-ratio: 4 / 3; }
  .sfb-art > img { object-position: 66% 50%; }
  .sfb-art.feature .sfb-pic { right: auto; left: 50%; transform: translate(-50%, -50%); height: 84%; }
  .sfb-shade { inset: 0 0 auto; aspect-ratio: 4 / 3; background: linear-gradient(0deg, var(--night-deep) 0%, rgba(15, 12, 22, 0) 45%); }
  .sfb-copy { max-width: none; margin-top: -36px; padding: 0 20px 66px; }
  .sfb-sub { -webkit-line-clamp: 5; }
  .sfb-nav { left: 16px; right: 12px; bottom: 12px; }
  .sfb-arrows .sfb-btn:not(.small) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sfb-slide, .sfb-slide.on, .sfb-dot { transition: none; }
  .sfb-dot.on i { animation: none; background-size: 100% 100%; }
}

/* The Library with its banner: the page title stays for screen readers; search sits on the banner's foot */
.lib-hero.has-banner { padding-block: clamp(16px, 2.5vw, 28px) 20px; }
.lib-hero.has-banner > h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lib-hero.has-banner > p { display: none; }
.lib-hero.has-banner .lib-search { position: relative; z-index: 3; margin: -30px clamp(16px, 4vw, 48px) 0; max-width: 680px; padding: 6px; border-radius: 999px; background: #1f1830; border: 1px solid #4a3c66; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7); }
.lib-hero.has-banner .lib-search input { border-color: transparent; background: transparent; padding-block: 11px; }
.lib-hero.has-banner .lib-search input:focus { box-shadow: none; }
.lib-hero.has-banner .lib-search:focus-within { border-color: #6c5a86; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7), 0 0 0 4px rgba(160, 114, 254, 0.14); }
.lib-hero.has-banner .lib-filters { margin-top: 22px; }
@media (max-width: 640px) { .lib-hero.has-banner .lib-search { margin-inline: 10px; } .lib-hero.has-banner .lib-search .btn { padding-inline: 16px; } }
.sfb.off { display: none; }
/* the search box sits over the banner's foot: lift the dots and arrows clear of it */
.lib-hero.has-banner:has(.lib-search) .sfb-nav { bottom: 42px; }
.lib-hero.has-banner:has(.lib-search) .sfb-copy { padding-bottom: 104px; }
@media (max-width: 640px) { .lib-hero.has-banner:has(.lib-search) .sfb-copy { padding-bottom: 94px; } .lib-hero.has-banner:has(.lib-search) .sfb-nav { bottom: 38px; } }

/* ---------- the banner's skeleton (World and the Library): the banner's own boxes, filled with shimmer ---------- */
.sfb.sk { border-color: var(--line); }
.sk-hero-b .sfb { border-color: var(--line); }
.sk-sfb .sfb-slide { opacity: 1; visibility: visible; }
.sk-sfb u.sfb-art { position: absolute; inset: 0 0 0 46%; border-radius: 0; opacity: 0.55; }
.sk-sfb .sfb-copy { gap: 0; }
.sk-sfb .sfb-copy b { height: clamp(30px, 2.9vw, 40px); margin-top: 8px; }
.sk-sfb .sfb-copy i:first-child { margin-top: 0; }
.sk-sfb .sfb-copy b:nth-child(2) { margin-top: 22px; }
.sk-sfb .sfb-copy b + i { margin-top: 22px; }
.sk-sfb .sfb-copy i { height: 13px; margin-top: 14px; }
.sk-sfb u.sk-pill { width: 190px; height: 48px; border-radius: 999px; margin-top: 28px; display: block; }
@media (max-width: 640px) {
  .sk-sfb u.sfb-art { position: relative; inset: auto; opacity: 0.55; }
  .sk-sfb .sfb-copy b { margin-top: 10px; }
  .sk-sfb .sfb-copy i { margin-top: 16px; }
  .sk-sfb .sfb-copy i:nth-last-of-type(1) { margin-bottom: 14px; }
}
.sfb-cover-space { display: block; width: 1px; height: 60px; }
.sfb-sizer { pointer-events: none; }
.sk-sfb .sfb-covers { display: block; }

/* ---------- the Library's shelves while they load: a heading, then cards with a cover, title and writer ---------- */
.sk-lib .shelf-head b { height: 29px; margin: 0; border-radius: 8px; }
.sk-lib .shelf-head i { height: 13px; margin-top: 13px; }
.sk-lib .shelf-row { overflow: hidden; }
.sk-card { display: flex; flex-direction: column; gap: 10px; }
.sk-card u { display: block; aspect-ratio: 2 / 3; border-radius: 10px; }
.sk-card i { height: 14px; margin-top: 2px; }
.sk-card i + i { height: 12px; margin-top: 4px; }
.sk-lib .results-head b { height: 29px; margin: 0; }
/* on phones the featured story's two buttons stack, which makes that slide the tallest: the sizer allows for it */
@media (max-width: 640px) { .lib-hero.has-banner:has(.lib-search) .sfb-sizer .sfb-copy { padding-bottom: 109px; } }

/* My library while it loads: the big heading, then a shelf of covers and a shelf of compact cards */
.sk-mehero { padding: clamp(32px, 4.4vw, 64px) 0 13px; }
.sk-mehero b { width: min(420px, 80%); height: clamp(47px, 6.1vw, 88px); margin: 0; border-radius: 12px; }
.sk-mehero i { width: min(260px, 70%); height: 22px; margin-top: 13px; }
.sk-meshelf { margin-top: 36px; }
.sk-meshelf i.sk-lab { width: 130px; height: 13px; margin-top: 1px; }
.sk-meshelf i.sk-sub { width: min(280px, 70%); height: 14px; margin-top: 9px; }
.sk-meshelf .sk-row { margin-top: 22px; }
.sk-mecards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; margin-top: 22px; }
.sk-mecards u { height: 74px; border-radius: 14px; }

/* ---- Membership (getstoryflux.com/membership) ---- */
.mem-page { max-width: 1080px; padding-bottom: 72px; }
.mem-hero { position: relative; margin: 28px 0 0; border-radius: 24px; overflow: hidden; aspect-ratio: 2.5 / 1; background: #1b1330; box-shadow: 0 40px 90px -40px rgba(124, 58, 237, 0.55); }
.mem-hero img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.03); transition: opacity 0.9s ease, transform 2.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.mem-hero img.in { opacity: 1; transform: none; }
.mem-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 55%, rgba(20, 16, 28, 0.55) 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); border-radius: inherit; }
.mem-head { text-align: center; max-width: 640px; margin: 0 auto 26px; padding: 40px 0 0; }
.mem-head h1 { font-size: var(--step-3, 2.2rem); line-height: 1.1; margin-bottom: 12px; }
.mem-head p { color: var(--mist); }
.mem-now { display: flex; flex-direction: column; gap: 4px; max-width: 640px; margin: 0 auto 26px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.03); font-size: 0.92rem; color: var(--mist); }
.mem-now[hidden] { display: none; }
.mem-now b { color: var(--text); }
.mem-warn { color: #fca5a5; }
.mem-plans { grid-template-columns: repeat(3, 1fr); margin-top: 18px; }
.mem-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; font-size: 0.9rem; flex: 1; }
.mem-perks li { display: flex; gap: 8px; }
.mem-perks li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 0.55em; border-radius: 50%; background: var(--gold, #fdb813); }
.mem-badge { align-self: flex-start; font-size: 0.8rem; font-weight: 600; color: var(--gold, #fdb813); border: 1px solid rgba(253, 184, 19, 0.45); border-radius: 999px; padding: 6px 12px; }
.mem-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mem-mine { outline: 2px solid rgba(253, 184, 19, 0.55); outline-offset: 2px; }
@media (max-width: 860px) { .mem-plans { grid-template-columns: 1fr; } .mem-plans .plan-main { transform: none; } .mem-head { padding-top: 24px; } }
@media (max-width: 700px) { .mem-hero { aspect-ratio: 4 / 3; margin-top: 12px; border-radius: 18px; } }
@media (prefers-reduced-motion: reduce) { .mem-hero img { transition: none; transform: none; } }
.mem-plans .plan p:not(.price) { flex: none; }

/* running low on messages: a small chip by the account button (lib-auth.js) */
.acct-low { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(253, 184, 19, 0.5); background: rgba(253, 184, 19, 0.1); color: #fde68a; font-size: 0.78rem; font-weight: 600; white-space: nowrap; text-decoration: none; animation: acct-low-in 0.35s cubic-bezier(0.7, 0.2, 0.29, 0.98) both; }
.acct-low::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold, #fdb813); }
.acct-low:hover { background: rgba(253, 184, 19, 0.18); }
.acct-low.out { border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.1); color: #fecaca; }
.acct-low.out::before { background: #f87171; }
.acct-low[hidden] { display: none; }
@keyframes acct-low-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (max-width: 520px) { .acct-low { padding: 0 9px; font-size: 0.72rem; } }
@media (prefers-reduced-motion: reduce) { .acct-low { animation: none; } }

/* Membership: monthly / yearly, and packs */
.mem-cycle { display: flex; justify-content: center; gap: 4px; width: max-content; margin: 0 auto; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.mem-cycle button { height: 34px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; color: var(--mist); font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.mem-cycle button.on { background: var(--gold, #fdb813); color: #1a1208; }
.mem-packs { max-width: 820px; margin: 56px auto 0; padding: 32px 28px 30px; border-radius: 22px; border: 1px solid rgba(253, 184, 19, 0.18);
  background: radial-gradient(120% 140% at 50% 0%, rgba(253, 184, 19, 0.08), transparent 60%), linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent); }
.mem-packs[hidden] { display: none; }
.mem-packs-head { text-align: center; max-width: 520px; margin: 0 auto 22px; }
.mem-packs-kick { display: inline-block; padding: 3px 10px; border-radius: 999px; background: rgba(253, 184, 19, 0.14); color: var(--gold, #fdb813); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.mem-packs h2 { font-family: var(--sans, inherit); font-size: var(--step-2, 1.6rem); margin: 10px 0 8px; }
.mem-packs-head p { color: var(--mist); margin: 0; }
.mem-packs-have { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: -6px auto 22px; font-size: 0.85rem; }
.mem-packs-have b { color: var(--text); margin-right: 4px; }
.mem-packs-have span { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--mist); }
.mem-packs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mem-pack { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 18px; border: 1px solid var(--line); background: var(--night-2, #1b1626); text-align: left; transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; }
.mem-pack:hover { transform: translateY(-3px); border-color: rgba(253, 184, 19, 0.45); box-shadow: 0 24px 50px -28px rgba(253, 184, 19, 0.45); }
.mem-pack.voice:hover { border-color: rgba(167, 139, 250, 0.55); box-shadow: 0 24px 50px -28px rgba(167, 139, 250, 0.55); }
.mem-pack-top { display: flex; align-items: center; gap: 12px; }
.mem-pack-top b { display: block; font-size: 1.05rem; }
.mem-pack-top small { display: block; color: var(--mist); font-size: 0.85rem; }
.mem-pack-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(253, 184, 19, 0.12); color: var(--gold, #fdb813); }
.mem-pack-ic.voice { background: rgba(167, 139, 250, 0.14); color: #c4b5fd; }
.mem-pack-price { margin: 0; font-family: var(--script, inherit); font-size: var(--step-3, 2rem); font-weight: 700; line-height: 1; }
.mem-pack-price span { margin-left: 8px; font-family: var(--sans, inherit); font-size: 0.8rem; font-weight: 500; color: var(--mist); }
.mem-pack-gets { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; flex: 1; font-size: 0.92rem; color: var(--mist); }
.mem-pack-gets li { display: flex; align-items: baseline; gap: 6px; }
.mem-pack-gets li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--gold, #fdb813); transform: translateY(-2px); }
.mem-pack.voice .mem-pack-gets li::before { background: #a78bfa; }
.mem-pack-gets strong { color: var(--text); font-size: 1.05rem; }
.mem-pack .btn { align-self: stretch; justify-content: center; text-align: center; }
.mem-hint { margin: 18px 0 0; text-align: center; color: var(--mist); font-size: 0.88rem; }
@media (max-width: 600px) { .mem-packs { padding: 24px 16px; } .mem-packs-row { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .mem-pack { transition: none; } .mem-pack:hover { transform: none; } }

/* Membership: the "your membership" box while it loads */
.mem-now.mem-now-sk { gap: 8px; box-sizing: border-box; overflow: hidden; }
.mem-now-sk b { width: 38%; height: 15px; margin: 2px 0 3px; }
.mem-now-sk i { width: 86%; height: 13px; margin: 3px 0; }
.mem-now-sk i.short { width: 44%; }
