:root {
  color-scheme: dark;
  --bg: #020711;
  --bg-soft: #071321;
  --panel: rgba(5, 18, 33, 0.78);
  --panel-strong: rgba(4, 14, 27, 0.94);
  --line: rgba(157, 202, 238, 0.34);
  --line-strong: rgba(122, 202, 255, 0.78);
  --text: #f4f8fc;
  --muted: #b9c7d5;
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --radius: 24px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --content: 1220px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 70% 10%, rgba(27, 113, 193, 0.24), transparent 26rem),
    radial-gradient(circle at 14% 28%, rgba(63, 74, 177, 0.16), transparent 24rem),
    radial-gradient(circle at 80% 80%, rgba(14, 116, 144, 0.13), transparent 26rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
}

body::before {
  opacity: 0.9;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.85) 0 1px, transparent 1.3px),
    radial-gradient(circle, rgba(125,211,252,.72) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(255,255,255,.45) 0 .8px, transparent 1.1px);
  background-position: 0 0, 38px 54px, 76px 16px;
  background-size: 112px 112px, 149px 149px, 83px 83px;
}

body::after {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(2, 7, 17, 0.04), rgba(2, 7, 17, 0.84) 74%, #020711),
    radial-gradient(ellipse at 50% -20%, rgba(125, 211, 252, 0.11), transparent 52%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: #00111d;
  background: #dff6ff;
  border-radius: 10px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(161, 207, 239, 0.16);
  background: rgba(2, 7, 17, 0.76);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(calc(100% - 32px), var(--content));
  min-height: 76px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-link img {
  width: 154px;
  height: auto;
  filter: drop-shadow(0 0 14px rgba(104, 195, 255, 0.26));
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  color: #dce8f2;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: #fff;
  border-color: rgba(125, 211, 252, 0.42);
  background: rgba(34, 123, 181, 0.12);
}

.menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 10px;
  color: #eef8ff;
  background: rgba(7, 24, 42, 0.75);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 5px 0;
  background: currentColor;
  border-radius: 10px;
}

main {
  width: min(calc(100% - 32px), var(--content));
  margin-inline: auto;
  padding: 34px 0 72px;
}

.hero {
  position: relative;
  min-height: 410px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    radial-gradient(circle at 70% 36%, rgba(143, 216, 255, 0.24), transparent 10%),
    radial-gradient(ellipse at 68% 38%, rgba(35, 120, 224, 0.21), transparent 34%),
    radial-gradient(ellipse at 74% 48%, rgba(174, 87, 255, 0.1), transparent 38%),
    linear-gradient(135deg, rgba(2, 11, 24, 0.93), rgba(4, 20, 38, 0.74));
  box-shadow: var(--shadow), inset 0 0 70px rgba(68, 160, 231, 0.08);
  isolation: isolate;
}

.hero::before {
  position: absolute;
  width: 520px;
  height: 520px;
  right: -160px;
  bottom: -310px;
  border: 1px solid rgba(125, 211, 252, 0.34);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 24%, rgba(125, 211, 252, 0.38), transparent 2%),
    radial-gradient(circle at 42% 36%, rgba(36, 87, 148, 0.26), transparent 34%),
    #020a15;
  box-shadow: 0 -18px 80px rgba(85, 175, 255, 0.2);
  content: "";
}

.hero::after {
  position: absolute;
  width: 620px;
  height: 3px;
  right: -44px;
  top: 50%;
  background: linear-gradient(90deg, transparent, rgba(112, 201, 255, 0.8), transparent);
  transform: rotate(-18deg);
  filter: blur(0.4px);
  content: "";
}

.hero-brand {
  position: relative;
  z-index: 2;
  width: min(700px, 78%);
  text-align: center;
}

.hero-brand img {
  width: min(680px, 100%);
  margin-inline: auto;
  filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.45));
}

.hero-title {
  margin: 22px 0 0;
  color: #f2f7fb;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.3rem, 3vw, 2.7rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-wrap: balance;
}

.section {
  margin-top: 34px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 22px;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.7rem);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.section-heading::before {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  background: #eaf7ff;
  box-shadow: 0 0 10px #7dd3fc, 0 0 28px #38bdf8;
  content: "";
  transform: rotate(45deg);
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 24px;
  align-items: start;
}

.photo-stack,
.about-copy,
.character-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.photo-stack {
  padding: 18px;
  display: grid;
  gap: 18px;
  border-radius: var(--radius);
}

.profile-figure {
  margin: 0;
}

.profile-figure img {
  width: 100%;
  aspect-ratio: 4 / 4.6;
  object-fit: cover;
  object-position: center 24%;
  border: 1px solid rgba(174, 217, 247, 0.5);
  border-radius: 18px;
  background: #07111d;
}

.profile-figure.luna img {
  aspect-ratio: 4 / 3.75;
  object-position: center 28%;
}

.profile-figure figcaption {
  margin-top: 10px;
  color: #f4f7fa;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.35;
  text-align: center;
}

.about-copy {
  padding: clamp(24px, 4vw, 48px);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(7, 27, 46, 0.88), rgba(3, 13, 25, 0.92)),
    var(--panel);
}

.about-copy p {
  margin: 0 0 1em;
  color: #dce5ed;
  font-size: clamp(1rem, 1.35vw, 1.1rem);
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.about-copy a {
  color: #8dddff;
  overflow-wrap: anywhere;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.characters-page .hero {
  min-height: 280px;
}

.characters-page .hero-brand {
  width: min(590px, 80%);
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.character-card {
  min-height: 290px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease;
}

.character-card.link-card:hover,
.character-card.link-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  background: rgba(7, 30, 51, 0.9);
  outline: none;
}

.character-placeholder {
  min-height: 190px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: rgba(231, 246, 255, 0.92);
  border: 1px solid rgba(150, 210, 250, 0.28);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 50%, rgba(83, 174, 230, 0.23), transparent 30%),
    radial-gradient(circle at 50% 115%, rgba(104, 79, 190, 0.2), transparent 48%),
    #030c18;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4.6rem, 8vw, 7rem);
  line-height: 1;
  text-shadow: 0 0 24px rgba(125, 211, 252, 0.55);
}

.character-card.no-image {
  min-height: 290px;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 26%, rgba(52, 134, 194, 0.14), transparent 35%),
    var(--panel);
}

.character-meta {
  padding: 17px 6px 4px;
}

.character-meta h2 {
  margin: 0;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.1vw, 1.8rem);
  font-weight: 400;
}

.character-meta p {
  margin: 5px 0 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.long-card .character-meta h2 {
  font-size: clamp(1.12rem, 1.8vw, 1.5rem);
}

.footer-space {
  height: 24px;
}

:focus-visible {
  outline: 3px solid rgba(125, 211, 252, 0.86);
  outline-offset: 4px;
}

@media (max-width: 900px) {
  .about-layout {
    grid-template-columns: 1fr;
  }

  .photo-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .character-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .nav-shell {
    min-height: 68px;
  }

  .brand-link img {
    width: 124px;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 16px;
    right: 16px;
    display: none;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(3, 12, 24, 0.97);
    box-shadow: var(--shadow);
  }

  .site-nav[data-open="true"] {
    display: flex;
  }

  .site-nav a {
    justify-content: center;
  }

  main {
    width: min(calc(100% - 20px), var(--content));
    padding-top: 18px;
  }

  .hero {
    min-height: 300px;
    border-radius: 24px;
  }

  .hero::before {
    width: 370px;
    height: 370px;
    right: -190px;
    bottom: -215px;
  }

  .hero-title {
    margin-top: 14px;
  }

  .section {
    margin-top: 28px;
  }

  .section-heading {
    gap: 13px;
  }

  .photo-stack {
    grid-template-columns: 1fr;
  }

  .profile-figure img,
  .profile-figure.luna img {
    aspect-ratio: 4 / 4.2;
  }

  .about-copy {
    padding: 22px 18px;
  }

  .character-grid {
    grid-template-columns: 1fr;
  }

  .character-card,
  .character-card.no-image {
    min-height: 0;
  }

  .character-placeholder {
    min-height: 172px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}


/* Book 1 character gallery */
.book-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.book-section-heading .section-heading {
  margin-bottom: 0;
}

.coming-soon-label {
  flex: 0 0 auto;
  padding: 9px 14px;
  color: #dff5ff;
  border: 1px solid rgba(125, 211, 252, 0.45);
  border-radius: 999px;
  background: rgba(31, 125, 181, 0.13);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.character-image {
  width: 100%;
  min-height: 190px;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  object-position: center;
  border: 1px solid rgba(150, 210, 250, 0.28);
  border-radius: 16px;
  background: #f4f1eb;
}

.character-image-landscape {
  background: #f7f7f6;
}

@media (max-width: 680px) {
  .book-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .character-image {
    min-height: 220px;
    aspect-ratio: 4 / 4.7;
  }

}

/* Tiberius reader */
.reader-page main {
  width: min(calc(100% - 32px), 1040px);
}

.reader-hero {
  position: relative;
  padding: clamp(42px, 8vw, 92px) clamp(22px, 7vw, 74px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    radial-gradient(circle at 78% 25%, rgba(94, 193, 255, 0.24), transparent 8%),
    radial-gradient(ellipse at 74% 30%, rgba(26, 93, 185, 0.28), transparent 34%),
    radial-gradient(ellipse at 15% 88%, rgba(96, 69, 191, 0.16), transparent 40%),
    linear-gradient(135deg, rgba(4, 17, 33, 0.96), rgba(2, 8, 18, 0.88));
  box-shadow: var(--shadow), inset 0 0 80px rgba(83, 177, 245, 0.08);
}

.reader-hero::after {
  position: absolute;
  right: -110px;
  bottom: -235px;
  width: 470px;
  height: 470px;
  border: 1px solid rgba(125, 211, 252, 0.34);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, rgba(135, 220, 255, 0.32), transparent 4%), #030b17;
  box-shadow: 0 -20px 80px rgba(80, 169, 255, 0.2);
  content: "";
}

.reader-kicker,
.reader-hero h1,
.chapter-nav {
  position: relative;
  z-index: 1;
}

.reader-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.reader-hero h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 8vw, 6.3rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.chapter-nav {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chapter-nav a {
  padding: 8px 12px;
  color: #dceaf4;
  border: 1px solid rgba(139, 204, 245, 0.25);
  border-radius: 999px;
  background: rgba(4, 20, 35, 0.58);
  text-decoration: none;
  font-size: 0.83rem;
  transition: border-color 160ms ease, background 160ms ease;
}

.chapter-nav a:hover,
.chapter-nav a:focus-visible {
  border-color: var(--line-strong);
  background: rgba(30, 113, 165, 0.18);
}

.reader-shell {
  margin-top: 28px;
  padding: clamp(24px, 6vw, 72px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(5, 20, 36, 0.92), rgba(3, 11, 22, 0.96)),
    var(--panel-strong);
  box-shadow: var(--shadow);
}

.chapter-section {
  scroll-margin-top: 102px;
}

.chapter-section + .chapter-section {
  margin-top: clamp(70px, 10vw, 118px);
  padding-top: clamp(54px, 8vw, 84px);
  border-top: 1px solid rgba(147, 203, 240, 0.22);
}

.chapter-section h2 {
  margin: 0 0 28px;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.chapter-section h3 {
  margin: 42px 0 20px;
  color: #eef8ff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.16;
}

.chapter-section h4 {
  margin: 30px 0 16px;
  color: #d8f2ff;
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  letter-spacing: 0.04em;
}

.chapter-section p {
  max-width: 74ch;
  margin: 0 auto 1.22em;
  color: #dce5ed;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.82;
}

.chapter-section .source-line {
  margin: 0 0 34px;
  padding: 14px 17px;
  color: #9edfff;
  border-left: 2px solid var(--accent-strong);
  background: rgba(15, 71, 108, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.93rem;
  line-height: 1.55;
}

.first-chapter > .source-line:first-child {
  margin-top: 0;
}

@media (max-width: 680px) {
  .reader-page main {
    width: min(calc(100% - 20px), 1040px);
  }

  .reader-hero {
    padding: 40px 20px 34px;
    border-radius: 24px;
  }

  .reader-hero::after {
    right: -215px;
  }

  .chapter-nav {
    flex-wrap: nowrap;
    padding-bottom: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .chapter-nav a {
    flex: 0 0 auto;
  }

  .reader-shell {
    padding: 24px 18px;
    border-radius: 22px;
  }

  .chapter-section p {
    font-size: 1.02rem;
    line-height: 1.74;
  }
}

/* Encyclopedia-to-chapter transition */
.entry-divider {
  width: min(100%, 74ch);
  height: 1px;
  margin: clamp(48px, 7vw, 78px) auto clamp(34px, 5vw, 54px);
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(126, 211, 255, 0.82), transparent);
  box-shadow: 0 0 18px rgba(80, 179, 255, 0.26);
}

.chapter-section p.chapter-opening {
  text-indent: 2rem;
}

/* Chapter reactions and comments */
.chapter-feedback {
  max-width: 74ch;
  margin: clamp(58px, 8vw, 96px) auto 0;
  padding-top: clamp(30px, 5vw, 48px);
  border-top: 1px solid rgba(147, 203, 240, 0.22);
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}

.reaction-button,
.comment-submit {
  appearance: none;
  border: 1px solid rgba(139, 204, 245, 0.34);
  border-radius: 999px;
  background: rgba(7, 28, 48, 0.82);
  color: #edf8ff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.reaction-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 15px;
}

.reaction-button:hover,
.reaction-button:focus-visible,
.comment-submit:hover,
.comment-submit:focus-visible {
  border-color: var(--line-strong);
  background: rgba(26, 92, 137, 0.42);
  transform: translateY(-1px);
}

.reaction-button[aria-pressed="true"] {
  border-color: #8cddff;
  background: rgba(37, 122, 177, 0.42);
  box-shadow: 0 0 22px rgba(71, 180, 244, 0.18);
}

.reaction-count {
  min-width: 1.8rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #bfe9ff;
  text-align: center;
  font-size: 0.85rem;
}

.comments-panel {
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(139, 204, 245, 0.2);
  border-radius: 22px;
  background: rgba(3, 17, 30, 0.72);
}

.chapter-section .comments-panel h3 {
  margin: 0 0 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3vw, 2.3rem);
}

.comment-form {
  display: grid;
  gap: 10px;
}

.comment-form label {
  color: #bfe8fb;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  border: 1px solid rgba(139, 204, 245, 0.28);
  border-radius: 14px;
  background: rgba(1, 10, 20, 0.72);
  color: #f2f8fc;
  font: inherit;
}

.comment-form input {
  min-height: 44px;
  padding: 10px 12px;
}

.comment-form textarea {
  min-height: 130px;
  padding: 12px;
  resize: vertical;
  line-height: 1.55;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: 2px solid rgba(93, 198, 255, 0.52);
  outline-offset: 2px;
  border-color: var(--line-strong);
}

.comment-submit {
  justify-self: start;
  min-height: 44px;
  margin-top: 4px;
  padding: 9px 17px;
}

.comment-list {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.reader-comment {
  padding: 16px 18px;
  border-left: 2px solid rgba(92, 198, 255, 0.68);
  border-radius: 0 14px 14px 0;
  background: rgba(15, 50, 75, 0.24);
}

.reader-comment-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 8px;
}

.reader-comment-name {
  color: #eff9ff;
  font-weight: 800;
}

.reader-comment-time {
  color: #88b9d3;
  font-size: 0.78rem;
}

.chapter-section .reader-comment-body {
  margin: 0;
  color: #d9e6ee;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.96rem;
  line-height: 1.62;
  white-space: pre-wrap;
}

@media (max-width: 680px) {
  .chapter-section p.chapter-opening {
    text-indent: 1.35rem;
  }

  .feedback-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .reaction-button {
    justify-content: center;
  }

  .comments-panel {
    padding: 20px 16px;
    border-radius: 18px;
  }

  .comment-submit {
    width: 100%;
  }
}

/* Shared feedback service states */
.feedback-status {
  min-height: 1.4em;
  margin: 0 0 14px;
  color: #9ac9df;
  font-size: 0.9rem;
}

.feedback-status:empty {
  display: none;
}

.feedback-status[data-state="error"] {
  color: #ffb5b5;
}

.feedback-status[data-state="loading"] {
  color: #bfe9ff;
}

.chapter-feedback[aria-busy="true"] {
  opacity: 0.82;
}

.reaction-button:disabled,
.comment-submit:disabled,
.comment-form input:disabled,
.comment-form textarea:disabled {
  cursor: wait;
  opacity: 0.62;
}

.comment-empty {
  margin: 0;
  color: #88aabd;
  font-style: italic;
}

/* Character reader chapter rail */
.reader-page main {
  width: min(calc(100% - 32px), 1380px);
}

.reader-hero {
  width: min(100%, 1040px);
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1040px) 230px;
  align-items: start;
  gap: 24px;
  margin-top: 28px;
}

.reader-layout .reader-shell {
  margin-top: 0;
}

.chapter-rail {
  position: sticky;
  top: 92px;
  z-index: 20;
}

.chapter-rail-toggle {
  display: none;
}

.chapter-rail-nav {
  padding: 20px 16px;
  border: 1px solid rgba(139, 204, 245, 0.25);
  border-radius: 22px;
  background:
    radial-gradient(circle at 80% 0%, rgba(93, 198, 255, 0.16), transparent 34%),
    rgba(3, 17, 30, 0.94);
  box-shadow: var(--shadow), inset 0 0 36px rgba(77, 174, 235, 0.06);
  backdrop-filter: blur(18px);
}

.chapter-rail-nav h2 {
  margin: 0 0 14px;
  color: #f4fbff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 400;
}

.chapter-rail-nav a {
  display: block;
  position: relative;
  padding: 10px 10px 10px 20px;
  color: #b8d4e4;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.35;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.chapter-rail-nav a::before {
  position: absolute;
  top: 50%;
  left: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(116, 204, 255, 0.42);
  transform: translateY(-50%);
  content: "";
}

.chapter-rail-nav a:hover,
.chapter-rail-nav a:focus-visible {
  color: #f2fbff;
  background: rgba(61, 156, 214, 0.14);
  transform: translateX(2px);
}

.chapter-rail-nav a[aria-current="true"] {
  color: #fff;
  background: linear-gradient(90deg, rgba(50, 154, 220, 0.25), rgba(50, 154, 220, 0.05));
  box-shadow: inset 2px 0 #71d1ff;
}

.chapter-rail-nav a[aria-current="true"]::before {
  background: #a6e7ff;
  box-shadow: 0 0 10px rgba(110, 213, 255, 0.85);
}

@media (max-width: 1150px) {
  .reader-page main {
    width: min(calc(100% - 28px), 1040px);
  }

  .reader-hero {
    width: 100%;
  }

  .reader-layout {
    display: block;
    margin-top: 28px;
  }

  .chapter-rail {
    position: fixed;
    top: 50%;
    right: 0;
    width: min(290px, calc(100vw - 54px));
    transform: translateY(-50%) translateX(calc(100% - 44px));
    transition: transform 200ms ease;
  }

  .chapter-rail[data-open="true"] {
    transform: translateY(-50%) translateX(0);
  }

  .chapter-rail-toggle {
    display: grid;
    position: absolute;
    top: 50%;
    left: -44px;
    width: 44px;
    height: 138px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(139, 204, 245, 0.38);
    border-right: 0;
    border-radius: 15px 0 0 15px;
    background: rgba(5, 25, 42, 0.97);
    color: #eaf8ff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    transform: translateY(-50%) rotate(180deg);
    cursor: pointer;
    box-shadow: -10px 0 28px rgba(0, 0, 0, 0.26);
  }

  .chapter-rail-toggle:hover,
  .chapter-rail-toggle:focus-visible {
    color: #fff;
    background: rgba(20, 77, 113, 0.98);
  }

  .chapter-rail-nav {
    max-height: min(72vh, 620px);
    overflow-y: auto;
    border-radius: 22px 0 0 22px;
  }
}

@media (max-width: 680px) {
  .reader-page main {
    width: min(calc(100% - 20px), 1040px);
  }

  .chapter-rail {
    width: min(300px, calc(100vw - 46px));
  }

  .chapter-rail-nav {
    padding: 18px 14px;
  }

  .chapter-rail-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}
