/* ===== DESIGN TOKENS ===== */
:root {
  --paper: #f5f6f2;
  --surface: #ffffff;
  --ink: #20312f;
  --muted: #6d7773;
  --faint: #e5e9e3;
  --line: #20312f;
  --soft-line: #d8dfd8;
  --mint: #9dbdac;
  --danger: #a74035;
  --ui: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --reading: Georgia, "Times New Roman", serif;
  --edge: clamp(20px, 4vw, 48px);
  --content: 1260px;
  color-scheme: light;
}

/* ===== RESET & BASE ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body, button, input, textarea, select { font-family: var(--ui); }
button, input, textarea, select { font-size: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 400; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ===== UTILITIES ===== */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.quiet { color: var(--muted); font-size: .82rem; }
.eyebrow { color: var(--muted); font-size: .63rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.app {
  width: min(var(--content), calc(100% - var(--edge) * 2));
  margin: 0 auto;
  padding: 0 0 84px;
}

/* ===== TOPBAR / HEADER ===== */
.topbar {
  height: 52px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--edge);
  background: rgba(245, 246, 242, .94);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand {
  font-size: .78rem;
  letter-spacing: -.03em;
  font-style: italic;
}
.brand-text strong {
  display: block;
  font-weight: 700;
  font-style: italic;
  font-size: .85rem;
}
.brand-text small { display: none; }
.topnav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.8vw, 36px);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .01em;
}
.topnav a {
  border-bottom: 1px solid transparent;
  padding: 3px 0;
  transition: border-color 0.15s ease;
}
.topnav a:hover { border-color: var(--ink); }

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--soft-line);
  padding: 0;
  background: var(--paper);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 0;
  width: min(var(--content), calc(100% - var(--edge) * 2));
  margin: 0 auto;
  font-size: .75rem;
  color: var(--muted);
}
.footer-inner > * {
  padding: 40px 24px;
  border-right: 1px solid var(--soft-line);
}
.footer-inner > *:last-child { border-right: none; }
.footer-inner > *:first-child { padding-left: 0; }
.footer-brand {
  color: var(--ink);
  font-weight: 700;
  font-style: italic;
  display: block;
  margin-bottom: 6px;
}
.footer-sep { display: none; }

/* ===== SHARED CONTROLS ===== */
.button, .ghost-button, .danger-button, .icon-button {
  align-items: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #ffffff;
  display: inline-flex;
  gap: 6px;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  border-radius: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.button:hover { background: transparent; color: var(--ink); }
.ghost-button, .icon-button { background: transparent; color: var(--ink); }
.ghost-button:hover, .icon-button:hover { background: var(--ink); color: #ffffff; }
.danger-button { background: transparent; border-color: var(--danger); color: var(--danger); }
.danger-button:hover { background: var(--danger); color: #ffffff; }
.icon-button { width: 34px; padding: 0; }
.field, .select-field, .textarea-field {
  border: 1px solid var(--soft-line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  width: 100%;
}
.field, .select-field { height: 38px; padding: 0 10px; }
.textarea-field { line-height: 1.6; min-height: 86px; padding: 9px 10px; resize: vertical; }
.field:focus, .select-field:focus, .textarea-field:focus { border-color: var(--ink); }
.form-label { color: var(--muted); display: grid; font-size: .68rem; font-weight: 600; gap: 5px; letter-spacing: .02em; }
.form-label > span { text-transform: uppercase; }
.checkbox-row { align-items: center; display: inline-flex; gap: 7px; min-height: 38px; color: var(--ink); font-size: .74rem; font-weight: 500; }
.checkbox-row input { accent-color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.wide { grid-column: 1 / -1; }

/* ===== PILLS / TAGS ===== */
.pill {
  border: 1px solid var(--ink);
  border-radius: 100px;
  color: var(--ink);
  display: inline-flex;
  font-size: 10px;
  font-weight: 600;
  line-height: 22px;
  padding: 0 10px;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: .03em;
}
.locked { border-color: var(--danger); color: var(--danger); }
.series-pill { background: var(--ink); color: #ffffff; border-color: var(--ink); }

/* ===== HOME / LANDING ===== */
.editorial-hero {
  padding: clamp(68px, 10vw, 132px) 0 clamp(44px, 6vw, 78px);
  text-align: left;
}
.hero-intro { max-width: 790px; }
.hero-intro .eyebrow { display: block; margin-bottom: 17px; color: #567365; }
.hero-intro h1 {
  font-family: var(--display);
  font-size: clamp(3.25rem, 8vw, 7.4rem);
  font-weight: 700;
  letter-spacing: -.075em;
  line-height: .92;
  margin: 0;
  max-width: 9ch;
  text-transform: none;
}
.hero-intro p:last-child { color: var(--muted); display: block; font-size: clamp(1rem, 1.5vw, 1.18rem); line-height: 1.7; margin-top: 24px; max-width: 48ch; }
.catalog { padding-bottom: 86px; }
.catalog-controls {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 0 0 22px;
}
.category-filter { align-items: center; display: flex; flex: 1; flex-wrap: wrap; gap: 7px; }
.category-filter > span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .07em; margin-right: 8px; text-transform: uppercase; }
.filter-chip {
  background: #e9eee9;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 26px;
  padding: 0 11px;
  text-transform: uppercase;
}
.filter-chip:hover, .filter-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.catalog-tools { align-items: center; display: flex; flex: 0 1 440px; gap: 8px; justify-content: flex-end; }
.series-filter { background: var(--surface); border: 1px solid transparent; border-radius: 999px; color: var(--ink); font-size: 10px; height: 34px; max-width: 155px; padding: 0 10px; }
.catalog-search { display: flex; flex: 0 1 270px; position: relative; }
.catalog-search .field { background: var(--surface); border-color: transparent; border-radius: 999px; height: 34px; padding: 0 38px 0 13px; }
.search-button { background: transparent; border: 0; color: var(--ink); font-size: 21px; line-height: 1; padding: 0; position: absolute; right: 11px; top: 3px; }
.catalog-count { color: var(--muted); font-size: 10px; letter-spacing: .04em; margin: 0; padding: 0 0 18px; text-transform: uppercase; }
.catalog-empty { grid-column: 1 / -1; margin: 0; padding: 36px 20px; }
.subscribe-section { align-items: center; background: #e1ebe3; border-radius: 18px; display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr) minmax(300px, .85fr); margin-top: 52px; padding: clamp(24px, 4vw, 48px); }
.subscribe-section h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 700; letter-spacing: -.045em; margin: 5px 0; }
.subscribe-section p:not(.eyebrow) { color: var(--muted); font-size: .82rem; }
.subscribe-section form { align-items: center; display: grid; gap: 9px; grid-template-columns: 1fr 1fr auto; }
.subscribe-section .message { color: #3f6858; font-size: .74rem; grid-column: 1 / -1; }
.affiliate-bear { bottom: 18px; left: 18px; position: fixed; z-index: 90; }
.affiliate-bear-link { align-items: center; background: #fff4d9; border: 1px solid #201d17; border-radius: 18px; box-shadow: 3px 3px 0 #201d17; display: flex; gap: 7px; min-height: 47px; padding: 7px 12px 7px 9px; position: relative; transition: transform .15s ease, box-shadow .15s ease; }
.affiliate-bear-link:hover { box-shadow: 1px 1px 0 #201d17; transform: translate(2px, 2px); }
.bear-face { align-items: center; background: #b8794c; border: 1px solid #201d17; border-radius: 48% 48% 45% 45%; color: #fff4d9; display: flex; font-size: 10px; height: 28px; justify-content: center; position: relative; width: 30px; }
.bear-face::before, .bear-face::after { background: #201d17; border-radius: 50%; content: ""; height: 3px; position: absolute; top: 8px; width: 3px; }
.bear-face::before { left: 7px; }.bear-face::after { right: 7px; }
.bear-ears::before, .bear-ears::after { background: #b8794c; border: 1px solid #201d17; border-radius: 50%; content: ""; height: 11px; position: absolute; top: 3px; width: 11px; z-index: 0; }
.bear-ears::before { left: 11px; }.bear-ears::after { left: 31px; }
.affiliate-label { font-size: 10px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.affiliate-close { align-items: center; background: var(--ink); border: 1px solid var(--ink); border-radius: 50%; color: white; display: flex; font-size: 14px; height: 17px; justify-content: center; line-height: 1; padding: 0 0 2px; position: absolute; right: -7px; top: -7px; width: 17px; z-index: 2; }
.affiliate-close:hover { background: white; color: var(--ink); }

/* ===== FEATURED STORY — HIDDEN ===== */
.featured-story { display: none; }

/* ===== CATEGORY NAVIGATION ===== */
.catalog-nav {
  align-items: center;
  border-bottom: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 clamp(28px, 4vw, 50px);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  justify-content: center;
  margin-bottom: 0;
}
.catalog-nav > span {
  color: var(--muted);
  margin-right: 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.catalog-nav a {
  border: 1px solid var(--ink);
  border-radius: 100px;
  padding: 5px 14px;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
}
.catalog-nav a:hover,
.catalog-nav a:first-of-type {
  background: var(--ink);
  color: #ffffff;
  text-decoration: none;
}

/* ===== HOME SECTIONS ===== */
.home-section, .search-section { margin: 0 0 0; scroll-margin-top: 68px; }
.section-heading {
  align-items: flex-end;
  border-bottom: none;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-height: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}
.section-heading h2 {
  font-family: var(--display);
  font-size: 0;
  letter-spacing: 0;
  line-height: 0;
  visibility: hidden;
  height: 0;
  margin: 0;
  padding: 0;
}

/* ===== STORY GRID ===== */
.story-grid {
  display: grid;
  gap: clamp(18px, 2.3vw, 30px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.story-card {
  min-width: 0;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(29, 48, 43, .04), 0 9px 24px rgba(29, 48, 43, .045);
  overflow: hidden;
  transition: box-shadow .22s ease, transform .22s ease;
}
.story-card:hover { box-shadow: 0 12px 30px rgba(29, 48, 43, .12); transform: translateY(-4px); }
.story-card-link { display: block; height: 100%; }
.story-card-link:hover { opacity: 1; }

/* Card cover */
.story-card-cover {
  background: #dbe3dc;
  position: relative;
  overflow: hidden;
}
.story-card-cover img {
  aspect-ratio: 1.45 / 1;
  object-fit: cover;
  width: 100%;
  transition: transform 0.3s ease;
}
.story-card-link:hover .story-card-cover img {
  transform: scale(1.02);
}
.card-flag {
  background: rgba(32, 49, 47, .9);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 999px;
  left: 13px;
  padding: 4px 8px;
  position: absolute;
  text-transform: uppercase;
  top: 13px;
  letter-spacing: .04em;
}

/* Card copy */
.story-card-copy {
  display: flex;
  flex-direction: column;
  min-height: 224px;
  padding: 19px 20px 21px;
}
.card-kicker {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 11px;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 15px;
  font-weight: 400;
}
.card-kicker .pill {
  font-size: 9px;
  line-height: 20px;
  padding: 0 8px;
}
.story-card h3 {
  font-family: var(--display);
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
}
.series-label {
  color: var(--muted);
  font-size: .65rem;
  margin-top: 4px;
}
.card-synopsis {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--muted);
  display: -webkit-box;
  font-size: 13px;
  line-height: 1.65;
  margin: 12px 0 16px;
  overflow: hidden;
}

/* HIDE stats (views, chapters) per design spec */
.card-stats { display: none; }

/* READ MORE link */
.text-link {
  border-bottom: 0;
  color: #3f6858;
  font-size: 10px;
  font-weight: 700;
  margin-top: auto;
  padding-bottom: 0;
  text-transform: uppercase;
  width: max-content;
  letter-spacing: .06em;
}
.story-card-link:hover .text-link { color: var(--ink); }

.comment-section { border-top: 1px solid var(--soft-line); margin-top: 60px; padding-top: 30px; }
.comment-section .section-heading h2 { font-size: 1.7rem; height: auto; line-height: 1.1; visibility: visible; }
.comment-list { display: grid; gap: 12px; margin: 24px 0; max-width: 720px; }
.comment { background: var(--surface); border-radius: 12px; padding: 17px 19px; }
.comment strong { font-size: .82rem; }
.comment time { color: var(--muted); font-size: .68rem; margin-left: 9px; }
.comment p { color: var(--muted); font-size: .84rem; margin-top: 7px; }
.comment-form { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; max-width: 720px; }
.comment-form textarea, .comment-form .message { grid-column: 1 / -1; }
.comment-form .message { color: #3f6858; font-size: .74rem; }

/* ===== CONTINUE READING ===== */
.continue-list { border-bottom: 1px solid var(--line); }
.continue-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 13px;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  padding: 9px 0;
}
.continue-item img { aspect-ratio: 1; object-fit: cover; width: 48px; }
.continue-item strong, .continue-item small { display: block; }
.continue-item strong { font-family: var(--display); font-size: .9rem; font-weight: 600; }
.continue-item small { color: var(--muted); font-size: .65rem; }
.continue-item i { background: var(--faint); display: block; height: 3px; margin-top: 6px; max-width: 180px; }
.continue-item i b { background: var(--ink); display: block; height: 100%; }
.continue-item em { font-size: .65rem; font-style: normal; }

/* ===== SERIES STRIP ===== */
.series-strip {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.series-tile {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 125px;
  padding: 18px;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.series-tile:last-child { border-right: 0; }
.series-tile:hover { background: var(--ink); color: #ffffff; }
.series-tile span, .series-tile small { font-size: .61rem; }
.series-tile small { margin-top: auto; opacity: .7; }
.series-tile strong { font-size: 1.1rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin-top: 8px; }

/* ===== CATEGORY INDEX ===== */
.category-index { display: flex; flex-wrap: wrap; gap: 0; padding-top: 15px; }
.category-link {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--soft-line);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 16px 13px 0;
  padding: 0 0 2px;
  transition: border-color 0.15s ease;
}
.category-link:hover { border-color: var(--ink); }
.category-link span { color: var(--muted); font-size: .62rem; margin-left: 3px; }

/* ===== RANDOM PICK ===== */
.random-pick {
  align-items: center;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding: 24px 0;
}
.random-pick h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.03em; margin: 6px 0; }

/* ===== STORY PAGE ===== */
.story-hero {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(155px, 240px) minmax(0, 1fr) minmax(150px, 215px);
  gap: clamp(20px, 4vw, 65px);
  padding: clamp(38px, 7vw, 96px) 0 39px;
}
.story-poster { border: 1px solid var(--line); height: max-content; }
.story-poster img { aspect-ratio: 2 / 3; object-fit: cover; width: 100%; }
.story-overview h1 {
  font-family: var(--display);
  font-size: clamp(2.05rem, 5vw, 5.25rem);
  font-weight: 800;
  letter-spacing: -.06em;
  line-height: .98;
  margin: 10px 0 14px;
}
.story-byline { color: var(--muted); font-size: .75rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 17px 0; }
.story-synopsis { color: var(--muted); font-size: 1rem; line-height: 1.65; max-width: 57ch; }
.story-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 23px; }
.story-actions .is-active { background: var(--ink); color: #ffffff; }
.story-facts { align-content: start; border-top: 1px solid var(--line); display: grid; margin: 4px 0 0; }
.story-facts div { border-bottom: 1px solid var(--soft-line); padding: 10px 0; }
.story-facts dt { color: var(--muted); font-size: .59rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.story-facts dd { font-size: .85rem; font-weight: 600; margin: 3px 0 0; }
.story-tags { align-items: flex-start; border-bottom: 1px solid var(--line); display: flex; gap: 30px; padding: 15px 0; }
.story-tags > span { color: var(--muted); font-size: .63rem; font-weight: 700; padding-top: 3px; text-transform: uppercase; }
.story-tags .chip-row { margin: 0; }

/* ===== CHAPTERS ===== */
.chapter-section { margin: 56px 0; }
.chapter-list { border-bottom: 1px solid var(--line); }
.chapter-row {
  align-items: center;
  border-bottom: 1px solid var(--soft-line);
  display: grid;
  gap: 14px;
  grid-template-columns: 41px minmax(0, 1fr) auto 18px;
  min-height: 64px;
  transition: background 0.15s ease;
}
.chapter-row:first-child { border-top: 0; }
.chapter-row:hover { background: rgba(17,17,15,.04); }
.chapter-number { font-size: .8rem; text-align: center; font-weight: 600; }
.chapter-row-copy strong, .chapter-row-copy small { display: block; }
.chapter-row-copy strong { font-size: .91rem; font-weight: 500; letter-spacing: -.025em; }
.chapter-row-copy small { color: var(--muted); font-size: .63rem; margin-top: 2px; }
.arrow { color: var(--muted); font-size: .9rem; }

/* ===== READER ===== */
.reader-shell { --reader-paper: #fbfaf5; --reader-ink: #171613; --reader-muted: #77736a; background: var(--reader-paper); color: var(--reader-ink); left: 0; min-height: calc(100vh - 52px); padding-bottom: 37px; position: relative; width: 100%; }
.reader-sepia { --reader-paper: #eee5d3; --reader-ink: #332b22; --reader-muted: #786d61; }
.reader-night { --reader-paper: #1b1b19; --reader-ink: #f0eee7; --reader-muted: #b9b3a8; }
.reading-progress { background: color-mix(in srgb, var(--reader-ink) 10%, transparent); height: 3px; left: 0; position: fixed; right: 0; top: 52px; z-index: 20; }
.reading-progress i { background: var(--reader-ink); display: block; height: 100%; }
.reader-top, .reader-bottom { align-items: center; display: flex; font-size: .67rem; justify-content: space-between; margin: 0 auto; max-width: 920px; padding: 15px 0; width: min(100% - var(--edge) * 2, 920px); }
.reader-top span { display: flex; gap: 15px; }
.reader-top a:hover { text-decoration: underline; text-underline-offset: 3px; }
.reader-tools { align-items: center; border-bottom: 1px solid color-mix(in srgb, var(--reader-ink) 40%, transparent); border-top: 1px solid color-mix(in srgb, var(--reader-ink) 40%, transparent); display: flex; gap: 5px; justify-content: flex-end; margin: 0 auto; max-width: 920px; padding: 7px 0; width: min(100% - var(--edge) * 2, 920px); }
.reader-tools > span { color: var(--reader-muted); font-size: .59rem; margin-right: auto; text-transform: uppercase; }
.reader-tools .icon-button { border-color: color-mix(in srgb, var(--reader-ink) 50%, transparent); color: var(--reader-ink); }
.reader-tools .icon-button:hover { background: var(--reader-ink); color: var(--reader-paper); }
.reader-page { border-bottom: 1px solid color-mix(in srgb, var(--reader-ink) 38%, transparent); margin: 0 auto; max-width: 720px; padding: clamp(39px, 6vw, 84px) 0; width: min(100% - var(--edge) * 2, 720px); }
.reader-page.reader-wide { max-width: 900px; width: min(100% - var(--edge) * 2, 900px); }
.reader-page header { border-bottom: 1px solid color-mix(in srgb, var(--reader-ink) 35%, transparent); padding-bottom: 24px; }
.reader-page .eyebrow, .reader-page .reader-subtitle { color: var(--reader-muted); }
.reader-page h1 { font-family: var(--display); font-size: clamp(1.7rem, 3.6vw, 3.15rem); font-weight: 700; letter-spacing: -.05em; line-height: 1.08; margin: 9px 0; }
.reader-subtitle { font-size: .67rem; }
.chapter-body { font-family: var(--reading); font-size: 1.13rem; letter-spacing: .003em; padding-top: 37px; }
.chapter-body p { margin-bottom: 1.4em; }
.chapter-end-mark { color: var(--reader-muted); font-size: .82rem; padding-top: 27px; text-align: center; }
.reader-bottom { padding-top: 22px; }
.locked-panel { border: 1px solid color-mix(in srgb, var(--reader-ink) 45%, transparent); margin-top: 30px; padding: 32px; text-align: center; }
.locked-panel h2 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.04em; margin: 7px 0; }
.locked-panel > p { color: var(--reader-muted); font-size: .79rem; }
.locked-form { display: grid; gap: 10px; margin: 22px auto 0; max-width: 320px; text-align: left; }
.message { font-size: .7rem; min-height: 16px; }
.error { color: var(--danger); }

/* ===== META LINE ===== */
.meta-line { color: var(--muted); display: flex; flex-wrap: wrap; font-size: .7rem; gap: 10px; margin: 17px 0 22px; }
.meta-line span + span::before { content: "·"; margin-right: 10px; }

/* ===== CMS ===== */
.cms-head { align-items: flex-end; border-bottom: 1px solid var(--line); display: flex; gap: 22px; justify-content: space-between; padding: 43px 0 14px; }
.cms-head h1 { font-family: var(--display); font-size: clamp(1.6rem, 3vw, 2.8rem); font-weight: 700; letter-spacing: -.05em; margin-top: 5px; }
.cms-nav { align-items: center; display: flex; flex-wrap: wrap; gap: 5px; }
.cms-nav button { background: transparent; border: 1px solid transparent; color: var(--muted); font-size: .65rem; padding: 5px 7px; }
.cms-nav button:hover, .cms-nav .active { border-color: var(--line); color: var(--ink); }
.metric-grid { border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(6, 1fr); margin-bottom: 35px; }
.metric { border-right: 1px solid var(--line); display: grid; gap: 4px; min-height: 100px; padding: 16px; }
.metric:last-child { border-right: 0; }
.metric span { color: var(--muted); font-size: .61rem; text-transform: uppercase; }
.metric strong { font-size: 1.7rem; font-weight: 700; letter-spacing: -.04em; }
.cms-panel { border: 1px solid var(--line); margin: 0 0 18px; padding: 20px; }
.trend-list { display: grid; grid-template-columns: repeat(4, 1fr); margin: 20px 0 0; }
.trend-list div { border-left: 1px solid var(--soft-line); min-height: 68px; padding: 0 14px; }
.trend-list div:first-child { border-left: 0; padding-left: 0; }
.trend-list dt { color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.trend-list dd { font-size: .9rem; font-weight: 600; margin: 6px 0 0; }
.quick-start { align-items: center; display: flex; justify-content: space-between; }
.quick-start h2 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.04em; margin: 5px 0; }
.quick-start p:not(.eyebrow) { color: var(--muted); font-size: .78rem; max-width: 60ch; }
.field-note { color: var(--muted); font-size: .65rem; font-weight: 400; text-transform: none; }
.analytics-grid { border: 1px solid var(--soft-line); grid-template-columns: repeat(4, 1fr); margin-top: 18px; }
.analytics-grid .metric { min-height: 88px; }
.analytics-grid .metric small { color: var(--muted); font-size: .6rem; }
.analytics-note { color: var(--muted); font-size: .68rem; margin-top: 12px; }
.analytics-lists { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.analytics-lists h2 { font-size: 1.1rem; font-weight: 700; letter-spacing: -.03em; margin: 4px 0 12px; }
.analytics-table { border-top: 1px solid var(--soft-line); }
.analytics-table > div { border-bottom: 1px solid var(--soft-line); display: grid; gap: 3px; padding: 9px 0; }
.analytics-table strong { font-size: .74rem; font-weight: 600; line-height: 1.35; }
.analytics-table span { color: var(--muted); font-size: .63rem; }
.cms-toolbar { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; margin: 17px 0; }
.cms-toolbar .field { margin-left: auto; max-width: 260px; }
.import-help { color: var(--muted); font-size: .68rem; margin: -8px 0 15px; }
.code-area { background: #171717; color: #f5f2e9; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .76rem; }
.admin-list { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.admin-list-row { align-items: center; background: transparent; border: 0; border-bottom: 1px solid var(--soft-line); display: flex; gap: 11px; padding: 9px 0; text-align: left; width: 100%; transition: background 0.15s ease; }
.admin-list-row:hover { background: rgba(17,17,15,.04); }
.admin-list-row img { aspect-ratio: 1; object-fit: cover; width: 39px; }
.admin-list-row > :last-child { margin-left: auto; }
.admin-list-info { display: grid; gap: 2px; }
.admin-list-info strong { font-size: .95rem; font-weight: 600; letter-spacing: -.03em; }
.admin-list-info small { color: var(--muted); font-size: .63rem; }
.editor-head { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 11px; justify-content: space-between; padding: 17px 0; }
.editor-head > div { display: flex; gap: 6px; }
.story-form .section-heading, .chapter-manager .section-heading { margin-bottom: 17px; }
.story-form .section-heading h2,
.chapter-manager .section-heading h2 {
  font-size: clamp(1.05rem, 1.8vw, 1.5rem);
  visibility: visible;
  height: auto;
  line-height: 1;
  font-weight: 700;
}
.toggle-set { display: flex; flex-wrap: wrap; gap: 16px; }
.chapter-manager-grid { display: grid; grid-template-columns: 215px minmax(0, 1fr); gap: 23px; }
.chapter-picker { border-top: 1px solid var(--soft-line); }
.chapter-pick-btn { background: transparent; border: 0; border-bottom: 1px solid var(--soft-line); display: grid; grid-template-columns: 15px minmax(0, 1fr); padding: 9px 0; text-align: left; width: 100%; }
.chapter-pick-btn:hover, .chapter-pick-btn.active { background: rgba(17,17,15,.06); }
.chapter-pick-btn strong { font-size: .82rem; font-weight: 500; letter-spacing: -.025em; }
.chapter-pick-btn small { color: var(--muted); font-size: .59rem; grid-column: 2; }
.drag-handle { color: var(--muted); font-size: .75rem; grid-row: span 2; }
.chapter-form .form-grid { margin: 13px 0; }
.rich-area { font-family: var(--reading); font-size: .94rem; }
.chapter-tools, .inline-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.chapter-tools label { align-items: center; cursor: pointer; }
.login-panel { border: 1px solid var(--line); margin: 70px auto; max-width: 410px; padding: 32px; }
.login-panel h1 { font-size: 2.1rem; font-weight: 800; letter-spacing: -.05em; margin: 8px 0; }
.login-panel > p:not(.eyebrow) { color: var(--muted); font-size: .78rem; }
.login-panel form { display: grid; gap: 11px; margin-top: 25px; }
.settings-divider { border-top: 1px solid var(--soft-line); margin: 24px 0 16px; padding-top: 18px; }
.settings-divider .quiet { margin-top: 4px; }
.settings-help { color: var(--muted); font-size: .68rem; margin: 12px 0 16px; }
.settings-help code { background: var(--faint); color: var(--ink); padding: 1px 4px; }
.empty-state { border-bottom: 1px solid var(--line); margin: 90px auto; max-width: 520px; padding: 28px 0; text-align: center; }
.empty-state h1 { font-size: 2.3rem; font-weight: 800; letter-spacing: -.05em; margin: 8px 0 15px; }

/* ===== LOADING ===== */
.loading-screen { align-items: center; display: flex; flex-direction: column; justify-content: center; min-height: 300px; }
.loading-dots { display: flex; gap: 5px; }
.loading-dots span { animation: blink .9s infinite alternate; background: var(--ink); border-radius: 50%; display: block; height: 5px; width: 5px; }
.loading-dots span:nth-child(2) { animation-delay: .15s; }
.loading-dots span:nth-child(3) { animation-delay: .3s; }
.loading-label { color: var(--muted); font-size: .7rem; margin-top: 9px; }
@keyframes blink { to { opacity: .25; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .story-hero { grid-template-columns: 170px minmax(0, 1fr); }
  .story-facts { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .story-facts div { border-right: 1px solid var(--soft-line); padding: 9px 12px; }
  .story-facts div:first-child { padding-left: 0; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .metric:nth-child(3n) { border-right: 0; }
  .metric:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .trend-list { grid-template-columns: repeat(2, 1fr); gap: 15px 0; }
  .chapter-manager-grid { grid-template-columns: 175px minmax(0, 1fr); }
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-lists { grid-template-columns: 1fr; }
  .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner > *:nth-child(2) { border-right: none; }
}

@media (max-width: 640px) {
  .topbar { height: 48px; }
  .topnav { gap: 12px; font-size: 11px; }
  .topnav a:nth-child(2) { display: none; }
  .app { padding-bottom: 54px; }
  .editorial-hero { padding-top: 50px; padding-bottom: 40px; }
  .hero-intro h1 { font-size: clamp(2.8rem, 16vw, 5rem); }
  .catalog-controls { align-items: stretch; flex-direction: column; gap: 12px; }
  .category-filter { gap: 6px; }
  .category-filter > span { width: 100%; }
  .catalog-tools { flex-basis: auto; justify-content: stretch; width: 100%; }
  .series-filter { flex: 0 0 42%; max-width: none; }
  .catalog-search { flex-basis: auto; flex: 1; width: auto; }
  .subscribe-section { grid-template-columns: 1fr; }
  .subscribe-section form { grid-template-columns: 1fr; }
  .affiliate-bear { bottom: 12px; left: 12px; }
  .catalog-nav { gap: 6px; }
  .catalog-nav > span { width: 100%; text-align: center; margin-right: 0; }
  .story-grid { grid-template-columns: 1fr; }
  .story-card-copy { min-height: 180px; }
  .series-strip { grid-template-columns: 1fr 1fr; }
  .series-tile:nth-child(2n) { border-right: 0; }
  .story-hero { grid-template-columns: 122px minmax(0, 1fr); gap: 16px; padding-top: 35px; }
  .story-overview h1 { font-size: clamp(1.75rem, 10vw, 2.8rem); }
  .story-facts { grid-template-columns: 1fr 1fr; }
  .story-facts div:nth-child(2n) { border-right: 0; }
  .story-tags { gap: 14px; }
  .chapter-row { gap: 8px; grid-template-columns: 33px minmax(0, 1fr) auto 13px; }
  .chapter-row .pill { display: none; }
  .reader-shell { margin-left: calc((100vw - 100%) / -2); width: 100vw; }
  .reader-top, .reader-bottom, .reader-tools, .reader-page { width: calc(100% - var(--edge) * 2); }
  .reader-page { padding-top: 49px; }
  .reader-bottom .button, .reader-bottom .ghost-button { font-size: .61rem; padding: 0 8px; }
  .cms-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .cms-nav { width: 100%; }
  .cms-toolbar .field { margin-left: 0; max-width: none; order: 2; width: 100%; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(n) { border-right: 1px solid var(--line); }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .trend-list { grid-template-columns: 1fr; }
  .trend-list div { border-left: 0; border-top: 1px solid var(--soft-line); padding: 10px 0; }
  .trend-list div:first-child { border-top: 0; }
  .quick-start { align-items: flex-start; flex-direction: column; gap: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .chapter-manager-grid { grid-template-columns: 1fr; }
  .chapter-picker { display: grid; grid-template-columns: 1fr 1fr; }
  .chapter-pick-btn:nth-child(odd) { border-right: 1px solid var(--soft-line); }
  .editor-head { align-items: flex-start; flex-wrap: wrap; }
  .editor-head .message { order: 3; width: 100%; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-inner > * { border-right: none; border-bottom: 1px solid var(--soft-line); padding: 24px 0; }
  .footer-inner > *:last-child { border-bottom: none; }
}

@media print {
  .topbar, .site-footer, .reader-top, .reader-tools, .reader-bottom, .reading-progress { display: none; }
  .reader-page { max-width: none; width: 100%; }
}
