/* VEIL v50 — MASTER UI */
:root {
  --bg: #050812;
  --bg-soft: #090f19;
  --surface: rgba(12, 18, 30, 0.94);
  --surface-2: rgba(17, 24, 39, 0.98);
  --text: #f4f5f7;
  --muted: #aeb6c4;
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.22);
  --accent: #ff3d70;
  --accent-cool: #8dc9ff;
  --accent-soft: rgba(255, 61, 112, 0.13);
  --danger: #ff6b6b;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
  --header: rgba(4, 8, 16, 0.66);
}

html[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-soft: #eaedf2;
  --surface: rgba(255, 255, 255, 0.97);
  --surface-2: rgba(248, 249, 251, 0.99);
  --text: #171b24;
  --muted: #5f6979;
  --line: rgba(23, 27, 36, 0.12);
  --line-strong: rgba(23, 27, 36, 0.2);
  --accent: #d72759;
  --accent-cool: #4f87b8;
  --accent-soft: rgba(215, 39, 89, 0.08);
  --danger: #bd2d3d;
  --shadow: 0 30px 90px rgba(41, 48, 63, 0.14);
  --header: rgba(246, 247, 249, 0.72);
}

html[data-theme="black"] {
  --bg: #000000;
  --bg-soft: #030303;
  --surface: rgba(5, 5, 5, 0.98);
  --surface-2: rgba(9, 9, 9, 0.99);
  --text: #f5f5f5;
  --muted: #999999;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --accent: #ff3d70;
  --accent-cool: #8dc9ff;
  --accent-soft: rgba(141, 201, 255, 0.10);
  --danger: #ff6b6b;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  --header: rgba(0, 0, 0, 0.78);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
  transition: background .3s ease, color .3s ease;
}
button, a, input, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent-cool); outline-offset: 3px; }


.sr-only { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
.chapter-add-controls { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.chapter-add-controls .small-select { width:auto; min-width:150px; max-width:220px; }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: 78px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 4.2vw;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-left {
  display: flex;
  align-items: center;
  justify-self: start;
  gap: 14px;
}

.brand, .main-nav, .header-actions { display: flex; align-items: center; }
.brand { gap: 12px; }
.brand-mark { width: 29px; height: 29px; display: grid; place-items: center; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-name { font-size: .92rem; font-weight: 700; letter-spacing: .26em; }

.main-nav { position: relative; height: 100%; gap: 38px; justify-content: center; }
.nav-link { position: relative; display: flex; align-items: center; height: 100%; color: var(--muted); font-size: .96rem; font-weight: 600; transition: color .2s ease; }
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-indicator { position: absolute; left: 0; bottom: 0; width: 0; height: 2px; background: var(--text); border-radius: 99px; transition: transform .28s cubic-bezier(.2,.8,.2,1), width .28s cubic-bezier(.2,.8,.2,1); }

.menu-toggle {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--accent-soft);
}

.menu-toggle-icon {
  position: relative;
  width: 18px;
  height: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.menu-bar {
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .22s ease, opacity .22s ease;
}

.menu-toggle.is-open .menu-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.is-open .menu-bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open .menu-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.menu-panel {
  position: fixed;
  top: 78px;
  left: 24px;
  z-index: 60;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.menu-panel[hidden] {
  display: none;
}

.menu-panel-inner {
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.menu-item {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.menu-item:hover,
.menu-item:focus-visible {
  background: var(--accent-soft);
}

.header-actions { justify-content: flex-end; gap: 10px; }
.login-btn, .theme-toggle, .primary-btn, .secondary-btn, .danger-btn {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
}
.login-btn:hover, .theme-toggle:hover, .secondary-btn:hover { transform: translateY(-1px); border-color: var(--line-strong); background: var(--accent-soft); }
.login-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; }
.login-btn svg { width: 17px; height: 17px; }
.theme-toggle {
  position: relative;
  width: 82px;
  height: 38px;
  flex: 0 0 82px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform .2s ease, border-color .2s ease, background .25s ease, box-shadow .25s ease;
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--accent-soft);
  box-shadow: 0 8px 24px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.08);
}
.theme-toggle:active { transform: translateY(0); }
.theme-icon {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 30px;
  justify-self: center;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  transition: color .25s ease, transform .25s ease, opacity .25s ease;
}
.theme-thumb {
  position: absolute;
  z-index: 1;
  top: 5px;
  left: 5px;
  width: 24px;
  height: 26px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 5px 14px rgba(0,0,0,.22);
  transition: left .28s cubic-bezier(.2,.8,.2,1), background .25s ease, box-shadow .25s ease;
  pointer-events: none;
}
.theme-toggle:not(.is-light):not(.is-black) .theme-moon { color: var(--bg); transform: scale(1.04); }
.theme-toggle:not(.is-light):not(.is-black) .theme-sun,
.theme-toggle:not(.is-light):not(.is-black) .theme-black-mark { opacity: .62; }
.theme-toggle.is-light { background: rgba(15,23,42,.06); }
.theme-toggle.is-light .theme-thumb {
  left: 29px;
  background: var(--bg-soft);
  box-shadow: 0 5px 14px rgba(38,45,61,.18);
}
.theme-toggle.is-light .theme-sun { color: var(--text); transform: scale(1.04); }
.theme-toggle.is-light .theme-moon,
.theme-toggle.is-light .theme-black-mark { opacity: .62; color: var(--muted); }
.theme-toggle.is-black { background: #000; border-color: rgba(255,255,255,.22); }
.theme-toggle.is-black .theme-thumb {
  left: 53px;
  background: #f5f5f5;
  box-shadow: 0 5px 16px rgba(255,255,255,.12);
}
.theme-toggle.is-black .theme-black-mark { color: #000; transform: scale(.82); }
.theme-toggle.is-black .theme-sun,
.theme-toggle.is-black .theme-moon { opacity: .58; color: #b8b8b8; }

.hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; background: #050812 url("hero-art.jpeg") center 43% / cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 70% 46%, transparent 0 27%, rgba(0,0,0,.22) 74%, rgba(0,0,0,.45) 100%); transition: background .35s ease; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3,7,16,.92) 0%, rgba(3,7,16,.60) 34%, rgba(3,7,16,.12) 72%, rgba(3,7,16,.16) 100%), linear-gradient(0deg, rgba(3,6,13,.55) 0%, transparent 35%, rgba(3,6,13,.18) 100%); transition: background .35s ease; }
html[data-theme="light"] .hero-overlay { background: linear-gradient(90deg, rgba(244,245,247,.70) 0%, rgba(244,245,247,.38) 34%, rgba(244,245,247,.06) 72%, rgba(244,245,247,.08) 100%), linear-gradient(0deg, rgba(244,245,247,.18) 0%, transparent 42%, rgba(244,245,247,.05) 100%); }
html[data-theme="light"] .hero::after { background: radial-gradient(circle at 70% 46%, transparent 0 30%, rgba(255,255,255,.04) 74%, rgba(255,255,255,.12) 100%); }
.hero-content { position: relative; z-index: 2; width: min(760px, 88vw); margin-left: 8vw; padding-top: 6vh; }
.eyebrow, .section-kicker { margin: 0 0 18px; font-size: .71rem; letter-spacing: .26em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.hero h1 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(5rem, 11vw, 9.5rem); font-weight: 600; line-height: .78; letter-spacing: .025em; text-shadow: 0 10px 32px rgba(0,0,0,.3); }
.title-rule { width: 96px; height: 2px; margin: 30px 0 23px; background: linear-gradient(90deg, var(--accent-cool), rgba(141,201,255,0)); }
.hero-description { max-width: 580px; margin: 0 0 38px; font-size: clamp(1rem, 1.45vw, 1.2rem); line-height: 1.7; color: #e8edf7; white-space: pre-line; }
html[data-theme="light"] .hero-description { color: #283142; }
.scroll-cue { display: inline-flex; align-items: center; gap: 12px; border: 0; padding: 0; background: transparent; color: var(--text); cursor: pointer; font-size: .9rem; font-weight: 600; }
.scroll-icon { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 15px; animation: bob 1.7s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }
.story-preview, .credits-section, .chapters-section { scroll-margin-top: 108px; }
.story-preview { padding: 130px 0 120px; background: var(--bg); }
.chapters-section { padding: 0 0 150px; background: var(--bg); }
.credits-section { position: relative; min-height: 54vh; padding: 175px 0 190px; background: var(--bg-soft); }
.credits-section::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.site-footer {
  display: flex;
  justify-content: center;
  padding: 24px 4vw 30px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: .74rem;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}
.site-footer p { margin: 0; }
.section-inner { width: min(1060px, 88vw); margin: 0 auto; }
.section-inner.narrow { max-width: 760px; }
.section-heading { max-width: 860px; }
.section-inner h2 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(3rem, 6vw, 5.2rem); font-weight: 600; line-height: .98; letter-spacing: -.02em; }

.story-follow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 860px;
  margin-top: 38px;
  padding: 18px 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--surface), rgba(255,255,255,.015));
  box-shadow: 0 18px 50px rgba(0,0,0,.08);
}
.story-follow-copy { display: grid; gap: 5px; min-width: 0; }
.story-follow-kicker { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.story-follow-note { color: var(--muted); font-size: .86rem; line-height: 1.55; }
.follow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 17px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: .86rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}
.follow-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(0,0,0,.17); }
.follow-btn:active { transform: translateY(0); }
.follow-btn.is-following { background: var(--accent-soft); color: var(--text); border-color: rgba(255,61,112,.34); }
.follow-btn-icon { font-size: 1.08rem; line-height: 1; }
html[data-theme="light"] .follow-btn.is-following { border-color: rgba(215,39,89,.28); }
.chapters-list { display: grid; gap: 14px; margin-top: 42px; }
.chapter-card { display: grid; grid-template-columns: 96px 1fr auto; gap: 20px; align-items: center; padding: 18px 20px; border: 1px solid var(--line); background: var(--surface); border-radius: 18px; transition: transform .2s ease, border-color .2s ease; }
.chapter-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.chapter-number { font-size: .72rem; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; }
.chapter-title { margin: 2px 0 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.85rem; line-height: 1; }
.chapter-card-copy { min-width: 0; }
.chapter-summary { margin: 5px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.55; white-space: pre-line; }
.chapter-arrow { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.chapter-read-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 104px; min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: .72rem; font-weight: 800; letter-spacing: .16em; cursor: pointer; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.chapter-read-button:hover, .chapter-read-button:focus-visible { transform: translateY(-1px); background: var(--accent-soft); border-color: var(--line-strong); outline: none; }
.chapter-read-button span:last-child { font-size: 1rem; letter-spacing: 0; }
@media (max-width: 700px) { .chapter-card { grid-template-columns: 1fr auto; } .chapter-card-copy { grid-column: 1 / -1; } .chapter-read-button { grid-column: 2; justify-self: end; } }
.chapter-empty { padding: 28px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(0,0,0,.68); backdrop-filter: blur(10px); }
.modal { position: relative; width: min(560px, 100%); max-height: calc(100svh - 48px); overflow-y: auto; padding: 38px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: 0 35px 100px rgba(0,0,0,.4); }
.modal h2 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(2.5rem, 5vw, 3.6rem); line-height: .98; font-weight: 600; }
.modal p:not(.section-kicker) { color: var(--muted); line-height: 1.75; }
.modal-close { position: absolute; top: 14px; right: 16px; border: 0; background: transparent; font-size: 2rem; line-height: 1; cursor: pointer; }
.modal-actions { position: sticky; bottom: -1px; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; padding-top: 14px; background: var(--surface); }
.primary-btn, .secondary-btn, .danger-btn { min-height: 46px; padding: 0 18px; }
.primary-btn { background: var(--text); color: var(--bg); }
.primary-btn:hover { transform: translateY(-1px); opacity: .92; }
.secondary-btn { background: transparent; }
.danger-btn { color: #fff; background: var(--danger); border-color: transparent; }
.danger-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }

.auth-note { margin-bottom: 22px; }
.field-label { display: block; margin: 18px 0 8px; font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field-input { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); resize: vertical; }
.field-input:focus { border-color: var(--accent-cool); }
.auth-error { min-height: 22px; margin: 12px 0 0; color: var(--danger) !important; font-size: .9rem; line-height: 1.5; }
.auth-error[data-type="success"] { color: #48d597 !important; }
.auth-error[data-type="info"] { color: var(--accent-cool) !important; }
.auth-error:empty { min-height: 0; }
 .phone-number-row { display: grid; grid-template-columns: minmax(112px, 0.34fr) minmax(0, 1fr); gap: 9px; align-items: stretch; }
.phone-country-select { width: 100%; min-height: 46px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.phone-country-select:focus { border-color: var(--accent-cool); outline: none; }
.phone-number-input { min-width: 0; }
.auth-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.auth-secondary-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 12px; }
.auth-secondary-actions .text-btn { font-size: .8rem; }

.rating-group {
  display: flex;
  gap: 8px;
  margin: 8px 0 16px;
}

.rating-star {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, color .15s ease, background .15s ease;
}

.rating-star:hover,
.rating-star:focus-visible,
.rating-star.is-selected {
  border-color: var(--accent-cool);
  background: var(--accent-soft);
  color: var(--text);
}
.small-btn { min-height: 38px; padding-inline: 13px; }
.file-input { width: 100%; color: var(--muted); }
.image-preview { margin-top: 13px; aspect-ratio: 16 / 7; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; background: linear-gradient(135deg, var(--bg-soft), var(--bg)); background-size: cover; background-position: center; }
.chapter-tools { display: flex; gap: 7px; flex-wrap: wrap; }
.text-btn { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); background: transparent; border-radius: 999px; color: var(--muted); cursor: pointer; }
.text-btn:hover { color: var(--text); border-color: var(--line-strong); }
.text-btn.danger { color: var(--danger); }
.chapter-save-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.chapter-save-status { color: var(--muted); font-size: .82rem; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  max-width: min(460px, calc(100vw - 32px));
  min-height: 52px;
  padding: 13px 18px 13px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 15px;
  background: rgba(8,12,20,.96);
  box-shadow: 0 18px 45px rgba(0,0,0,.28), 0 3px 12px rgba(0,0,0,.16);
  color: #ffffff;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .005em;
  opacity: 0;
  transform: translate3d(0, 12px, 0) scale(.98);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.toast::before {
  content: "✓";
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(72,213,151,.16);
  color: #72e4ae;
  font-size: .82rem;
  font-weight: 800;
}
.toast[data-type="error"] { border-color: rgba(255,107,107,.48); }
.toast[data-type="error"]::before { content: "!"; background: rgba(255,107,107,.16); color: #ff8585; }
.toast[data-type="info"] { border-color: rgba(141,201,255,.48); }
.toast[data-type="info"]::before { content: "i"; background: rgba(141,201,255,.16); color: #a9d7ff; }
html[data-theme="light"] .toast {
  background: rgba(255,255,255,.98);
  border-color: rgba(23,27,36,.16);
  box-shadow: 0 18px 45px rgba(38,45,61,.18), 0 3px 12px rgba(38,45,61,.10);
  color: #111827;
}
html[data-theme="light"] .toast[data-type="success"] { border-color: rgba(24,135,91,.34); }
html[data-theme="light"] .toast[data-type="error"] { border-color: rgba(189,45,61,.38); }
html[data-theme="light"] .toast[data-type="info"] { border-color: rgba(79,135,184,.38); }
.toast.visible { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }

.submission-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 9px;
  margin: 2px 0 18px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
}
.submission-identity strong { color: var(--text); }
.submission-identity button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-cool);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.submission-identity button:hover { color: var(--text); }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .main-nav { order: 3; grid-column: 1 / -1; display: none; }
  .login-btn span:last-child { display: none; }
  .login-btn { width: 42px; padding: 0; }
  .hero-content { margin-left: 7vw; }
  .menu-panel { top: 70px; }
}

@media (max-width: 620px) {
  .site-header { height: 70px; padding: 0 18px; }
  .brand-name { font-size: .82rem; }
  .menu-panel { top: 70px; left: 14px; right: 14px; width: auto; }
  .hero { background-position: 61% 43%; }
  .hero-content { margin: 0 7vw; padding-top: 8vh; }
  .hero h1 { font-size: clamp(4.4rem, 22vw, 7rem); }
  .hero-description { max-width: 90vw; }
  .story-preview, .credits-section { padding: 95px 0 110px; }
  .chapters-section { padding-bottom: 110px; }
  .story-follow { align-items: stretch; flex-direction: column; gap: 16px; margin-top: 30px; padding: 17px; }
  .follow-btn { width: 100%; }
  .modal { max-height: calc(100svh - 28px); padding: 30px 24px 24px; }
  .modal-actions { flex-direction: column; }
  .chapter-card { grid-template-columns: 1fr auto; }
  .chapter-number { grid-column: 1 / -1; }
}

/* =========================================================
   CHAPTER READER
   ========================================================= */
.reader-backdrop {
  z-index: 160;
  padding: 18px;
}

.chapter-reader {
  position: relative;
  width: min(1120px, 100%);
  height: min(94svh, 980px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: 0 40px 120px rgba(0,0,0,.45);
}

.reader-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 30px 34px 20px;
  border-bottom: 1px solid var(--line);
}

.reader-heading h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: .94;
}

.reader-heading .section-kicker {
  margin-bottom: 10px;
}

.reader-submeta { margin: 8px 0 0; color: var(--muted); font-size: .82rem; letter-spacing: .04em; }

.reader-close {
  position: static;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
}

.reader-mode-row {
  display: flex;
  gap: 4px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  overflow-x: auto;
}

.reader-mode-btn {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: .83rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.reader-mode-btn:hover,
.reader-mode-btn:focus-visible,
.reader-mode-btn.is-active {
  color: var(--text);
  border-color: var(--line);
  background: var(--accent-soft);
}

.reader-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}

.reader-toolbar-spacer {
  flex: 1;
}

.reader-control {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.reader-control:hover:not(:disabled),
.reader-control:focus-visible:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--accent-soft);
}

.reader-control:disabled {
  opacity: .36;
  cursor: not-allowed;
}

.reader-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(255,255,255,.012), transparent 18%),
    var(--bg-soft);
}

.reader-page {
  width: min(820px, 92%);
  margin: 0 auto;
  padding: 42px 0 84px;
  font-size: var(--reader-text-size, 1.06rem);
  line-height: 1.95;
}

.reader-page .reader-art {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto 36px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  background: var(--bg);
  transition: filter .2s ease;
}

.reader-page.reader-bw .reader-art {
  filter: grayscale(1) contrast(1.06);
}

.reader-page .reader-content-title {
  margin: 0 0 22px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.3rem, 5vw, 4.5rem);
  line-height: .96;
}

.reader-page .reader-summary {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: .95rem;
}

.reader-page .reader-paragraph {
  margin: 0 0 20px;
  color: var(--text);
  white-space: pre-wrap;
}

.reader-empty {
  padding: 34px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
}

.reader-help {
  width: min(820px, 92%);
  margin: 0 auto;
  padding: 44px 0 84px;
}

.reader-help h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: .96;
}

.reader-help > p:not(.section-kicker) {
  max-width: 700px;
  color: var(--muted);
  line-height: 1.85;
}

.reader-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.reader-help-grid > div {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.reader-help-grid strong {
  font-size: .86rem;
}

.reader-help-grid span {
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.65;
}

@media (max-width: 620px) {
  .reader-backdrop {
    padding: 8px;
  }

  .chapter-reader {
    width: 100%;
    height: calc(100svh - 16px);
    border-radius: 20px;
  }

  .reader-header {
    padding: 24px 20px 16px;
  }

  .reader-toolbar {
    flex-wrap: wrap;
  }

  .reader-toolbar-spacer {
    display: none;
  }

  .reader-body {
    padding-inline: 0;
  }

  .reader-page,
  .reader-help {
    width: min(100% - 34px, 820px);
    padding-top: 26px;
  }

  .reader-help-grid {
    grid-template-columns: 1fr;
  }
}


.text-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

.menu-nav-link {
  display: flex;
  align-items: center;
}


.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 4px 0 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}

.auth-mode-btn {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}

.auth-mode-btn:hover,
.auth-mode-btn:focus-visible {
  color: var(--text);
}

.auth-mode-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .08);
}



/* Account experience polish */
.auth-modal { width: min(520px, 100%); padding: clamp(28px, 5vw, 42px); }
.auth-modal .section-kicker { margin-bottom: 10px; }
.auth-modal .field-input { transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.auth-modal .field-input:focus { outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.auth-modal .primary-btn, .auth-modal .secondary-btn { border-radius: 12px; }
.auth-confirmation { padding-top: 8px; }
.auth-confirmation-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 4px 0 20px; border: 1px solid rgba(72, 213, 151, .35); border-radius: 50%; color: #48d597; font-size: 1.35rem; }
.auth-confirmation h3 { margin: 0 0 12px; font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1; font-weight: 600; }
.auth-confirmation > p:not(.section-kicker):not(.auth-confirmation-note) { margin: 0 0 18px; }
.auth-confirmation strong { color: var(--text); overflow-wrap: anywhere; }
.auth-confirmation ol { margin: 0; padding: 18px 18px 18px 38px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); color: var(--text); }
.auth-confirmation li { padding: 5px 0; line-height: 1.6; }
.auth-confirmation-note { margin: 14px 0 0; font-size: .84rem; }
.auth-confirmation .auth-actions { margin-top: 24px; }
.auth-confirmation button:disabled { opacity: .55; cursor: wait; }
@media (max-width: 520px) {
  .modal { padding: 28px 20px; border-radius: 20px; }
  .auth-actions > button { flex: 1 1 100%; }
  .auth-confirmation .auth-actions > button { flex: 1 1 100%; }
}

/* =========================================================
   VEIL — Professional account / sign-in experience
   ========================================================= */
.auth-modal {
  width: min(540px, 100%);
  padding: clamp(28px, 5vw, 44px);
}

.auth-modal .modal-close {
  z-index: 3;
}

.auth-note {
  max-width: 44rem;
  margin-bottom: 24px;
}

.auth-methods {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.auth-method {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 14px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.auth-method:hover,
.auth-method:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--accent-soft);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
}

.auth-method:disabled {
  opacity: .6;
  cursor: wait;
  transform: none;
}

.auth-method-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface, var(--bg));
  font-weight: 700;
}

.google-icon {
  font-size: 1.18rem;
  font-family: Arial, sans-serif;
  color: var(--text);
}

.phone-icon svg {
  width: 21px;
  height: 21px;
}

.auth-method-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.auth-method-copy strong {
  font-size: .94rem;
  line-height: 1.25;
}

.auth-method-copy small {
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.35;
}

.auth-method-arrow {
  color: var(--muted);
  font-size: 1rem;
  transition: transform .2s ease, color .2s ease;
}

.auth-method:hover .auth-method-arrow,
.auth-method:focus-visible .auth-method-arrow {
  color: var(--text);
  transform: translateX(2px);
}

.auth-error {
  min-height: 22px;
  margin: 15px 0 0;
  color: var(--danger) !important;
  font-size: .86rem;
  line-height: 1.5;
}

.auth-error[data-type="info"] { color: var(--accent-cool) !important; }
.auth-error[data-type="success"] { color: #48d597 !important; }
.auth-error:empty { min-height: 0; }

.auth-privacy-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.55;
  text-align: center;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.auth-actions > button {
  flex: 1 1 180px;
}

.auth-modal .primary-btn,
.auth-modal .secondary-btn {
  border-radius: 12px;
}

.username-setup {
  display: grid;
  gap: 10px;
}
.username-setup h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.04; letter-spacing: -.03em; }
.username-input-wrap { position: relative; display: flex; align-items: center; }
.username-input-wrap > span { position: absolute; left: 16px; z-index: 1; color: var(--muted); font-weight: 700; }
.username-input-wrap .field-input { padding-left: 38px; }
.username-rules { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }

.auth-account {
  padding-top: 6px;
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 2px 4px;
}

.account-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, var(--accent-soft), transparent 58%), var(--surface, var(--bg));
  background-size: cover;
  background-position: center;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
  overflow: hidden;
}

.account-avatar.has-image {
  color: transparent;
  border-color: var(--line);
}

.account-profile-copy {
  min-width: 0;
}

.account-profile-copy .section-kicker {
  margin-bottom: 5px;
}

.account-profile-copy h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 2.45rem);
  line-height: 1;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.account-profile-copy p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .82rem;
  overflow-wrap: anywhere;
}

.account-divider {
  height: 1px;
  margin: 28px 0 16px;
  background: var(--line);
}

.account-logout {
  width: auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(220, 76, 76, .38);
  border-radius: 12px;
  background: rgba(220, 76, 76, .08);
  color: var(--danger);
  font: inherit;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.account-logout:hover,
.account-logout:focus-visible {
  background: rgba(220, 76, 76, .14);
  border-color: rgba(220, 76, 76, .6);
  transform: translateY(-1px);
}

.account-logout:active { transform: translateY(0); }

.logout-gate-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--danger);
}

.logout-gate-icon svg { width: 18px; height: 18px; }

@media (max-width: 520px) {
  .auth-modal { padding: 28px 20px; }
  .auth-method { grid-template-columns: 40px minmax(0, 1fr) 18px; min-height: 68px; }
  .auth-method-icon { width: 40px; height: 40px; border-radius: 12px; }
  .account-profile { align-items: flex-start; }
  .account-avatar { width: 64px; height: 64px; flex-basis: 64px; }
}


/* =========================================================
   VEIL — PUBLIC UI POLISH v1.0
   ========================================================= */

:root {
  --panel-border: rgba(255,255,255,.16);
  --panel-highlight: rgba(255,255,255,.055);
  --control-height: 44px;
}

html[data-theme="light"] {
  --panel-border: rgba(23,27,36,.14);
  --panel-highlight: rgba(23,27,36,.035);
}

/* Historical: VEIL v31 — Header / navigation */
.site-header {
  box-shadow: 0 10px 34px rgba(0,0,0,.08);
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.brand,
.nav-link,
.login-btn,
.theme-toggle,
.menu-toggle {
  -webkit-tap-highlight-color: transparent;
}

.brand {
  min-height: 44px;
  padding: 0 4px;
  border-radius: 12px;
  transition: opacity .2s ease, transform .2s ease;
}
.brand:hover { opacity: .88; transform: translateY(-1px); }

.login-btn {
  min-height: var(--control-height);
  padding-inline: 16px;
  background: var(--panel-highlight);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.login-btn:hover,
.login-btn:focus-visible {
  background: var(--accent-soft);
  box-shadow: 0 8px 24px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.06);
}


/* Menu */
.menu-panel {
  width: min(390px, calc(100vw - 32px));
  border-color: var(--panel-border);
  box-shadow: 0 26px 70px rgba(0,0,0,.28), 0 2px 12px rgba(0,0,0,.10);
  animation: veilMenuIn .18s ease-out;
}
@keyframes veilMenuIn {
  from { opacity: 0; transform: translateY(-7px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.menu-panel-inner { padding: 12px; gap: 3px; }
.menu-item {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: .91rem;
  letter-spacing: -.01em;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, color .18s ease;
}
.menu-item:hover,
.menu-item:focus-visible {
  background: var(--accent-soft);
  border-color: var(--line);
  transform: translateX(2px);
}
.menu-item-icon {
  width: 24px;
  flex: 0 0 24px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  filter: saturate(.9);
}
.menu-item:hover .menu-item-icon,
.menu-item:focus-visible .menu-item-icon { color: var(--text); }
.menu-item-meta {
  margin-left: 5px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
}
.menu-divider {
  height: 1px;
  margin: 7px 4px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

/* General interactive controls */
.primary-btn,
.secondary-btn,
.danger-btn,
.reader-control,
.text-btn,
.auth-method,
.account-logout,
.scroll-cue,
.rating-star {
  -webkit-tap-highlight-color: transparent;
}
.primary-btn,
.secondary-btn,
.danger-btn {
  min-height: 46px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.primary-btn {
  box-shadow: 0 10px 24px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.08);
}
.primary-btn:hover,
.primary-btn:focus-visible { box-shadow: 0 14px 30px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.08); }
.secondary-btn {
  background: var(--panel-highlight);
}
.secondary-btn:hover,
.secondary-btn:focus-visible { box-shadow: 0 8px 22px rgba(0,0,0,.08); }

/* Modal / form system */
.modal-backdrop {
  background: rgba(2,5,12,.64);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html[data-theme="light"] .modal-backdrop { background: rgba(20,24,31,.28); }
.modal {
  border-color: var(--panel-border);
  box-shadow: 0 36px 100px rgba(0,0,0,.34), 0 2px 16px rgba(0,0,0,.10);
}
.modal-close {
  width: 40px;
  height: 40px;
  border-color: var(--line);
  background: var(--panel-highlight);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.modal-close:hover,
.modal-close:focus-visible {
  transform: rotate(4deg) scale(1.03);
  background: var(--accent-soft);
  border-color: var(--line-strong);
}
.field-input,
.phone-country-select {
  min-height: 48px;
  border-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field-input:hover,
.phone-country-select:hover { border-color: var(--line-strong); }
.field-input:focus,
.phone-country-select:focus {
  border-color: var(--accent-cool);
  box-shadow: 0 0 0 3px rgba(141,201,255,.10);
}

/* Feedback / bug identity panel */
.submission-identity {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, var(--surface-2), var(--bg-soft));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

/* Toast — intentionally more prominent */
.toast {
  right: 26px;
  bottom: 26px;
  min-height: 60px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 15px 20px 15px 16px;
  gap: 13px;
  border-radius: 17px;
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: 0 24px 60px rgba(0,0,0,.34), 0 5px 18px rgba(0,0,0,.15);
}
.toast::before {
  width: 30px;
  height: 30px;
  font-size: .9rem;
}/* Cards / content surfaces */

.chapter-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 20px 46px rgba(0,0,0,.11), inset 0 1px 0 rgba(255,255,255,.04);
}

/* Reader */
.chapter-reader {
  border-color: var(--panel-border);
  box-shadow: 0 44px 130px rgba(0,0,0,.48), 0 3px 18px rgba(0,0,0,.12);
}
.reader-mode-row,
.reader-toolbar { box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
.reader-mode-btn:hover,
.reader-mode-btn:focus-visible,
.reader-mode-btn.is-active,
.reader-control:hover:not(:disabled),
.reader-control:focus-visible:not(:disabled) {
  box-shadow: 0 7px 18px rgba(0,0,0,.07);
}

/* Footer */
.site-footer {
  min-height: 70px;
  align-items: center;
  background: linear-gradient(180deg, var(--bg-soft), var(--bg));
}

/* Version modal */
.version-modal { text-align: left; }
.version-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 4px 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--accent-soft);
  font-size: 1.2rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.version-number {
  display: inline-block;
  margin-left: 7px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 700;
  vertical-align: middle;
}

@media (max-width: 620px) {
  .menu-panel { width: auto; }
  .toast {
    right: 16px;
    bottom: 16px;
    max-width: calc(100vw - 32px);
    min-height: 58px;
    font-size: .96rem;
  }
}

/* =========================================================
   VOLUMES + READER ENGAGEMENT
   ========================================================= */
.volume-group {
  margin-top: 34px;
}
.volume-group + .volume-group { margin-top: 58px; }
.volume-group-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.volume-group-head h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: .95;
}
.volume-count {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.volume-group-actions { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.volume-rating-summary { display:inline-flex; align-items:center; gap:8px; min-height:34px; padding:0 11px; border:1px solid var(--line); border-radius:999px; background:var(--surface); }
.volume-rating-label { color:var(--muted); font-size:.62rem; font-weight:850; letter-spacing:.14em; text-transform:uppercase; }
.volume-rating-value { font-size:.82rem; font-weight:900; }
.rating-green { color:#1f9d62 !important; }
.rating-yellow { color:#c69219 !important; }
.rating-red { color:#d84c4c !important; }
.rating-none { color:var(--muted) !important; }
.volume-chapters { display: grid; gap: 12px; }

.reader-chapter-select {
  max-width: min(360px, 30vw);
  min-height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.reader-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 34px 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.reader-secondary-action {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}
.reader-secondary-action:hover,
.reader-secondary-action:focus-visible {
  border-color: var(--line-strong);
  background: var(--accent-soft);
}
.reader-page.reader-fit-natural .reader-art { width: auto; max-width: 100%; }

.reader-volume-end {
  margin-top: 60px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 20px 55px rgba(0,0,0,.08);
}
.reader-volume-end h3 {
  margin: 0 0 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: .98;
}
.reader-volume-end > p:not(.section-kicker) { color: var(--muted); }
.volume-engagement {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.volume-like-cluster { display:flex; align-items:center; gap:9px; }
.volume-like-count { color:var(--muted); font-size:.82rem; font-weight:750; }
.volume-rating-box { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding-left:14px; border-left:1px solid var(--line); }
.volume-rating-options { display:flex; gap:4px; flex-wrap:wrap; }
.volume-rating-button { width:30px; height:30px; border:1px solid var(--line); border-radius:8px; background:var(--surface-2); color:var(--muted); font-size:.68rem; font-weight:850; cursor:pointer; transition:.18s ease; }
.volume-rating-button:hover, .volume-rating-button:focus-visible, .volume-rating-button.is-selected { color:var(--text); border-color:var(--accent-cool); background:var(--accent-soft); transform:translateY(-1px); }

.volume-like-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}
.volume-like-button:hover,
.volume-like-button.is-liked {
  border-color: var(--line-strong);
  background: var(--accent-soft);
}
.volume-like-button b { margin-left: 5px; }
.volume-comment-count { color: var(--muted); font-size: .88rem; }
.volume-comments { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.comments-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.comments-head > div { display:flex; flex-direction:column; gap:3px; }
.comments-head span { color: var(--muted); font-size:.82rem; }
.comments-read-all { min-height:34px; padding:0 13px; border:1px solid var(--line); border-radius:999px; background:rgba(255,255,255,.045); color:var(--text); backdrop-filter:blur(10px); cursor:pointer; font-size:.72rem; font-weight:800; }
.comments-read-all:hover, .comments-read-all:focus-visible { background:var(--accent-soft); border-color:var(--line-strong); }
.comment-list { display:grid; gap:10px; }
.comment-author-row { display:flex; align-items:center; gap:10px; }
.comment-avatar { width:34px; height:34px; flex:0 0 34px; display:grid; place-items:center; border-radius:50%; background:var(--surface-2); border:1px solid var(--line); color:var(--text); font-size:.72rem; font-weight:800; background-position:center; background-size:cover; }
.comment-avatar.has-image { color:transparent; }
.comment-author-row strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.comment-reply .comment-avatar { width:28px; height:28px; flex-basis:28px; font-size:.64rem; }

.volume-comment {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
}
.volume-comment strong { font-size:.84rem; }
.volume-comment p { margin:6px 0 0; white-space:pre-wrap; line-height:1.65; }
.comment-author-row { display:flex; align-items:center; gap:8px; }
.comment-author-row span { color:var(--muted); font-size:.66rem; letter-spacing:.06em; text-transform:uppercase; }
.comment-actions { display:flex; align-items:center; gap:5px; margin-top:10px; }
.comment-action { min-height:30px; padding:0 9px; border:1px solid transparent; border-radius:999px; background:transparent; color:var(--muted); cursor:pointer; font-size:.72rem; font-weight:800; }
.comment-action:hover, .comment-action:focus-visible, .comment-action.is-liked { color:var(--text); border-color:var(--line); background:var(--accent-soft); }
.comment-reply-list { display:grid; gap:8px; margin:10px 0 0 18px; }
.comment-reply { padding:9px 11px; border-left:2px solid var(--line); color:var(--muted); }
.comment-reply p { margin:3px 0 0; }
.comment-reply-compose { display:grid; grid-template-columns:1fr auto; gap:8px; margin-top:10px; }
.comment-reply-compose textarea { width:100%; min-width:0; resize:vertical; border:1px solid var(--line); border-radius:10px; padding:9px 11px; background:var(--surface); color:var(--text); }
.comment-reply-submit { border:1px solid var(--line); border-radius:999px; padding:0 13px; background:var(--surface-2); color:var(--text); cursor:pointer; font-weight:800; }
.comments-empty { color:var(--muted); font-size:.9rem; }
.comment-compose { display:grid; gap:10px; margin-top:14px; }
.comment-compose textarea { width:100%; resize:vertical; }

@media (max-width: 820px) {
  .reader-chapter-select { max-width: 100%; flex: 1 1 100%; order: 3; }
  .reader-contents-control { order: 2; }
  .reader-toolbar-spacer { display:none; }
  .volume-group-head { align-items:flex-start; flex-direction:column; }
  .volume-group-actions { width:100%; justify-content:space-between; }
}

@media (max-width: 620px) {
  .reader-page-actions { display:grid; grid-template-columns:1fr 1fr; }
  .reader-secondary-action { width:100%; }
  .reader-volume-end { padding:22px; border-radius:18px; }
  .comments-head { flex-direction:column; gap:4px; }
}

.reader-page-stack { display:grid; gap:26px; }
.reader-page-frame { margin:0; }
.reader-page-frame .reader-art { margin:0 auto 8px; }
.reader-page-frame figcaption {
  text-align:center;
  color:var(--muted);
  font-size:.7rem;
  font-weight:800;
  letter-spacing:.14em;
}
.chapter-pages-note { display:block; margin-top:8px; color:var(--muted); font-size:.78rem; }


/* =========================================================
   V14 READER NAVIGATION POLISH
   ========================================================= */
.reader-progress {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.volume-group {
  position: relative;
}
.volume-group-head {
  align-items: center;
}
.volume-group-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-shrink: 0;
}
.reader-page-stack {
  display: grid;
  justify-items: center;
  gap: 24px;
}
.reader-page-frame {
  width: min(100%, 920px);
  margin: 0;
  display: grid;
  justify-items: center;
}
.reader-page-frame figcaption {
  width: 100%;
  padding-top: 8px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-align: center;
}
.reader-page.reader-fit-natural .reader-page-frame { width: auto; max-width: 100%; }
.reader-page.reader-fit-natural .reader-page-frame figcaption { width: 100%; }
@media (max-width: 760px) {
  .reader-progress { display: none; }
}


/* =========================================================
   V20 READER — CINEMATIC ANIME READER REDESIGN
   ========================================================= */
.reader-backdrop {
  padding: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(141,201,255,.07), transparent 38%),
    rgba(2, 5, 11, .88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.chapter-reader {
  width: 100%;
  height: 100svh;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: #05070d;
  box-shadow: none;
  isolation: isolate;
}

.chapter-reader::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: auto;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,.26), transparent 18%, transparent 82%, rgba(0,0,0,.26)),
    linear-gradient(180deg, rgba(141,201,255,.035), transparent 18%);
}

.reader-header,
.reader-mode-row,
.reader-toolbar,
.reader-body { position: relative; z-index: 1; }

.reader-header {
  min-height: 88px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand close"
    "heading close";
  align-items: end;
  gap: 4px 24px;
  padding: 16px clamp(22px, 4vw, 54px) 14px;
  background: linear-gradient(180deg, rgba(7,10,18,.98), rgba(7,10,18,.86));
  border-bottom: 1px solid rgba(255,255,255,.09);
}

.reader-header-topline {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .2em;
}
.reader-brand-mark { color: var(--text); }
.reader-brand-divider { opacity: .35; }
.reader-brand-label { color: var(--accent-cool); }

.reader-heading { grid-area: heading; min-width: 0; }
.reader-heading .section-kicker {
  margin: 0 0 4px;
  color: rgba(255,255,255,.48);
  font-size: .61rem;
  letter-spacing: .18em;
}
.reader-heading h2 {
  max-width: min(900px, 78vw);
  margin: 0;
  overflow: hidden;
  color: #f7f8fb;
  font-size: clamp(1.65rem, 3vw, 2.75rem);
  font-weight: 500;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader-submeta {
  margin: 5px 0 0;
  color: rgba(255,255,255,.48);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.reader-close {
  grid-area: close;
  align-self: center;
  width: 42px;
  height: 42px;
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.035);
  color: rgba(255,255,255,.82);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.reader-close:hover,
.reader-close:focus-visible {
  transform: rotate(3deg);
  border-color: rgba(255,255,255,.3);
  background: rgba(255,255,255,.08);
}

.reader-mode-row {
  justify-content: center;
  gap: 4px;
  padding: 9px 18px;
  background: rgba(9,13,22,.94);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.reader-mode-btn {
  min-height: 34px;
  padding: 0 16px;
  border-color: transparent;
  border-radius: 8px;
  color: rgba(255,255,255,.52);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.reader-mode-btn:hover,
.reader-mode-btn:focus-visible {
  color: rgba(255,255,255,.86);
  background: rgba(255,255,255,.055);
  box-shadow: none;
}
.reader-mode-btn.is-active {
  color: #fff;
  border-color: rgba(141,201,255,.18);
  background: linear-gradient(180deg, rgba(141,201,255,.13), rgba(141,201,255,.06));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 5px 18px rgba(0,0,0,.18);
}

.reader-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(190px, 1fr) auto auto auto auto auto;
  align-items: center;
  gap: 7px;
  min-height: 54px;
  padding: 8px clamp(14px, 3vw, 38px);
  background: rgba(6,10,17,.96);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.reader-toolbar-spacer { display: none; }
.reader-control {
  min-height: 34px;
  padding: 0 11px;
  border-color: rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
  color: rgba(255,255,255,.72);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .04em;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.reader-control:hover:not(:disabled),
.reader-control:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(141,201,255,.25);
  background: rgba(141,201,255,.08);
  color: #fff;
  box-shadow: none;
}
.reader-control:disabled { opacity: .24; }
.reader-contents-control { min-width: 82px; }
.reader-chapter-select {
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 34px;
  padding: 0 34px 0 12px;
  border-color: rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
  color: rgba(255,255,255,.82);
  font-size: .7rem;
  font-weight: 700;
  outline: none;
}
.reader-progress {
  padding: 0 3px;
  color: rgba(255,255,255,.42);
  font-size: .62rem;
  letter-spacing: .11em;
}

.reader-body {
  background:
    radial-gradient(circle at 50% 0%, rgba(141,201,255,.035), transparent 26%),
    #080b12;
}
.reader-page {
  width: min(920px, calc(100% - 48px));
  padding: 42px 0 100px;
  color: #f5f6f8;
}
.reader-page-stack { gap: 44px; }
.reader-page-frame {
  position: relative;
  width: min(100%, 920px);
}
.reader-page-frame .reader-art {
  width: 100%;
  margin: 0 auto;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(0,0,0,.42), 0 0 0 1px rgba(255,255,255,.02);
}
.reader-page-frame figcaption {
  padding-top: 10px;
  color: rgba(255,255,255,.28);
  font-size: .58rem;
  letter-spacing: .2em;
}
.reader-page .reader-content-title,
.reader-page .reader-summary,
.reader-page .reader-paragraph,
.reader-page-actions,
.reader-volume-end { max-width: 820px; margin-left: auto; margin-right: auto; }
.reader-page .reader-content-title {
  margin-top: 58px;
  color: #f7f8fb;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
}
.reader-page .reader-summary { color: rgba(255,255,255,.5); }
.reader-page .reader-paragraph { color: rgba(255,255,255,.82); }

.reader-page-actions {
  border-top-color: rgba(255,255,255,.08);
}
.reader-secondary-action {
  border-color: rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
  color: rgba(255,255,255,.78);
}
.reader-secondary-action:hover,
.reader-secondary-action:focus-visible {
  border-color: rgba(141,201,255,.25);
  background: rgba(141,201,255,.08);
}

.reader-help {
  width: min(900px, calc(100% - 48px));
  padding: 54px 0 100px;
  color: #f5f6f8;
}
.reader-help h3 {
  max-width: 700px;
  margin-bottom: 16px;
  font-size: clamp(2rem, 5vw, 4rem);
}
.reader-help > p:not(.section-kicker) {
  max-width: 680px;
  color: rgba(255,255,255,.5);
  line-height: 1.8;
}
.reader-help-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 30px;
}
.reader-help-grid > div {
  min-height: 110px;
  padding: 18px 19px;
  border-color: rgba(255,255,255,.09);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  box-shadow: none;
}
.reader-help-grid strong {
  color: #f7f8fb;
  font-size: .78rem;
  letter-spacing: .04em;
}
.reader-help-grid span { color: rgba(255,255,255,.46); font-size: .78rem; }

/* Native hidden state must win over display rules above. */
.reader-toolbar[hidden],
.reader-page[hidden],
.reader-help[hidden] { display: none !important; }

.reader-volume-end {
  border-color: rgba(255,255,255,.09);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
}
.volume-like-button,
.comment-compose textarea {
  border-color: rgba(255,255,255,.1);
}

@media (max-width: 900px) {
  .reader-toolbar {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  }
  .reader-contents-control { grid-column: 1; }
  .reader-chapter-select { grid-column: 2; }
  .reader-progress { grid-column: 3; }
  .reader-toolbar [data-reader-action="text-smaller"],
  .reader-toolbar [data-reader-action="text-reset"],
  .reader-toolbar [data-reader-action="text-larger"] { display: none; }
  .reader-page { width: min(100% - 28px, 920px); }
}

@media (max-width: 620px) {
  .reader-header {
    min-height: 82px;
    padding: 12px 16px 12px;
  }
  .reader-heading h2 { max-width: calc(100vw - 100px); font-size: 1.45rem; }
  .reader-submeta { font-size: .6rem; }
  .reader-close { width: 38px; height: 38px; }
  .reader-mode-row { justify-content: flex-start; padding: 8px 12px; }
  .reader-mode-btn { min-height: 32px; padding: 0 12px; font-size: .62rem; }
  .reader-toolbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
    padding: 7px 10px;
  }
  .reader-toolbar .reader-control { min-height: 32px; padding: 0 9px; }
  .reader-toolbar [data-reader-action="prev"] span,
  .reader-toolbar [data-reader-action="next"] span { display: none; }
  .reader-contents-control { grid-column: 1; min-width: 42px; font-size: 0; }
  .reader-contents-control::before { content: "☰"; font-size: .85rem; }
  .reader-chapter-select { grid-column: 2; }
  .reader-progress { grid-column: 3; font-size: .54rem; }
  .reader-toolbar [data-reader-action="fit"] { grid-column: 1 / -1; }
  .reader-page { width: calc(100% - 20px); padding-top: 22px; }
  .reader-page-stack { gap: 30px; }
  .reader-help { width: calc(100% - 28px); padding-top: 34px; }
  .reader-help-grid { grid-template-columns: 1fr; }
}


/* v22 interaction fix: reader artwork/end-of-volume content must accept pointer input. */
.reader-page,
.reader-page * { pointer-events: auto; }
.reader-page::before,
.reader-page::after { pointer-events: none; }
.reader-page .reader-art { position: relative; z-index: 1; }
.reader-page-actions,
.reader-volume-end { position: relative; z-index: 2; }


/* =========================================================
   V28 — UNIFIED VOLUME PRESENTATION
   ========================================================= */
.volume-group {
  margin-top: 30px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.028), transparent 48%),
    var(--surface);
  box-shadow: 0 18px 50px rgba(0,0,0,.08);
}
.volume-group + .volume-group { margin-top: 20px; }
.volume-group-head {
  margin: 0 0 18px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.volume-heading-copy { min-width: 0; }
.volume-group-head h3 {
  font-size: clamp(2rem, 4vw, 3.15rem);
  letter-spacing: -.02em;
}
.volume-mode-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.volume-mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cool);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.volume-count {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}
.volume-chapters { gap: 10px; }
.chapter-card {
  grid-template-columns: 88px minmax(0, 1fr) auto;
  padding: 20px 18px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg) 72%, var(--surface));
}
.chapter-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.chapter-mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .1em;
}
.chapter-read-button {
  min-width: 132px;
  min-height: 44px;
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  box-shadow: 0 8px 22px rgba(0,0,0,.12);
}
.chapter-read-button:hover,
.chapter-read-button:focus-visible {
  background: var(--text);
  color: var(--bg);
  opacity: .88;
}

.reader-mode-row {
  justify-content: center;
  gap: 4px;
  padding: 10px 18px;
  background: rgba(7,10,18,.92);
}
.reader-mode-btn {
  min-width: 132px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(255,255,255,.55);
  background: transparent;
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.reader-mode-btn:hover { color: #fff; background: rgba(255,255,255,.05); }
.reader-mode-btn.is-active {
  color: #fff;
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.13);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035);
}
.reader-toolbar {
  gap: 8px;
  padding: 10px clamp(18px, 4vw, 42px);
  background: rgba(7,10,18,.94);
}
.reader-control,
.reader-chapter-select {
  min-height: 38px;
}
.reader-control {
  border-radius: 10px;
}
.reader-chapter-select {
  border-radius: 10px;
  background: rgba(255,255,255,.035);
}
.reader-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 40px) 70px;
}
.reader-page-stack { gap: 34px; }
.reader-page-frame {
  width: min(100%, 980px);
}
.reader-page-frame .reader-art {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 22px 70px rgba(0,0,0,.28);
}
.reader-page-frame figcaption { opacity: .65; }
@media (max-width: 760px) {
  .volume-group { padding: 18px; border-radius: 20px; }
  .chapter-card { grid-template-columns: 1fr auto; }
  .chapter-number { grid-column: 1 / -1; }
  .chapter-card-copy { grid-column: 1 / -1; }
  .chapter-read-button { grid-column: 2; justify-self: end; }
  .reader-mode-btn { min-width: 0; flex: 1 1 0; padding: 0 8px; font-size: .59rem; }
}


/* =========================================================
   V28 — READING CONTINUITY + CROSS-VOLUME NAVIGATION
   ========================================================= */
.reading-resume {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  margin: 0 0 24px;
  padding: 18px 20px;
  border:1px solid var(--line);
  border-radius:20px;
  background:linear-gradient(135deg, var(--accent-soft), transparent 55%), var(--surface);
  box-shadow:0 14px 38px rgba(0,0,0,.08);
}
.reading-resume[hidden] { display:none !important; }
.resume-copy { min-width:0; }
.resume-copy h3 { margin:4px 0 3px; font-size:.92rem; letter-spacing:.08em; font-weight:800; }
.resume-copy p:last-child { margin:0; color:var(--muted); line-height:1.45; }
.resume-button, .reader-jump-next {
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  min-height:46px; padding:0 17px; border:1px solid var(--line-strong); border-radius:999px;
  background:var(--text); color:var(--bg); font:inherit; font-size:.7rem; font-weight:800;
  letter-spacing:.14em; cursor:pointer; white-space:nowrap; transition:transform .18s ease, opacity .18s ease;
}
.resume-button:hover, .reader-jump-next:hover { transform:translateY(-1px); opacity:.9; }
.reader-next-panel {
  margin: 42px auto 0; padding:34px clamp(20px,4vw,44px); width:min(760px,100%);
  border:1px solid var(--line); border-radius:26px; text-align:center;
  background:linear-gradient(180deg, var(--accent-soft), transparent 72%), var(--surface);
}
.reader-next-panel h3 { margin:7px 0 5px; font-family:"Cormorant Garamond",Georgia,serif; font-size:clamp(2rem,4vw,3rem); line-height:.98; }
.reader-next-panel p:not(.section-kicker) { color:var(--muted); margin:0 0 20px; }
@media (max-width:700px) {
  .reading-resume { align-items:stretch; flex-direction:column; }
  .resume-button { width:100%; }
  .reader-next-panel { border-radius:20px; }
}


/* =========================================================
   V28 READER NAVIGATION + VOLUME CHAPTER PICKERS
   ========================================================= */
.volume-group-head {
  align-items: center;
  padding-bottom: 18px;
  margin-bottom: 0;
}
.volume-group-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-width: min(430px, 42%);
}
.volume-chapter-picker {
  display: grid;
  grid-template-columns: auto minmax(210px, 1fr);
  align-items: center;
  gap: 10px;
}
.volume-chapter-picker > span {
  color: var(--muted);
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .14em;
}
.volume-chapter-select {
  min-width: 230px;
  min-height: 42px;
  padding: 0 38px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .78rem;
  font-weight: 750;
  cursor: pointer;
  outline: none;
}
.volume-chapter-select:hover,
.volume-chapter-select:focus-visible {
  border-color: var(--line-strong);
  background: var(--accent-soft);
}
.volume-chapter-select option,
.reader-chapter-select option {
  background: #0c121e;
  color: #f7f8fb;
}

.reader-nav-primary {
  min-height: 46px !important;
  min-width: 126px;
  padding: 0 17px !important;
  border-color: rgba(141,201,255,.24) !important;
  background: linear-gradient(180deg, rgba(141,201,255,.12), rgba(141,201,255,.045)) !important;
  color: #fff !important;
  font-size: .72rem !important;
  letter-spacing: .055em !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 8px 24px rgba(0,0,0,.18);
}
.reader-nav-primary:hover:not(:disabled),
.reader-nav-primary:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(141,201,255,.46) !important;
  background: linear-gradient(180deg, rgba(141,201,255,.19), rgba(141,201,255,.08)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 30px rgba(0,0,0,.24);
}
.reader-nav-primary:disabled {
  opacity: .28;
  filter: saturate(.45);
}
.reader-nav-prev { justify-self: start; }
.reader-nav-next { justify-self: end; }
.reader-chapter-select {
  color: #f7f8fb;
  font-weight: 760;
}

@media (max-width: 900px) {
  .volume-group-head { align-items: flex-start; }
  .volume-group-actions { width: 100%; min-width: 0; justify-content: space-between; }
  .volume-chapter-picker { flex: 1 1 auto; grid-template-columns: auto minmax(0, 1fr); }
  .volume-chapter-select { min-width: 0; width: 100%; }
}
@media (max-width: 620px) {
  .volume-group-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .volume-chapter-picker { grid-template-columns: 1fr; gap: 6px; }
  .volume-chapter-select { min-height: 44px; }
  .reader-nav-primary { min-width: 108px; min-height: 42px !important; }
}

/* =========================================================
   Historical: VEIL v31 — READER THEME SYNC
   The reader is part of the site, so its surfaces, controls,
   typography and artwork framing follow the global theme.
   ========================================================= */
html[data-theme="dark"] .chapter-reader {
  color-scheme: dark;
}

html[data-theme="light"] .reader-backdrop {
  background: rgba(238, 241, 246, .78);
}

html[data-theme="light"] .chapter-reader {
  background: var(--bg);
  color: var(--text);
  border-color: var(--line-strong);
  box-shadow: 0 30px 100px rgba(41, 48, 63, .18);
}

html[data-theme="light"] .chapter-reader::before {
  background:
    linear-gradient(90deg, rgba(23,27,36,.045), transparent 18%, transparent 82%, rgba(23,27,36,.045)),
    linear-gradient(180deg, rgba(79,135,184,.045), transparent 18%);
}

html[data-theme="light"] .reader-header {
  background: linear-gradient(180deg, rgba(250,251,253,.98), rgba(244,245,247,.94));
  border-bottom-color: var(--line);
}

html[data-theme="light"] .reader-heading h2,
html[data-theme="light"] .reader-page .reader-content-title,
html[data-theme="light"] .reader-help h3 {
  color: var(--text);
}

html[data-theme="light"] .reader-heading .section-kicker,
html[data-theme="light"] .reader-submeta,
html[data-theme="light"] .reader-header-topline,
html[data-theme="light"] .reader-progress,
html[data-theme="light"] .reader-page-frame figcaption {
  color: var(--muted);
}

html[data-theme="light"] .reader-mode-row,
html[data-theme="light"] .reader-toolbar {
  background: rgba(248,249,251,.96);
  border-color: var(--line);
}

html[data-theme="light"] .reader-mode-btn {
  color: var(--muted);
}

html[data-theme="light"] .reader-mode-btn:hover,
html[data-theme="light"] .reader-mode-btn:focus-visible {
  color: var(--text);
  background: var(--accent-soft);
}

html[data-theme="light"] .reader-mode-btn.is-active {
  color: var(--text);
  border-color: rgba(79,135,184,.24);
  background: rgba(79,135,184,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 5px 18px rgba(41,48,63,.08);
}

html[data-theme="light"] .reader-control,
html[data-theme="light"] .reader-chapter-select,
html[data-theme="light"] .reader-close,
html[data-theme="light"] .reader-secondary-action {
  border-color: var(--line);
  background: rgba(255,255,255,.62);
  color: var(--text);
}

html[data-theme="light"] .reader-control:hover:not(:disabled),
html[data-theme="light"] .reader-control:focus-visible:not(:disabled),
html[data-theme="light"] .reader-secondary-action:hover,
html[data-theme="light"] .reader-secondary-action:focus-visible,
html[data-theme="light"] .reader-close:hover,
html[data-theme="light"] .reader-close:focus-visible {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  color: var(--text);
}

html[data-theme="light"] .reader-body {
  background:
    radial-gradient(circle at 50% 0%, rgba(79,135,184,.055), transparent 26%),
    var(--bg-soft);
}

html[data-theme="light"] .reader-page {
  color: var(--text);
}

html[data-theme="light"] .reader-page .reader-summary {
  color: var(--muted);
}

html[data-theme="light"] .reader-page .reader-paragraph {
  color: color-mix(in srgb, var(--text) 84%, var(--muted));
}

html[data-theme="light"] .reader-page-frame .reader-art {
  border-color: var(--line);
  box-shadow: 0 24px 60px rgba(41,48,63,.14), 0 0 0 1px rgba(23,27,36,.025);
}

html[data-theme="light"] .reader-help {
  color: var(--text);
}

html[data-theme="light"] .reader-help > p:not(.section-kicker) {
  color: var(--muted);
}

html[data-theme="light"] .reader-help-grid > div {
  border-color: var(--line);
  background: rgba(255,255,255,.62);
  box-shadow: 0 12px 30px rgba(41,48,63,.06);
}

html[data-theme="light"] .reader-help-grid strong {
  color: var(--text);
}

html[data-theme="light"] .reader-help-grid span {
  color: var(--muted);
}

html[data-theme="light"] .reader-volume-end {
  border-color: var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,.82), rgba(255,255,255,.58));
  box-shadow: 0 24px 60px rgba(41,48,63,.1);
}


/* =========================================================
   Historical: VEIL v31 — READER TITLE ORDER, CROSS-VOLUME PREVIOUS,
   AND IN-READER THEME CONTROL
   ========================================================= */
.reader-header-actions {
  grid-area: close;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
}
.reader-theme-toggle {
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  color: rgba(255,255,255,.8);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  cursor: pointer;
}
.reader-theme-toggle.is-black { background: #050505; border-color: rgba(255,255,255,.20); color: #f5f5f5; }

.reader-theme-toggle:hover,
.reader-theme-toggle:focus-visible {
  border-color: rgba(141,201,255,.3);
  background: rgba(141,201,255,.08);
}
.reader-page-intro {
  max-width:820px;
  margin:0 auto;
  padding:8px 0 30px;
}
.reader-page-intro .section-kicker { margin:0 0 8px; color:var(--muted); }
.reader-page-intro h3 { margin:0; font-family:"Cormorant Garamond", Georgia, serif; font-size:clamp(2rem,4vw,3.35rem); line-height:.98; color:var(--text); }
.reader-content-heading {
  width: min(820px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 22px;
}
.reader-content-heading .section-kicker {
  margin: 0 0 7px;
  color: rgba(255,255,255,.42);
}
.reader-content-heading h3 {
  margin: 0;
  color: #f7f8fb;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: .98;
}
.reader-page {
  padding-top: 10px !important;
}
.reader-page .reader-content-title {
  display: none !important;
}
.reader-nav-primary {
  min-height: 44px !important;
  min-width: 128px;
  font-weight: 900;
}
.reader-nav-prev { justify-self: start; }
.reader-nav-next { justify-self: end; }

html[data-theme="light"] .reader-theme-toggle {
  border-color: var(--line);
  background: rgba(255,255,255,.68);
  color: var(--text);
}
html[data-theme="light"] .reader-theme-toggle:hover,
html[data-theme="light"] .reader-theme-toggle:focus-visible {
  border-color: var(--line-strong);
  background: var(--accent-soft);
}
html[data-theme="light"] .reader-content-heading .section-kicker {
  color: var(--muted);
}
html[data-theme="light"] .reader-content-heading h3 {
  color: var(--text);
}
html[data-theme="light"] .reader-nav-primary {
  border-color: var(--line-strong) !important;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(232,236,243,.9)) !important;
  color: var(--text) !important;
  box-shadow: 0 8px 22px rgba(41,48,63,.12) !important;
}
html[data-theme="light"] .reader-nav-primary:hover:not(:disabled),
html[data-theme="light"] .reader-nav-primary:focus-visible:not(:disabled) {
  background: linear-gradient(180deg, #ffffff, #f0f2f6) !important;
  color: var(--text) !important;
}

@media (max-width: 620px) {
  .reader-header-actions { gap: 5px; }
  .reader-theme-label { display: none; }
  .reader-theme-toggle { width: 38px; padding: 0; }
  .reader-content-heading {
    width: calc(100% - 34px);
    padding-top: 30px;
    padding-bottom: 16px;
  }
  .reader-content-heading h3 { font-size: 2rem; }
  .reader-nav-primary { min-width: 104px; }
}


/* Historical: VEIL v31 — engagement, rating and credits polish */
html[data-theme="light"] .volume-rating-summary,
html[data-theme="light"] .volume-rating-button,
html[data-theme="light"] .comments-read-all,
html[data-theme="light"] .comment-reply-submit { background:rgba(255,255,255,.9); color:var(--text); }
html[data-theme="light"] .volume-rating-button:hover,
html[data-theme="light"] .volume-rating-button:focus-visible,
html[data-theme="light"] .volume-rating-button.is-selected { background:rgba(79,135,184,.11); }
html[data-theme="light"] .comments-read-all { box-shadow:0 8px 22px rgba(41,48,63,.08); }
html[data-theme="light"] .comment-action { color:var(--muted); }
html[data-theme="light"] .comment-action:hover,
html[data-theme="light"] .comment-action:focus-visible,
html[data-theme="light"] .comment-action.is-liked { color:var(--text); background:rgba(215,39,89,.08); border-color:var(--line-strong); }
html[data-theme="light"] .comment-reply-compose textarea { background:#fff; color:var(--text); }
@media (max-width:700px) {
  .volume-rating-box { width:100%; padding-left:0; border-left:0; border-top:1px solid var(--line); padding-top:12px; }
  .comment-reply-compose { grid-template-columns:1fr; }
}


/* =========================================================
   Historical: VEIL v33 — FINAL THEME + TOAST POLISH
   ========================================================= */
/* Midnight Blue is the default: visibly blue, still restrained and cinematic. */
:root {
  --bg: #071426;
  --bg-soft: #0c1b31;
  --surface: rgba(10, 25, 45, 0.96);
  --surface-2: rgba(15, 31, 53, 0.99);
  --text: #f4f7fb;
  --muted: #aab8c9;
  --line: rgba(170, 205, 238, 0.15);
  --line-strong: rgba(170, 205, 238, 0.28);
  --accent-soft: rgba(141, 201, 255, 0.12);
  --header: rgba(5, 15, 30, 0.78);
}

.theme-toggle {
  width: 104px;
  height: 40px;
  flex: 0 0 104px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-highlight, rgba(255,255,255,.055));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 5px 18px rgba(0,0,0,.10);
  overflow: hidden;
  isolation: isolate;
  transform: none;
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-1px);
  background: var(--accent-soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 9px 24px rgba(0,0,0,.14);
}
.theme-toggle:active { transform: translateY(0); }
.theme-icon {
  position: relative;
  z-index: 2;
  width: 30px;
  height: 30px;
  justify-self: center;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  opacity: .68;
  transition: color .2s ease, opacity .2s ease, transform .2s ease;
}
.theme-thumb {
  position: absolute;
  z-index: 1;
  top: 5px;
  left: 5px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  box-shadow: 0 4px 12px rgba(0,0,0,.22);
  pointer-events: none;
  transition: left .24s cubic-bezier(.2,.8,.2,1), background .2s ease, box-shadow .2s ease;
}
.theme-toggle[data-theme="dark"] .theme-thumb { left: 5px; background: #dceeff; }
.theme-toggle[data-theme="light"] .theme-thumb { left: 37px; background: #ffffff; box-shadow: 0 4px 12px rgba(38,45,61,.18); }
.theme-toggle[data-theme="black"] .theme-thumb { left: 69px; background: #f5f5f5; box-shadow: 0 4px 14px rgba(255,255,255,.12); }
.theme-toggle[data-theme="dark"] .theme-moon,
.theme-toggle[data-theme="light"] .theme-sun,
.theme-toggle[data-theme="black"] .theme-black-mark {
  color: #14243a;
  opacity: 1;
  transform: scale(1.02);
}
.theme-toggle[data-theme="black"] { background: #030303; border-color: rgba(255,255,255,.24); }
.theme-toggle[data-theme="black"] .theme-sun,
.theme-toggle[data-theme="black"] .theme-moon { color: #b8b8b8; }
.theme-toggle[data-theme="black"] .theme-black-mark { color: #111; }

/* Toasts must remain visible above modal layers and across all themes. */
.toast {
  visibility: hidden;
  display: flex;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
}
.toast.visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
html[data-theme="black"] .toast {
  background: rgba(8,8,8,.98);
  border-color: rgba(255,255,255,.20);
  color: #f5f5f5;
}
html[data-theme="black"] .toast[data-type="info"] { border-color: rgba(141,201,255,.42); }

@media (max-width: 620px) {
  .theme-toggle { width: 94px; flex-basis: 94px; }
  .theme-toggle[data-theme="dark"] .theme-thumb { left: 5px; }
  .theme-toggle[data-theme="light"] .theme-thumb { left: 32px; }
  .theme-toggle[data-theme="black"] .theme-thumb { left: 59px; }
  .theme-icon { width: 26px; height: 30px; }
  .theme-thumb { width: 25px; height: 30px; }
}


/* Historical: VEIL v36 stability fixes */
[hidden] { display: none !important; }

.hero {
  position: relative;
  min-height: calc(100svh - 78px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #050812;
}
.hero-backdrop {
  position: absolute; inset: -5%;
  background: url("hero-art.jpeg") center / cover no-repeat;
  filter: blur(28px) brightness(.42) saturate(.82);
  transform: scale(1.06);
  opacity: .95;
}
.hero-artwork {
  position: absolute;
  z-index: 2;
  top: 0; right: 2.2vw;
  height: 100%;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}
.hero-artwork img {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: center;
  filter: saturate(.98) contrast(1.01);
}
.hero-overlay {
  position: absolute; inset: 0; z-index: 3;
  background: linear-gradient(90deg, rgba(3,7,16,.88) 0%, rgba(3,7,16,.68) 30%, rgba(3,7,16,.20) 55%, rgba(3,7,16,.04) 78%, rgba(3,7,16,.18) 100%), linear-gradient(0deg, rgba(3,6,13,.28), transparent 38%, rgba(3,6,13,.10));
}
.hero-content {
  position: relative; z-index: 4;
  width: min(560px, 42vw);
  margin-left: 8vw;
  padding-top: 4vh;
}
.visually-hidden-title {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important;
}
.hero .title-rule { margin-top: 18px; }

/* The username screen must never appear before authentication. */
.username-setup[hidden] { display: none !important; }

@media (max-width: 900px) {
  .hero-content { width: min(520px, 55vw); margin-left: 6vw; }
  .hero-artwork { right: -5vw; opacity: .92; }
  .hero-overlay { background: linear-gradient(90deg, rgba(3,7,16,.91) 0%, rgba(3,7,16,.73) 42%, rgba(3,7,16,.18) 78%, rgba(3,7,16,.30) 100%); }
}
@media (max-width: 700px) {
  .hero { min-height: calc(100svh - 70px); align-items: flex-end; }
  .hero-artwork { right: -34vw; top: 0; height: 72%; opacity: .72; }
  .hero-content { width: 88vw; margin: 0 6vw; padding: 0 0 11vh; }
  .hero-overlay { background: linear-gradient(0deg, rgba(3,7,16,.95) 0%, rgba(3,7,16,.72) 40%, rgba(3,7,16,.08) 82%, rgba(3,7,16,.18) 100%); }
}


/* Historical: VEIL v38 — chapter placeholders */
.chapter-placeholder {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 28px;
  text-align: center;
  border: 1px solid var(--border-color, rgba(148,163,184,.22));
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(30,64,175,.08), rgba(15,23,42,.04));
}
.chapter-placeholder-kicker {
  font-size: .72rem;
  letter-spacing: .18em;
  opacity: .68;
}
.chapter-placeholder strong {
  font-size: clamp(1.35rem, 3vw, 2rem);
}
.chapter-placeholder > span:last-child {
  max-width: 520px;
  line-height: 1.65;
  opacity: .68;
}
