:root {
  color-scheme: dark;
  --bg: #0d0f12;
  --surface: #15191f;
  --surface-strong: #1b2129;
  --surface-soft: #101419;
  --text: #f4f0e8;
  --muted: #a9b0ba;
  --muted-strong: #d2d7de;
  --accent: #e2b45d;
  --accent-strong: #f1c66d;
  --danger: #c05a4c;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --shadow: rgba(0, 0, 0, 0.42);
  --page-ratio: 1024 / 1536;
  --page-width: min(34vw, 58vh);
  --icon-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.06 12.35a1 1 0 0 1 0-.7 10.75 10.75 0 0 1 19.88 0 1 1 0 0 1 0 .7 10.75 10.75 0 0 1-19.88 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  --icon-message: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3Cpath d='M8 9h8'/%3E%3Cpath d='M8 13h5'/%3E%3C/svg%3E");
  --icon-route: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='19' r='3'/%3E%3Cpath d='M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15'/%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3C/svg%3E");
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  overflow: auto;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 16rem),
    linear-gradient(135deg, #090b0f, var(--bg) 42%, #11161c);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 22px 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: inherit;
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand-copy {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.brand-main {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}

.brand strong {
  flex: 0 0 auto;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.brand-mark {
  width: 1.65rem;
  aspect-ratio: 1;
  border: 1px solid rgba(226, 180, 93, 0.85);
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 45%, var(--accent) 46% 54%, transparent 55%),
    rgba(226, 180, 93, 0.1);
}

.reader-shell {
  flex: 1 0 auto;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
  align-items: start;
  gap: clamp(0.9rem, 1.6vw, 1.4rem);
  width: 100%;
  min-height: 0;
  min-width: 0;
  padding: 0.65rem clamp(0.8rem, 1.8vw, 1.6rem) 0.75rem;
}

.reader-panel {
  display: grid;
  grid-template-rows: auto auto;
  min-height: 0;
  min-width: 0;
}

.reader-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.78rem;
  width: min(100%, 74rem);
  margin: 0 auto 0.55rem;
}

.reader-brand {
  flex: 0 0 auto;
}

.reader-chapter-jump {
  flex: 1 1 23rem;
  max-width: min(38rem, 100%);
}

.reader-title-block {
  display: flex;
  align-items: baseline;
  gap: 0.34rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.reader-title-block::before {
  content: "/";
  color: rgba(244, 240, 232, 0.32);
}

.reader-title-block #page-title {
  color: inherit;
  font: inherit;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-controls {
  position: sticky;
  top: 0.8rem;
  display: grid;
  gap: 0.72rem;
  min-width: 0;
}

.control-card,
.parallel-nav,
.route-follow-panel {
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.control-card {
  display: grid;
  gap: 0.7rem;
  padding: 0.76rem;
}

.reading-mode-card {
  position: fixed;
  left: clamp(0.75rem, 2vw, 1.25rem);
  bottom: clamp(0.75rem, 2vw, 1.25rem);
  z-index: 45;
  width: min(15.5rem, calc(100vw - 1.5rem));
  gap: 0.32rem;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.reading-mode-kicker {
  display: none;
}

.reading-mode-switch {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.56rem;
  width: 100%;
  min-height: 3.06rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.5rem 0.62rem;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    rgba(16, 20, 26, 0.94);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 0.9rem 2rem rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.reading-mode-switch:hover,
.reading-mode-switch:focus-visible {
  border-color: rgba(226, 180, 93, 0.75);
  outline: none;
}

.reading-mode-switch-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.reading-mode-switch-copy span:first-child {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reading-mode-switch-copy span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reading-mode-visual {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.9rem;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(226, 180, 93, 0.5);
  border-radius: 8px;
  color: var(--accent-strong);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), transparent 48%),
    rgba(226, 180, 93, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.reading-mode-visual[data-variant="omniscient"]::before {
  content: "";
  width: 1.32rem;
  aspect-ratio: 1;
  background: currentColor;
  -webkit-mask: var(--icon-eye) center / contain no-repeat;
  mask: var(--icon-eye) center / contain no-repeat;
}

.reading-mode-visual[data-variant="omniscient"]::after {
  display: none;
}

.reading-mode-visual[data-variant="character"] {
  border-radius: 999px;
}

.reading-mode-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--avatar-position, 50% 28%);
  transform: scale(var(--avatar-zoom, 1));
  transform-origin: var(--avatar-origin, 50% 28%);
}

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

.chapter-jump {
  position: relative;
  display: grid;
  gap: 0.26rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chapter-select-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-width: min(22rem, 100%);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.54rem 0.64rem;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    rgba(16, 20, 26, 0.94);
  cursor: pointer;
  letter-spacing: 0;
  outline: none;
  text-align: left;
  text-transform: none;
  box-shadow: 0 0.9rem 2rem rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.chapter-select-button:hover,
.chapter-select-button:focus-visible,
.chapter-jump[data-open] .chapter-select-button {
  border-color: rgba(226, 180, 93, 0.75);
}

.chapter-select-button span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-select-icon {
  display: grid;
  place-items: center;
  width: 1.25rem;
  aspect-ratio: 1;
  border: 1px solid rgba(226, 180, 93, 0.34);
  border-radius: 6px;
  color: var(--accent-strong);
  background: rgba(226, 180, 93, 0.08);
  font-size: 0.9rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.chapter-jump[data-open] .chapter-select-icon {
  transform: rotate(180deg);
}

.chapter-select-menu {
  position: absolute;
  top: calc(100% + 0.42rem);
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 0.24rem;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.32rem;
  background: rgba(12, 15, 19, 0.98);
  box-shadow: 0 1.2rem 2.4rem rgba(0, 0, 0, 0.42);
}

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

.chapter-option {
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0.58rem 0.62rem;
  color: var(--muted-strong);
  background: transparent;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.15;
  text-align: left;
  text-transform: none;
}

.chapter-option:hover,
.chapter-option:focus-visible {
  border-color: rgba(226, 180, 93, 0.4);
  background: rgba(226, 180, 93, 0.1);
  color: var(--text);
  outline: none;
}

.chapter-option[aria-selected="true"] {
  color: var(--text);
  background: rgba(226, 180, 93, 0.15);
}

.chapter-option:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.chapter-option-check {
  color: var(--accent-strong);
  font-weight: 900;
  opacity: 0;
}

.chapter-option[aria-selected="true"] .chapter-option-check {
  opacity: 1;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.4vw, 2.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.reading-mode-modal {
  width: min(94vw, 50rem);
  max-height: min(90vh, 44rem);
  overflow: auto;
  border: 1px solid rgba(226, 180, 93, 0.34);
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(226, 180, 93, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 10rem),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 14px),
    rgba(13, 15, 18, 0.98);
  box-shadow:
    0 2rem 5rem rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.reading-mode-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}

.reading-mode-dialog {
  display: grid;
  gap: 1.15rem;
  padding: clamp(1rem, 3vw, 1.65rem);
}

.reading-mode-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.reading-mode-header h2,
.reading-mode-choice-panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.reading-mode-title-block {
  display: grid;
  gap: 0.3rem;
  max-width: 28rem;
}

.reading-mode-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.2rem;
  aspect-ratio: 1;
  border: 1px solid rgba(226, 180, 93, 0.38);
  border-radius: 8px;
  color: var(--accent-strong);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 48%),
    rgba(226, 180, 93, 0.08);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.reading-mode-close:hover,
.reading-mode-close:focus-visible {
  border-color: rgba(226, 180, 93, 0.78);
  outline: none;
  background: rgba(226, 180, 93, 0.13);
  transform: translateY(-1px);
}

.reading-mode-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(13rem, 0.82fr);
  gap: 0.82rem;
}

.reading-mode-choice-panel,
.reading-mode-choice {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(150deg, rgba(226, 180, 93, 0.1), transparent 34%),
    rgba(16, 20, 26, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.reading-mode-choice-panel::before,
.reading-mode-choice::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 2px solid rgba(226, 180, 93, 0.36);
  pointer-events: none;
}

.reading-mode-choice-panel {
  display: grid;
  gap: 0.95rem;
  padding: 0.95rem;
}

.reading-mode-choice-intro {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 2.65rem minmax(0, 1fr);
  align-items: center;
  gap: 0.12rem 0.75rem;
}

.reading-mode-choice-intro p {
  grid-column: 2;
}

.reading-mode-choice-panel p,
.reading-mode-choice-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.reading-character-list {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.2rem, 1fr));
  gap: 0.52rem;
}

.reading-character-choice,
.reading-mode-choice {
  cursor: pointer;
}

.reading-character-choice {
  position: relative;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  min-height: 2.7rem;
  border: 1px solid rgba(226, 180, 93, 0.24);
  border-radius: 8px;
  padding: 0.38rem 0.46rem;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.045), transparent 48%),
    rgba(255, 255, 255, 0.025);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.reading-character-choice:hover,
.reading-character-choice:focus-visible,
.reading-mode-choice:hover,
.reading-mode-choice:focus-visible {
  border-color: rgba(226, 180, 93, 0.78);
  outline: none;
  background: rgba(226, 180, 93, 0.11);
}

.reading-character-choice:hover,
.reading-character-choice:focus-visible {
  transform: translateY(-1px);
}

.reading-character-choice[data-selected],
.reading-mode-choice[data-selected] {
  border-color: rgba(241, 198, 109, 0.9);
  background:
    linear-gradient(135deg, rgba(226, 180, 93, 0.18), rgba(226, 180, 93, 0.055) 48%, rgba(255, 255, 255, 0.035)),
    rgba(19, 22, 27, 0.95);
  box-shadow:
    0 0 0 1px rgba(226, 180, 93, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.reading-character-avatar-wrap,
.reading-character-avatar,
.reading-character-avatar img {
  display: block;
  width: 100%;
  height: 100%;
}

.reading-character-avatar {
  overflow: hidden;
  border: 1px solid rgba(226, 180, 93, 0.46);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.reading-character-avatar img {
  object-fit: cover;
  object-position: 50% 28%;
  transform: scale(var(--avatar-zoom, 1));
}

.reading-mode-choice {
  display: grid;
  align-content: center;
  gap: 0.48rem;
  padding: 1rem;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.reading-mode-choice:hover,
.reading-mode-choice:focus-visible {
  transform: translateY(-1px);
}

.reading-mode-choice > span {
  position: relative;
  z-index: 1;
}

.reading-mode-choice-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.55rem;
  aspect-ratio: 1;
  border: 1px solid rgba(226, 180, 93, 0.38);
  border-radius: 8px;
  color: var(--accent-strong);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 48%),
    rgba(226, 180, 93, 0.09);
}

.reading-mode-choice-mark-private::before {
  content: "";
  width: 1.22rem;
  height: 1.48rem;
  border: 2px solid currentColor;
  border-radius: 4px;
  transform: rotate(-5deg);
  background:
    linear-gradient(180deg, transparent 58%, rgba(226, 180, 93, 0.24) 59% 68%, transparent 69%),
    rgba(226, 180, 93, 0.04);
}

.reading-mode-choice-mark-private::after {
  content: "";
  position: absolute;
  right: 0.52rem;
  bottom: 0.46rem;
  width: 0.42rem;
  aspect-ratio: 1;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: rgba(13, 15, 18, 0.98);
}

.reading-mode-choice-mark-eye::before {
  content: "";
  width: 1.42rem;
  aspect-ratio: 1;
  background: currentColor;
  -webkit-mask: var(--icon-eye) center / contain no-repeat;
  mask: var(--icon-eye) center / contain no-repeat;
}

.reading-mode-choice-mark-eye::after {
  display: none;
}

.reading-mode-choice-title {
  color: var(--accent-strong);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.reader-stage {
  display: grid;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.single-spread {
  grid-template-columns: minmax(0, 1fr);
}

.reader-page-unit {
  display: grid;
  grid-template-areas: "story page";
  grid-template-columns: minmax(16rem, 23rem) minmax(0, var(--page-width));
  gap: clamp(0.8rem, 1.6vw, 1.4rem);
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.reader-page-unit.has-parallel-nav {
  grid-template-columns: minmax(16rem, 23rem) minmax(0, var(--page-width));
}

.parallel-nav {
  align-self: center;
  display: grid;
  gap: 0.48rem;
  min-width: 0;
  padding: 0.76rem;
}

.parallel-nav-title {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.parallel-nav-list {
  display: grid;
  gap: 0.42rem;
}

.parallel-target {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.55rem;
  gap: 0.16rem;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.56rem 0.62rem;
  color: var(--text);
  text-align: left;
  background: rgba(21, 25, 31, 0.78);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.parallel-target:hover:not(:disabled),
.parallel-target:focus-visible {
  transform: translateX(1px);
  border-color: rgba(226, 180, 93, 0.72);
  background: rgba(226, 180, 93, 0.1);
  outline: none;
}

.parallel-target:disabled {
  cursor: default;
}

.parallel-target[data-active] {
  border-color: rgba(226, 180, 93, 0.68);
  background: rgba(226, 180, 93, 0.12);
}

.parallel-target:disabled:not([data-active]) {
  opacity: 0.45;
}

.parallel-target-copy {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

.parallel-target-avatars {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.parallel-target-avatar {
  display: block;
  width: 2rem;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(226, 180, 93, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0.2rem 0.55rem rgba(0, 0, 0, 0.24);
}

.parallel-target-avatar + .parallel-target-avatar {
  margin-left: -0.62rem;
}

.parallel-target-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  transform: scale(var(--avatar-zoom, 1));
}

.parallel-target-label {
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.08;
}

.parallel-target-detail {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.1;
}

.book-wrap {
  grid-area: page;
  display: grid;
  place-items: center;
  min-height: 0;
}

.book {
  position: relative;
  width: var(--page-width);
  max-width: 100%;
  aspect-ratio: var(--page-ratio);
  border-radius: 8px;
  background: #080a0d;
  box-shadow: 0 1.8rem 3.8rem var(--shadow);
}

.book::before,
.book::after {
  display: none;
}

.comic-page {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #f6edd4;
}

.current-page {
  z-index: 2;
}

.page-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0b0d10;
}

.page-click-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 50%;
  border: 0;
  padding: 0;
  background: transparent;
}

.page-click-zone[hidden] {
  display: none;
}

.page-click-zone-prev {
  left: 0;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M20 7 11 16l9 9' fill='none' stroke='%23080a0d' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M20 7 11 16l9 9' fill='none' stroke='%23f4f0e8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 8 16, w-resize;
}

.page-click-zone-next {
  right: 0;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='m12 7 9 9-9 9' fill='none' stroke='%23080a0d' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='m12 7 9 9-9 9' fill='none' stroke='%23f4f0e8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 24 16, e-resize;
}

.page-click-zone:focus-visible {
  outline: 2px solid rgba(226, 180, 93, 0.8);
  outline-offset: -0.35rem;
}

.mobile-page-counter {
  display: none;
}

.empty-sheet {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(37, 28, 18, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(37, 28, 18, 0.05) 1px, transparent 1px),
    #f6edd4;
  background-size: 36px 36px;
}

.empty-sheet::before {
  content: "";
  position: absolute;
  inset: 6%;
  border: 2px dashed rgba(37, 28, 18, 0.22);
}

.empty-sheet::after {
  content: "";
  position: absolute;
  inset: 10% 12%;
  border: 1px solid rgba(37, 28, 18, 0.16);
}

.story-panel {
  grid-area: story;
  min-width: 0;
}

.story-panel-close {
  display: none;
}

.panel-card,
.thumbnail-dock {
  border-radius: 8px;
  background: rgba(21, 25, 31, 0.9);
  box-shadow: 0 1.1rem 2.5rem rgba(0, 0, 0, 0.22);
}

.panel-card {
  position: relative;
  display: grid;
  gap: 0.85rem;
  border-radius: 18px;
  padding: 1.05rem 1.1rem;
  color: #1a1712;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.24)),
    #f4ecd9;
  box-shadow:
    0 0.9rem 2rem rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.panel-card::before,
.panel-card::after {
  content: "";
  position: absolute;
  top: 42%;
  pointer-events: none;
}

.panel-card::before {
  right: -0.78rem;
  width: 1.25rem;
  height: 1.25rem;
  border-right: 1px solid rgba(28, 23, 18, 0.2);
  border-bottom: 1px solid rgba(28, 23, 18, 0.2);
  background: #f4ecd9;
  transform: rotate(-18deg) skew(16deg);
  transform-origin: center;
  box-shadow: 0.35rem 0.4rem 0.65rem rgba(0, 0, 0, 0.12);
}

.panel-card::after {
  right: 0;
  width: 1rem;
  height: 1.6rem;
  background: #f4ecd9;
}

.panel-card h2 {
  margin: -0.2rem 0 -0.2rem;
  color: #1a1712;
  font-size: clamp(1.1rem, 1.5vw, 1.45rem);
  line-height: 1.08;
}

.panel-card .eyebrow {
  color: #8c6120;
}

.story-text {
  display: grid;
  gap: 0.62rem;
}

.story-text p {
  margin: 0;
  color: #3d372d;
  font-size: clamp(0.86rem, 0.92vw, 1rem);
  line-height: 1.48;
}

.route-follow-panel {
  position: relative;
  display: grid;
  gap: 0.5rem;
  padding: 0.82rem;
}

#side-route-choices:not([hidden]) .route-follow-panel {
  border-color: rgba(226, 180, 93, 0.7);
  background:
    linear-gradient(180deg, rgba(226, 180, 93, 0.16), rgba(21, 25, 31, 0.9) 42%),
    rgba(21, 25, 31, 0.9);
  box-shadow:
    0 0 0 1px rgba(226, 180, 93, 0.18),
    0 0 1.6rem rgba(226, 180, 93, 0.22),
    0 1.1rem 2.5rem rgba(0, 0, 0, 0.22);
  animation: route-choice-glow 1800ms ease-in-out infinite alternate;
}

@keyframes route-choice-glow {
  from {
    box-shadow:
      0 0 0 1px rgba(226, 180, 93, 0.14),
      0 0 1rem rgba(226, 180, 93, 0.16),
      0 1.1rem 2.5rem rgba(0, 0, 0, 0.22);
  }

  to {
    box-shadow:
      0 0 0 1px rgba(226, 180, 93, 0.28),
      0 0 2rem rgba(226, 180, 93, 0.28),
      0 1.1rem 2.5rem rgba(0, 0, 0, 0.22);
  }
}

.route-follow-panel h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.route-follow-grid {
  display: grid;
  gap: 0.58rem;
}

.route-choice {
  display: flex;
  align-items: center;
  gap: 0.66rem;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.58rem 0.66rem;
  color: var(--text);
  text-align: left;
  background: rgba(226, 180, 93, 0.08);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.route-choice:hover:not(:disabled),
.route-choice:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(226, 180, 93, 0.9);
  background: rgba(226, 180, 93, 0.16);
  outline: none;
}

.route-choice:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.route-follow-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.route-choice-label {
  font-weight: 750;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.route-choice-detail {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.18;
}

.route-choice-avatars {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding-left: 0.12rem;
}

.route-choice-avatar {
  display: block;
  width: 2.15rem;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(226, 180, 93, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0.2rem 0.55rem rgba(0, 0, 0, 0.22);
}

.route-choice-avatar + .route-choice-avatar {
  margin-left: -0.72rem;
}

.route-choice-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  transform: scale(var(--avatar-zoom, 1));
}

.chapter-sheet {
  display: grid;
  place-content: center;
  height: 100%;
  padding: 12%;
  color: #19130d;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(226, 180, 93, 0.25), transparent 52%),
    #f6edd4;
}

.chapter-sheet h2 {
  margin: 0.4rem 0 0.7rem;
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 0.92;
}

.chapter-sheet p {
  max-width: 18rem;
  margin: 0 auto;
  color: rgba(25, 19, 13, 0.72);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.42;
}

.reader-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 0;
}

.page-arrow {
  display: grid;
  place-items: center;
  width: 2.45rem;
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.page-arrow span {
  font-size: 1.2rem;
  line-height: 1;
}

.page-arrow:hover:not(:disabled),
.page-arrow:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(226, 180, 93, 0.74);
  background: var(--surface-strong);
  outline: none;
}

.page-arrow:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.page-counter {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.44rem 0.8rem;
  color: var(--muted-strong);
  background: rgba(21, 25, 31, 0.84);
  font-size: 0.9rem;
  font-weight: 700;
}

.thumbnail-dock {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 0.74rem 0.42rem 0.5rem;
  margin: 0;
  background: rgba(14, 17, 21, 0.88);
}

.thumb-strip {
  max-width: 100%;
  display: grid;
  gap: 0.55rem;
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 0.16rem 0.12rem 0.24rem;
  scrollbar-color: rgba(226, 180, 93, 0.65) rgba(255, 255, 255, 0.08);
}

.timeline-dock-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-width: 0;
}

.adjacent-thumbs {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 0.88rem;
  min-width: 0;
}

.adjacent-thumb-item {
  display: grid;
  justify-items: center;
  gap: 0.68rem;
  opacity: 0.58;
  filter: saturate(0.65) brightness(0.78);
  transition: filter 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.adjacent-thumb-item:has(.thumb-button[aria-current="true"]) {
  opacity: 1;
  filter: none;
  transform: translateY(-0.06rem);
}

.adjacent-thumb-label {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  line-height: 1;
}

.adjacent-thumb-item:has(.thumb-button[aria-current="true"]) .adjacent-thumb-label {
  color: var(--text);
}

.adjacent-thumb-item .thumb-button {
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.adjacent-thumb-item .thumb-button[aria-current="true"] {
  width: 3rem;
  flex-basis: 3rem;
  transform: scale(1.08);
}

.route-map-toggle {
  position: fixed;
  right: clamp(0.9rem, 2vw, 1.4rem);
  bottom: clamp(0.9rem, 2vw, 1.4rem);
  z-index: 40;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.7rem;
  width: max-content;
  min-height: 3.06rem;
  max-width: calc(100vw - 1.8rem);
  overflow: hidden;
  border: 1px solid rgba(226, 180, 93, 0.54);
  border-radius: 8px;
  padding: 0.52rem 0.68rem;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(226, 180, 93, 0.18), rgba(226, 180, 93, 0.05) 46%, rgba(17, 22, 28, 0.86)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 24px);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0.9rem 2.2rem rgba(0, 0, 0, 0.34);
}

.route-map-toggle:hover,
.route-map-toggle:focus-visible {
  border-color: rgba(226, 180, 93, 0.86);
  background:
    linear-gradient(135deg, rgba(226, 180, 93, 0.24), rgba(226, 180, 93, 0.08) 46%, rgba(17, 22, 28, 0.9)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.052) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 24px);
  outline: none;
}

.route-map-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.9rem;
  aspect-ratio: 1;
  border: 1px solid rgba(226, 180, 93, 0.52);
  border-radius: 7px;
  color: var(--accent-strong);
  background:
    linear-gradient(135deg, rgba(246, 237, 212, 0.18), rgba(226, 180, 93, 0.05)),
    rgba(14, 17, 21, 0.68);
}

.route-map-icon::before,
.route-map-icon::after {
  content: "";
}

.route-map-icon::before {
  display: block;
  width: 1.2rem;
  aspect-ratio: 1;
  background: currentColor;
  -webkit-mask: var(--icon-route) center / contain no-repeat;
  mask: var(--icon-route) center / contain no-repeat;
}

.route-map-icon::after {
  display: none;
}

.route-map-panel {
  display: grid;
  gap: 0.45rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-top: 0.5rem;
}

.route-map-modal {
  width: min(98vw, 112rem);
  max-width: 98vw;
  max-height: 92vh;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background: rgba(14, 17, 21, 0.98);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.55);
}

.route-map-modal::backdrop {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(4px);
}

.route-map-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: min(72vh, 44rem);
  max-height: 92vh;
}

.route-map-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
}

.route-map-dialog-header h2 {
  flex: 1;
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.route-map-recenter {
  border: 1px solid rgba(226, 180, 93, 0.36);
  border-radius: 8px;
  padding: 0.46rem 0.72rem;
  color: var(--accent-strong);
  background: rgba(226, 180, 93, 0.08);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.route-map-recenter:hover,
.route-map-recenter:focus-visible {
  border-color: rgba(226, 180, 93, 0.74);
  outline: none;
  background: rgba(226, 180, 93, 0.14);
}

.route-map-close {
  display: grid;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.route-map-close:hover,
.route-map-close:focus-visible {
  border-color: rgba(226, 180, 93, 0.74);
  outline: none;
}

.route-map-dialog-body {
  position: relative;
  overflow: hidden;
  padding: 1.35rem;
  cursor: grab;
  overscroll-behavior: contain;
  touch-action: none;
  user-select: none;
}

.route-map-dialog-body[data-panning] {
  cursor: grabbing;
}

.route-map-filter {
  position: absolute;
  top: 0.82rem;
  left: 0.82rem;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.32rem;
  max-width: calc(100% - 1.64rem);
  overflow-x: auto;
  border: 1px solid rgba(226, 180, 93, 0.24);
  border-radius: 8px;
  padding: 0.34rem;
  background: rgba(14, 17, 21, 0.88);
  box-shadow: 0 0.55rem 1.45rem rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(5px);
  cursor: auto;
  touch-action: pan-x;
}

.route-map-filter-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  border: 1px solid rgba(226, 180, 93, 0.3);
  border-radius: 999px;
  padding: 0.12rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.route-map-filter-button:hover,
.route-map-filter-button:focus-visible {
  border-color: rgba(255, 213, 128, 0.86);
  outline: none;
  background: rgba(226, 180, 93, 0.12);
}

.route-map-filter-button[data-active] {
  border-color: rgba(255, 213, 128, 0.98);
  background: rgba(226, 180, 93, 0.18);
  box-shadow:
    0 0 0 1px rgba(255, 213, 128, 0.32),
    0 0.28rem 0.8rem rgba(226, 180, 93, 0.18);
}

.route-map-filter-locked {
  min-height: 2.7rem;
}

.route-map-filter-locked .route-map-filter-avatars {
  width: 2rem;
  aspect-ratio: 1;
}

.route-map-filter-locked-label {
  padding-right: 0.18rem;
  color: var(--accent-strong);
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.route-map-filter-all {
  width: auto;
  min-width: 2.7rem;
  padding: 0 0.52rem;
  color: var(--accent-strong);
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.route-map-filter-avatars,
.route-map-filter-avatar,
.route-map-filter-avatar img {
  display: block;
  width: 100%;
  height: 100%;
}

.route-map-filter-avatar {
  overflow: hidden;
  border-radius: inherit;
}

.route-map-filter-avatar img {
  object-fit: cover;
  object-position: 50% 28%;
  transform: scale(var(--avatar-zoom, 1));
}

.route-map-panel-title {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.route-map {
  position: relative;
  display: grid;
  grid-template-columns: max-content 5.75rem max-content 5.75rem max-content 5.75rem max-content;
  grid-template-rows: repeat(5, minmax(5.6rem, auto));
  align-items: center;
  gap: 0.95rem 1rem;
  min-width: max-content;
  padding: 0.65rem;
  transform-origin: 0 0;
  touch-action: none;
  will-change: transform;
}

.route-connectors {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.route-connectors > path {
  fill: none;
  stroke: rgba(226, 180, 93, 0.7);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition:
    opacity 160ms ease,
    stroke 160ms ease,
    stroke-width 160ms ease;
}

.route-connectors marker path {
  fill: rgba(226, 180, 93, 0.82);
}

.route-branch {
  position: relative;
  z-index: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 0.62rem;
  width: max-content;
  max-width: max-content;
  min-height: 4.35rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.42rem;
  background: rgba(14, 17, 21, 0.94);
  box-shadow: 0 0.6rem 1.4rem rgba(0, 0, 0, 0.18);
  transition:
    opacity 160ms ease,
    filter 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.route-branch[data-active] {
  border-color: rgba(226, 180, 93, 0.52);
  background: rgba(226, 180, 93, 0.08);
}

.route-common {
  grid-column: 1;
  grid-row: 3;
}

.route-act-linear {
  grid-column: 1 / -1;
  grid-row: 1;
}

.route-pitus {
  grid-column: 3;
  grid-row: 1;
}

.route-main {
  grid-column: 3;
  grid-row: 3;
}

.route-rael {
  grid-column: 3;
  grid-row: 4;
  margin-left: clamp(19rem, 25vw, 28rem);
}

.route-ymelia {
  grid-column: 3;
  grid-row: 2;
  margin-left: clamp(23rem, 33vw, 36rem);
}

.route-gedeon {
  grid-column: 3;
  grid-row: 5;
  margin-left: clamp(10rem, 12vw, 14rem);
}

.route-candide {
  grid-column: 5;
  grid-row: 3;
}

.route-join {
  grid-column: 5;
  grid-row: 2;
}

.route-pitus-tessa {
  grid-column: 7;
  grid-row: 1;
}

.route-zone-fantome {
  grid-column: 7;
  grid-row: 2;
}

.route-branch-header {
  display: grid;
  gap: 0.34rem;
  flex: 0 0 auto;
  min-width: 4.7rem;
}

.route-branch-title {
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  line-height: 1.05;
  text-transform: uppercase;
}

.route-branch-avatars {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.route-branch-avatar {
  display: block;
  width: 1.72rem;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(226, 180, 93, 0.46);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0.16rem 0.42rem rgba(0, 0, 0, 0.24);
}

.route-branch-avatar + .route-branch-avatar {
  margin-left: -0.48rem;
}

.route-branch-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  transform: scale(var(--avatar-zoom, 1));
}

.route-branch-pages {
  display: flex;
  align-items: center;
  gap: 0.48rem;
}

.route-pending {
  display: grid;
  place-items: center;
  width: 4.35rem;
  min-height: 3.55rem;
  border: 1px dashed rgba(226, 180, 93, 0.42);
  border-radius: 8px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.thumb-button {
  position: relative;
  flex: 0 0 2.35rem;
  width: 2.35rem;
  border: 0;
  border-radius: 6px;
  padding: 0.14rem;
  background: transparent;
  cursor: pointer;
  overflow: visible;
}

.route-map .thumb-button {
  flex-basis: 3.1rem;
  width: 3.1rem;
}

.route-map[data-route-filter-active] .route-branch[data-route-dimmed] {
  opacity: 0.2;
  filter: saturate(0.42) brightness(0.62);
}

.route-map[data-route-filter-active] .route-branch[data-route-highlighted] {
  border-color: rgba(255, 213, 128, 0.82);
  background: rgba(226, 180, 93, 0.11);
  box-shadow:
    0 0.7rem 1.6rem rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 213, 128, 0.18);
}

.route-map[data-route-filter-active] .thumb-button[data-route-dimmed] {
  opacity: 0.24;
  filter: saturate(0.32) brightness(0.58);
}

.route-map[data-route-filter-active] .thumb-button[data-route-highlighted] .thumb-page {
  border-color: rgba(255, 213, 128, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 213, 128, 0.32),
    0 0.34rem 0.78rem rgba(226, 180, 93, 0.18);
}

.route-map[data-route-filter-active] .route-connectors > path[data-route-dimmed] {
  opacity: 0.16;
  stroke: rgba(226, 180, 93, 0.32);
}

.route-map[data-route-filter-active] .route-connectors > path[data-route-highlighted] {
  opacity: 1;
  stroke: rgba(255, 213, 128, 0.98);
  stroke-width: 1.9;
}

.thumb-button[aria-current="true"] {
  box-shadow: 0 0 0 2px rgba(226, 180, 93, 0.84);
}

.thumb-button:hover,
.thumb-button:focus-visible {
  outline: none;
}

.thumb-page {
  display: block;
  width: 100%;
  aspect-ratio: var(--page-ratio);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(37, 28, 18, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(37, 28, 18, 0.08) 1px, transparent 1px),
    #f6edd4;
  background-size: 14px 14px;
}

.thumb-page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.thumb-chapter {
  display: grid;
  place-items: center;
  color: #19130d;
  background: #f6edd4;
  font-size: 0.72rem;
  font-weight: 800;
}

.thumb-number {
  position: absolute;
  top: -0.04rem;
  right: -0.04rem;
  display: grid;
  place-items: center;
  min-width: 1.15rem;
  min-height: 1.15rem;
  border-radius: 999px;
  padding: 0.02rem 0.28rem;
  color: #14171b;
  background: var(--text);
  box-shadow: 0 0.15rem 0.35rem rgba(0, 0, 0, 0.38);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
}

@media (max-width: 820px) {
  :root {
    --page-width: min(calc(100vw - 1.2rem), calc((100svh - 7.4rem) * 0.6667));
  }

  body {
    overflow: auto;
    min-height: 100vh;
  }

  .reader-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.55rem;
    min-height: auto;
    padding: 0.52rem 0.44rem 0.72rem;
  }

  .reader-heading {
    width: 100%;
    margin-bottom: 0.45rem;
  }

  .reader-chapter-jump {
    min-width: 0;
  }

  .chapter-select-button {
    min-width: 0;
  }

  .reader-chapter-jump .chapter-select-menu {
    left: auto;
    right: 0;
    width: min(24rem, calc(100vw - 0.9rem));
  }

  .reader-controls {
    position: static;
    gap: 0.55rem;
  }

  .page-nav-card {
    display: none;
  }

  .reader-stage {
    align-items: start;
  }

  .reader-page-unit {
    position: relative;
    grid-template-areas: "page";
    grid-template-columns: minmax(0, var(--page-width));
    align-content: start;
  }

  .reader-page-unit.has-parallel-nav {
    grid-template-columns: minmax(0, var(--page-width));
  }

  .parallel-nav {
    width: min(100%, var(--page-width));
    margin: 0.65rem auto 0;
  }

  .parallel-nav-list {
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  }

  .panel-card {
    max-width: none;
  }

  .panel-card::before,
  .panel-card::after {
    display: none;
  }

  .story-panel {
    position: absolute;
    top: clamp(0.52rem, 2.2vw, 0.78rem);
    right: clamp(0.52rem, 2.2vw, 0.78rem);
    bottom: auto;
    left: auto;
    z-index: 6;
    width: auto;
    cursor: pointer;
    transform: none;
  }

  .story-panel[data-story-expanded="true"] {
    top: auto;
    left: clamp(0.56rem, 2.4vw, 0.9rem);
    right: clamp(0.56rem, 2.4vw, 0.9rem);
    bottom: clamp(0.58rem, 2.5vw, 0.92rem);
    width: auto;
    cursor: default;
    transform: none;
  }

  .story-panel .panel-card {
    display: grid;
    place-items: center;
    width: 2.82rem;
    aspect-ratio: 1;
    gap: 0;
    max-height: none;
    overflow: hidden;
    border: 1px solid rgba(226, 180, 93, 0.22);
    border-radius: 10px;
    padding: 0;
    color: var(--text);
    background:
      radial-gradient(circle at 78% 22%, rgba(226, 180, 93, 0.2), transparent 34%),
      linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 48%),
      rgba(12, 15, 19, 0.68);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.22),
      0 0.55rem 1.25rem rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(10px);
    -webkit-overflow-scrolling: touch;
  }

  .story-panel .panel-card::before {
    content: "";
    position: static;
    display: block;
    width: 1.58rem;
    aspect-ratio: 1;
    background: rgba(244, 240, 232, 0.82);
    -webkit-mask: var(--icon-message) center / contain no-repeat;
    mask: var(--icon-message) center / contain no-repeat;
  }

  .story-panel .panel-card::after {
    display: none;
  }

  .story-panel[data-story-expanded="true"] .panel-card {
    display: grid;
    place-items: stretch;
    width: auto;
    aspect-ratio: auto;
    gap: 0.5rem;
    max-height: min(34svh, 13.5rem);
    overflow-y: auto;
    border: 1px solid rgba(226, 180, 93, 0.26);
    border-radius: 8px;
    padding: 0.7rem 2.64rem 0.78rem 0.78rem;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 36%),
      rgba(12, 15, 19, 0.82);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.34),
      0 0.8rem 1.8rem rgba(0, 0, 0, 0.38);
    scrollbar-color: rgba(226, 180, 93, 0.78) rgba(255, 255, 255, 0.12);
    scrollbar-width: thin;
  }

  .story-panel[data-story-expanded="true"] .panel-card::before {
    display: none;
  }

  .story-panel[data-story-expanded="true"] .panel-card::after {
    display: none;
  }

  .story-panel[data-story-expanded="true"] .story-panel-close {
    position: absolute;
    top: 0.48rem;
    right: 0.48rem;
    display: grid;
    place-items: center;
    width: 1.72rem;
    aspect-ratio: 1;
    border: 1px solid rgba(226, 180, 93, 0.32);
    border-radius: 999px;
    padding: 0;
    color: rgba(244, 240, 232, 0.86);
    background: rgba(8, 10, 13, 0.42);
    box-shadow: 0 0.34rem 0.82rem rgba(0, 0, 0, 0.22);
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1;
  }

  .story-panel[data-story-expanded="true"] .story-panel-close:hover,
  .story-panel[data-story-expanded="true"] .story-panel-close:focus-visible {
    border-color: rgba(226, 180, 93, 0.68);
    color: var(--text);
    outline: none;
    background: rgba(226, 180, 93, 0.16);
  }

  .story-panel[data-story-expanded="true"] .panel-card::-webkit-scrollbar {
    width: 0.36rem;
  }

  .story-panel[data-story-expanded="true"] .panel-card::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
  }

  .story-panel[data-story-expanded="true"] .panel-card::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(226, 180, 93, 0.76);
  }

  .story-panel .panel-card h2 {
    display: none;
    margin: -0.1rem 0 0;
    color: var(--text);
    overflow: hidden;
    font-size: clamp(0.88rem, 2.55vw, 1.02rem);
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .story-panel[data-story-expanded="true"] .panel-card h2 {
    display: block;
    font-size: clamp(0.96rem, 2.7vw, 1.12rem);
    white-space: normal;
  }

  .story-panel .panel-card .eyebrow {
    display: none;
    color: var(--accent-strong);
    font-size: 0.58rem;
  }

  .story-panel[data-story-expanded="true"] .panel-card .eyebrow {
    display: block;
  }

  .story-panel .story-text {
    display: none;
    gap: 0.44rem;
  }

  .story-panel[data-story-expanded="true"] .story-text {
    display: grid;
  }

  .story-panel .story-text p {
    color: rgba(244, 240, 232, 0.86);
    font-size: clamp(0.78rem, 2.35vw, 0.92rem);
    line-height: 1.4;
  }

  .page-click-zone {
    z-index: 5;
    width: 30%;
    cursor: pointer;
  }

  .page-click-zone::before {
    content: "";
    position: absolute;
    top: 46%;
    display: grid;
    place-items: center;
    width: clamp(2.35rem, 8vw, 2.85rem);
    aspect-ratio: 1;
    border: 1px solid rgba(246, 237, 212, 0.18);
    border-radius: 999px;
    color: rgba(244, 240, 232, 0.66);
    background: rgba(8, 10, 13, 0.22);
    box-shadow: 0 0.55rem 1.2rem rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(6px);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
    opacity: 0.48;
    transform: translateY(-50%);
  }

  .page-click-zone-prev::before {
    content: "←";
    left: clamp(0.34rem, 1.8vw, 0.7rem);
  }

  .page-click-zone-next::before {
    content: "→";
    right: clamp(0.34rem, 1.8vw, 0.7rem);
  }

  .mobile-page-counter {
    position: absolute;
    top: clamp(0.5rem, 2vw, 0.74rem);
    left: 50%;
    z-index: 5;
    display: block;
    border: 1px solid rgba(246, 237, 212, 0.22);
    border-radius: 999px;
    padding: 0.36rem 0.68rem;
    color: rgba(244, 240, 232, 0.9);
    background: rgba(8, 10, 13, 0.46);
    box-shadow: 0 0.55rem 1.35rem rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(7px);
    font-size: clamp(0.68rem, 2.2vw, 0.8rem);
    font-weight: 850;
    line-height: 1;
    transform: translateX(-50%);
  }
}

@media (max-width: 680px) {
  :root {
    --page-width: min(calc(100vw - 0.7rem), calc((100svh - 6.7rem) * 0.6667));
  }

  .reader-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.46rem;
  }

  .brand-main {
    flex-wrap: wrap;
    gap: 0.28rem 0.5rem;
  }

  .brand {
    gap: 0.46rem;
  }

  .brand-mark {
    width: 1.42rem;
    border-radius: 7px;
  }

  .brand strong {
    font-size: 0.78rem;
  }

  .brand small {
    display: none;
  }

  .reader-title-block {
    max-width: 100%;
    gap: 0.26rem;
    font-size: clamp(0.66rem, 2.7vw, 0.8rem);
  }

  .reader-title-block::before {
    display: none;
  }

  .chapter-jump {
    width: 100%;
  }

  .chapter-select-button {
    width: 100%;
    gap: 0.34rem;
    padding: 0.45rem 0.48rem;
  }

  .chapter-select-icon {
    width: 1.05rem;
    border-radius: 5px;
    font-size: 0.76rem;
  }

  .chapter-option {
    padding: 0.5rem 0.54rem;
    font-size: 0.76rem;
  }

  .reading-mode-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .reading-mode-card {
    width: auto;
    padding: 0;
    border-radius: 10px;
  }

  .reading-mode-kicker,
  .reading-mode-switch-copy {
    display: none;
  }

  .reading-mode-switch {
    grid-template-columns: 1fr;
    width: 2.84rem;
    height: 2.84rem;
    min-height: 2.84rem;
    padding: 0.42rem;
  }

  .reading-mode-visual {
    width: 1.86rem;
  }

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

  .route-map-toggle {
    right: 0.75rem;
    bottom: 0.75rem;
    gap: 0.52rem;
    height: 2.84rem;
    min-height: 2.84rem;
    max-width: calc(100vw - 1.5rem);
    padding: 0.42rem 0.58rem;
    background:
      linear-gradient(135deg, rgba(226, 180, 93, 0.18), rgba(226, 180, 93, 0.08) 42%, rgba(14, 17, 21, 0.96)),
      rgba(14, 17, 21, 0.96);
    box-shadow:
      0 0 0 1px rgba(14, 17, 21, 0.72),
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 0.9rem 2rem rgba(0, 0, 0, 0.46);
    backdrop-filter: blur(5px);
  }

  .route-map-icon {
    width: 1.86rem;
  }

  .reader-shell {
    min-height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  #side-route-choices:not([hidden]) .route-follow-panel {
    animation: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
