@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500&display=swap");
:root {
  --bg: #101411;
  --panel: #191f1a;
  --text: #ece9dd;
  --muted: #9aab9d;
  --line: #364337;
  --accent: #c4d1a1;
  --size: 20px;
  --font: Georgia, serif;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px "DM Sans",
    sans-serif;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  color: inherit;
}
button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 17px;
}
button:hover,
a:hover {
  color: var(--accent);
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.3;
  cursor: default;
}
a {
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
header {
  height: 104px;
  max-width: 1350px;
  margin: auto;
  padding: 0 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: Georgia, serif;
  font-size: 25px;
  letter-spacing: 3px;
}
.brand span {
  display: block;
  font:
    8px "DM Sans",
    sans-serif;
  letter-spacing: 3px;
  margin-top: 6px;
  color: var(--muted);
}
nav {
  display: flex;
  gap: 12px;
}
nav button {
  border: 0;
}
nav #settings {
  font: 22px Georgia;
  border: 1px solid var(--line);
  padding: 7px 13px;
}
.hero {
  max-width: 1250px;
  margin: auto;
  min-height: 690px;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 9%;
  align-items: center;
  padding: 65px 6% 60px;
}
.art {
  position: relative;
  text-align: center;
  isolation: isolate;
}
.art:before {
  content: "";
  position: absolute;
  inset: -60px;
  background: radial-gradient(ellipse, #84987930, transparent 65%);
  z-index: -2;
}
.orbit {
  position: absolute;
  width: 112%;
  height: 75%;
  border: 1px solid #73836340;
  border-radius: 50%;
  transform: rotate(-28deg);
  left: -6%;
  top: 12%;
  z-index: -1;
}
.art img {
  width: 78%;
  max-height: 455px;
  object-fit: cover;
  box-shadow: 15px 25px 60px #0008;
  transform: rotate(-4deg);
  border: 1px solid #aec0a555;
  border-radius: 3px;
}
.art-caption {
  display: block;
  margin-top: 38px;
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--muted);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 22px;
}
h1 {
  font:
    500 clamp(45px, 5vw, 72px)/1.1 "Playfair Display",
    Georgia,
    serif;
  letter-spacing: -2px;
  margin: 0;
}
h1 em {
  color: var(--accent);
}
.summary {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
  margin: 25px 0 30px;
}
.editions {
  padding: 0;
  border: 0;
  display: flex;
  gap: 10px;
  margin: 0 0 25px;
}
.editions legend {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 12px;
}
.editions button {
  text-align: left;
  flex: 1;
  padding: 14px;
}
.editions button span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 6px;
}
.selected {
  border-color: var(--accent);
  background: #a9bf8e10;
}
.actions {
  display: flex;
  align-items: center;
  gap: 22px;
}
.primary {
  background: var(--accent);
  color: #172015;
  border: 0;
  min-width: 190px;
  padding: 16px 20px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.primary:hover {
  background: #d9e4ba;
  color: #172015;
}
.actions a {
  font-size: 11px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}
.muted {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
#resume-note {
  margin-top: 18px;
}
footer {
  max-width: 1200px;
  margin: auto;
  border-top: 1px solid var(--line);
  padding: 25px 3%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.5px;
}
footer button {
  border: 0;
  font-size: 11px;
  letter-spacing: 0;
}
#reader {
  max-width: 900px;
  margin: auto;
  padding: 30px 30px 60px;
}
.reader-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}
.reader-meta button {
  border: 0;
  font-size: 11px;
}
article {
  max-width: 700px;
  margin: 60px auto;
  font: var(--size)/1.9 var(--font);
  overflow-wrap: anywhere;
}
article h1 {
  font:
    500 2em/1.3 "Playfair Display",
    Georgia,
    serif;
  letter-spacing: -0.5px;
  margin-bottom: 40px;
}
article h2 {
  font-size: 1.25em;
}
article p {
  margin: 1.1em 0;
}
article p:empty {
  display: none;
}
.reader-nav {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.end-note {
  text-align: center;
  color: var(--muted);
}
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: min(640px, 94vw);
  max-height: 85vh;
  padding: 26px;
}
dialog::backdrop {
  background: #000a;
  backdrop-filter: blur(8px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.dialog-head h2 {
  font: 25px Georgia;
  margin: 0;
}
.dialog-head button {
  border: 0;
  padding: 8px;
}
label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin: 18px 0;
}
select,
input {
  font:
    14px "DM Sans",
    sans-serif;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 12px;
  border-radius: 5px;
  width: 100%;
  margin-top: 8px;
}
input[type="range"] {
  accent-color: var(--accent);
}
#chapter-results {
  max-height: 47vh;
  overflow: auto;
}
#chapter-results button {
  display: block;
  text-align: left;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  line-height: 1.7;
  padding: 16px 10px;
}
#chapter-results small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #142016;
  border-radius: 6px;
  padding: 12px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#toast.show {
  opacity: 1;
}
[hidden] {
  display: none !important;
}
body[data-theme="light"] {
  --bg: #fafbf7;
  --panel: #fff;
  --text: #202820;
  --muted: #667363;
  --line: #d8dfd1;
  --accent: #58703a;
  color-scheme: light;
}
body[data-theme="sepia"] {
  --bg: #eee6d4;
  --panel: #f7efde;
  --text: #342e23;
  --muted: #776e5d;
  --line: #d1c5ac;
  --accent: #626d3c;
  color-scheme: light;
}
body:not([data-theme="dark"]) .primary {
  color: white;
}
body[data-theme="dark"] .primary {
  color: #172015;
}
@media (max-width: 720px) {
  header {
    height: 80px;
    padding: 0 6%;
  }
  nav {
    gap: 0;
  }
  nav button {
    padding: 10px;
    font-size: 12px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 45px 7%;
  }
  .art img {
    width: 180px;
    max-height: 260px;
  }
  .orbit {
    width: 250px;
    left: calc(50% - 125px);
  }
  .art-caption {
    margin-top: 24px;
  }
  .intro {
    text-align: center;
  }
  h1 {
    font-size: 49px;
  }
  .eyebrow {
    font-size: 9px;
  }
  .editions {
    text-align: left;
  }
  .actions {
    justify-content: center;
    gap: 18px;
  }
  .primary {
    min-width: 165px;
  }
  .summary {
    margin: 20px 0;
  }
  footer {
    margin: 0 7%;
    padding: 20px 0;
    gap: 15px;
    line-height: 1.7;
  }
  footer span {
    max-width: 160px;
  }
  #reader {
    padding: 20px;
  }
  .reader-meta {
    flex-wrap: wrap;
  }
  .reader-meta button {
    padding: 9px 0;
  }
  article {
    margin: 35px auto;
  }
  article h1 {
    font-size: 1.65em;
  }
  .reader-nav button {
    padding: 12px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
body[data-theme="nord"] {
  --bg: #2e3440;
  --panel: #3b4252;
  --text: #eceff4;
  --muted: #b8c4d7;
  --line: #515e73;
  --accent: #88c0d0;
}
body[data-theme="dracula"] {
  --bg: #282a36;
  --panel: #343746;
  --text: #f8f8f2;
  --muted: #b5b5cd;
  --line: #56586c;
  --accent: #bd93f9;
}
body[data-theme="solarized"] {
  --bg: #002b36;
  --panel: #073642;
  --text: #c6d4d4;
  --muted: #93a1a1;
  --line: #315561;
  --accent: #b6ca72;
}
body[data-theme="mocha"] {
  --bg: #1e1e2e;
  --panel: #313244;
  --text: #cdd6f4;
  --muted: #bac2de;
  --line: #585b70;
  --accent: #cba6f7;
}
body[data-theme="oled"] {
  --bg: #000;
  --panel: #141414;
  --text: #eee;
  --muted: #aaa;
  --line: #383838;
  --accent: #d2e7af;
}
body[data-theme] .primary {
  color: var(--bg);
}
.font-sample {
  font: var(--size)/1.7 var(--font);
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
#chapter-index {
  display: grid;
  grid-template-columns: minmax(280px, 35%) 1fr;
  max-width: 1600px;
  margin: auto;
}
.index-book {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 30px 8%;
  text-align: center;
  border-right: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 30%, #80977e20, transparent 65%);
}
.index-back {
  display: block;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 25px;
}
.index-book img {
  width: 65%;
  max-width: 260px;
  max-height: 340px;
  object-fit: contain;
  box-shadow: 0 15px 45px #0004;
  border-radius: 6px;
}
.index-book h1 {
  font-size: 34px;
  letter-spacing: -1px;
  margin: 24px 0 18px;
}
.index-book .eyebrow {
  letter-spacing: 2px;
}
.index-actions {
  display: flex;
  gap: 12px;
  margin: 30px 0;
}
.index-actions .primary {
  flex: 1;
  justify-content: center;
  font-size: 13px;
  min-width: 0;
}
.index-actions > a:last-child {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 23px;
}
.index-book .summary {
  text-align: left;
  font:
    17px/1.8 Georgia,
    serif;
}
.index-main {
  min-width: 0;
  padding: 0 24px 30px;
}
.index-toolbar {
  display: flex;
  gap: 12px;
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 20px 0;
  z-index: 1;
  border-bottom: 1px solid var(--line);
}
.index-toolbar input,
.index-toolbar select {
  margin: 0;
}
.index-toolbar input {
  flex: 1;
  min-width: 0;
}
.index-toolbar select {
  width: 220px;
}
.index-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  padding: 15px 0;
}
.index-status h2 {
  font-size: 13px;
  font-weight: 500;
}
.chapter-card {
  display: block;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 21px 24px;
  margin-bottom: 12px;
  border-radius: 9px;
  min-height: 100px;
  transition: background 0.15s;
}
.chapter-card small {
  color: var(--muted);
  font:
    11px/1.6 ui-monospace,
    monospace;
  letter-spacing: 1px;
}
.chapter-card h3 {
  font:
    600 22px/1.4 Georgia,
    serif;
  margin: 6px 65px 0 0;
  color: var(--accent);
}
.chapter-badge {
  position: absolute;
  right: 14px;
  top: 14px;
  font:
    9px ui-monospace,
    monospace;
  background: var(--bg);
  padding: 5px 9px;
  border-radius: 20px;
  color: var(--muted);
  letter-spacing: 1px;
}
.chapter-card:hover,
.chapter-card.last-read {
  background: var(--accent);
  color: var(--bg);
}
.chapter-card:hover h3,
.chapter-card.last-read h3,
.chapter-card:hover small,
.chapter-card.last-read small {
  color: var(--bg);
}
#support .primary {
  width: fit-content;
}
.index-main #index-results:empty {
  min-height: 200px;
}
@media (max-width: 850px) {
  #chapter-index {
    grid-template-columns: 1fr;
  }
  .index-book {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 25px 7%;
  }
  .index-book img {
    width: 140px;
    max-height: 200px;
  }
  .index-book h1 {
    font-size: 30px;
  }
  .index-book .summary,
  .index-book > p.muted:last-child {
    display: none;
  }
  .index-actions {
    max-width: 420px;
    margin: 22px auto;
  }
  .index-book .eyebrow {
    margin-bottom: 15px;
  }
  .index-main {
    padding: 0 16px 20px;
  }
  .index-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .index-toolbar input {
    width: calc(100% - 65px);
    flex: auto;
  }
  .index-toolbar select {
    width: 100%;
  }
  .chapter-card {
    padding: 20px 16px;
  }
  .chapter-card h3 {
    font-size: 20px;
  }
  header {
    height: auto;
    min-height: 90px;
    gap: 12px;
    flex-wrap: wrap;
    padding: 15px 5%;
  }
  nav {
    flex-wrap: wrap;
  }
  nav button {
    font-size: 11px;
    padding: 9px;
  }
  .chapter-badge {
    font-size: 8px;
  }
  .brand {
    font-size: 23px;
  }
}
/* Supplied artwork stays sharp: just 1px blur and 30% dimming. */
body {
  isolation: isolate;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: -3px;
  z-index: -2;
  background: url("assets/background.png") center center/cover no-repeat;
  filter: blur(1px) brightness(0.7);
  pointer-events: none;
}
header {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}
.intro {
  background: color-mix(in srgb, var(--bg) 87%, transparent);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.hero {
  gap: 6%;
  padding-left: 4%;
  padding-right: 4%;
}
footer {
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  padding: 20px 25px;
  border-radius: 10px;
}
.art-caption {
  display: table;
  margin: 38px auto 0;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-radius: 4px;
}
#reader {
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  min-height: calc(100vh - 104px);
}
.index-book {
  background: color-mix(in srgb, var(--bg) 90%, transparent);
}
.index-main {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}
.info-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font:
    600 22px Georgia,
    serif;
  color: var(--accent);
  align-self: center;
}
.size-control {
  margin: 24px 0;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.size-control > div {
  display: flex;
  align-items: center;
  gap: 14px;
}
.size-control button {
  font-size: 23px;
  width: 44px;
  height: 44px;
  padding: 0;
}
.size-control output {
  min-width: 52px;
  text-align: center;
  font-size: 15px;
  color: var(--text);
}
.info-page {
  padding: 60px 7%;
}
.info-back {
  position: fixed;
  top: 20px;
  left: 20px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent);
  font-size: 27px;
  z-index: 2;
}
.info-shell {
  max-width: 1100px;
  margin: auto;
  padding: 50px 55px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 25px 80px #0005;
}
.info-heading {
  text-align: center;
  margin-bottom: 44px;
}
.info-heading h1 {
  font-size: 54px;
  background: linear-gradient(110deg, #ffb46d, #ff637d, #cf67d9);
  background-clip: text;
  color: transparent;
  font-weight: 700;
  letter-spacing: -1px;
}
.info-heading > p {
  font:
    italic 17px/1.7 Georgia,
    serif;
  color: var(--muted);
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 35px;
}
.info-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 25px;
  margin-bottom: 24px;
  background: color-mix(in srgb, var(--bg) 65%, transparent);
}
.info-card h2 {
  font:
    600 22px Georgia,
    serif;
  margin: 0 0 20px;
}
.info-card h2 > span {
  color: #eaa077;
  margin-right: 9px;
}
.info-card p {
  font:
    16px/1.8 Georgia,
    serif;
  color: var(--muted);
}
.info-card p:last-child {
  margin-bottom: 0;
}
.identity-card {
  overflow: hidden;
  border: 1px solid #eec498;
  border-radius: 16px;
  background: #f1cd9f;
  color: #24251f;
  margin-bottom: 24px;
}
.identity-art {
  height: 160px;
  background: url("assets/background.png") center 43% / cover;
}
.identity-copy {
  padding: 0 25px 24px;
}
.identity-icon {
  display: grid;
  place-items: center;
  width: 65px;
  height: 65px;
  margin-top: -30px;
  position: relative;
  border: 4px solid #f1cd9f;
  background: #282b23;
  border-radius: 50%;
  font: 30px Georgia;
  color: #f1cd9f;
}
.identity-copy h2 {
  font:
    700 27px/1.2 Georgia,
    serif;
  margin: 14px 0;
}
.info-tag {
  font-size: 8px;
  letter-spacing: 1.5px;
}
.identity-copy p {
  font:
    16px/1.7 Georgia,
    serif;
}
.edition-credit {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.edition-credit > span {
  font-size: 10px;
  color: var(--muted);
}
.info-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.info-links a {
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 15px 6px;
  color: var(--accent);
  font-size: 12px;
}
.info-foot {
  text-align: center;
  color: var(--muted);
  font:
    12px Georgia,
    serif;
  margin: 40px 0 0;
}
@media (max-width: 720px) {
  .intro {
    padding: 24px 18px;
  }
  .info-page {
    padding: 75px 4% 25px;
  }
  .info-shell {
    padding: 30px 20px;
  }
  .info-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .info-heading h1 {
    font-size: 38px;
  }
  .info-heading > p {
    font-size: 15px;
  }
  .info-card {
    padding: 22px;
  }
  .hero {
    padding: 35px 5%;
  }
  .art-caption {
    margin-top: 20px;
  }
  .info-back {
    position: absolute;
  }
  body::before {
    background-position: 40% center;
  }
}

.community-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 4px 0 20px;
}
.community-links .community-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 9px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px 5px;
  font-size: 11px;
  color: var(--accent);
}
.community-link[data-community="githubUrl"] {
  color: #87cdd2;
}
.community-link[data-community="contributionUrl"],
.contribution-button {
  color: #e0bb85;
}
.community-link[data-community="donationUrl"] {
  color: #f08eb4;
}
.community-link[data-community="discordUrl"] {
  color: #b89cf2;
}
.community-link:hover {
  background: var(--panel);
}
#community-notice {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 8px 35px #0007;
  z-index: 100;
  font-size: 13px;
  text-align: center;
}
@media (max-width: 420px) {
  .community-links {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* Full-width header with balanced, viewport-relative gutters. */
body > header {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-left: clamp(20px, 5vw, 76px);
  padding-right: clamp(20px, 5vw, 76px);
}
body > header > nav {
  align-items: center;
  justify-content: flex-end;
}
@media (max-width: 480px) {
  body > header {
    padding: 16px 20px;
    justify-content: center;
    gap: 14px;
  }
  body > header > .brand {
    text-align: center;
  }
  body > header > nav {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }
}

#comments {
  margin: 45px auto 0;
  max-width: 740px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
#comments h2 {
  font:
    26px Georgia,
    serif;
}
#giscus-thread {
  margin-top: 24px;
  min-width: 0;
}
.giscus-frame {
  width: 100%;
  border: 0;
}

/* In-reader chapter picker: the underlying chapter stays in place. */
.chapter-popup-open {
  overflow: hidden;
}
#contents {
  width: min(680px, 94vw);
  max-height: 85dvh;
  padding: 25px 20px 15px;
  overflow: hidden;
}
#contents .dialog-head {
  margin: 0 0 22px;
}
#contents .dialog-head h2 {
  color: var(--accent);
  font-weight: 600;
}
#contents .dialog-head h2:after {
  content: "";
  display: block;
  width: 32px;
  height: 3px;
  background: var(--accent);
  border-radius: 4px;
  margin-top: 12px;
}
.popup-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.popup-filters input,
.popup-filters select {
  width: 100%;
  min-width: 0;
  margin: 0;
}
#contents #count {
  margin: 12px 4px;
}
#contents #chapter-results {
  position: relative;
  max-height: calc(85dvh - 210px);
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
}
#chapter-results .popup-chapter {
  display: flex;
  align-items: baseline;
  gap: 15px;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 7px;
  padding: 13px 15px;
  margin: 3px 0;
  line-height: 1.5;
  color: var(--text);
}
.popup-number {
  min-width: 40px;
  color: var(--muted);
  font:
    12px ui-monospace,
    monospace;
}
.popup-title {
  font:
    16px/1.5 Georgia,
    serif;
  flex: 1;
}
.popup-star {
  color: var(--accent);
  font-size: 12px;
}
#chapter-results .popup-chapter:hover,
#chapter-results .current-chapter {
  background: color-mix(in srgb, var(--accent) 13%, var(--panel));
  color: var(--accent);
}
#chapter-results .current-chapter .popup-number {
  color: var(--accent);
}
@media (max-width: 480px) {
  #contents {
    padding: 20px 14px 12px;
  }
  .popup-filters {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  #contents #chapter-results {
    max-height: calc(85dvh - 250px);
  }
  .popup-title {
    font-size: 15px;
  }
  #chapter-results .popup-chapter {
    padding: 12px 10px;
    gap: 8px;
  }
}
/* User-controlled wallpaper, shared by every page. */
:root {
  --wallpaper: url("assets/background.png");
  --wallpaper-color: #101411;
  --wallpaper-blur: 1px;
  --wallpaper-brightness: 0.7;
  --wallpaper-zoom: 1;
  --wallpaper-position: 50% 50%;
  --reading-opacity: 97%;
}
body::before {
  inset: -45px;
  background-image: var(--wallpaper);
  background-color: var(--wallpaper-color);
  background-position: var(--wallpaper-position);
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(var(--wallpaper-blur)) brightness(var(--wallpaper-brightness));
  transform: scale(var(--wallpaper-zoom));
}
#reader {
  background: color-mix(in srgb, var(--bg) var(--reading-opacity), transparent);
}
.background-open.info-button {
  padding: 7px;
  border: 1px solid var(--line);
  min-width: 38px;
}
.info-page > .background-open {
  position: absolute;
  right: 22px;
  top: 22px;
  background: var(--bg);
}
.background-preferences-link {
  width: 100%;
  text-align: left;
  margin-top: 12px;
}
#background-settings {
  width: min(540px, 94vw);
  max-height: 90dvh;
  padding: 24px;
  overscroll-behavior: contain;
}
#background-settings .dialog-head {
  margin-bottom: 16px;
}
#background-settings .eyebrow {
  font-size: 9px;
  margin: 0 0 8px;
}
#background-settings .dialog-head h2 {
  font-size: 27px;
}
#background-settings > label {
  margin: 18px 0 0;
}
.background-preview {
  height: 145px;
  overflow: hidden;
  position: relative;
  border-radius: 12px;
  isolation: isolate;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
}
.background-preview-art {
  position: absolute;
  inset: -25px;
  z-index: -1;
  background-image: var(--wallpaper);
  background-color: var(--wallpaper-color);
  background-position: var(--wallpaper-position);
  background-size: cover;
  filter: blur(var(--wallpaper-blur)) brightness(var(--wallpaper-brightness));
  transform: scale(var(--wallpaper-zoom));
}
.background-preview > span {
  font:
    italic 24px Georgia,
    serif;
  color: white;
  text-shadow: 0 2px 12px #000;
  background: #0003;
  padding: 10px;
  border-radius: 8px;
}
.background-controls {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 5px;
}
.background-range {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px;
  margin: 16px 0;
}
.background-range input {
  grid-column: 1/-1;
  margin: 2px 0;
  padding: 0;
  height: 24px;
}
.background-range output {
  font-size: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
#background-color {
  height: 45px;
  padding: 4px;
  width: 100%;
}
.background-url-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.background-url-row input {
  min-width: 0;
  margin: 0;
}
.background-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.background-footer .primary {
  min-width: 90px;
  justify-content: center;
}
.background-footer button {
  font-size: 12px;
}
#background-settings::backdrop {
  backdrop-filter: none;
  background: #0006;
}
#background-file {
  font-size: 12px;
}
#background-settings input:disabled {
  opacity: 0.35;
}
@media (max-width: 480px) {
  #background-settings {
    padding: 20px 16px;
  }
  .background-preview {
    height: 120px;
  }
  .background-url-row {
    flex-wrap: wrap;
  }
  .background-url-row input {
    width: 100%;
  }
}

/* Compact developer cards, styled to match the GSGW reference layout. */
.info-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.info-developers {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.info-developers > .info-card,
.info-developers > .community-links {
  width: 100%;
  max-width: 400px;
}
.developer-carousel {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #192139;
  color: #eef0fa;
  border-color: #47547a;
  box-shadow: 0 12px 28px #0003;
}
.developer-profile[hidden] {
  display: none;
}
.developer-profile {
  margin: 0;
  max-width: none;
  background: #192139;
  animation: profile-fade 0.3s ease;
}
.developer-profile[aria-label="TheLX23"] {
  background: #142e30;
}
.developer-profile .identity-art {
  height: 112px;
}
.developer-profile .identity-copy {
  position: relative;
  padding: 40px 16px 16px 20px;
}
.developer-profile .identity-icon {
  position: absolute;
  left: 20px;
  top: -40px;
  width: 80px;
  height: 80px;
  margin: 0;
  border: 4px solid #192139;
  background: #303b60;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 12px #0003;
  font-size: 30px;
}
.developer-profile[aria-label="TheLX23"] .identity-icon {
  border-color: #142e30;
  background: #286164;
}
.developer-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 4px;
}
.developer-name h2 {
  margin: 0;
  font:
    800 30px/1.2 Georgia,
    serif;
  overflow-wrap: anywhere;
}
.developer-role {
  font:
    600 10.5px/1.4 Georgia,
    serif;
  border-radius: 20px;
  padding: 2px 6px;
  background: #ffffff20;
  white-space: nowrap;
}
.developer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font:
    14px/1.5 Georgia,
    serif;
  color: #d1c9e7;
}
.developer-links a {
  color: inherit;
  opacity: 0.75;
}
.developer-links a:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.developer-profile .developer-bio {
  font:
    700 14px/1.4 Georgia,
    serif;
  margin: 12px 0 0;
  min-height: 20px;
}

.info-developers .community-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.info-developers .community-link {
  flex-direction: row;
  font:
    600 14px Georgia,
    serif;
  padding: 14px 8px;
}
@keyframes profile-fade {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .developer-profile {
    animation: none;
  }
}
@media (max-width: 720px) {
  .info-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .info-developers .community-links {
    margin-bottom: 24px;
  }
}
@media (max-width: 380px) {
  .developer-name h2 {
    font-size: 26px;
  }
}

.developer-profile .identity-icon {
  overflow: hidden;
}
.developer-profile .identity-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.developer-profile[aria-label="Mr. Meaow46"] .identity-art {
  background-image: url("assets/meaow-banner.png");
  background-position: center 65%;
}

.developer-profile[aria-label="TheLX23"] .developer-links {
  color: #c5e5df;
}
.developer-profile[aria-label="TheLX23"] .developer-role {
  background: #34716b;
  color: #e5f7f1;
}

.developer-profile[aria-label="TheLX23"] .identity-art {
  background-image: url("assets/lx-banner.png");
  background-position: center 40%;
}
