:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-warm: #fbf7ee;
  --ink: #171a1a;
  --muted: #66706d;
  --line: #dedbd2;
  --teal: #0f766e;
  --teal-dark: #0b5f59;
  --terra: #c85b45;
  --blue: #3f6f8f;
  --olive: #6e7d3f;
  --gold: #b58b2a;
  --shadow: 0 18px 45px rgba(25, 29, 28, 0.12);
  --radius: 8px;
  --font-sans: "PingFang SC", -apple-system, "SF UI Text", "Lucida Grande", STheiti, "Microsoft YaHei", sans-serif;
  --font-serif: SourceHanSerifCN-Bold, "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", STSong, serif;
  --font-reading: SourceHanSerifCN-Regular, "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", STSong, serif;
  --header-bg: rgba(247, 246, 242, 0.92);
  --hover-bg: #ebe7dc;
  --reader-bg: #f3eadc;
  --reader-header-bg: rgba(243, 234, 220, 0.92);
  --reader-panel: #fff8ec;
  --reader-page: #fffaf0;
  --reader-soft: #eadfce;
  --reader-hover: #f0f8f4;
  --reader-line: #d9cbb7;
  --reader-text: #2d2923;
  color-scheme: light;
}

html[data-shuban-theme="sepia"] {
  --bg: #dfe6d6;
  --surface: #edf1e7;
  --surface-warm: #e8eddf;
  --ink: #263129;
  --muted: #5d6a60;
  --line: #bdc8b7;
  --teal: #2e7869;
  --teal-dark: #245f54;
  --header-bg: rgba(223, 230, 214, 0.94);
  --hover-bg: #d2dccb;
  --reader-bg: #d9e2d0;
  --reader-header-bg: rgba(217, 226, 208, 0.94);
  --reader-panel: #e9eee1;
  --reader-page: #eef1e4;
  --reader-soft: #d2dbc8;
  --reader-hover: #dce8d8;
  --reader-line: #b9c5b2;
  --reader-text: #263129;
  --shadow: 0 18px 45px rgba(39, 54, 43, 0.13);
  color-scheme: light;
}

html[data-shuban-theme="night"] {
  --bg: #171c1f;
  --surface: #22282b;
  --surface-warm: #272d2b;
  --ink: #e1e2dc;
  --muted: #a9b0ad;
  --line: #3d4648;
  --teal: #69c4b5;
  --teal-dark: #8ad6ca;
  --terra: #e18a76;
  --blue: #7da9c5;
  --olive: #a4b66a;
  --gold: #d2ad55;
  --header-bg: rgba(23, 28, 31, 0.94);
  --hover-bg: #30383a;
  --reader-bg: #151a1c;
  --reader-header-bg: rgba(21, 26, 28, 0.95);
  --reader-panel: #22282a;
  --reader-page: #1b2022;
  --reader-soft: #343d3e;
  --reader-hover: #293536;
  --reader-line: #3d4748;
  --reader-text: #dddcd4;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: calc(100% - 40px);
  max-width: 1450px;
  margin: 0 auto;
}

/* The homepage intentionally uses the full available canvas for dense shelves.
   Other pages stop growing once they reach the reader's comfortable shell. */
.library-home .container {
  max-width: none;
}

.skip-link,
.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
}

.skip-link:focus {
  z-index: 20;
  width: auto;
  height: auto;
  padding: 10px 14px;
  clip: auto;
  background: var(--ink);
  color: #fff;
}

.site-header {
  position: sticky;
  z-index: 15;
  top: 0;
  border-bottom: 1px solid rgba(222, 219, 210, 0.84);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: var(--radius);
  background-color: #f6f1e8;
  background-image: url("../images/brand/brand-mark.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 34px 34px;
  box-shadow: inset 0 0 0 1px rgba(23, 63, 58, 0.1);
  color: transparent;
  font-size: 0;
  line-height: 0;
}

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

.brand strong {
  font-size: 17px;
  line-height: 1.1;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

.site-nav a,
.link-button {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: #3f4744;
  font-weight: 700;
}

.site-nav a:hover,
.site-nav a.is-active,
.link-button:hover {
  background: var(--hover-bg);
  color: var(--ink);
}

.site-nav-more {
  position: relative;
}

.site-nav-more > summary {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 5px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: #3f4744;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.site-nav-more > summary::-webkit-details-marker {
  display: none;
}

.site-nav-more > summary:hover,
.site-nav-more > summary.is-active,
.site-nav-more[open] > summary {
  background: var(--hover-bg);
  color: var(--ink);
}

.site-nav-more > summary span {
  transition: transform 160ms ease;
}

.site-nav-more[open] > summary span {
  transform: rotate(180deg);
}

.site-nav-more-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: 226px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(38, 35, 29, 0.16);
}

.site-nav-more:not([open]) .site-nav-more-menu {
  display: none;
}

.site-nav-more-menu a {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.header-search-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #3f4744;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.header-search-link:hover,
.header-search-link:focus-visible {
  background: var(--hover-bg);
  color: var(--ink);
}

.header-search-link svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.9;
}

.header-theme-picker {
  position: relative;
  flex: 0 0 auto;
}

.header-theme-toggle {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #3f4744;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.header-theme-toggle:hover,
.header-theme-toggle:focus-visible,
.header-theme-picker:has(.header-theme-menu:not([hidden])) .header-theme-toggle {
  background: var(--hover-bg);
  color: var(--ink);
}

.header-theme-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.header-theme-menu {
  position: absolute;
  z-index: 70;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  width: min(272px, calc(100vw - 24px));
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 20px 48px rgba(25, 31, 28, 0.18);
}

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

.header-theme-menu-title {
  padding: 4px 7px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.header-theme-menu button {
  display: grid;
  width: 100%;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.header-theme-menu button:hover,
.header-theme-menu button:focus-visible {
  border-color: color-mix(in srgb, var(--teal) 22%, var(--line));
  background: var(--hover-bg);
}

.header-theme-menu button[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--teal) 34%, var(--line));
  background: color-mix(in srgb, var(--teal) 9%, var(--surface));
}

.header-theme-menu button > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.header-theme-menu strong {
  font-size: 13px;
}

.header-theme-menu small {
  color: var(--muted);
  font-size: 10px;
}

.header-theme-menu button > b {
  color: var(--teal);
  opacity: 0;
}

.header-theme-menu button[aria-checked="true"] > b {
  opacity: 1;
}

.theme-swatch {
  display: block;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(38, 42, 40, 0.18);
  border-radius: 999px;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.26);
}

.theme-swatch-paper { background: #f7f6f2; }
.theme-swatch-sepia { background: #dfe6d6; }
.theme-swatch-night { background: #171c1f; }

.header-theme-picker-compact .header-theme-toggle {
  width: 40px;
  min-height: 40px;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
}

.header-theme-picker-compact .header-theme-toggle-label {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.mobile-only-nav-link,
.mobile-nav-utilities {
  display: none;
}

.menu-toggle {
  display: none;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.mobile-header-tools,
.mobile-search-toggle,
.mobile-global-search-panel {
  display: none;
}

.header-icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.menu-icon-close {
  display: none;
}

.menu-toggle[aria-expanded="true"] .menu-icon-lines {
  display: none;
}

.menu-toggle[aria-expanded="true"] .menu-icon-close {
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 850;
  line-height: 1;
}

.btn-primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.btn-primary:hover {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.btn-secondary {
  border-color: var(--line);
  background: var(--surface);
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.12);
  color: #fff8ee;
}

.text-link {
  color: var(--teal);
  font-weight: 850;
}

.site-hero {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  background: #1f2424;
}

.site-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(18, 20, 20, 0.78), rgba(18, 20, 20, 0.42) 48%, rgba(18, 20, 20, 0.12)),
    linear-gradient(180deg, rgba(18, 20, 20, 0.1), rgba(18, 20, 20, 0.55));
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  min-height: 620px;
  padding: 64px 0 86px;
  color: #fff8ee;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.eyebrow.light {
  color: #a6f0df;
}

.hero-content h1 {
  margin: 0;
  font-size: clamp(46px, 7vw, 92px);
  line-height: 1;
}

.hero-content p:not(.eyebrow) {
  width: min(650px, 100%);
  margin: 20px 0 0;
  color: rgba(255, 248, 238, 0.9);
  font-size: 20px;
}

.hero-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: min(620px, 100%);
  margin-top: 28px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.hero-search input,
.search-input {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: 0;
}

.hero-search input {
  border: 0;
  padding: 0 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.metric-strip {
  margin-top: -44px;
  position: relative;
  z-index: 2;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow);
}

.metric-grid div {
  padding: 22px;
  background: var(--surface);
}

.metric-grid strong,
.metric-grid span {
  display: block;
}

.metric-grid strong {
  font-size: 30px;
  line-height: 1.1;
}

.metric-grid span {
  margin-top: 4px;
  color: var(--muted);
}

.section-band {
  padding: 76px 0;
}

.muted-band {
  background: #eeebe3;
}

.faq-band {
  padding-top: 48px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.section-heading.compact {
  margin-bottom: 18px;
}

.section-heading h1,
.section-heading h2,
.page-title h1,
.split-section h2,
.trust-grid h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
}

.section-copy,
.page-title p,
.split-section > div > p,
.trust-item p,
.site-footer p {
  color: var(--muted);
}

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

.classic-library-page .book-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px 12px;
}

.book-card,
.author-card,
.trust-item,
.category-grid a,
.note-card,
.toc-list a,
.help-card,
.policy-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.book-card {
  position: relative;
  overflow: visible;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.book-card:hover {
  border-color: #bcb6aa;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.book-cover {
  position: relative;
  display: grid;
  aspect-ratio: 3 / 4;
  min-height: 0;
  place-items: end start;
  overflow: hidden;
  padding: 14px;
  color: #fff;
  background: #24333b;
  box-shadow: inset 12px 0 18px rgba(0, 0, 0, 0.18);
  isolation: isolate;
}

.book-card .book-cover {
  width: calc(100% - 28px);
  margin: 14px;
  border-radius: 6px;
}

.book-cover::before {
  position: absolute;
  inset: 0 0 0 9px;
  z-index: 2;
  width: 1px;
  content: "";
  background: rgba(255, 255, 255, 0.26);
}

.book-cover::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background: linear-gradient(180deg, transparent 42%, rgba(5, 9, 12, 0.18) 62%, rgba(5, 9, 12, 0.82) 100%);
  pointer-events: none;
}

.book-cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.book-card:hover .book-cover-image {
  transform: scale(1.025);
}

.book-cover span {
  position: relative;
  z-index: 3;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.16;
  text-wrap: balance;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.72);
}

.book-card-body {
  display: grid;
  gap: 8px;
  padding: 0 16px 18px;
}

.book-card h2,
.book-card h3,
.book-card p {
  margin: 0;
}

.book-card h2,
.book-card h3 {
  font-size: 20px;
  line-height: 1.25;
}

.book-card h2 a:hover,
.book-card h3 a:hover {
  color: var(--teal);
}

.source-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #b9d8d1;
  border-radius: 999px;
  background: #e8f5f2;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.source-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.source-list a {
  color: var(--teal);
  font-weight: 850;
}

.book-source {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #cfdedb;
  border-radius: var(--radius);
  background: #eef8f5;
}

.book-source summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 850;
}

.book-source[open] summary {
  margin-bottom: 4px;
}

details.book-source:not([open]) {
  display: block;
}

details.book-source:not([open]) > :not(summary) {
  display: none;
}

.book-source p {
  margin: 0;
  color: #4c615c;
}

.meta-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.meta-table div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.meta-table strong,
.meta-table span {
  display: block;
}

.meta-table span {
  color: var(--muted);
  font-size: 13px;
}

.quote-panel {
  padding: 22px;
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  background: #f2eee5;
  font-family: var(--font-reading);
  font-size: 20px;
  line-height: 1.9;
}

.quote-panel p {
  margin: 0;
}

.source-callout {
  padding: 20px;
  border: 1px solid #d7c8a2;
  border-radius: var(--radius);
  background: #fff6df;
}

.source-callout strong {
  display: block;
  margin-bottom: 6px;
}

.source-callout p {
  margin: 0;
  color: #675b3d;
}

.source-callout.compact {
  margin-bottom: 18px;
}

.comparison-scroll {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.comparison-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.comparison-table thead th {
  background: #f6f1e8;
  color: #3f4744;
  font-size: 13px;
  text-transform: uppercase;
}

.comparison-table tbody tr:last-child th,
.comparison-table tbody tr:last-child td {
  border-bottom: 0;
}

.comparison-table a {
  color: var(--teal);
  font-weight: 900;
}

.book-card p {
  color: #515956;
}

.book-meta,
.book-info,
.chip-row {
  color: var(--muted);
  font-size: 13px;
}

.book-info,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.book-info span,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #efe9dc;
  color: #555d59;
  font-weight: 800;
}

.book-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.book-card-actions .text-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 56px;
  align-items: center;
}

.feature-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.feature-list div {
  padding-left: 18px;
  border-left: 3px solid var(--teal);
}

.feature-list strong,
.feature-list span {
  display: block;
}

.feature-list span {
  color: var(--muted);
}

.reader-preview {
  padding: 18px;
  border: 1px solid #d5cbbb;
  border-radius: var(--radius);
  background: #fcf6e9;
  box-shadow: var(--shadow);
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.preview-top span {
  font-weight: 900;
}

.preview-top strong {
  color: var(--teal);
  font-size: 28px;
}

.preview-page {
  min-height: 260px;
  padding: 28px;
  border: 1px solid #e1d5c2;
  border-radius: var(--radius);
  background: #fffaf0;
  font-family: var(--font-reading);
  font-size: 20px;
  line-height: 2;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 44px;
}

.rank-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-list a {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.rank-list a:hover {
  border-color: #bcb6aa;
}

.rank-list span {
  color: var(--teal);
  font-weight: 900;
}

.rank-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-list em {
  color: var(--terra);
  font-style: normal;
  font-weight: 900;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.category-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 16px;
  font-weight: 900;
}

.category-grid a:hover,
.author-card:hover,
.toc-list a:hover {
  border-color: #bcb6aa;
  box-shadow: 0 12px 28px rgba(25, 29, 28, 0.08);
}

.category-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.author-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.author-card {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 148px;
  overflow: hidden;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface) 88%, #e9f1ec));
  box-shadow: 0 8px 22px rgba(25, 31, 28, 0.05);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.author-card::after {
  position: absolute;
  right: -34px;
  bottom: -42px;
  width: 100px;
  height: 100px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 6%, transparent);
  content: "";
  pointer-events: none;
}

.author-card:hover,
.author-card:focus-visible {
  border-color: color-mix(in srgb, var(--teal) 42%, var(--line));
  box-shadow: 0 16px 34px rgba(25, 42, 36, 0.12);
  transform: translateY(-3px);
}

.author-card-media {
  display: grid;
  width: 96px;
  height: 120px;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 13px;
  background: var(--surface-warm);
  box-shadow: 0 8px 18px rgba(25, 31, 28, 0.11);
  color: var(--accent-dark);
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 900;
}

.author-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-card-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.author-card-copy strong {
  font-family: var(--font-serif);
  font-size: 21px;
}

.author-card-copy > span,
.author-card-copy small {
  color: var(--muted);
}

.author-card-copy > span {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.author-card-copy small {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--hover-bg);
  font-size: 10px;
  font-weight: 800;
}

.trust-grid {
  display: grid;
  grid-template-columns: 1.1fr repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.trust-item {
  min-height: 188px;
  padding: 20px;
}

.trust-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

summary {
  min-height: 58px;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 900;
}

details p {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
}

.site-footer {
  padding: 46px 0;
  border-top: 1px solid var(--line);
  background: #171a1a;
  color: #f8f4ea;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr;
  gap: 28px;
}

.footer-brand .brand-mark {
  background-color: #f6f1e8;
}

.site-footer p,
.site-footer a,
.site-footer small {
  color: #c8d0cd;
}

.site-footer nav,
.site-footer div {
  display: grid;
  align-content: start;
  gap: 9px;
}

.site-footer strong {
  color: #fff8ee;
}

.page-hero {
  padding: 64px 0 34px;
  border-bottom: 1px solid var(--line);
  background: #eeebe3;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs a {
  color: var(--teal);
  font-weight: 800;
}

.page-title {
  display: grid;
  gap: 12px;
  width: min(760px, 100%);
}

.page-title h1 {
  font-size: clamp(38px, 6vw, 68px);
}

.page-title p {
  margin: 0;
  font-size: 19px;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

.filter-bar .segmented {
  flex-wrap: wrap;
}

.search-input {
  padding: 0 14px;
}

.filter-summary {
  min-height: 24px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.whatsapp-contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, auto);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
}

.whatsapp-contact-panel h2,
.whatsapp-contact-panel p {
  margin-bottom: 10px;
}

.whatsapp-contact-number {
  display: block;
  margin-top: 15px;
  color: var(--teal-dark);
  font-size: 18px;
}

.whatsapp-contact-actions {
  display: grid;
  gap: 9px;
  min-width: min(100%, 300px);
}

.whatsapp-contact-actions .btn {
  width: 100%;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eee9df;
}

.segmented button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.segmented button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(25, 29, 28, 0.08);
}

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

.category-library-card {
  position: relative;
  display: grid;
  grid-template-rows: 208px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(25, 31, 28, 0.06);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.category-library-card:hover,
.category-library-card:focus-within {
  border-color: color-mix(in srgb, var(--teal) 42%, var(--line));
  box-shadow: 0 18px 40px rgba(25, 42, 36, 0.14);
  transform: translateY(-4px);
}

.category-card-media {
  position: relative;
  display: block;
  min-height: 0;
  overflow: hidden;
  background: var(--surface-warm);
}

.category-card-media::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 38%, rgba(15, 25, 22, 0.82));
  content: "";
}

.category-cover-collage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1.15fr .92fr .92fr;
  gap: 3px;
  padding: 10px 10px 0;
  background:
    radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--teal) 22%, transparent), transparent 34%),
    color-mix(in srgb, var(--surface-warm) 82%, #c7d9d1);
}

.category-cover-tile {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 11px 11px 0 0;
  box-shadow: 0 8px 18px rgba(18, 28, 24, .2);
  transform-origin: bottom center;
}

.category-cover-tile-2 { transform: translateY(14px); }
.category-cover-tile-3 { transform: translateY(27px); }

.category-card-media[data-cover-count="2"] .category-cover-collage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.category-card-media[data-cover-count="1"] .category-cover-collage { grid-template-columns: minmax(0, 1fr); padding-inline: 26%; }

.category-card-media picture,
.category-card-media img {
  display: block;
  width: 100%;
  height: 100%;
}

.category-card-media img {
  object-fit: cover;
  object-position: center 30%;
  transition: transform 300ms ease;
}

.category-library-card:hover .category-card-media img,
.category-library-card:focus-within .category-card-media img {
  transform: scale(1.035);
}

.category-card-visual-copy {
  position: absolute;
  z-index: 1;
  right: 18px;
  bottom: 14px;
  left: 18px;
  display: grid;
  gap: 2px;
  color: #fff;
}

.category-card-visual-copy small {
  color: rgba(255, 255, 255, 0.76);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
}

.category-card-visual-copy strong {
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-card-media-empty {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #dfece7, #eadfca);
  color: var(--teal-dark);
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 900;
}

.category-card-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.category-card-body > p,
.category-library-card h2,
.category-library-card .eyebrow {
  margin: 0;
}

.category-card-body > p {
  min-height: 48px;
  color: var(--muted);
  line-height: 1.7;
}

.category-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.category-card-heading > strong {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f2ee;
  color: var(--teal-dark);
  font-size: 12px;
}

.category-card-heading h2 {
  margin-top: 3px;
  font-size: 25px;
  line-height: 1.2;
}

.category-card-eyebrow {
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

.category-library-card .chip {
  text-decoration: none;
}

.category-card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.category-card-cta b {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--hover-bg);
  transition: transform 180ms ease, background 180ms ease;
}

.category-card-cta:hover b,
.category-card-cta:focus-visible b {
  background: #dceee7;
  transform: translateX(3px);
}

.language-library-card {
  border-color: color-mix(in srgb, var(--teal) 30%, var(--line));
  background: linear-gradient(155deg, color-mix(in srgb, var(--surface) 86%, #eaf5f1), var(--surface));
}

.language-library-card .category-card-heading > strong,
.language-category-card b {
  color: var(--teal-dark);
}

/* Category-to-route bridge: real covers replace the old text-only callout. */
.library-route-showcase {
  position: relative;
  overflow: hidden;
  padding: clamp(42px, 5vw, 68px) 0;
  background:
    radial-gradient(circle at 9% 12%, color-mix(in srgb, var(--teal) 14%, transparent), transparent 28%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-warm) 90%, #dcece5), var(--surface-warm));
}

.library-route-showcase::before {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(color-mix(in srgb, var(--line) 28%, transparent) 1px, transparent 1px);
  background-size: 100% 68px;
  content: "";
  opacity: .28;
  pointer-events: none;
}

.library-route-showcase-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  align-items: stretch;
  gap: clamp(34px, 5vw, 76px);
}

.library-route-mosaic {
  display: grid;
  height: clamp(400px, 33vw, 470px);
  min-height: 0;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.library-route-visual {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(21, 32, 28, .13);
  color: #fff;
  isolation: isolate;
}

.library-route-visual-main {
  grid-row: 1 / -1;
}

.library-route-visual::after {
  position: absolute;
  z-index: 1;
  inset: 28% 0 0;
  background: linear-gradient(180deg, transparent, rgba(10, 17, 15, .82));
  content: "";
}

.library-route-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: transform 360ms ease, filter 360ms ease;
}

.library-route-visual > span {
  position: absolute;
  z-index: 2;
  right: 15px;
  bottom: 14px;
  left: 15px;
  display: grid;
  gap: 2px;
}

.library-route-visual small {
  color: rgba(255, 255, 255, .76);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
}

.library-route-visual strong {
  font-size: clamp(14px, 1.35vw, 20px);
  line-height: 1.25;
}

.library-route-visual:is(:hover, :focus-visible) img {
  filter: saturate(1.06) contrast(1.02);
  transform: scale(1.045);
}

.library-route-visual:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.library-route-copy {
  align-self: center;
}

.library-route-copy h2 {
  max-width: 10em;
  margin: 10px 0 14px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
}

.library-route-copy > p {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.library-route-steps {
  display: grid;
  margin: 28px 0 26px;
  padding: 0;
  list-style: none;
  border-top: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

.library-route-steps li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 68px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

.library-route-steps li > span {
  color: var(--teal-dark);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 900;
}

.library-route-steps li div {
  display: grid;
  gap: 2px;
}

.library-route-steps small {
  color: var(--muted);
}

.library-route-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.library-route-text-link {
  color: var(--teal-dark);
  font-weight: 850;
}

.library-route-text-link span {
  display: inline-block;
  transition: transform 180ms ease;
}

.library-route-text-link:is(:hover, :focus-visible) span {
  transform: translateX(3px);
}

@media (max-width: 980px) {
  .library-route-showcase-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .library-route-copy {
    align-self: stretch;
  }

  .library-route-copy h2 {
    max-width: none;
  }
}

@media (max-width: 600px) {
  .library-route-showcase {
    padding: 34px 0 40px;
  }

  .library-route-mosaic {
    height: 348px;
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .library-route-visual-main {
    grid-row: auto;
  }

  .library-route-visual > span {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  .library-route-visual strong {
    font-size: 13px;
  }

  .library-route-copy h2 {
    font-size: 31px;
  }

  .library-route-copy > p {
    font-size: 15px;
  }

  .library-route-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .library-route-actions .btn,
  .library-route-text-link {
    width: 100%;
    text-align: center;
  }
}

.language-switch {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--hover-bg);
}

.language-switch a {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 800;
}

.language-switch a:hover,
.language-switch a.is-active {
  background: var(--surface);
  color: var(--teal-dark);
  box-shadow: 0 4px 12px rgba(27, 50, 44, 0.08);
}

.book-detail-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
}

.book-detail-cover {
  position: sticky;
  top: 96px;
}

.book-detail-cover .book-cover {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.book-detail-copy {
  display: grid;
  gap: 24px;
}

.book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.detail-stats div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.detail-stats strong,
.detail-stats span {
  display: block;
}

.detail-stats strong {
  font-size: 24px;
}

.detail-stats span {
  color: var(--muted);
  font-size: 13px;
}

.content-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.content-panel h2,
.content-panel h3 {
  margin-top: 0;
}

.reception-panel {
  display: grid;
  gap: 20px;
}

.reception-heading,
.reception-source-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.reception-heading h2,
.reception-summary,
.reception-grid h3,
.reception-grid p {
  margin: 0;
}

.reception-heading h2 {
  margin-top: 3px;
}

.reception-policy {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8f1ed;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 900;
}

.reception-summary {
  max-width: 860px;
  color: var(--muted);
  font-size: 15px;
}

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

.reception-grid article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-warm);
}

.reception-grid article > span {
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.reception-grid h3 {
  margin-top: 6px;
  font-size: 16px;
}

.reception-grid p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.reception-source-heading {
  align-items: baseline;
  padding-top: 2px;
}

.reception-source-heading span {
  color: var(--muted);
  font-size: 11px;
}

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

.reception-links a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.reception-links a:hover,
.reception-links a:focus-visible {
  border-color: #7aa99f;
  background: var(--reader-hover);
}

.reception-links strong,
.reception-links span {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reception-links strong {
  font-size: 13px;
}

.reception-links span {
  grid-column: 1;
  color: var(--muted);
  font-size: 11px;
}

.reception-links b {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--teal);
}

.toc-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.toc-list a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.55em;
  align-items: baseline;
  padding: 12px 14px;
  color: #39413e;
  font-weight: 800;
}

.toc-list .toc-number {
  min-width: 2ch;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.toc-list .toc-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.reader-shell {
  min-height: 100vh;
  background: var(--reader-bg);
  color: var(--reader-text);
}

.reader-header {
  border-bottom: 1px solid var(--reader-line);
  background: var(--reader-header-bg);
}

.reader-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 760px) 260px;
  gap: 24px;
  align-items: start;
  padding: 28px 0;
}

.reader-aside,
.reader-tools {
  position: sticky;
  top: 92px;
  padding: 18px;
  border: 1px solid var(--reader-line);
  border-radius: var(--radius);
  background: var(--reader-panel);
}

.reader-progress {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: var(--reader-soft);
}

.reader-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.reader-toc {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.reader-toc a {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid var(--reader-line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--reader-page) 78%, transparent);
  color: var(--reader-text);
  font-weight: 800;
}

.reader-toc a:is(.is-active, .is-current) {
  border-color: var(--teal);
  background: var(--reader-hover);
  color: var(--teal);
}

.reader-toc a:hover,
.reader-toc a:focus-visible {
  border-color: var(--teal);
  background: var(--reader-hover);
}

.reader-toc .toc-number {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--reader-soft);
  font-size: 12px;
}

.reader-toc .toc-title {
  display: block;
  width: auto;
  min-width: 0;
  height: auto;
  padding-top: 2px;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
}

.reader-toc small {
  align-self: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
}

.chapter-page {
  min-height: 780px;
  scroll-margin-top: 132px;
  padding: 54px;
  border: 1px solid var(--reader-line);
  border-radius: var(--radius);
  background: var(--reader-page);
  color: var(--reader-text);
  font-family: var(--font-reading);
  font-size: 20px;
  line-height: 2;
  box-shadow: var(--shadow);
}

.chapter-page.reader-font-16 { font-size: 16px; }
.chapter-page.reader-font-18 { font-size: 18px; }
.chapter-page.reader-font-20 { font-size: 20px; }
.chapter-page.reader-font-22 { font-size: 22px; }
.chapter-page.reader-font-24 { font-size: 24px; }
.chapter-page.reader-font-26 { font-size: 26px; }
.chapter-page.reader-font-28 { font-size: 28px; }

.chapter-page.theme-sepia {
  border-color: var(--reader-line);
  background: var(--reader-page);
  color: var(--reader-text);
}

.chapter-page.theme-night {
  border-color: var(--reader-line);
  background: var(--reader-page);
  color: var(--reader-text);
}

.reader-tools {
  display: grid;
  gap: 10px;
}

.reader-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.is-disabled,
.is-disabled:hover {
  pointer-events: none;
  opacity: 0.48;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-row button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--reader-line);
  border-radius: var(--radius);
  background: var(--reader-page);
  color: var(--reader-text);
  font-weight: 850;
}

.tool-row button.is-active {
  border-color: var(--teal);
  color: var(--teal);
}

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

.help-card,
.policy-card,
.note-card {
  padding: 20px;
}

.help-card h2,
.policy-card h2,
.note-card h3 {
  margin-top: 0;
}

.timeline {
  display: grid;
  gap: 14px;
  padding-left: 0;
  list-style: none;
}

.timeline li {
  padding: 16px;
  border-left: 3px solid var(--teal);
  background: var(--surface);
}

.review-list {
  display: grid;
  gap: 12px;
}

.review-list article,
.discussion-list a,
.shelf-item,
.pricing-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.review-list article {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.review-list.stacked {
  align-content: start;
}

.review-list strong a:hover,
.feature-review h2 a:hover {
  color: var(--teal);
}

.review-list span,
.discussion-list span,
.shelf-item p,
.pricing-card p,
.clean-list,
.form-shell label {
  color: var(--muted);
}

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

.pricing-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 300px;
  padding: 24px;
}

.pricing-card.featured {
  border-color: #91c9bd;
  box-shadow: var(--shadow);
}

.pricing-card h2,
.pricing-card p {
  margin: 0;
}

.pricing-card strong {
  font-size: 30px;
}

.editorial-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* Blog */
.blog-page,
.blog-article-page {
  overflow: clip;
}

.blog-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--terra);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
}

.blog-article-header h1 {
  max-width: 900px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(42px, 6.8vw, 82px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.blog-topic-strip-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.blog-topic-strip {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.blog-topic-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 12px;
}

.blog-topic-list a {
  min-width: 0;
  min-height: 106px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-warm);
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}

.blog-topic-list a:hover,
.blog-topic-list a:focus-visible {
  border-color: color-mix(in srgb, var(--teal) 48%, var(--line));
  background: color-mix(in srgb, var(--teal) 7%, var(--surface));
  transform: translateY(-2px);
}

.blog-topic-list strong,
.blog-topic-list span {
  display: block;
}

.blog-topic-list strong {
  margin-bottom: 5px;
  font-size: 16px;
}

.blog-topic-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.blog-featured-section {
  padding-top: 42px;
}

.blog-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.blog-section-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.16;
}

.blog-section-heading p {
  margin: 0;
  color: var(--muted);
}

.blog-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.blog-card:hover,
.blog-card:focus-within {
  border-color: color-mix(in srgb, var(--teal) 42%, var(--line));
  box-shadow: 0 16px 34px rgba(25, 29, 28, .1);
  transform: translateY(-3px);
}

.blog-card-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--surface-warm);
}

.blog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.blog-card:hover .blog-card-media img {
  transform: scale(1.025);
}

.blog-card-copy {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 22px;
}

.blog-card-copy h2,
.blog-card-copy p {
  margin: 0;
}

.blog-card-copy h2 {
  font-family: var(--font-serif);
  font-size: clamp(23px, 2.4vw, 31px);
  line-height: 1.24;
}

.blog-card-copy p {
  color: var(--muted);
}

.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 13px;
}

.blog-card-meta span {
  color: var(--teal);
  font-weight: 900;
}

.blog-read-link {
  width: fit-content;
  color: var(--teal);
  font-weight: 900;
}

.blog-card-featured {
  display: grid;
  grid-template-columns: minmax(300px, .85fr) minmax(0, 1.15fr);
}

.blog-card-featured .blog-card-media {
  height: 100%;
  min-height: 390px;
  aspect-ratio: auto;
}

.blog-card-featured .blog-card-copy {
  align-content: center;
  padding: clamp(28px, 5vw, 64px);
}

.blog-card-featured .blog-card-copy h2 {
  font-size: clamp(32px, 4.2vw, 54px);
}

.blog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.blog-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-filter-list button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.blog-filter-list button:hover,
.blog-filter-list button:focus-visible,
.blog-filter-list button.is-active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.blog-search {
  flex: 0 1 320px;
}

.blog-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

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

.blog-card[hidden] {
  display: none;
}

.blog-empty {
  padding: 44px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.blog-empty p {
  margin-bottom: 0;
  color: var(--muted);
}

.blog-article-header {
  padding: clamp(36px, 6vw, 82px) 0;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(150deg, var(--surface-warm), var(--bg));
}

.blog-article-header-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(270px, .55fr);
  align-items: center;
  gap: clamp(34px, 6vw, 86px);
}

.blog-article-header h1 {
  font-size: clamp(40px, 5.8vw, 70px);
}

.blog-article-dek {
  max-width: 820px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
}

.blog-article-meta,
.blog-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 16px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
}

.blog-tag-list {
  margin-top: 12px;
}

.blog-tag-list a {
  color: var(--teal);
  font-weight: 800;
}

.blog-article-header figure {
  max-width: 390px;
  margin: 0 0 0 auto;
  overflow: hidden;
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
}

.blog-article-header figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.blog-article-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(240px, 300px);
  justify-content: center;
  align-items: start;
  gap: clamp(42px, 7vw, 96px);
  padding-top: clamp(48px, 7vw, 86px);
  padding-bottom: clamp(56px, 8vw, 104px);
}

.blog-article-body {
  min-width: 0;
  font-family: var(--font-reading);
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.95;
}

.blog-article-lead {
  margin-top: 0;
  padding-left: 20px;
  border-left: 3px solid var(--terra);
  color: var(--ink);
  font-size: 1.12em;
}

.blog-article-body section {
  margin-top: 48px;
}

.blog-article-body h2 {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.35;
}

.blog-article-body p {
  margin: 0 0 1.25em;
}

.blog-article-body blockquote {
  margin: 32px 0;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--surface-warm);
}

.blog-article-aside {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
}

.blog-article-aside p {
  margin: 5px 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.blog-article-aside > a {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.blog-article-aside img {
  width: 46px;
  height: 61px;
  border-radius: 4px;
  object-fit: cover;
}

.blog-article-aside strong,
.blog-article-aside small {
  display: block;
}

.blog-article-aside strong {
  line-height: 1.35;
}

.blog-article-aside small {
  margin-top: 4px;
  color: var(--muted);
}

.blog-related-section {
  background: var(--surface-warm);
}

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

.blog-related-book {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.blog-related-book img {
  width: 104px;
  aspect-ratio: 3 / 4;
  border-radius: 5px;
  object-fit: cover;
}

.blog-related-book h3,
.blog-related-book p {
  margin: 5px 0;
}

.blog-related-book span,
.blog-related-book p {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .blog-article-header-grid,
  .blog-card-featured,
  .blog-article-layout {
    grid-template-columns: 1fr;
  }

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

  .blog-card-grid,
  .blog-related-books {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blog-card-featured .blog-card-media {
    min-height: 320px;
  }

  .blog-article-header figure {
    width: min(360px, 80vw);
    margin: 0;
  }

  .blog-article-aside {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .blog-article-aside > div {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .blog-card-grid,
  .blog-related-books,
  .blog-article-aside {
    grid-template-columns: 1fr;
  }

  .blog-article-header h1 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .blog-topic-strip {
    padding: 18px 0;
  }

  .blog-topic-list {
    gap: 8px;
  }

  .blog-topic-list a {
    min-height: 96px;
    padding: 13px;
  }

  .blog-toolbar,
  .blog-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .blog-search {
    flex-basis: auto;
  }

  .blog-card-featured .blog-card-media {
    min-height: 250px;
  }

  .blog-related-book {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .blog-related-book img {
    width: 86px;
  }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #efe9dc;
  color: #555d59;
  font-size: 13px;
  font-weight: 900;
}

.discussion-list {
  display: grid;
  gap: 10px;
}

.discussion-list a {
  display: grid;
  gap: 4px;
  padding: 14px;
}

.discussion-list a:hover,
.shelf-item:hover,
.pricing-card:hover {
  border-color: #bcb6aa;
}

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

.shelf-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
}

.shelf-item .book-cover {
  border-radius: 6px;
}

.shelf-item h2,
.shelf-item p {
  margin: 6px 0;
}

.progress-bar {
  overflow: hidden;
  height: 8px;
  margin: 10px 0;
  border-radius: 999px;
  background: #e6dfd2;
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.progress-72 span {
  width: 72%;
}

.clean-list {
  display: grid;
  gap: 10px;
  padding-left: 20px;
}

.form-shell {
  width: min(760px, 100%);
}

.form-shell form {
  display: grid;
  gap: 14px;
}

.form-shell label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.form-shell input,
.form-shell select,
.form-shell textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.form-shell textarea {
  resize: vertical;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

@media (max-width: 1040px) {
  .header-actions {
    display: none;
  }

  .header-inner {
    flex-wrap: wrap;
    min-height: 64px;
    gap: 10px;
    padding: 8px 0;
  }

  .menu-toggle,
  .mobile-search-toggle {
    display: inline-flex;
    width: 40px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
  }

  .mobile-header-tools {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
  }

  .site-nav {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    min-height: 44px;
  }

  .mobile-only-nav-link {
    display: block;
  }

  .mobile-nav-utilities {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .mobile-nav-utilities :is(a, button) {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: #3f4744;
    font: inherit;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
  }

  .mobile-nav-utilities :is(a, button):hover,
  .mobile-nav-utilities :is(a, button):focus-visible,
  .mobile-nav-utilities button[aria-expanded="true"] {
    background: var(--hover-bg);
    color: var(--ink);
  }

  .site-header .mobile-search-panel {
    display: none;
  }

  .site-header .mobile-search-panel.is-open {
    display: grid;
  }

  .book-grid,
  .author-row,
  .trust-grid,
  .footer-grid,
  .wide-grid,
  .help-grid,
  .policy-grid,
  .pricing-grid,
  .editorial-list,
  .shelf-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-section,
  .two-column,
  .book-detail-layout,
  .reader-layout {
    grid-template-columns: 1fr;
  }

  .book-detail-cover,
  .reader-aside,
  .reader-tools {
    position: static;
  }

  .reader-layout {
    width: min(860px, calc(100% - 32px));
  }
}

@media (min-width: 1041px) and (max-width: 1180px) {
  .header-search-link,
  .header-theme-toggle {
    width: 40px;
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  .header-search-link > span,
  .header-theme-toggle-label {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    padding: 0;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 28px, 1180px);
  }

  .header-inner {
    flex-wrap: wrap;
    min-height: 64px;
    gap: 10px;
    padding: 8px 0;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .mobile-header-tools {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
  }

  .mobile-search-toggle {
    display: inline-flex;
    width: 40px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
  }

  .mobile-search-toggle[aria-expanded="true"],
  .menu-toggle[aria-expanded="true"] {
    border-color: #8eb5ac;
    background: #e9f3ef;
    color: var(--teal-dark);
  }

  .site-nav {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    min-height: 44px;
  }

  .site-nav-more,
  .site-nav-more > summary {
    width: 100%;
  }

  .site-nav-more > summary {
    justify-content: space-between;
    min-height: 44px;
  }

  .site-nav-more-menu {
    position: static;
    width: 100%;
    margin-top: 4px;
    box-shadow: none;
  }

  .site-nav-more-menu a {
    min-height: 42px;
  }

  .site-hero,
  .hero-content {
    min-height: 640px;
  }

  .hero-content {
    padding: 54px 0 80px;
  }

  .hero-content p:not(.eyebrow) {
    font-size: 18px;
  }

  .hero-search,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .book-grid,
  .author-row,
  .trust-grid,
  .footer-grid,
  .wide-grid,
    .help-grid,
    .policy-grid,
    .pricing-grid,
    .editorial-list,
    .shelf-board,
    .detail-stats,
    .toc-list {
    grid-template-columns: 1fr;
  }

  .shelf-item {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .section-band {
    padding: 52px 0;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .segmented button {
    flex: 1 1 120px;
  }

  .chapter-page {
    padding: 28px;
    font-size: 18px;
  }
}

@media (max-width: 900px) {
  .classic-library-page .book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 10px;
  }
}

/* Adaptive two-row recommendations and a compact, grouped site footer. */
.home-library-main .home-recommendation-grid {
  --home-recommendation-card-min: 175px;
  align-items: stretch;
}

.site-footer {
  position: relative;
  overflow: hidden;
  padding: 44px 0 22px;
  border-top-color: rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 12% 4%, rgba(42, 124, 111, 0.18), transparent 32%),
    linear-gradient(145deg, #171b1a 0%, #111514 100%);
}

.site-footer::before {
  position: absolute;
  top: 0;
  right: 8%;
  width: 190px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(111, 200, 184, 0.7), transparent);
  content: "";
}

.site-footer .footer-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.65fr);
  gap: 34px clamp(42px, 6vw, 96px);
  align-items: start;
}

.site-footer .footer-intro {
  display: grid;
  justify-items: start;
  gap: 13px;
}

.site-footer .footer-brand {
  width: fit-content;
}

.site-footer .footer-brand .brand-mark {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.site-footer .footer-intro > p {
  max-width: 270px;
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}

.site-footer .footer-cta {
  display: inline-flex;
  width: fit-content;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 7px 12px;
  border: 1px solid rgba(127, 203, 189, 0.28);
  border-radius: 999px;
  background: rgba(91, 171, 157, 0.09);
  color: #d9f0ea;
  font-size: 12px;
  font-weight: 850;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.site-footer .footer-cta:hover,
.site-footer .footer-cta:focus-visible {
  border-color: rgba(127, 203, 189, 0.62);
  background: rgba(91, 171, 157, 0.18);
  color: #fff;
  transform: translateY(-1px);
}

.site-footer .footer-link-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(26px, 4vw, 58px);
}

.site-footer .footer-link-groups nav {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 7px;
  min-width: 0;
}

.site-footer .footer-link-groups strong {
  margin-bottom: 4px;
  color: #f7f5ef;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.site-footer .footer-link-groups a {
  position: relative;
  width: fit-content;
  padding: 2px 0;
  color: #b8c2be;
  font-size: 13px;
  line-height: 1.55;
  transition: color 150ms ease, transform 150ms ease;
}

.site-footer .footer-link-groups a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: #76c6b7;
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 150ms ease;
}

.site-footer .footer-link-groups a:hover,
.site-footer .footer-link-groups a:focus-visible {
  color: #fff;
  transform: translateX(2px);
}

.site-footer .footer-link-groups a:is(:hover, :focus-visible)::after {
  transform: scaleX(1);
}

.site-footer .footer-bottom {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: #8f9b97;
  font-size: 11px;
}

.site-footer .footer-legal {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-footer .footer-legal a {
  color: #aeb8b4;
}

.site-footer .footer-legal a:hover,
.site-footer .footer-legal a:focus-visible {
  color: #fff;
}

@media (max-width: 760px) {
  .site-footer {
    padding: 34px 0 20px;
  }

  .site-footer .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .site-footer .footer-intro {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 16px;
  }

  .site-footer .footer-intro > p {
    grid-column: 1 / -1;
  }

  .site-footer .footer-cta {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }

  .site-footer .footer-link-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 24px;
  }

  .site-footer .footer-link-groups nav:last-child {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    column-gap: 20px;
  }

  .site-footer .footer-link-groups nav:last-child strong {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .site-footer .footer-intro {
    grid-template-columns: 1fr;
  }

  .site-footer .footer-cta {
    grid-column: 1;
    grid-row: auto;
  }

  .site-footer .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

/* Classics discovery and grouped reading routes. */
.route-filter-nav {
  position: sticky;
  z-index: 8;
  top: 72px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-warm) 94%, transparent);
  backdrop-filter: blur(12px);
}

.route-filter-nav .container {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 7px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.route-filter-nav button {
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: #4d5652;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.route-filter-nav button:hover,
.route-filter-nav button:focus-visible {
  border-color: color-mix(in srgb, var(--teal) 34%, var(--line));
  color: var(--teal-dark);
  transform: translateY(-1px);
}

.route-filter-nav button.is-active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  box-shadow: 0 7px 16px rgba(20, 118, 108, 0.16);
}

.routes-list-section,
.routes-grid > [id] {
  scroll-margin-top: 140px;
}

.route-featured-section {
  background:
    radial-gradient(circle at 12% 0, rgba(207, 166, 86, 0.14), transparent 30%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-warm) 78%, #eef5f1), var(--page));
}

.route-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.route-featured-grid .route-card {
  height: 100%;
}

.route-featured-grid .route-card:nth-child(2)::before {
  background: linear-gradient(90deg, #9b5b43, #d5a354);
}

.route-featured-grid .route-card:nth-child(3)::before {
  background: linear-gradient(90deg, #516e8d, #81a3a0);
}

.routes-list-section [data-route-result-count] {
  color: var(--teal-dark);
}

.classics-hero {
  overflow: hidden;
  background:
    radial-gradient(circle at 77% 22%, rgba(211, 163, 67, 0.16), transparent 26%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-warm) 88%, #eaf3ed), color-mix(in srgb, var(--page) 90%, #f4ead7));
}

.classics-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  align-items: center;
  gap: clamp(32px, 6vw, 86px);
}

.classics-hero .page-title {
  max-width: 690px;
}

.classics-hero-kicker,
.classic-entry-heading > span,
.classic-shelf-heading > div > span,
.classic-route-callout .container > div > span {
  display: block;
  margin-bottom: 7px;
  color: #9a4d34;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.classics-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}

.classics-hero-mosaic {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  min-height: 290px;
  padding: 28px 20px 4px;
}

.classics-hero-mosaic span {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 3px solid rgba(255, 255, 255, 0.76);
  border-radius: 9px;
  background: #ddd5c8;
  box-shadow: 0 18px 35px rgba(37, 40, 36, 0.2);
  transform: rotate(-4deg) translateY(14px);
}

.classics-hero-mosaic span:nth-child(2) { z-index: 2; transform: rotate(2deg) translateY(-8px); }
.classics-hero-mosaic span:nth-child(3) { z-index: 3; transform: rotate(-1deg) translateY(8px); }
.classics-hero-mosaic span:nth-child(4) { transform: rotate(4deg) translateY(22px); }

.classics-hero-mosaic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.classic-entry-section {
  padding-top: 38px;
  padding-bottom: 38px;
}

.classic-entry-heading {
  margin-bottom: 17px;
}

.classic-entry-heading h2,
.classic-shelf-heading h2,
.classic-route-callout h2 {
  margin: 0;
  font-size: clamp(25px, 3vw, 34px);
}

.classic-entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.classic-entry-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 7px 19px rgba(30, 39, 35, 0.055);
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.classic-entry-card:hover,
.classic-entry-card:focus-visible {
  border-color: color-mix(in srgb, var(--teal) 36%, var(--line));
  box-shadow: 0 14px 28px rgba(30, 50, 42, 0.12);
  transform: translateY(-3px);
}

.classic-entry-cover {
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 7px;
  background: #e5e0d7;
}

.classic-entry-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.classic-entry-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.classic-entry-copy small {
  color: #9a4d34;
  font-size: 10px;
  font-weight: 900;
}

.classic-entry-copy strong {
  font-size: 16px;
  line-height: 1.3;
}

.classic-entry-copy > span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.classic-entry-copy b {
  color: var(--teal);
  font-size: 11px;
}

.classic-shelf-nav {
  position: sticky;
  z-index: 7;
  top: 72px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(12px);
}

.classic-shelf-nav .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding-top: 11px;
  padding-bottom: 11px;
}

.classic-shelf-nav a {
  display: inline-flex;
  min-height: 40px;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  color: #57615d;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.classic-shelf-nav a:hover,
.classic-shelf-nav a:focus-visible {
  border-color: color-mix(in srgb, var(--teal) 34%, var(--line));
  background: #e6eee9;
  color: var(--teal-dark);
  transform: translateY(-1px);
}

.classic-shelf-section {
  scroll-margin-top: 132px;
}

.classic-shelf-section.classic-shelf-tinted {
  background: color-mix(in srgb, var(--surface-warm) 64%, var(--page));
}

.classic-shelf-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 21px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.classic-shelf-heading p {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.classic-shelf-card {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
}

.classic-shelf-cover {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 9px;
  background: #e3ddd3;
  box-shadow: 0 8px 18px rgba(29, 34, 31, 0.12);
}

.classic-shelf-cover::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(32, 42, 37, 0.1);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.classic-shelf-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 230ms ease, filter 230ms ease;
}

.classic-shelf-card:hover .classic-shelf-cover img,
.classic-shelf-card:focus-within .classic-shelf-cover img {
  filter: saturate(1.04) contrast(1.02);
  transform: scale(1.025);
}

.classic-shelf-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  padding: 10px 2px 0;
}

.classic-card-category {
  width: fit-content;
  margin-bottom: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e7f2ee;
  color: var(--teal-dark);
  font-size: 9px;
  font-weight: 850;
}

.classic-shelf-copy h3 {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.7em;
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.classic-shelf-copy > p {
  overflow: hidden;
  min-height: 1.5em;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classic-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 24px;
  margin-top: 8px;
}

.classic-card-meta span {
  padding: 3px 6px;
  border-radius: 999px;
  background: #eeeae1;
  color: #626862;
  font-size: 9px;
  font-weight: 780;
}

.classic-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: auto;
  padding-top: 10px;
}

.classic-card-actions .btn {
  min-width: 0;
  min-height: 34px;
  padding: 6px 5px;
  font-size: 10px;
  white-space: nowrap;
}

.classic-route-callout {
  background: linear-gradient(135deg, #173f3a, #23584e);
  color: #fff;
}

.classic-route-callout .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.classic-route-callout .container > div > span {
  color: #efca7f;
}

.classic-route-callout p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.74);
}

.classic-route-callout .btn {
  flex: 0 0 auto;
  border-color: #fff;
  background: #fff;
  color: #173f3a;
}

@media (max-width: 1180px) {
  .route-filter-nav .container { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .classic-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .classic-shelf-nav .container { justify-content: flex-start; }
}

@media (max-width: 900px) {
  .route-filter-nav,
  .classic-shelf-nav { position: static; }
  .route-featured-grid { grid-template-columns: 1fr; }
  .classics-hero-layout { grid-template-columns: 1fr; gap: 18px; }
  .classics-hero-mosaic { width: min(100%, 560px); min-height: 220px; padding-top: 12px; }
  .classic-shelf-heading { align-items: start; flex-direction: column; gap: 8px; }
  .classic-library-page .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 9px; }
  .routes-list-section,
  .routes-grid > [id] { scroll-margin-top: 76px; }
}

@media (max-width: 600px) {
  .route-filter-nav .container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .classic-entry-grid { grid-template-columns: 1fr; }
  .classic-shelf-nav .container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .classic-shelf-nav a {
    min-height: 42px;
    padding: 9px 8px;
    border-radius: 10px;
    font-size: 13px;
  }
  .classics-hero-mosaic { min-height: 170px; padding-right: 0; padding-left: 0; }
  .classics-hero-actions { display: grid; grid-template-columns: 1fr; }
  .classic-route-callout .container { align-items: stretch; flex-direction: column; }
  .classic-route-callout .btn { width: 100%; }
  .classic-shelf-copy { padding-top: 7px; }
  .classic-shelf-copy h3 { min-height: 2.6em; font-size: 12px; line-height: 1.3; }
  .classic-shelf-copy > p,
  .classic-card-category,
  .classic-card-meta,
  .classic-card-actions { display: none; }
}

@media (max-width: 760px) {
  .classic-library-page .book-card .book-cover {
    width: calc(100% - 10px);
    margin: 5px;
    padding: 6px;
  }

  .classic-library-page .book-cover span,
  .classic-library-page .book-card-body > p,
  .classic-library-page .book-info {
    display: none;
  }

  .classic-library-page .book-card-body {
    gap: 3px;
    padding: 4px 6px 9px;
  }

  .classic-library-page .book-card h2,
  .classic-library-page .book-card h3 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

/* Modern library experience */

body {
  overflow-x: hidden;
}

:focus-visible {
  outline: 3px solid #e3a82b;
  outline-offset: 3px;
}

.btn-small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 13px;
}

.icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: #5b625f;
  font-size: 18px;
  font-weight: 900;
}

.icon-button.is-active {
  border-color: #d6a13a;
  background: #fff6d9;
  color: #8a5a00;
}

.favorite-text-button {
  white-space: nowrap;
}

.favorite-text-button.is-active {
  border-color: #d6a13a;
  background: #fff6d9;
  color: #8a5a00;
}

.library-home {
  background: #f2f0e9;
}

.library-home .container,
.home-library {
  width: calc(100% - 40px);
}

.library-header {
  background: rgba(248, 247, 242, 0.97);
}

.library-header-inner {
  min-height: 64px;
}

.library-nav {
  flex: 1 1 auto;
  justify-content: center;
}

.library-search-row {
  display: grid;
  grid-template-columns: minmax(0, 860px) auto;
  justify-content: center;
  gap: 14px;
  padding: 0 0 12px;
}

.library-search-row.mobile-global-search-panel {
  display: none;
}

.site-header .header-global-search-panel {
  display: none;
}

.site-header .header-global-search-panel.is-open {
  display: grid;
  animation: header-search-reveal 160ms ease-out;
}

@keyframes header-search-reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.global-search {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 5px 6px 5px 14px;
  border: 1px solid #c9c5ba;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(23, 26, 26, 0.05);
}

.global-search > span {
  color: var(--teal);
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
}

.global-search input {
  min-width: 0;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
}

.global-search-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.global-search-results a {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid #ebe8e0;
}

.global-search-results a:last-child {
  border-bottom: 0;
}

.global-search-results a:hover {
  background: #f3f5f1;
}

.global-search-results img {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 3px;
}

.global-search-results picture {
  display: block;
  width: 36px;
  height: 48px;
}

.global-search-results span,
.global-search-results strong,
.global-search-results small {
  display: block;
  min-width: 0;
}

.global-search-results small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-shelf-link {
  display: none;
  align-items: center;
  color: var(--teal);
  font-weight: 850;
}

.home-library {
  padding: 30px 0 72px;
}

.library-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  padding: 24px 28px;
  border: 1px solid #d8d3c8;
  border-radius: 12px;
  background:
    linear-gradient(120deg, rgba(244, 239, 223, 0.94), rgba(255, 255, 255, 0.95)),
    #fff;
}

.library-intro h1,
.library-intro p {
  margin: 0;
}

.library-intro h1 {
  max-width: 760px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.library-intro p:not(.eyebrow) {
  max-width: 760px;
  margin-top: 10px;
  color: var(--muted);
}

.library-facts {
  display: flex;
  gap: 8px;
  margin: 0;
}

.library-facts div {
  min-width: 96px;
  padding: 12px 14px;
  border-left: 1px solid var(--line);
}

.library-facts dt {
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
}

.library-facts dd {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.library-trust-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 10px 0 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d8d4ca;
  border-radius: 10px;
  background: #fff;
  list-style: none;
}

.library-trust-strip li {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 11px 14px;
  border-left: 1px solid #e5e1d8;
}

.library-trust-strip li:first-child {
  border-left: 0;
}

.library-trust-strip strong {
  font-size: 12px;
}

.library-trust-strip span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-library-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 22px;
}

.home-reading-column {
  position: sticky;
  align-self: start;
  top: 142px;
  max-height: calc(100vh - 158px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.home-reading-column::-webkit-scrollbar {
  display: none;
}

.reading-sidebar {
  overflow: hidden;
  border-color: #d4d0c6;
  border-radius: 10px;
}

.reading-sidebar > summary {
  display: none;
}

.reading-sidebar-inner {
  display: grid;
  gap: 1px;
  background: #d8d4ca;
}

.side-module {
  padding: 15px;
  background: #fff;
}

.side-primary {
  background: #f0f7f4;
}

.side-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.side-heading h2 {
  margin: 0;
  font-size: 15px;
}

.side-heading a {
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
}

.side-heading > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.interest-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.interest-picker label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 11px;
  font-weight: 800;
}

.interest-picker input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.side-continue-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 11px;
}

.side-continue-card picture,
.side-continue-card img {
  width: 64px;
  height: 85px;
  aspect-ratio: 3 / 4;
  border-radius: 4px;
  object-fit: cover;
}

.side-continue-card picture {
  display: block;
  overflow: hidden;
}

.side-continue-card strong,
.side-continue-card span {
  display: block;
}

.side-continue-card strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.side-continue-card span {
  color: var(--muted);
  font-size: 11px;
}

.side-continue-card .btn {
  width: 100%;
  margin-top: 7px;
}

.side-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-list li {
  min-width: 0;
}

.side-list a {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 58px;
  padding: 5px 7px 5px 5px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.side-list a:hover {
  border-color: #cdded8;
  background: #fff;
  transform: translateX(2px);
}

.side-list img {
  width: 36px;
  height: 48px;
  border-radius: 5px;
  box-shadow: 0 4px 10px rgba(35, 40, 38, 0.12);
  object-fit: cover;
}

.side-update-copy,
.side-update-copy strong,
.side-update-copy small {
  display: block;
  min-width: 0;
}

.side-update-copy strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.side-update-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-list time {
  padding: 3px 5px;
  border-radius: 999px;
  background: #edf5f2;
  color: var(--teal-dark);
  font-size: 9px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.side-ranking-module {
  background: linear-gradient(160deg, #fff 0%, #f8f4ea 100%);
}

.side-ranking-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-ranking-list li {
  min-width: 0;
}

.side-ranking-list a {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 14px;
  gap: 10px;
  align-items: center;
  padding: 7px;
  border: 1px solid #e6dfd2;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.side-ranking-list a:hover {
  border-color: #b9d1c9;
  box-shadow: 0 8px 18px rgba(39, 45, 43, 0.08);
  transform: translateY(-1px);
}

.side-rank-cover {
  position: relative;
  width: 44px;
  height: 58px;
}

.side-rank-cover img {
  width: 44px;
  height: 58px;
  border-radius: 6px;
  box-shadow: 0 5px 12px rgba(36, 35, 31, 0.16);
  object-fit: cover;
}

.side-ranking-list b {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #e9e5dc;
  color: #605b50;
  font-size: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.side-ranking-list li:nth-child(-n + 3) b {
  background: var(--teal);
  color: #fff;
}

.side-rank-copy,
.side-ranking-list strong,
.side-ranking-list small,
.side-ranking-list em {
  display: block;
  min-width: 0;
}

.side-ranking-list strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-ranking-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.side-ranking-list em {
  margin-top: 2px;
  color: var(--accent-dark);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.side-rank-arrow {
  color: #9f988b;
  font-family: var(--font-serif);
  font-size: 22px;
}

.side-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.home-library-main {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.home-section {
  min-width: 0;
  padding: 22px;
  border: 1px solid #d8d4ca;
  border-radius: 10px;
  background: var(--surface);
}

.home-section-tinted {
  border-color: #c7dcd5;
  background: #f1f7f4;
}

.home-section-compact {
  padding-bottom: 24px;
}

.home-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e4e1d9;
}

.home-section-heading h2,
.home-section-heading p {
  margin: 0;
}

.home-section-heading h2 {
  font-size: 24px;
  line-height: 1.2;
}

.home-section-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.home-section-heading > a,
.section-heading-actions a,
.section-heading-actions button {
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.section-heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-heading-actions button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.section-heading-actions button:hover,
.section-heading-actions button:focus-visible {
  text-decoration: underline;
}

.section-kicker {
  color: #9a4b34;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.06em;
}

.library-book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px 14px;
  min-width: 0;
}

.library-book-card {
  position: relative;
  display: grid;
  height: 100%;
  min-width: 0;
  grid-template-rows: auto 1fr;
  transition: transform 180ms ease;
}

.library-cover,
.shelf-cover {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 1px solid #cbc6b9;
  border-radius: 6px;
  background: #e7e4dc;
  box-shadow: 0 7px 16px rgba(24, 28, 26, 0.12);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.library-cover {
  z-index: 1;
}

.library-cover img,
.shelf-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.library-cover picture,
.shelf-cover picture {
  display: block;
  width: 100%;
  height: 100%;
}

.library-cover:hover img {
  transform: scale(1.025);
}

.book-hover-panel {
  display: none;
}

@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  :is(.library-book-card, .book-card)[data-book-hover-card] {
    transition: transform 180ms ease;
  }

  :is(.library-book-card, .book-card)[data-book-hover-card]:is(:hover, :focus-within) {
    z-index: 3;
    transform: translateY(-4px);
  }

  .library-book-card[data-book-hover-card]:is(:hover, :focus-within) .library-cover img,
  .book-card[data-book-hover-card]:is(:hover, :focus-within) .book-cover-image {
    transform: scale(1.035);
  }

  .library-book-card[data-book-hover-card]:is(:hover, :focus-within) .library-cover {
    border-color: color-mix(in srgb, var(--teal) 46%, var(--line));
    box-shadow: 0 16px 32px rgba(27, 43, 38, 0.16);
  }

  .book-card[data-book-hover-card]:is(:hover, :focus-within) {
    border-color: color-mix(in srgb, var(--teal) 42%, var(--line));
    box-shadow: 0 14px 30px rgba(27, 43, 38, 0.12);
  }
}

.book-hover-kicker {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.035em;
}

.book-hover-panel strong {
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.25;
}

.book-hover-author {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.book-hover-panel p {
  display: -webkit-box;
  overflow: hidden;
  margin: 2px 0;
  color: #4e5753;
  font-size: 13px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.book-hover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.book-hover-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--reader-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.library-book-copy {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  gap: 5px;
  padding-top: 9px;
}

.book-type-pill {
  max-width: 100%;
  overflow: hidden;
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e8f1ed;
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 6px;
  min-height: 42px;
  min-width: 0;
}

.library-title-row .icon-button,
.library-card-actions,
.library-card-actions :is(button, a) {
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

.library-title-row .icon-button {
  flex: 0 0 auto;
  isolation: isolate;
}

.book-hover-panel {
  pointer-events: none;
}

[data-action="favorite"],
[data-action="toggle-shelf"] {
  touch-action: manipulation;
}

[data-action="favorite"].is-active {
  border-color: color-mix(in srgb, #d39c2c 52%, var(--line));
  background: color-mix(in srgb, #f4d886 24%, var(--surface));
  color: #8a5a00;
}

[data-action="toggle-shelf"].is-active {
  border-color: color-mix(in srgb, var(--teal) 32%, var(--line));
  background: color-mix(in srgb, var(--teal) 8%, var(--surface));
  color: var(--teal-dark);
}

.library-title-row h3,
.library-book-copy p {
  margin: 0;
}

.library-title-row h3 {
  display: -webkit-box;
  overflow: hidden;
  min-width: 0;
  font-size: 16px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.library-author,
.library-reason {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.library-author {
  min-height: 35px;
}

.library-reason {
  min-height: 35px;
  color: #6e5148;
}

.mini-progress {
  overflow: hidden;
  height: 5px;
  border-radius: 999px;
  background: #e3ded3;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.progress-p0 { width: 0%; }
.progress-p5 { width: 5%; }
.progress-p10 { width: 10%; }
.progress-p15 { width: 15%; }
.progress-p20 { width: 20%; }
.progress-p25 { width: 25%; }
.progress-p30 { width: 30%; }
.progress-p35 { width: 35%; }
.progress-p40 { width: 40%; }
.progress-p45 { width: 45%; }
.progress-p50 { width: 50%; }
.progress-p55 { width: 55%; }
.progress-p60 { width: 60%; }
.progress-p65 { width: 65%; }
.progress-p70 { width: 70%; }
.progress-p75 { width: 75%; }
.progress-p80 { width: 80%; }
.progress-p85 { width: 85%; }
.progress-p90 { width: 90%; }
.progress-p95 { width: 95%; }
.progress-p100 { width: 100%; }

.library-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.library-card-actions .btn {
  width: 100%;
  min-width: 0;
  padding-inline: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-author-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-author-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf9f5;
}

.home-author-media,
.home-author-media img,
.author-monogram {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.home-author-media {
  display: grid;
  overflow: hidden;
  place-items: center;
  background: var(--surface-warm);
}

.home-author-media img {
  object-fit: cover;
}

.author-monogram {
  display: grid;
  place-items: center;
  color: var(--accent-dark);
  font-family: var(--font-serif);
  font-weight: 900;
}

.home-author-copy {
  display: grid;
  min-width: 0;
}

.home-author-card:hover,
.home-category-card:hover {
  border-color: #8fb8af;
  background: #f2f8f5;
}

.home-author-card span,
.home-author-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.home-category-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 88px;
  overflow: hidden;
  padding: 9px 12px 9px 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, #faf9f5, color-mix(in srgb, var(--surface) 86%, #e9f1ec));
  box-shadow: 0 6px 18px rgba(25, 31, 28, 0.04);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.home-category-card:hover,
.home-category-card:focus-visible {
  border-color: color-mix(in srgb, var(--teal) 42%, var(--line));
  background: linear-gradient(145deg, #f7fbf9, #edf5f1);
  box-shadow: 0 12px 26px rgba(25, 42, 36, 0.1);
  transform: translateY(-2px);
}

.home-category-media {
  display: grid;
  width: 58px;
  height: 70px;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: var(--surface-warm);
  color: var(--teal-dark);
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 900;
}

.home-category-media picture,
.home-category-media img {
  display: block;
  width: 100%;
  height: 100%;
}

.home-category-media img {
  object-fit: cover;
  transition: transform 220ms ease;
}

.home-category-card:hover .home-category-media img,
.home-category-card:focus-visible .home-category-media img {
  transform: scale(1.06);
}

.home-category-copy {
  min-width: 0;
}

.home-category-card strong,
.home-category-card small {
  display: block;
}

.home-category-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-category-card b {
  color: var(--teal);
  font-size: 12px;
  white-space: nowrap;
}

.home-category-card.language-category-card {
  border-color: color-mix(in srgb, var(--teal) 32%, var(--line));
  background: color-mix(in srgb, var(--surface) 88%, #e8f4ef);
}

.home-route-grid,
.routes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.routes-grid > div {
  min-width: 0;
  height: 100%;
}

.routes-grid > div > .route-card {
  height: 100%;
}

.route-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 11px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 17px;
  background: linear-gradient(150deg, var(--surface), color-mix(in srgb, var(--surface) 90%, #edf3ef));
  box-shadow: 0 8px 24px rgba(25, 31, 28, 0.06);
  scroll-margin-top: 160px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.route-card-full {
  grid-template-rows: auto 1fr auto;
  gap: 0;
  padding: 0;
  border-radius: 22px;
  background: var(--surface);
}

.route-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #157e74, #d6a33a);
  content: "";
}

.route-card:nth-child(4n + 2)::before,
.routes-grid > div:nth-child(4n + 2) > .route-card::before { background: linear-gradient(90deg, #9b5b43, #d5a354); }
.route-card:nth-child(4n + 3)::before,
.routes-grid > div:nth-child(4n + 3) > .route-card::before { background: linear-gradient(90deg, #516e8d, #81a3a0); }
.route-card:nth-child(4n + 4)::before,
.routes-grid > div:nth-child(4n + 4) > .route-card::before { background: linear-gradient(90deg, #78617f, #b48a69); }

.route-card:hover,
.route-card:focus-within {
  border-color: color-mix(in srgb, var(--teal) 38%, var(--line));
  box-shadow: 0 17px 38px rgba(25, 42, 36, 0.12);
  transform: translateY(-3px);
}

.route-card-compact {
  padding: 16px;
  background: linear-gradient(150deg, #faf9f5, color-mix(in srgb, var(--surface) 88%, #e9f1ec));
}

.route-card-showcase {
  display: grid;
  grid-template-columns: 174px minmax(0, 1fr);
  gap: 22px;
  min-height: 228px;
  padding: 24px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background:
    radial-gradient(circle at 4% 8%, rgba(216, 169, 78, 0.18), transparent 30%),
    linear-gradient(145deg, #f2eee4, #edf4f0 72%);
}

.route-cover-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  height: 180px;
  align-self: center;
}

.route-cover-gallery a {
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: #ddd7ca;
  box-shadow: 0 10px 22px rgba(33, 40, 36, 0.17);
  transition: transform 170ms ease, box-shadow 170ms ease;
}

.route-cover-gallery a:first-child {
  grid-row: 1 / 3;
}

.route-cover-gallery a:hover,
.route-cover-gallery a:focus-visible {
  z-index: 2;
  box-shadow: 0 14px 28px rgba(33, 40, 36, 0.24);
  transform: translateY(-3px);
}

.route-cover-gallery picture,
.route-cover-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.route-card-summary {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.route-card-summary .route-card-head {
  margin-bottom: 14px;
}

.route-card-summary h3 {
  margin-bottom: 8px;
  font-size: clamp(25px, 2.1vw, 32px);
  line-height: 1.15;
}

.route-card-summary > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #59645f;
  font-size: 14px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.route-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.route-meta-row span {
  padding: 5px 9px;
  border: 1px solid rgba(23, 126, 116, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.67);
  color: #52625c;
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.route-meta-row b {
  color: var(--teal-dark);
}

.route-card-content {
  padding: 21px 24px 18px;
}

.route-sequence-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
}

.route-sequence-heading strong {
  font-size: 15px;
}

.route-sequence-heading span {
  color: var(--muted);
  font-size: 11px;
}

.route-card-compact > p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.route-cover-stack {
  display: flex;
  min-height: 78px;
  padding-left: 6px;
}

.route-cover-stack a {
  display: block;
  width: 56px;
  height: 75px;
  margin-left: -6px;
  overflow: hidden;
  border: 2px solid #faf9f5;
  border-radius: 4px;
  background: #e7e4dc;
  box-shadow: 0 5px 12px rgba(24, 28, 26, 0.13);
  transition: transform 160ms ease;
}

.route-cover-stack a:nth-child(2) { transform: translateY(3px) rotate(2deg); }
.route-cover-stack a:nth-child(3) { transform: translateY(1px) rotate(-2deg); }
.route-cover-stack a:nth-child(4) { transform: translateY(4px) rotate(2.5deg); }

.route-cover-stack a:hover,
.route-cover-stack a:focus-visible {
  z-index: 2;
  transform: translateY(-5px) rotate(0);
}

.route-cover-stack picture,
.route-cover-stack img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.route-card-head,
.route-progress-copy,
.route-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.route-accent {
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f2ee;
  color: var(--teal-dark);
  font-weight: 900;
}

.route-card h3,
.route-card p {
  margin: 0;
}

.route-card h3 {
  font-size: 23px;
}

.route-card p {
  color: var(--muted);
  font-size: 13px;
}

.route-book-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-book-list li {
  padding: 0;
  border-top: 1px solid #ece8df;
}

.route-book-list a {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-radius: 10px;
  transition: background 150ms ease, transform 150ms ease;
}

.route-book-list a:hover,
.route-book-list a:focus-visible {
  background: color-mix(in srgb, var(--teal) 7%, transparent);
  transform: translateX(3px);
}

.route-book-list .route-step-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #ece8df;
  color: #5f625e;
  font-size: 11px;
  font-weight: 900;
}

.route-book-list li.is-complete .route-step-number {
  background: var(--teal);
  color: #fff;
}

.route-book-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.route-book-copy strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-book-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.route-progress-copy strong {
  overflow: hidden;
  max-width: 65%;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-card-footer {
  padding: 17px 24px 21px;
  border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--surface-warm) 58%, var(--surface));
}

.route-card-footer .mini-progress {
  margin: 9px 0 15px;
}

.route-card-footer .route-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, max-content));
  gap: 8px;
}

.route-card-footer .btn {
  min-height: 40px;
}

.route-actions {
  justify-content: flex-start;
}

.route-detail-link {
  color: var(--teal);
  font-weight: 850;
}

.routes-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: clamp(30px, 5vw, 72px);
  align-items: center;
}

.routes-promise {
  position: relative;
  overflow: hidden;
  padding: 25px;
  border: 1px solid rgba(23, 126, 116, 0.2);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(211, 163, 67, 0.25), transparent 37%),
    linear-gradient(145deg, #eef5f1, #fffaf0);
  box-shadow: 0 16px 38px rgba(31, 49, 42, 0.09);
}

.routes-overview-band {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.routes-overview-band .routes-promise {
  display: grid;
  grid-template-columns: minmax(190px, .55fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding: 19px 22px;
  border-radius: var(--radius);
  box-shadow: none;
}

.routes-overview-copy > span {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

.routes-overview-band .routes-promise strong {
  font-size: 24px;
}

.routes-overview-band .routes-promise-grid {
  margin-top: 0;
}

.routes-promise strong,
.routes-promise span {
  display: block;
}

.routes-promise strong {
  margin-top: 6px;
  font-size: 29px;
  line-height: 1.2;
}

.routes-promise > span,
.routes-hero-kicker,
.routes-section-heading > div > span {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.routes-hero-kicker {
  display: block;
  margin: 20px 0 8px;
}

.routes-promise-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}

.routes-promise-grid span {
  display: grid;
  gap: 2px;
  padding-top: 10px;
  border-top: 1px solid rgba(23, 126, 116, 0.16);
  color: var(--muted);
  font-size: 10px;
}

.routes-promise-grid b {
  color: var(--ink);
  font-size: 12px;
}

.routes-list-section {
  padding-top: 34px;
}

.routes-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.routes-section-heading h2 {
  margin: 5px 0 0;
  font-size: 28px;
}

.routes-section-heading > p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.route-jump-nav {
  position: sticky;
  z-index: 8;
  top: 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 246, 242, 0.96);
  backdrop-filter: blur(12px);
}

.route-jump-nav .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 7px;
  padding: 10px 0;
}

.route-jump-nav a {
  min-width: 0;
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  color: #4d5652;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.route-jump-nav a:hover {
  border-color: color-mix(in srgb, var(--teal) 24%, var(--line));
  background: #e6eee9;
  color: var(--teal-dark);
}

.shelf-hero .page-title {
  width: min(880px, 100%);
}

.shelf-count {
  width: fit-content;
  margin-top: 10px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #e1ece8;
  color: var(--teal-dark);
  font-size: 13px;
}

.shelf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.shelf-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.shelf-library-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 15px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.shelf-library-item h2,
.shelf-library-item p {
  margin: 5px 0;
}

.shelf-library-item h2 {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-library-item p {
  color: var(--muted);
  font-size: 13px;
}

.shelf-status-picker {
  margin-top: 10px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--line) 84%, #fff);
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-warm) 80%, #fff), var(--surface-warm));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 1px 2px rgba(57, 52, 43, 0.06);
}

.shelf-status-caption {
  display: block;
  margin: 0 3px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.shelf-status-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.shelf-status-option {
  display: inline-flex;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.shelf-status-option span {
  font-size: 11px;
  line-height: 1;
}

.shelf-status-option:hover {
  border-color: color-mix(in srgb, var(--teal) 30%, var(--line));
  background: color-mix(in srgb, var(--surface) 82%, var(--teal) 4%);
  color: var(--ink);
  transform: translateY(-1px);
}

.shelf-status-option:active {
  box-shadow: inset 0 2px 4px rgba(40, 42, 39, 0.12);
  transform: translateY(1px);
}

.shelf-status-option:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--teal) 28%, transparent);
  outline-offset: 2px;
}

.shelf-status-option.is-active {
  border-color: color-mix(in srgb, var(--teal) 42%, var(--line));
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--surface) 88%, var(--teal) 5%));
  color: var(--teal-dark);
  box-shadow: 0 4px 10px rgba(28, 91, 81, 0.13), 0 1px 2px rgba(28, 91, 81, 0.12), inset 0 1px 0 #fff;
  transform: translateY(-1px);
}

.shelf-status-want.is-active {
  border-color: #d9b56c;
  color: #77551a;
  box-shadow: 0 4px 10px rgba(151, 106, 29, 0.13), 0 1px 2px rgba(151, 106, 29, 0.12), inset 0 1px 0 #fff;
}

.shelf-status-completed.is-active {
  border-color: #94a49d;
  color: #35463f;
  box-shadow: 0 4px 10px rgba(53, 70, 63, 0.13), 0 1px 2px rgba(53, 70, 63, 0.12), inset 0 1px 0 #fff;
}

html[data-shuban-theme="night"] .shelf-status-picker {
  border-color: var(--line);
  background: var(--reader-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-shuban-theme="night"] .shelf-status-option.is-active {
  border-color: #50756d;
  background: linear-gradient(180deg, #273238, #212b30);
  color: #d7ece6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-shuban-theme="night"] .shelf-status-want.is-active {
  border-color: #846d42;
  color: #f0d8a2;
}

.bookmark-list {
  display: grid;
  gap: 10px;
}

.bookmark-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.bookmark-row strong,
.bookmark-row span {
  display: block;
}

.bookmark-row span {
  color: var(--muted);
  font-size: 12px;
}

.bookmark-row p {
  margin: 5px 0 0;
}

.bookmark-row > div:last-child {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.privacy-local-band {
  padding-top: 0;
}

.reader-layout {
  width: min(1450px, calc(100% - 32px));
  grid-template-columns: 270px minmax(0, 760px) 320px;
  gap: 20px;
  justify-content: center;
}

.reader-aside,
.reader-tools {
  max-height: calc(100vh - 116px);
  overflow-y: auto;
}

.reader-aside {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.reader-aside::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.reader-aside h1 {
  margin-bottom: 5px;
}

.reader-tools {
  gap: 14px;
  padding: 20px;
}

.reader-tools > strong {
  margin-bottom: 1px;
  font-family: var(--font-serif);
  font-size: 18px;
}

.reader-tools .reader-action-stack {
  gap: 10px;
}

.reader-tools .btn {
  min-height: 44px;
}

.reader-aside {
  scroll-margin-top: 126px;
}

.reader-progress-label {
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.continue-last-link {
  display: block;
  margin-top: 9px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.reader-toc a {
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: start;
}

.reader-toc a.is-current {
  border-color: var(--teal);
  background: #f0fbf7;
  color: var(--teal-dark);
}

.reader-toc a.is-read .toc-number {
  background: var(--teal);
  color: #fff;
}

.reader-toc small {
  align-self: center;
  color: var(--muted);
  font-size: 10px;
}

.toc-title {
  display: block;
  width: auto;
  min-width: 0;
  height: auto;
  padding: 3px 0;
  overflow: visible;
  background: transparent;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.reader-toc a:hover,
.reader-toc a:focus-visible {
  border-color: #7aa99f;
  background: #f0f8f4;
}

.reader-nav {
  gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--reader-line);
}

.reader-nav .btn {
  display: grid;
  justify-content: stretch;
  min-height: 64px;
  gap: 3px;
  padding: 9px 12px;
  text-align: left;
  line-height: 1.35;
  white-space: normal;
}

.reader-nav-direction,
.reader-nav-title {
  display: block;
  min-width: 0;
}

.reader-nav-direction {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.reader-nav-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chapter-heading {
  margin-bottom: 34px;
  padding-bottom: 24px;
  border-bottom: 1px solid currentColor;
  border-bottom-color: rgba(100, 84, 65, 0.2);
}

.chapter-heading p {
  margin: 0 0 4px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 900;
}

.chapter-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 32px;
}

[data-chapter-content] > p {
  scroll-margin-top: 120px;
}

.reader-action-stack,
.tool-group {
  display: grid;
  gap: 8px;
}

.reader-action-stack .btn {
  width: 100%;
}

.tool-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.reader-source-link {
  padding: 8px 0;
  text-align: center;
}

.reader-notice {
  margin: 0;
  padding: 9px;
  border-radius: 6px;
  background: #e5f2ed;
  color: var(--teal-dark);
  font-size: 12px;
}

.annotation-trigger {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  margin: 0 0.06em;
  padding: 0 0.08em;
  border: 0;
  border-bottom: 1px dashed #9b741d;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  vertical-align: baseline;
}

.annotation-trigger:hover,
.annotation-trigger:focus-visible {
  background: #fff1bd;
  color: #674b08;
}

.annotation-trigger span {
  align-self: flex-start;
  margin: 0.22em 0 0 0.22em;
  color: #8a6207;
  font-family: var(--font-sans);
  font-size: 0.5em;
  font-weight: 950;
  line-height: 1;
}

.modern-guide {
  display: grid;
  gap: 18px;
  margin-top: 58px;
  padding: 24px;
  border: 1px solid #b9cec7;
  border-radius: 10px;
  background: color-mix(in srgb, var(--reader-hover) 76%, var(--reader-page));
  color: var(--reader-text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
}

.modern-guide[hidden] {
  display: none;
}

.modern-guide-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.modern-guide-heading h3,
.modern-guide-heading p,
.modern-guide > p {
  margin: 0;
}

.modern-guide-heading h3 {
  margin-top: 4px;
  color: var(--reader-text);
  font-family: var(--font-serif);
  font-size: 24px;
}

.modern-guide-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 10px;
  font-weight: 950;
}

.modern-guide > p {
  color: var(--reader-text);
}

.modern-guide-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.modern-guide-points li {
  padding: 13px;
  border: 1px solid var(--reader-line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--reader-page) 82%, transparent);
  font-size: 13px;
  line-height: 1.6;
}

.modern-guide-source {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--reader-line);
  color: var(--muted);
  font-size: 11px;
}

.modern-guide-source a {
  color: var(--teal);
  font-weight: 900;
}

.annotation-panel {
  position: relative;
  padding: 15px;
  border: 1px solid #cbb77d;
  border-radius: 8px;
  background: #fff8e5;
}

.annotation-panel h2 {
  margin: 5px 28px 6px 0;
  font-size: 18px;
}

.annotation-panel p {
  margin: 0 0 10px;
  color: #544c3f;
  font-size: 13px;
}

.annotation-type {
  color: #8a5a00;
  font-size: 11px;
  font-weight: 950;
}

.annotation-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  background: transparent;
  font-size: 21px;
}

.annotation-related {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #ddcfa5;
}

.annotation-related strong {
  width: 100%;
  font-size: 11px;
}

.annotation-related a {
  padding: 3px 7px;
  border-radius: 999px;
  background: #efe2b7;
  font-size: 11px;
  font-weight: 800;
}

.annotation-empty {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.reader-mobile-bar {
  display: none;
}

.reader-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: 84vh;
  padding: 0;
  border: 1px solid #c8c3b7;
  border-radius: 12px;
  background: #fbfaf6;
  color: var(--ink);
  box-shadow: 0 28px 70px rgba(18, 22, 21, 0.28);
}

.reader-dialog::backdrop {
  background: rgba(16, 20, 19, 0.62);
}

.dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.dialog-heading h2,
.dialog-heading p {
  margin: 0;
}

.dialog-heading > button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 22px;
}

.dialog-search,
.bookmark-dialog form,
.bookmark-dialog > p {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 18px 22px;
}

.dialog-search > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.dialog-search input,
.bookmark-dialog textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font: inherit;
}

.book-search-output {
  max-height: 50vh;
  overflow-y: auto;
  padding: 0 22px 22px;
}

.search-summary {
  padding: 9px 11px;
  border-radius: 6px;
  background: #e7f2ee;
  color: var(--teal-dark);
  font-weight: 850;
}

.search-result-group {
  margin-top: 14px;
}

.search-result-group h3 {
  margin: 0 0 7px;
  font-size: 16px;
}

.search-result-group h3 span {
  color: var(--muted);
  font-size: 12px;
}

.search-result-group > a {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.search-result-group > a:hover {
  background: #f0f5f2;
}

.search-result-group small {
  color: var(--teal);
  font-weight: 800;
}

mark {
  padding: 0 2px;
  background: #ffe59b;
  color: #2d2414;
}

.search-empty {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.search-suggestions a {
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8f1ed;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 850;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 1260px) {
  .library-book-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .home-library-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .reader-layout {
    grid-template-columns: 230px minmax(0, 760px) 300px;
    gap: 16px;
  }

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

@media (max-width: 1040px) {
  .library-header .header-actions {
    display: none;
  }

  .library-search-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mobile-shelf-link {
    display: inline-flex;
  }

  .home-library-layout {
    grid-template-columns: 1fr;
  }

  .home-reading-column {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .reading-sidebar > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 13px 16px;
    background: #eef4f1;
  }

  .reading-sidebar > summary small {
    color: var(--muted);
    font-size: 11px;
  }

  .reading-sidebar:not([open]) .reading-sidebar-inner {
    display: none;
  }

  .reading-sidebar-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
  }

  .library-book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reader-mobile-bar {
    position: sticky;
    z-index: 10;
    top: 72px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid #d9cbb7;
    background: #fff8ec;
  }

  .reader-mobile-bar button {
    min-height: 44px;
    border: 0;
    border-right: 1px solid #e0d4c3;
    background: transparent;
    font-weight: 850;
  }

  .reader-layout {
    grid-template-columns: minmax(0, 760px);
    width: min(800px, calc(100% - 28px));
  }

  .reader-aside {
    display: none;
    max-height: 70vh;
  }

  .reader-aside.is-open {
    display: block;
  }

  .reader-tools {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .library-home .container,
  .home-library {
    width: calc(100% - 24px);
  }

  .library-header-inner {
    padding-bottom: 8px;
  }

  .library-search-row {
    display: none;
    grid-template-columns: minmax(0, 1fr);
    padding: 0 0 10px;
  }

  .library-search-row.is-open {
    display: grid;
  }

  .global-search {
    grid-template-columns: auto minmax(0, 1fr);
    padding-right: 10px;
  }

  .global-search .btn {
    display: none;
  }

  .mobile-shelf-link {
    display: none;
  }

  .home-library {
    padding-top: 14px;
  }

  .library-intro {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .library-intro h1 {
    font-size: 34px;
  }

  .library-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .library-facts div {
    min-width: 0;
    padding: 8px 9px;
  }

  .library-facts dt {
    font-size: 21px;
  }

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

  .library-trust-strip li:nth-child(odd) {
    border-left: 0;
  }

  .library-trust-strip li:nth-child(n + 3) {
    border-top: 1px solid #e5e1d8;
  }

  .reading-sidebar-inner {
    grid-template-columns: 1fr;
  }

  .home-section {
    padding: 16px 12px;
  }

  .home-section-heading {
    align-items: start;
    margin-bottom: 13px;
  }

  .home-section-heading h2 {
    font-size: 21px;
  }

  .home-section-heading p {
    display: none;
  }

  .section-heading-actions {
    gap: 8px;
    font-size: 12px;
  }

  .library-book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px 10px;
  }

  .library-title-row h3 {
    font-size: 14px;
  }

  .library-book-card .icon-button {
    width: 30px;
    height: 30px;
  }

  .library-reason {
    min-height: 34px;
  }

  .library-card-actions {
    grid-template-columns: 1fr;
  }

  .reception-heading,
  .reception-source-heading,
  .modern-guide-heading,
  .modern-guide-source {
    align-items: flex-start;
    flex-direction: column;
  }

  .reception-grid,
  .reception-links,
  .modern-guide-points {
    grid-template-columns: 1fr;
  }

  .modern-guide {
    margin-top: 42px;
    padding: 18px;
  }

  .home-author-grid,
  .home-category-grid,
  .home-route-grid,
  .routes-grid {
    grid-template-columns: 1fr;
  }

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

  .route-card {
    padding: 17px;
  }

  .routes-hero-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .route-jump-nav {
    top: 64px;
  }

  .shelf-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .shelf-toolbar .segmented {
    width: 100%;
  }

  .shelf-toolbar .segmented button {
    flex: 1 0 auto;
  }

  .shelf-library-grid {
    grid-template-columns: 1fr;
  }

  .bookmark-row {
    align-items: stretch;
    flex-direction: column;
  }

  .bookmark-row > div:last-child .btn {
    flex: 1;
  }

  .chapter-page {
    min-height: 70vh;
    padding: 32px 22px;
  }

  .chapter-heading h2 {
    font-size: 27px;
  }

  .annotation-panel {
    position: fixed;
    z-index: 25;
    right: 10px;
    bottom: 10px;
    left: 10px;
    max-height: 58vh;
    overflow-y: auto;
    box-shadow: 0 18px 50px rgba(18, 22, 21, 0.28);
  }

  .dialog-search > div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .library-home .container,
  .home-library {
    width: calc(100% - 16px);
  }

  .library-search-row {
    gap: 8px;
  }

  .library-intro {
    padding: 17px;
  }

  .library-intro h1 {
    font-size: 30px;
  }

  .home-section {
    padding-inline: 9px;
  }

  .library-book-grid {
    gap-inline: 8px;
  }

  .library-book-copy {
    padding-top: 7px;
  }

  .library-author,
  .library-reason {
    font-size: 11px;
  }

  .reader-layout {
    width: min(100% - 16px, 800px);
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(.library-book-card, .book-card, .category-library-card, .author-card, .route-card),
  .book-hover-panel,
  .library-cover img,
  .book-cover-image,
  .category-card-media img,
  .home-category-media img {
    transition: none;
  }
}

/* Knowledge hubs shared with book, author, reader and route pages. */
.search-result-type { display: inline-block; margin-right: 6px; padding: 2px 6px; border-radius: 999px; background: var(--surface-muted); color: var(--accent); font-size: 10px; }
.search-result-monogram { display: grid; width: 36px; height: 44px; place-items: center; border-radius: 8px; background: var(--surface-muted); color: var(--accent); font-weight: 900; }
.annotation-idiom-link { display: inline-flex; margin: 4px 0 10px; color: var(--accent); font-size: 13px; font-weight: 850; text-decoration: none; }
.english-reading-guide h3 { margin: 24px 0 10px; }
.english-detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 22px; }
.book-related-idioms > .text-link { display: inline-flex; margin-top: 18px; }
.related-idiom-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.related-idiom-list a { display: grid; gap: 5px; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.related-idiom-list a:is(:hover, :focus-visible) { border-color: var(--accent); }
.related-idiom-list span { color: var(--muted); font-size: 13px; line-height: 1.55; }
.route-idiom-links { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 14px; }
.route-idiom-links > span { width: 100%; color: var(--muted); font-size: 11px; font-weight: 800; }
.route-idiom-links a { padding: 5px 8px; border-radius: 999px; background: var(--surface-muted); color: var(--accent); font-size: 11px; font-weight: 800; text-decoration: none; }
.knowledge-library-entry { padding-top: 0; }
.knowledge-library-entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.knowledge-library-entry-grid > a { display: grid; grid-template-columns: minmax(180px, .72fr) minmax(0, 1.28fr); gap: 24px; align-items: center; min-height: 270px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: inherit; text-decoration: none; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.knowledge-library-entry-grid > a:is(:hover, :focus-visible) { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.knowledge-library-entry-grid > a > span:last-child { display: grid; gap: 8px; }
.knowledge-library-entry-grid small { color: var(--accent); font-weight: 850; }
.knowledge-library-entry-grid strong { font-size: clamp(24px, 2.4vw, 34px); }
.knowledge-library-entry-grid p { margin: 0; color: var(--muted); line-height: 1.65; }
.knowledge-library-entry-grid b { color: var(--accent); }
.knowledge-entry-covers { position: relative; display: block; min-height: 210px; }
.knowledge-entry-covers img { position: absolute; bottom: 0; left: 50%; width: 41%; aspect-ratio: 3 / 4; border-radius: 9px; object-fit: cover; box-shadow: 0 10px 25px rgba(16, 29, 27, .18); transform: translateX(-50%); }
.knowledge-entry-covers img:first-child { transform: translateX(-92%) rotate(-7deg); }
.knowledge-entry-covers img:last-child { transform: translateX(-8%) rotate(7deg); }
.knowledge-entry-terms { display: flex; min-height: 210px; flex-direction: column; justify-content: center; gap: 10px; }
.knowledge-entry-terms i { align-self: flex-start; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-muted); color: var(--accent); font-family: var(--reading-font, serif); font-size: 18px; font-style: normal; font-weight: 800; }
.knowledge-entry-terms i:nth-child(2) { margin-left: 22%; }

@media (max-width: 760px) {
  .related-idiom-list, .knowledge-library-entry-grid { grid-template-columns: 1fr; }
  .knowledge-library-entry-grid > a { grid-template-columns: minmax(120px, .65fr) minmax(0, 1.35fr); min-height: 230px; padding: 18px; }
  .knowledge-entry-covers, .knowledge-entry-terms { min-height: 170px; }
}

@media (max-width: 480px) {
  .knowledge-library-entry-grid > a { grid-template-columns: 1fr; }
  .knowledge-entry-covers { min-height: 190px; }
  .knowledge-entry-terms { min-height: 130px; }
}

/* WeRead-inspired typography and site-wide reading themes */

body {
  transition: background-color 160ms ease, color 160ms ease;
}

:is(
  .page-title h1,
  .section-heading h1,
  .section-heading h2,
  .library-intro h1,
  .home-section-heading h2,
  .library-title-row h3,
  .book-card h2,
  .book-card h3,
  .route-card h3,
  .reader-aside h1,
  .chapter-heading h2,
  .dialog-heading h2
) {
  font-family: var(--font-serif);
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) :is(.library-home, .page-hero, .section-band) {
  background-color: var(--bg);
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) :is(.muted-band, .home-section-tinted, .side-primary) {
  background: var(--surface-warm);
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) :is(
  .library-header,
  .route-jump-nav
) {
  border-color: var(--line);
  background: var(--header-bg);
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) :is(
  .library-intro,
  .library-trust-strip,
  .side-module,
  .home-section,
  .home-author-card,
  .home-category-card,
  .category-library-card,
  .route-card,
  .routes-promise,
  .reader-preview,
  .preview-page,
  .content-panel,
  .comparison-scroll,
  .metric-grid div,
  .meta-table div,
  .rank-list a,
  .book-card,
  .author-card,
  .trust-item,
  .category-grid a,
  .note-card,
  .toc-list a,
  .help-card,
  .policy-card,
  .shelf-library-item,
  .global-search,
  .global-search-results,
  .header-theme-menu
) {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) .library-intro {
  background: var(--surface-warm);
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) .route-card-showcase,
html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) .route-card-footer {
  border-color: var(--line);
  background: var(--surface-warm);
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) .route-meta-row span {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

html[data-shuban-theme="night"] :is(
  .site-nav a,
  .link-button,
  .header-search-link,
  .header-theme-toggle,
  .book-card p,
  .library-reason,
  .route-jump-nav a,
  .toc-list a,
  .book-source p,
  .source-callout p,
  .comparison-table thead th,
  .book-info span,
  .chip,
  .icon-button
) {
  color: var(--muted);
}

html[data-shuban-theme="night"] .brand-mark {
  background-color: #f6f1e8;
}

html[data-shuban-theme="night"] :is(.source-badge, .book-type-pill, .route-accent, .shelf-count) {
  border-color: var(--line);
  background: var(--reader-hover);
  color: var(--teal-dark);
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) :is(.chip, .book-info span) {
  background: var(--reader-soft);
  color: var(--muted);
}

html[data-shuban-theme="night"] :is(.global-search-results a:hover, .home-author-card:hover, .home-category-card:hover) {
  background: var(--reader-hover);
}

html[data-shuban-theme="night"] .reading-sidebar {
  border-color: #3a4447;
  background: #1c2225;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

html[data-shuban-theme="night"] .reading-sidebar-inner {
  gap: 1px;
  background: #384144;
}

html[data-shuban-theme="night"] .side-module {
  background: #202629;
}

html[data-shuban-theme="night"] .side-primary {
  background: linear-gradient(150deg, #222c2d, #202729);
}

html[data-shuban-theme="night"] .side-heading {
  color: #e5e6e0;
}

html[data-shuban-theme="night"] .side-heading a {
  color: #78cdbf;
}

html[data-shuban-theme="night"] .side-continue-card :is(picture, img),
html[data-shuban-theme="night"] .side-list img,
html[data-shuban-theme="night"] .side-rank-cover img {
  border: 1px solid #465155;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.3);
}

html[data-shuban-theme="night"] .side-continue-card strong,
html[data-shuban-theme="night"] .side-update-copy strong,
html[data-shuban-theme="night"] .side-ranking-list strong {
  color: #e1e3dd;
}

html[data-shuban-theme="night"] .side-continue-card span,
html[data-shuban-theme="night"] .side-update-copy small,
html[data-shuban-theme="night"] .side-ranking-list small {
  color: #9fa9a6;
}

html[data-shuban-theme="night"] .side-continue-card .btn {
  border-color: #65c4b5;
  background: #65c4b5;
  color: #142421;
  box-shadow: 0 7px 16px rgba(22, 103, 91, 0.2);
}

html[data-shuban-theme="night"] .side-continue-card .mini-progress {
  background: #394447;
}

html[data-shuban-theme="night"] .side-list a {
  border-color: #343e41;
  background: #292f32;
  color: var(--ink);
}

html[data-shuban-theme="night"] .side-list a:hover,
html[data-shuban-theme="night"] .side-list a:focus-visible {
  border-color: #53716c;
  background: #30383a;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.16);
}

html[data-shuban-theme="night"] .side-list time {
  border: 1px solid #3b5a55;
  background: #263836;
  color: #7fd2c4;
}

html[data-shuban-theme="night"] .side-ranking-module {
  background: linear-gradient(160deg, #22282b 0%, #242927 100%);
}

html[data-shuban-theme="night"] .side-ranking-list a {
  border-color: #394245;
  background: #292f32;
}

html[data-shuban-theme="night"] .side-ranking-list a:hover,
html[data-shuban-theme="night"] .side-ranking-list a:focus-visible {
  border-color: #53716c;
  background: #30383a;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

html[data-shuban-theme="night"] .side-ranking-list b {
  border-color: #22282b;
  background: #414b4d;
  color: #dce0dc;
}

html[data-shuban-theme="night"] .side-ranking-list li:nth-child(-n + 3) b {
  background: #5ebcad;
  color: #142421;
}

html[data-shuban-theme="night"] .side-ranking-list em,
html[data-shuban-theme="night"] .side-rank-arrow {
  color: #8abdb4;
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) :is(
  .reader-shell,
  .reader-layout
) {
  background: var(--reader-bg);
  color: var(--reader-text);
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) :is(
  .reader-header,
  .reader-mobile-bar
) {
  border-color: var(--reader-line);
  background: var(--reader-header-bg);
  color: var(--reader-text);
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) :is(
  .reader-aside,
  .reader-tools
) {
  border-color: var(--reader-line);
  background: var(--reader-panel);
  color: var(--reader-text);
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) :is(
  .chapter-page,
  .chapter-page.theme-paper,
  .chapter-page.theme-sepia,
  .chapter-page.theme-night
) {
  border-color: var(--reader-line);
  background: var(--reader-page);
  color: var(--reader-text);
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) .reader-toc a {
  border-color: var(--reader-line);
  background: color-mix(in srgb, var(--reader-page) 82%, transparent);
  color: var(--reader-text);
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) .reader-toc a:is(.is-current, :hover, :focus-visible) {
  border-color: var(--teal);
  background: var(--reader-hover);
  color: var(--teal-dark);
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) :is(
  .reader-toc .toc-number,
  .reader-progress,
  .mini-progress
) {
  background: var(--reader-soft);
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) :is(
  .tool-row button,
  .reader-dialog,
  .dialog-heading > button,
  .dialog-search input,
  .bookmark-dialog textarea,
  .reader-source-link
) {
  border-color: var(--reader-line);
  background: var(--reader-page);
  color: var(--reader-text);
}

html[data-shuban-theme="night"] :is(.reader-notice, .annotation-panel, .annotation-trigger) {
  border-color: #526160;
  background: #293333;
  color: #d8dfda;
}

html[data-shuban-theme="night"] :is(.annotation-panel p, .annotation-type) {
  color: var(--muted);
}

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

/* Immersive reader: full viewport frame with a comfortable text measure. */

.reader-focus-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.reader-focus-button > span[aria-hidden="true"] {
  font-size: 18px;
  line-height: 1;
}

.reader-focus-exit {
  display: none;
  position: fixed;
  z-index: 50;
  top: 16px;
  right: 18px;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--reader-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--reader-panel) 92%, transparent);
  color: var(--reader-text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 10px 30px rgba(18, 22, 21, 0.16);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.reader-focus-exit kbd {
  padding: 2px 6px;
  border: 1px solid var(--reader-line);
  border-radius: 5px;
  background: var(--reader-soft);
  color: var(--muted);
  font: 700 10px/1.4 var(--font-sans);
}

.reader-focus-exit:hover,
.reader-focus-exit:focus-visible {
  border-color: var(--teal);
  color: var(--teal-dark);
}

html[data-reader-immersive="true"] {
  background: var(--reader-bg);
}

html[data-reader-immersive="true"] :is(.reader-header, .reader-mobile-bar, .reader-aside, .reader-tools) {
  display: none !important;
}

html[data-reader-immersive="true"] .reader-focus-exit {
  display: inline-flex;
}

html[data-reader-immersive="true"] .reader-layout {
  display: block;
  width: min(960px, calc(100% - 48px));
  min-height: 100vh;
  margin-inline: auto;
  padding: 32px 0 64px;
}

html[data-reader-immersive="true"] .chapter-page {
  width: 100%;
  min-height: calc(100vh - 96px);
  padding: clamp(52px, 7vw, 88px) clamp(36px, 8vw, 96px);
  border: 0;
  border-radius: 16px;
  box-shadow: none;
}

html[data-reader-immersive="true"] [data-chapter-content],
html[data-reader-immersive="true"] .chapter-heading,
html[data-reader-immersive="true"] .modern-guide {
  max-width: 760px;
  margin-inline: auto;
}

@media (max-width: 1040px) {
  .reader-mobile-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  html[data-reader-immersive="true"] .reader-layout {
    width: 100%;
    padding: 0;
  }

  html[data-reader-immersive="true"] .chapter-page {
    min-height: 100vh;
    padding: 70px 20px 44px;
    border-radius: 0;
  }

  .reader-focus-exit {
    top: 10px;
    right: 10px;
    min-height: 38px;
    padding-inline: 12px;
  }

  .reader-focus-exit kbd {
    display: none;
  }
}

/* Discovery, editorial depth and reading-layer upgrade */
.page-hero { padding: 34px 0 22px; }
.page-title { gap: 8px; }
.page-title h1 { font-size: clamp(32px, 4.8vw, 54px); }

.catalog-controls {
  display: grid;
  grid-template-columns: minmax(320px, 1.8fr) repeat(2, minmax(170px, .7fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 88%, var(--page));
}
.catalog-controls label { display: grid; gap: 5px; min-width: 0; }
.catalog-controls label > span { color: var(--muted); font-size: 12px; font-weight: 850; }
.catalog-controls input,
.catalog-controls select { width: 100%; min-width: 0; height: 48px; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background-color: var(--surface); color: var(--ink); font: inherit; transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease; }
.catalog-controls select { appearance: none; padding-right: 42px; cursor: pointer; font-weight: 750; }
.catalog-controls .catalog-filter { position: relative; }
.catalog-controls .catalog-filter::after { position: absolute; right: 17px; bottom: 19px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); content: ""; pointer-events: none; transform: rotate(45deg); }
.catalog-controls .catalog-search { grid-column: auto; }
.catalog-controls :is(input, select):focus-visible { outline: 3px solid color-mix(in srgb, var(--teal) 25%, transparent); outline-offset: 1px; border-color: var(--teal); }
.catalog-pagination { display: flex; grid-column: 1 / -1; width: 100%; justify-content: center; padding: 28px 0 6px; }
.catalog-pagination .btn { min-width: 160px; justify-content: center; }
.catalog-pagination [hidden] { display: none; }

.library-card-meta { display: flex; min-height: 44px; align-content: flex-start; flex-wrap: wrap; gap: 4px; margin: 7px 0 2px; }
.library-card-meta span { padding: 3px 6px; border-radius: 999px; background: var(--hover-bg); color: var(--muted); font-size: 10px; font-weight: 800; }
.library-title-row h3 a,
.book-card-body h2 a { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.home-library-main .library-book-grid { display: grid; grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; overflow: visible; padding: 12px 8px 16px; scroll-snap-type: none; }
.home-library-main .library-book-card { min-width: 0; }
.home-library-main .library-book-grid:not(.home-recommendation-grid) > .library-book-card:nth-child(n + 7) { display: none; }
.home-library-main .home-recommendation-grid {
  grid-auto-flow: row;
  grid-auto-columns: initial;
  grid-template-columns: repeat(auto-fit, minmax(min(175px, 100%), 1fr));
  overflow: visible;
  scroll-snap-type: none;
}

.book-detail-hero { padding: 20px 0 10px; background: var(--bg); border-bottom: 0; }
.book-detail-hero .breadcrumbs { margin-bottom: 0; }
.book-detail-band { padding-top: 12px; }
.book-detail-layout { gap: 38px; }
.book-detail-copy { gap: 18px; }
.book-detail-summary {
  position: relative;
  overflow: hidden;
  padding: 30px 32px 28px;
  border: 1px solid color-mix(in srgb, var(--teal) 22%, var(--line));
  border-radius: 20px;
  background:
    radial-gradient(circle at 94% 8%, color-mix(in srgb, var(--teal) 10%, transparent) 0 92px, transparent 93px),
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 88%, #eef7f3) 0%, var(--surface) 68%);
  box-shadow: 0 18px 42px rgba(31, 45, 40, 0.08);
}
.book-detail-intro { position: relative; z-index: 1; }
.book-detail-intro h1 { margin: 9px 0 4px; font-size: clamp(34px, 5vw, 58px); line-height: 1.08; }
.book-detail-byline, .book-detail-lead { margin: 8px 0 0; }
.book-detail-byline { color: var(--muted); font-weight: 750; }
.book-detail-lead { max-width: 760px; font-size: 17px; line-height: 1.75; }
.book-detail-progress { display: grid; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent); }
.book-detail-progress > span { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.book-detail-progress i { overflow: hidden; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--teal) 9%, var(--hover-bg)); }
.book-detail-progress em { display: block; height: 100%; border-radius: inherit; background: var(--teal); transition: width 180ms ease; }
.book-detail-summary .detail-stats {
  position: relative;
  z-index: 1;
  gap: 0;
  margin-top: 24px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  backdrop-filter: blur(8px);
}
.book-detail-summary .detail-stats div {
  display: grid;
  align-content: start;
  min-width: 0;
  padding: 13px 16px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.book-detail-summary .detail-stats div + div { border-left: 1px solid var(--line); }
.book-detail-summary .detail-stats span {
  order: 0;
  margin-bottom: 7px;
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.book-detail-summary .detail-stats strong {
  order: 1;
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: clamp(19px, 1.7vw, 25px);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-detail-summary .detail-stats small {
  order: 2;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}
.book-detail-summary .book-actions { position: relative; z-index: 1; margin: 20px 0 4px; }
.book-detail-summary .book-actions .btn { min-height: 46px; padding-inline: 20px; border-radius: 12px; }
.book-detail-summary .book-actions .btn-primary { min-width: 132px; box-shadow: 0 9px 20px color-mix(in srgb, var(--teal) 24%, transparent); }
.book-detail-summary .book-actions .btn-secondary { min-width: 94px; }
.book-detail-summary .book-actions .btn-primary::after { content: " →"; }
.detail-content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  counter-reset: detail-card;
}
.detail-content-grid .content-panel { margin: 0; }
.detail-overview-card {
  position: relative;
  overflow: hidden;
  min-height: 178px;
  padding: 25px 26px;
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 17px;
  background: linear-gradient(150deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 88%, var(--hover-bg)) 100%);
  transition: border-color 160ms ease, box-shadow 180ms ease, transform 180ms ease;
  counter-increment: detail-card;
}
.detail-overview-card::after {
  position: absolute;
  top: 13px;
  right: 18px;
  content: "0" counter(detail-card);
  color: color-mix(in srgb, var(--teal) 12%, transparent);
  font-family: var(--font-serif);
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}
.detail-card-kicker {
  position: relative;
  z-index: 1;
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}
.detail-overview-card h2 { position: relative; z-index: 1; margin: 9px 0 13px; font-size: 22px; }
.detail-overview-card p { position: relative; z-index: 1; margin: 0; color: #4f5854; line-height: 1.75; }
.book-detail-copy > .content-panel,
.book-detail-copy > .edition-panel { border-radius: 17px; }
@media (hover: hover) and (pointer: fine) {
  .detail-overview-card:hover {
    border-color: color-mix(in srgb, var(--teal) 42%, var(--line));
    box-shadow: 0 14px 30px rgba(31, 45, 40, 0.08);
    transform: translateY(-2px);
  }
}
.detail-chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-chip-list span { padding: 7px 10px; border-radius: 999px; background: var(--hover-bg); font-weight: 750; }
.detail-empty, .onsite-discussion p { color: var(--muted); }
.edition-panel summary, .faq-list summary { cursor: pointer; }
.edition-panel > summary { display: flex; justify-content: space-between; gap: 16px; font-size: 20px; font-weight: 850; }
.edition-panel summary small { color: var(--muted); font-size: 12px; }
.edition-panel dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0 0; }
.edition-panel dl div { padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.edition-panel dt, .edition-panel dd { margin: 0; }
.edition-panel dt { color: var(--muted); font-size: 11px; font-weight: 850; }
.edition-panel dd { margin-top: 4px; }
.detail-route-list, .faq-list { display: grid; gap: 9px; }
.detail-route-list a, .related-author-link { display: flex; justify-content: space-between; gap: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; }
.detail-route-list span, .related-author-link span { color: var(--muted); font-size: 12px; }
.related-book-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.related-book-list a { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
.related-book-list img { width: 54px; height: 72px; object-fit: cover; border-radius: 4px; }
.related-book-list strong, .related-book-list small { display: block; }
.related-book-list small { margin-top: 4px; color: var(--muted); }
.faq-list details { padding: 13px 0; border-bottom: 1px solid var(--line); }
.faq-list p { margin-bottom: 0; color: var(--muted); }

.author-profile-hero {
  padding: 28px 0 40px;
  background:
    radial-gradient(circle at 12% 16%, color-mix(in srgb, var(--teal) 8%, transparent), transparent 34%),
    linear-gradient(180deg, var(--surface) 0%, var(--surface-warm) 100%);
}

.author-profile-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 42px;
  align-items: center;
  margin-top: 24px;
}

.author-profile-portrait,
.author-profile-placeholder {
  width: 250px;
  min-height: 312px;
  margin: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 18px;
  background: linear-gradient(145deg, #d9e7e1, #f4efe3);
  box-shadow: 0 22px 44px rgba(33, 43, 39, 0.13);
}

.author-profile-portrait img {
  display: block;
  width: 250px;
  height: 312px;
  object-fit: cover;
  object-position: center 22%;
}

.author-profile-portrait figcaption {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
}

.author-profile-portrait figcaption a {
  color: var(--teal-dark);
  font-weight: 800;
}

.author-profile-placeholder {
  display: grid;
  place-items: center;
  min-height: 330px;
}

.author-profile-placeholder span {
  display: grid;
  width: 126px;
  height: 126px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.48);
  color: var(--teal-dark);
  font-family: var(--font-serif);
  font-size: 54px;
  font-weight: 900;
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.18);
}

.author-profile-copy h1 {
  margin: 10px 0 14px;
  font-size: clamp(40px, 5vw, 68px);
  letter-spacing: -0.04em;
}

.author-profile-lead {
  max-width: 900px;
  color: #46504c;
  font-size: 17px;
  line-height: 1.85;
}

.author-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 22px;
}

.author-facts div {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.author-facts span,
.author-facts strong {
  display: block;
  min-width: 0;
}

.author-facts span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.author-facts strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.author-profile-copy .book-actions {
  margin-top: 20px;
  padding-top: 2px;
}

.author-record-note {
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 84%, var(--accent-soft));
}

.author-record-note strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.author-record-note p {
  margin: 0;
  color: var(--muted);
}

.author-profile-content {
  padding-top: 30px;
}

.author-profile-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}

.author-profile-main,
.author-profile-aside {
  display: grid;
  gap: 18px;
}

.author-profile-aside {
  position: sticky;
  top: 92px;
}

.author-timeline {
  display: grid;
  gap: 0;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.author-timeline li {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.author-timeline time {
  color: var(--teal-dark);
  font-weight: 850;
}

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

.author-works-grid article {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-warm));
}

.author-work-cover,
.author-work-cover img {
  width: 86px;
  height: 116px;
  border-radius: 7px;
}

.author-work-cover {
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(24, 32, 29, 0.12);
}

.author-work-cover img { object-fit: cover; }
.author-works-grid article > div { min-width: 0; }
.author-works-grid article span { color: var(--teal-dark); font-size: 10px; font-weight: 850; }
.author-works-grid h3 { margin: 5px 0 7px; font-size: 17px; }
.author-works-grid p { display: -webkit-box; overflow: hidden; margin: 0 0 8px; color: var(--muted); font-size: 11px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }

.author-profile-aside .detail-chip-list a {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--hover-bg);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

.author-notable-list { margin: 0; padding-left: 20px; }
.author-notable-list li + li { margin-top: 7px; }
.author-source-list,
.related-author-list { display: grid; gap: 8px; }
.author-source-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.author-source-list a span { color: var(--muted); font-size: 10px; }
.author-source-list a b { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--teal-dark); }
.author-source-note { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.related-author-list a { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 9px; align-items: center; padding: 8px; border-radius: 9px; }
.related-author-list a:hover { background: var(--hover-bg); }
.related-author-list a > span { grid-row: 1 / 3; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--surface-warm); color: var(--teal-dark); font-weight: 900; }
.related-author-list small { color: var(--muted); }

.reader-mode-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.modern-guide { display: grid; gap: 20px; padding: 26px; }
.modern-guide > details > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 18px 20px; cursor: pointer; }
.modern-guide > details > summary span, .modern-guide > details > summary small { color: var(--muted); font-size: 11px; font-weight: 800; }
.modern-guide-body { padding: 0 20px 20px; }
.modern-guide-heading > div > span { color: var(--teal-dark); font-size: 11px; font-weight: 900; letter-spacing: .06em; }
.modern-guide-introduction { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.modern-guide-essay { display: grid; gap: 18px; padding-top: 20px; border-top: 1px solid var(--reader-line); }
.modern-guide-essay p { margin: 0; color: var(--reader-text); font-family: var(--font-serif); font-size: 18px; line-height: 1.95; }
.modern-guide-structure { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.modern-guide-structure a { display: grid; gap: 4px; min-width: 0; padding: 12px; border: 1px solid var(--reader-line); border-radius: 9px; background: color-mix(in srgb, var(--reader-page) 80%, transparent); }
.modern-guide-structure a:hover { border-color: var(--teal); transform: translateY(-1px); }
.modern-guide-structure span { color: var(--muted); font-size: 10px; font-weight: 850; }
.modern-guide-structure strong { overflow: hidden; color: var(--reader-text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.modern-guide-questions,
.chapter-guide-supplement { padding: 18px; border-radius: 10px; background: color-mix(in srgb, var(--reader-page) 82%, transparent); }
.modern-guide-questions h4,
.chapter-guide-supplement h4 { margin: 0 0 10px; font-family: var(--font-serif); font-size: 18px; }
.modern-guide-questions ul,
.chapter-guide-supplement ul { display: grid; gap: 7px; margin: 0; padding-left: 20px; }
.chapter-guide-supplement > span { color: var(--teal-dark); font-size: 10px; font-weight: 900; }
.chapter-guide-supplement p { margin: 0 0 10px; line-height: 1.8; }
.book-modern-interpretation { display: grid; gap: 20px; border-color: color-mix(in srgb, var(--teal) 35%, var(--line)); background: linear-gradient(145deg, color-mix(in srgb, var(--teal) 5%, var(--surface)), var(--surface)); }
.book-modern-interpretation > header { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.book-modern-interpretation > header h2 { margin: 4px 0 0; }
.book-modern-interpretation > header > small { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: var(--hover-bg); color: var(--teal-dark); font-size: 10px; font-weight: 900; }
.book-modern-introduction { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.book-modern-essay { display: grid; gap: 18px; padding-top: 20px; border-top: 1px solid var(--line); }
.book-modern-essay p { margin: 0; font-family: var(--font-serif); font-size: 18px; line-height: 1.95; }
.book-modern-interpretation > details { padding-top: 4px; }
.book-modern-interpretation > details > summary { color: var(--teal-dark); cursor: pointer; font-weight: 900; }
.book-modern-structure { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.book-modern-structure a { display: grid; gap: 4px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.book-modern-structure a span { color: var(--muted); font-size: 10px; font-weight: 850; }
.book-modern-structure a strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-modern-note { margin: 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.guide-editorial-record { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--reader-line); color: var(--muted); font-size: 12px; }
.paragraph-explanation { margin: -14px 0 28px; padding: 10px 12px; border-left: 3px solid var(--teal); background: color-mix(in srgb, var(--reader-hover) 62%, transparent); font-family: var(--font-sans); font-size: 13px; }
.paragraph-explanation summary { color: var(--teal-dark); cursor: pointer; font-weight: 850; }
.paragraph-explanation summary small { color: var(--muted); font-weight: 700; }
.paragraph-explanation p { margin: 9px 0 0; font-family: var(--font-sans); font-size: 14px; line-height: 1.75; }
.reader-tools { scrollbar-width: none; }
.reader-tools::-webkit-scrollbar { display: none; }
.annotation-pronunciation { color: var(--muted); font-size: 12px; }

@media (max-width: 1180px) {
  .catalog-controls { grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(130px, 1fr)); }
  .catalog-controls .catalog-search { grid-column: auto; }
  .wide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-library-main .library-book-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-library-main .library-book-grid:not(.home-recommendation-grid) > .library-book-card:nth-child(n + 5) { display: none; }
  .home-library-main .home-recommendation-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .catalog-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-controls .catalog-search { grid-column: 1 / -1; }
  .wide-grid { grid-template-columns: 1fr; }
  .home-library-main .library-book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .home-library-main .library-book-grid:not(.home-recommendation-grid) > .library-book-card:nth-child(n + 3) { display: none; }
  .home-library-main .home-recommendation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-card-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-library-card { grid-template-rows: 190px minmax(0, 1fr); }
  .book-detail-layout, .detail-content-grid, .edition-panel dl, .related-book-list { grid-template-columns: 1fr; }
  .book-detail-cover { position: static; width: min(210px, 56vw); margin: 0 auto; }
  .detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-detail-summary { padding: 24px; border-radius: 17px; }
  .book-detail-summary .detail-stats div + div { border-left: 0; }
  .book-detail-summary .detail-stats div:nth-child(even) { border-left: 1px solid var(--line); }
  .book-detail-summary .detail-stats div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .modern-guide > details > summary { grid-template-columns: 1fr; }
  .modern-guide { gap: 17px; padding: 20px 18px; }
  .modern-guide-heading { display: grid; }
  .modern-guide-heading h3 { font-size: 22px; }
  .modern-guide-essay p { font-size: 17px; line-height: 1.9; }
  .modern-guide-structure { grid-template-columns: 1fr; }
  .book-modern-interpretation > header { display: grid; }
  .book-modern-interpretation > header > small { justify-self: start; }
  .book-modern-essay p { font-size: 17px; line-height: 1.9; }
  .book-modern-structure { grid-template-columns: 1fr; }
  .author-profile-layout,
  .author-profile-columns { grid-template-columns: 1fr; }
  .author-profile-layout { gap: 25px; }
  .author-profile-layout > aside { justify-self: center; }
  .author-profile-copy { text-align: center; }
  .author-profile-copy .book-actions { justify-content: center; }
  .author-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); text-align: left; }
  .author-profile-aside { position: static; }
  .author-works-grid { grid-template-columns: 1fr; }
  .route-card-full { padding: 0; }
  .route-card-showcase { grid-template-columns: 150px minmax(0, 1fr); gap: 18px; min-height: 210px; padding: 20px; }
  .route-cover-gallery { height: 164px; }
  .route-card-content { padding: 18px 20px 15px; }
  .route-card-footer { padding: 16px 20px 20px; }
  .route-card-summary h3 { font-size: 26px; }
  .routes-section-heading { align-items: start; flex-direction: column; gap: 7px; }
  .routes-section-heading > p { max-width: none; }
  .routes-promise { padding: 22px; }
  .route-jump-nav { position: static; }
  .route-jump-nav .container { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .route-jump-nav a { padding: 8px 5px; font-size: 12px; }
  .shelf-toolbar .segmented button { flex: 1 1 calc(50% - 4px); }
}

@media (max-width: 600px) {
  .routes-overview-band {
    padding: 16px 0;
  }

  .routes-overview-band .routes-promise {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 17px;
  }

  .route-card-showcase { grid-template-columns: 1fr; min-height: 0; }
  .route-cover-gallery { width: min(100%, 260px); height: 168px; justify-self: start; }
  .route-card-summary { justify-content: start; }
  .route-card-summary .route-card-head { margin-bottom: 10px; }
  .route-card-summary > p { -webkit-line-clamp: 4; }
  .route-meta-row { margin-top: 13px; }
  .route-sequence-heading { align-items: start; flex-direction: column; gap: 2px; }
}

@media (max-width: 420px) {
  .catalog-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-controls .catalog-search { grid-column: 1 / -1; }
  .book-detail-summary { padding: 20px 18px; }
  .book-detail-summary .detail-stats { grid-template-columns: 1fr; }
  .book-detail-summary .detail-stats div:nth-child(n) { border-left: 0; }
  .book-detail-summary .detail-stats div + div { border-top: 1px solid var(--line); }
  .book-detail-summary .book-actions { display: grid; grid-template-columns: 1fr; }
  .author-profile-portrait,
  .author-profile-placeholder,
  .author-profile-portrait img { width: min(250px, 76vw); }
  .author-profile-copy h1 { font-size: 38px; }
  .author-profile-lead { font-size: 15px; }
  .author-facts { grid-template-columns: 1fr; }
  .author-profile-copy .book-actions { display: grid; grid-template-columns: 1fr; margin-top: 16px; }
  .author-timeline li { grid-template-columns: 1fr; gap: 5px; }
  .routes-promise-grid { grid-template-columns: 1fr; gap: 5px; }
  .routes-promise-grid span { grid-template-columns: 50px 1fr; gap: 8px; }
  .route-card-showcase,
  .route-card-content,
  .route-card-footer { padding-right: 16px; padding-left: 16px; }
  .route-card-footer .route-actions { grid-template-columns: 1fr; }
  .route-card-footer .btn { width: 100%; }
  .route-progress-copy { align-items: start; flex-direction: column; gap: 3px; }
  .route-progress-copy strong { max-width: 100%; }
  .route-jump-nav .container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Book catalog density: seven covers on wide desktop, three on touch-sized screens. */
.catalog-page [data-book-list].book-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 18px 10px;
}

.catalog-page [data-book-card] .book-cover {
  width: calc(100% - 16px);
  margin: 8px;
  padding: 9px;
}

.catalog-page [data-book-card] .book-card-body {
  gap: 6px;
  padding: 0 10px 13px;
}

.catalog-page [data-book-card] .book-meta,
.catalog-page [data-book-card] .book-card-body > p:not(.book-meta) {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.catalog-page [data-book-card] .book-meta {
  min-height: 2.75em;
  font-size: 11px;
  line-height: 1.38;
  -webkit-line-clamp: 2;
}

.catalog-page [data-book-card] h2,
.catalog-page [data-book-card] h3 {
  min-height: 2.5em;
  font-size: 16px;
  line-height: 1.25;
}

.catalog-page [data-book-card] h2 a,
.catalog-page [data-book-card] h3 a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.catalog-page [data-book-card] .book-card-body > p:not(.book-meta) {
  min-height: 4.65em;
  font-size: 12px;
  line-height: 1.55;
  -webkit-line-clamp: 3;
}

.catalog-page [data-book-card] .book-info {
  min-height: 50px;
  align-content: flex-start;
  gap: 4px;
}

.catalog-page [data-book-card] .book-info span {
  min-height: 22px;
  padding-inline: 6px;
  font-size: 10px;
}

.catalog-page [data-book-card] .book-card-actions {
  gap: 6px;
  font-size: 11px;
}

@media (min-width: 901px) and (max-width: 1180px) {
  .catalog-page [data-book-list].book-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .catalog-page [data-book-list].book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 8px;
  }

  .catalog-page [data-book-card] .book-cover {
    width: calc(100% - 8px);
    margin: 4px;
    padding: 4px;
    border-radius: 5px;
  }

  .catalog-page [data-book-card] .book-cover span,
  .catalog-page [data-book-card] .book-meta,
  .catalog-page [data-book-card] .book-card-body > p:not(.book-meta),
  .catalog-page [data-book-card] .book-info,
  .catalog-page [data-book-card] .book-card-actions > span {
    display: none;
  }

  .catalog-page [data-book-card] .book-card-body {
    gap: 4px;
    padding: 3px 6px 8px;
  }

  .catalog-page [data-book-card] h2,
  .catalog-page [data-book-card] h3 {
    min-height: 2.6em;
    font-size: clamp(12px, 3.35vw, 15px);
    line-height: 1.3;
  }

  .catalog-page [data-book-card] .book-card-actions {
    margin-top: 1px;
    padding-top: 5px;
  }

  .catalog-page [data-book-card] .book-card-actions .text-link {
    min-height: 30px;
    font-size: clamp(10px, 2.8vw, 12px);
    white-space: nowrap;
  }
}

/* Reader-supported platform page and restrained ten-minute support prompt. */
.support-intro-band {
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.support-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: clamp(28px, 6vw, 88px);
  align-items: center;
}

.support-kicker,
.support-section-heading > span {
  color: #9a4b34;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.support-intro-copy h2 {
  max-width: 720px;
  margin: 8px 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.2;
}

.support-intro-copy > p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.support-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 13px 18px;
  align-items: center;
  margin-top: 20px;
}

.support-promise-card {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid color-mix(in srgb, var(--teal) 22%, var(--line));
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 24px 55px rgba(35, 47, 42, 0.12);
  backdrop-filter: blur(12px);
}

.support-promise-card::after {
  position: absolute;
  right: -42px;
  bottom: -42px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--teal) 8%, transparent);
  content: "";
}

.support-promise-card > span {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 900;
}

.support-promise-card > strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: 25px;
  line-height: 1.4;
}

.support-promise-card ul {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.support-promise-card li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.support-promise-card li::before {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--teal) 13%, transparent);
  color: var(--teal-dark);
  content: "✓";
  font-size: 10px;
  font-weight: 950;
}

.support-section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.support-section-heading h2 {
  margin: 7px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.5vw, 43px);
  line-height: 1.2;
}

.support-section-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.support-purpose-grid article {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface) 87%, #edf5f1));
  box-shadow: 0 10px 26px rgba(28, 37, 33, 0.05);
}

.support-purpose-grid b {
  position: absolute;
  right: 18px;
  top: 12px;
  color: color-mix(in srgb, var(--teal) 14%, transparent);
  font-family: var(--font-serif);
  font-size: 60px;
  line-height: 1;
}

.support-purpose-grid article > span {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 900;
}

.support-purpose-grid h3 {
  margin: 48px 0 10px;
  font-family: var(--font-serif);
  font-size: 23px;
}

.support-purpose-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.support-method-section {
  background: color-mix(in srgb, var(--surface-warm) 70%, var(--bg));
}

.support-method-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(340px, 1.06fr);
  gap: clamp(32px, 5vw, 62px);
  align-items: center;
}

.support-method-layout h2,
.support-faq-layout h2 {
  margin: 7px 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 48px);
}

.support-method-layout > div > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.support-nonmoney {
  margin-top: 26px;
  padding: 18px 20px;
  border-left: 3px solid var(--teal);
  border-radius: 0 12px 12px 0;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
}

.support-nonmoney p {
  margin: 5px 0 9px;
  color: var(--muted);
  font-size: 13px;
}

.support-nonmoney a {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.support-method-pending {
  display: grid;
  gap: 12px;
  padding: clamp(26px, 4vw, 40px);
  border: 1px solid color-mix(in srgb, #d2a24e 35%, var(--line));
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 8%, rgba(220, 171, 83, 0.18), transparent 28%),
    var(--surface);
  box-shadow: 0 22px 50px rgba(39, 38, 31, 0.09);
}

.support-method-pending > span {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f4ead3;
  color: #8b6422;
  font-size: 11px;
  font-weight: 900;
}

.support-method-pending > strong {
  margin-top: 5px;
  font-family: var(--font-serif);
  font-size: 25px;
  line-height: 1.4;
}

.support-method-pending > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.support-method-pending .btn {
  width: fit-content;
  margin-top: 8px;
}

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

.supporter-wall article,
.supporter-wall-empty {
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.supporter-wall article {
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

.supporter-wall article > span,
.supporter-wall-empty > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--teal) 10%, var(--surface-warm));
  color: var(--teal-dark);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 900;
}

.supporter-wall p,
.supporter-wall-empty p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.supporter-wall time {
  color: var(--muted);
  font-size: 11px;
}

.supporter-wall-empty {
  grid-template-columns: 44px minmax(0, 1fr);
  max-width: 680px;
}

.support-faq-section {
  padding-top: 30px;
}

.support-faq-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
  gap: clamp(30px, 6vw, 86px);
}

.support-page-hero {
  position: relative;
  overflow: hidden;
  padding: 30px 0 44px;
  background:
    radial-gradient(circle at 88% 16%, rgba(211, 164, 78, 0.2), transparent 29%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-warm) 92%, #e6efe9), color-mix(in srgb, var(--bg) 88%, #f4e8cf));
}

.support-page-hero::after {
  position: absolute;
  right: -90px;
  bottom: -150px;
  width: 340px;
  height: 340px;
  border: 1px solid color-mix(in srgb, var(--teal) 16%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 46px color-mix(in srgb, var(--teal) 3%, transparent);
  content: "";
  pointer-events: none;
}

.support-page-hero .breadcrumbs {
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
}

.support-page > section > .container,
.support-page > section > .support-method-layout {
  width: min(1120px, calc(100% - 40px));
}

.support-hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: clamp(30px, 5vw, 58px);
  align-items: center;
}

.support-intro-copy h1 {
  max-width: 650px;
  margin: 8px 0 16px;
  font-family: var(--font-serif);
  font-size: clamp(38px, 4.6vw, 60px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.support-hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.support-hero-facts span {
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--teal) 18%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 64%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.support-method-copy h2 {
  max-width: 580px;
  letter-spacing: -0.025em;
}

.support-steps {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  counter-reset: support-step;
  list-style: none;
}

.support-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.support-steps li::before {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--teal) 24%, var(--line));
  border-radius: 50%;
  background: color-mix(in srgb, var(--teal) 8%, var(--surface));
  color: var(--teal-dark);
  content: counter(support-step);
  counter-increment: support-step;
  font-size: 11px;
  font-weight: 950;
}

.support-trust-note {
  display: grid;
  gap: 5px;
  margin-top: 28px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--teal) 18%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.support-trust-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.support-checkout-card {
  display: grid;
  gap: 20px;
  padding: clamp(26px, 3.2vw, 36px);
  border: 1px solid color-mix(in srgb, #d2a24e 36%, var(--line));
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 4%, rgba(222, 174, 83, 0.2), transparent 30%),
    linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface) 88%, #f4ebd8));
  box-shadow: 0 24px 58px rgba(38, 37, 29, 0.12);
}

.support-checkout-top {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 17px;
  align-items: center;
}

.support-checkout-top > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.support-checkout-top > div > span {
  color: #8e6122;
  font-size: 12px;
  font-weight: 900;
}

.support-checkout-top strong {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.12;
}

.support-coffee-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, #176f67, #234c45);
  box-shadow: 0 12px 26px rgba(18, 87, 79, 0.25);
  color: #fffaf1;
}

.support-coffee-mark svg {
  width: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-checkout-card > p,
.support-checkout-card > small {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.support-checkout-card > p {
  font-size: 14px;
}

.support-checkout-card > small {
  font-size: 11px;
}

.support-payment-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
  gap: 1px;
}

.support-payment-meta span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 13px 10px;
  background: color-mix(in srgb, var(--surface) 94%, #f4ead5);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.support-payment-meta b {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-checkout-button {
  width: 100%;
  min-height: 52px;
  font-size: 15px;
  box-shadow: 0 12px 24px rgba(15, 118, 108, 0.19);
}

.support-other-section {
  padding: 0 0 70px;
}

.support-purpose-section .container,
.support-faq-section .container {
  max-width: 1040px;
}

.support-purpose-grid article {
  min-height: 205px;
}

.support-other-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 30px 34px;
  border: 1px solid color-mix(in srgb, var(--teal) 20%, var(--line));
  border-radius: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 94%, #e9f3ee), var(--surface));
}

.support-other-card h2 {
  margin: 6px 0 6px;
  font-family: var(--font-serif);
  font-size: clamp(25px, 3vw, 34px);
}

.support-other-card p {
  margin: 0;
  color: var(--muted);
}

.support-other-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
}

.support-faq-section .faq-list details {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.support-faq-section .faq-list summary {
  font-weight: 900;
}

.support-faq-section .faq-list p {
  margin-top: 10px;
  line-height: 1.7;
}

.support-prompt {
  position: fixed;
  z-index: 48;
  left: 22px;
  bottom: 22px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  width: min(390px, calc(100vw - 44px));
  gap: 14px;
  padding: 18px 42px 18px 18px;
  border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 22px 58px rgba(16, 29, 25, 0.23);
  color: var(--ink);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 200ms ease, transform 200ms ease;
  backdrop-filter: blur(16px);
}

.support-prompt.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.support-prompt-close {
  position: absolute;
  top: 8px;
  right: 9px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
}

.support-prompt-close:hover,
.support-prompt-close:focus-visible {
  background: var(--hover-bg);
  color: var(--ink);
}

.support-prompt-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--teal), #255b51);
  box-shadow: 0 8px 18px rgba(20, 118, 108, 0.22);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 900;
}

.support-prompt-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.support-prompt-copy small {
  color: #9a4b34;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.05em;
}

.support-prompt-copy strong {
  padding-right: 3px;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.35;
}

.support-prompt-copy p {
  margin: 1px 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.support-prompt-copy a {
  width: fit-content;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}

html[data-reader-immersive="true"] .support-prompt {
  display: none;
}

html:is([data-shuban-theme="sepia"], [data-shuban-theme="night"]) :is(
  .support-promise-card,
  .support-purpose-grid article,
  .support-method-pending,
  .support-checkout-card,
  .support-trust-note,
  .support-other-card,
  .supporter-wall article,
  .supporter-wall-empty,
  .support-prompt
) {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

@media (max-width: 820px) {
  .support-intro-grid,
  .support-hero-layout,
  .support-method-layout,
  .support-faq-layout {
    grid-template-columns: 1fr;
  }

  .support-purpose-grid,
  .supporter-wall {
    grid-template-columns: 1fr;
  }

  .support-promise-card {
    width: min(100%, 620px);
  }

  .support-page > section > .container,
  .support-page > section > .support-method-layout {
    width: min(calc(100% - 32px), 680px);
  }

  .support-other-card {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .support-intro-band {
    padding: 24px 0;
  }

  .support-page-hero {
    padding: 20px 0 32px;
  }

  .support-page-hero .breadcrumbs {
    margin-bottom: 22px;
  }

  .support-intro-copy h1 {
    font-size: clamp(34px, 10.5vw, 46px);
  }

  .support-intro-grid {
    gap: 22px;
  }

  .support-promise-card,
  .support-method-pending,
  .support-checkout-card {
    padding: 22px;
    border-radius: 17px;
  }

  .support-checkout-top {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 13px;
  }

  .support-coffee-mark {
    width: 52px;
    height: 52px;
    border-radius: 15px;
  }

  .support-coffee-mark svg {
    width: 29px;
  }

  .support-payment-meta span {
    padding: 11px 6px;
  }

  .support-other-section {
    padding-bottom: 44px;
  }

  .support-other-card {
    gap: 20px;
    padding: 23px;
    border-radius: 17px;
  }

  .support-other-actions,
  .support-other-actions .btn {
    width: 100%;
  }

  .support-purpose-grid article {
    min-height: 180px;
    padding: 21px;
  }

  .support-prompt {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
    padding: 15px 38px 15px 15px;
    border-radius: 15px;
  }

  .support-prompt-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 18px;
  }

  .support-prompt-copy strong {
    font-size: 16px;
  }

}

/* Reader continuity, typography and focus upgrade — 2026-08-27 */
.reader-immersive-progress,
.reader-immersive-toolbar,
.reader-mobile-tools {
  display: none;
}

.chapter-page :is(.chapter-heading, [data-chapter-content], .modern-guide, .chapter-completion) {
  width: 100%;
  margin-inline: auto;
  transition: max-width .2s ease;
}

.chapter-page[data-reader-width="narrow"] :is(.chapter-heading, [data-chapter-content], .modern-guide, .chapter-completion) { max-width: 560px; }
.chapter-page[data-reader-width="standard"] :is(.chapter-heading, [data-chapter-content], .modern-guide, .chapter-completion) { max-width: 680px; }
.chapter-page[data-reader-width="wide"] :is(.chapter-heading, [data-chapter-content], .modern-guide, .chapter-completion) { max-width: 820px; }
.chapter-page[data-reader-line-height="compact"] [data-chapter-content] { line-height: 1.7; }
.chapter-page[data-reader-line-height="comfortable"] [data-chapter-content] { line-height: 2; }
.chapter-page[data-reader-line-height="spacious"] [data-chapter-content] { line-height: 2.3; }
.chapter-page[data-reader-paragraph-spacing="compact"] [data-chapter-content] > p { margin-block: 0 1em; }
.chapter-page[data-reader-paragraph-spacing="comfortable"] [data-chapter-content] > p { margin-block: 0 1.55em; }
.chapter-page[data-reader-paragraph-spacing="spacious"] [data-chapter-content] > p { margin-block: 0 2.15em; }
.chapter-page[data-reader-font="serif"] { font-family: var(--font-reading), "Noto Serif SC", "Songti SC", serif; }
.chapter-page[data-reader-font="sans"] { font-family: var(--font-sans), "Noto Sans SC", "PingFang SC", sans-serif; }
.chapter-page[data-reader-font="system"] { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

@media (min-width: 1261px) {
  .reader-layout:has(.chapter-page[data-reader-width="wide"]) {
    grid-template-columns: 240px minmax(0, 820px) 240px;
    gap: 18px;
  }
}

.reader-settings-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reader-settings-shortcuts .btn { min-width: 0; }

.reader-preferences-drawer[hidden] { display: none !important; }

.reader-preferences-drawer {
  position: fixed;
  z-index: 120;
  top: 16px;
  right: 16px;
  bottom: 16px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(390px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--reader-line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--reader-panel) 97%, transparent);
  color: var(--reader-text);
  box-shadow: 0 28px 80px rgba(13, 21, 19, .28);
  backdrop-filter: blur(18px);
  animation: reader-drawer-in .2s ease both;
}

@keyframes reader-drawer-in {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

.reader-preferences-drawer > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--reader-line);
}

.reader-preferences-drawer > header span {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 900;
}

.reader-preferences-drawer > header h2 { margin: 3px 0 0; font-size: 24px; }
.reader-preferences-drawer > header button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--reader-line);
  border-radius: 50%;
  background: var(--reader-page);
  color: var(--reader-text);
  font-size: 24px;
  cursor: pointer;
}

.reader-preferences-scroll {
  display: grid;
  gap: 20px;
  align-content: start;
  overflow-y: auto;
  padding: 20px 22px 26px;
  scrollbar-width: none;
}

.reader-preferences-scroll::-webkit-scrollbar { display: none; }
.reader-preferences-scroll > section { display: grid; gap: 12px; scroll-margin-top: 18px; }
.reader-preferences-scroll h3 { margin: 0; font-size: 18px; }
.preference-group { display: grid; gap: 8px; }
.preference-group > span { color: var(--muted); font-size: 12px; font-weight: 850; }
.preference-group .tool-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.preference-group .tool-row-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.preference-group .tool-row button,
.preference-group .tool-row output {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding: 8px;
  border: 1px solid var(--reader-line);
  border-radius: 10px;
  background: var(--reader-page);
  color: var(--reader-text);
  font: 800 13px/1.25 var(--font-sans);
}

.preference-group .tool-row button { cursor: pointer; }
.preference-group .tool-row button:is(.is-active, :hover, :focus-visible) {
  border-color: var(--teal);
  background: var(--reader-hover);
  color: var(--teal-dark);
}
.preference-group .tool-row button:disabled { cursor: not-allowed; opacity: .42; }

.reader-switch {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--reader-line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--reader-page) 78%, transparent);
  color: var(--reader-text);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.reader-switch input { width: 18px; height: 18px; accent-color: var(--teal); }
.reader-preferences-reset { justify-self: start; padding: 4px 0; color: var(--muted); }

.reader-restore-marker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 22px;
  color: var(--teal-dark);
  font: 850 12px/1.4 var(--font-sans);
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .35s ease, transform .35s ease;
}

.reader-restore-marker::before,
.reader-restore-marker::after { content: ""; height: 1px; background: color-mix(in srgb, var(--teal) 45%, transparent); }
.reader-restore-marker::before { width: 26px; }
.reader-restore-marker::after { flex: 1; }
.reader-restore-marker.is-visible { opacity: 1; transform: none; }

.modern-guide-introduction {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.modern-guide > details {
  overflow: hidden;
  border: 1px solid var(--reader-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--reader-page) 86%, transparent);
}

.modern-guide > details > summary {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 54px;
  list-style: none;
  color: var(--teal-dark);
}

.modern-guide > details > summary::-webkit-details-marker { display: none; }
.modern-guide > details > summary::after { content: "＋"; font-size: 20px; }
.modern-guide > details[open] > summary::after { content: "−"; }
.modern-guide > details > summary span { color: var(--teal-dark); font-size: 14px; }
.modern-guide-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.chapter-completion {
  display: grid;
  gap: 18px;
  margin-top: clamp(44px, 8vw, 88px);
  padding-top: 28px;
  border-top: 1px solid var(--reader-line);
  font-family: var(--font-sans);
}

.chapter-completion > header span,
.chapter-next-card span,
.chapter-completion-links span {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 900;
}

.chapter-completion > header h3 { margin: 5px 0 3px; font: 800 26px/1.35 var(--font-serif); }
.chapter-completion > header p { margin: 0; color: var(--muted); font-size: 12px; }
.chapter-next-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--reader-line));
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--reader-hover) 72%, var(--reader-page)), var(--reader-page));
}

.chapter-next-card h4 { margin: 5px 0 6px; font: 800 22px/1.35 var(--font-serif); }
.chapter-next-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.chapter-next-card .btn { min-height: 46px; white-space: nowrap; }
.chapter-completion-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.chapter-completion-links a { display: grid; gap: 3px; min-width: 0; padding: 14px; border: 1px solid var(--reader-line); border-radius: 12px; background: var(--reader-page); }
.chapter-completion-links a:is(:hover, :focus-visible) { border-color: var(--teal); transform: translateY(-1px); }
.chapter-completion-links strong { overflow: hidden; color: var(--reader-text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.chapter-completion-links small { color: var(--muted); font-size: 11px; }
.chapter-reflection { display: grid; gap: 7px; }
.chapter-reflection label { color: var(--reader-text); font-size: 13px; font-weight: 850; }
.chapter-reflection > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.chapter-reflection input { min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--reader-line); border-radius: 9px; background: var(--reader-page); color: var(--reader-text); font: 14px/1.4 var(--font-sans); }
.chapter-reflection small { color: var(--muted); font-size: 10px; }

.chapter-page[data-line-focus="true"] [data-chapter-content] > p {
  opacity: .3;
  transition: opacity .22s ease;
}
.chapter-page[data-line-focus="true"] [data-chapter-content] > p.is-focused-paragraph { opacity: 1; }
.chapter-page[data-annotations-hidden="true"] .annotation-trigger {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  pointer-events: none;
}
.chapter-page[data-annotations-hidden="true"] .annotation-trigger > span { display: none; }
.chapter-page[data-pronunciation="true"] .annotation-trigger[data-pronunciation]:not([data-pronunciation=""]) { position: relative; margin-top: 1em; }
.chapter-page[data-pronunciation="true"] .annotation-trigger[data-pronunciation]:not([data-pronunciation=""])::before {
  content: attr(data-pronunciation);
  position: absolute;
  right: 0;
  bottom: calc(100% - 2px);
  left: 0;
  color: var(--muted);
  font: 700 9px/1 var(--font-sans);
  text-align: center;
  white-space: nowrap;
}

.reader-immersive-progress {
  position: fixed;
  z-index: 140;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: color-mix(in srgb, var(--reader-line) 70%, transparent);
}
.reader-immersive-progress span { display: block; height: 100%; background: var(--teal); transition: width .18s linear; }
.reader-immersive-toolbar {
  position: fixed;
  z-index: 110;
  top: 14px;
  right: 16px;
  left: 16px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity .2s ease, transform .2s ease;
}
.reader-immersive-toolbar > div { display: flex; gap: 7px; }
.reader-immersive-toolbar button {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--reader-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--reader-panel) 94%, transparent);
  color: var(--reader-text);
  font-weight: 850;
  box-shadow: 0 8px 24px rgba(12, 18, 17, .14);
  backdrop-filter: blur(12px);
  cursor: pointer;
}
.reader-immersive-toolbar .reader-focus-exit { position: static; display: inline-flex; }

html[data-reader-immersive="true"] :is(.reader-header, .reader-aside, .reader-tools, .reader-mobile-bar, .reader-mobile-tools) { display: none !important; }
html[data-reader-immersive="true"] :is(.reader-immersive-progress, .reader-immersive-toolbar) { display: flex; }
html[data-reader-immersive="true"][data-reader-chrome-visible="true"] .reader-immersive-toolbar,
html[data-reader-settings-open="true"] .reader-immersive-toolbar { opacity: 1; pointer-events: auto; transform: none; }
html[data-reader-immersive="true"] .reader-layout { width: min(980px, calc(100% - 40px)); padding-block: 0 70px; }
html[data-reader-immersive="true"] .chapter-page { min-height: 100vh; padding: clamp(68px, 8vw, 100px) clamp(28px, 8vw, 86px); border: 0; border-radius: 0; box-shadow: none; }
html[data-reader-immersive="true"] .chapter-page[data-reader-width="narrow"] :is(.chapter-heading, [data-chapter-content], .modern-guide, .chapter-completion) { max-width: 560px; }
html[data-reader-immersive="true"] .chapter-page[data-reader-width="standard"] :is(.chapter-heading, [data-chapter-content], .modern-guide, .chapter-completion) { max-width: 690px; }
html[data-reader-immersive="true"] .chapter-page[data-reader-width="wide"] :is(.chapter-heading, [data-chapter-content], .modern-guide, .chapter-completion) { max-width: 820px; }

html[data-shuban-theme="night"] :is(.reader-preferences-drawer, .chapter-next-card, .chapter-completion-links a, .chapter-reflection input) {
  border-color: var(--reader-line);
  background-color: var(--reader-panel);
  color: var(--reader-text);
}

@media (max-width: 1040px) {
  .reader-shell { padding-bottom: 64px; }
  .reader-header {
    transition: transform .2s ease, background-color .2s ease;
    will-change: transform;
  }
  .reader-header.is-scroll-hidden { transform: translateY(calc(-100% - 2px)); }
  .reader-mobile-bar {
    position: fixed;
    z-index: 75;
    top: auto;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--reader-line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--reader-panel) 96%, transparent);
    box-shadow: 0 16px 42px rgba(12, 18, 17, .22);
    backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 24px));
    transition: opacity .2s ease, transform .2s ease;
  }
  html[data-reader-mobile-chrome="true"]:not([data-reader-immersive="true"]) .reader-mobile-bar { opacity: 1; pointer-events: auto; transform: none; }
  .reader-mobile-bar button { min-height: 48px; border: 0; border-right: 1px solid var(--reader-line); background: transparent; color: var(--reader-text); font-weight: 850; }
  .reader-mobile-bar button:last-child { border-right: 0; }
  .reader-mobile-bar button:disabled { opacity: .4; }
}

@media (max-width: 600px) {
  .whatsapp-contact-panel {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .whatsapp-contact-actions {
    width: 100%;
  }

  .reader-preferences-drawer {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 84vh;
    border-width: 1px 0 0;
    border-radius: 20px 20px 0 0;
    animation-name: reader-drawer-up;
  }
  @keyframes reader-drawer-up {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .reader-preferences-drawer > header { padding: 16px 18px 12px; }
  .reader-preferences-scroll { padding: 16px 18px calc(24px + env(safe-area-inset-bottom)); }
  .reader-preferences-drawer > header h2 { font-size: 21px; }
  .preference-width { display: none; }
  .chapter-page { padding-inline: 21px; }
  .chapter-next-card { grid-template-columns: 1fr; gap: 15px; padding: 18px; }
  .chapter-next-card .btn { width: 100%; }
  .chapter-completion-links { grid-template-columns: 1fr; }
  .chapter-reflection > div { grid-template-columns: 1fr; }
  .chapter-reflection .btn { width: 100%; }
  .modern-guide-actions { display: grid; grid-template-columns: 1fr; }
  .modern-guide-actions .btn { width: 100%; }
  html[data-reader-immersive="true"] .reader-layout { width: 100%; padding: 0; }
  html[data-reader-immersive="true"] .chapter-page { padding: 64px 21px 70px; }
  .reader-immersive-toolbar { top: 8px; right: 8px; left: 8px; }
  .reader-immersive-toolbar > div { gap: 4px; }
  .reader-immersive-toolbar button { min-height: 42px; padding: 6px 9px; font-size: 11px; }
  .reader-immersive-toolbar .reader-focus-exit kbd { display: none; }
  .reader-immersive-toolbar > div { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reader-preferences-drawer,
  .reader-restore-marker,
  .reader-immersive-toolbar,
  .reader-mobile-bar,
  .reader-mobile-tools { animation: none; transition: none; }
}
.english-guide-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.english-guide-facts span { padding: 7px 10px; border-radius: 999px; background: var(--surface-muted); color: var(--muted); font-size: 12px; font-weight: 750; }

/* 2026-08 flagship reading platform upgrade */
.search-match-reason { margin-left: auto; padding-left: 12px; color: var(--muted); font-size: 10px; font-style: normal; white-space: nowrap; }
.global-search-results small { display: flex; align-items: center; gap: 4px; }

.flagship-reading-guide { overflow: hidden; border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 92%, var(--accent) 8%), var(--surface)); }
.book-detail-labels { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.book-flagship-pill { padding: 6px 10px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 999px; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); color: var(--accent); font-size: 11px; font-weight: 850; }
.flagship-guide-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.flagship-guide-heading h2 { margin: 5px 0 8px; }
.flagship-guide-heading p { max-width: 760px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.75; }
.flagship-badge { flex: 0 0 auto; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line)); border-radius: 999px; background: var(--surface); color: var(--accent); font-size: 12px; font-weight: 850; }
.flagship-reading-guide blockquote { margin: 24px 0; padding: 20px 24px; border: 0; border-left: 4px solid var(--accent); border-radius: 0 14px 14px 0; background: color-mix(in srgb, var(--surface-muted) 72%, transparent); }
.flagship-reading-guide blockquote span { display: block; margin-bottom: 7px; color: var(--accent); font-size: 12px; font-weight: 850; }
.flagship-reading-guide blockquote strong { display: block; font-family: var(--font-serif); font-size: clamp(19px, 2vw, 25px); line-height: 1.55; }
.flagship-reading-map { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.flagship-reading-map article { position: relative; min-height: 172px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.flagship-reading-map article > span { display: inline-grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 900; }
.flagship-reading-map h3 { margin: 17px 0 8px; font-size: 18px; }
.flagship-reading-map p { margin: 0; color: var(--muted); line-height: 1.7; }
.flagship-guide-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 28px; margin-top: 28px; }
.flagship-guide-grid h3 { margin: 0 0 14px; font-size: 17px; }
.flagship-chapter-list { display: grid; gap: 9px; }
.flagship-chapter-list a { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 12px; align-items: center; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
.flagship-chapter-list a:hover { border-color: var(--accent); transform: translateY(-1px); }
.flagship-chapter-list span { color: var(--accent); font-size: 12px; font-weight: 850; }
.flagship-chapter-list strong { font-size: 14px; line-height: 1.5; }
.flagship-guide-grid ol { margin: 0; padding-left: 22px; color: var(--muted); line-height: 1.8; }
.flagship-reading-guide > footer { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.flagship-reading-guide > footer span { margin-right: 4px; font-size: 12px; font-weight: 850; }
.flagship-reading-guide > footer a { padding: 7px 10px; border-radius: 999px; background: var(--surface-muted); color: var(--accent); font-weight: 750; }

.chapter-completion-progress { display: grid; grid-template-columns: minmax(120px, 1fr) auto; gap: 12px; align-items: center; margin-top: 13px; }
.chapter-completion-progress i, .insight-book-progress i { display: block; height: 6px; overflow: hidden; border-radius: 999px; background: var(--reader-progress-track, var(--surface-muted)); }
.chapter-completion-progress em, .insight-book-progress em { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.chapter-completion-progress small { color: var(--muted); }
.chapter-completion-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 16px 0 0; }
.reader-companion-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reader-companion-shortcuts .btn { min-width: 0; }
.speech-dialog, .reading-note-dialog { width: min(560px, calc(100vw - 32px)); }
.speech-dialog { max-height: min(680px, calc(100dvh - 28px)); overflow: hidden; }
.speech-dialog-body { display: grid; gap: 16px; overflow-y: auto; padding: 18px 22px 22px; scrollbar-width: none; }
.speech-dialog-body::-webkit-scrollbar { display: none; }
.speech-dialog > p, .reading-note-dialog > p { color: var(--muted); }
.speech-dialog-body > p { margin: 0; color: var(--muted); }
.speech-voice-choice { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.speech-voice-choice > span { color: var(--muted); font-size: 12px; font-weight: 850; }
.speech-voice-choice > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.speech-voice-choice button { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 850; cursor: pointer; }
.speech-voice-choice button:is(.is-active, :hover, :focus-visible) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); color: var(--accent); }
.speech-current-text { min-height: 76px; max-height: 150px; overflow-y: auto; margin: 0; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-muted); line-height: 1.65; overflow-wrap: anywhere; }
.speech-primary-controls { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 9px; }
.speech-stop-button { justify-self: center; color: var(--muted); }
.chapter-page [data-chapter-content] > p.is-speaking-paragraph { margin-inline: -15px; padding-inline: 15px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 11%, transparent); box-shadow: inset 3px 0 var(--accent); }
.note-dialog-footer { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-top: 12px; }
.note-dialog-footer > div { display: flex; gap: 8px; }
.reading-note-dialog textarea { width: 100%; resize: vertical; }

.shelf-hero-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.shelf-hero-summary .shelf-count { margin: 0; }
.insights-hero .page-title { max-width: 920px; }
.insights-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.insights-layout { display: grid; gap: 28px; max-width: 1180px; }
.insight-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.insight-metric-grid article { display: grid; min-height: 148px; align-content: end; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.insight-metric-grid strong { font-family: var(--font-serif); font-size: clamp(28px, 3vw, 42px); line-height: 1.1; }
.insight-metric-grid span { margin-top: 12px; font-weight: 850; }
.insight-metric-grid small { margin-top: 5px; color: var(--muted); }
.insights-chart-panel, .insights-reading-panel { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.reading-week-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; min-height: 210px; align-items: end; }
.reading-week-chart > div { display: grid; grid-template-rows: 150px auto auto; gap: 6px; text-align: center; }
.reading-week-chart > div > span { display: flex; align-items: end; justify-content: center; height: 150px; padding: 5px; border-radius: 10px; background: var(--surface-muted); }
.reading-week-chart i { width: min(34px, 70%); min-height: 8px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 58%, #d7af52)); }
.reading-week-chart strong { font-size: 12px; }
.reading-week-chart small { color: var(--muted); font-size: 11px; }
.insight-bar-height-1 { height: 10%; } .insight-bar-height-2 { height: 20%; } .insight-bar-height-3 { height: 30%; } .insight-bar-height-4 { height: 40%; } .insight-bar-height-5 { height: 50%; } .insight-bar-height-6 { height: 60%; } .insight-bar-height-7 { height: 70%; } .insight-bar-height-8 { height: 80%; } .insight-bar-height-9 { height: 90%; } .insight-bar-height-10 { height: 100%; }
.insight-book-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.insight-book-list article { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 15px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.insight-book-list img { width: 72px; height: 96px; border-radius: 8px; object-fit: cover; }
.insight-book-list h3 { margin: 5px 0 2px; font-size: 17px; }
.insight-book-list p, .insight-book-list span { margin: 0; color: var(--muted); font-size: 12px; }
.insight-book-list a { display: inline-block; margin-top: 10px; color: var(--accent); font-weight: 850; }
.insight-book-progress { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: center; margin-top: 10px; }
.insight-book-progress strong { font-size: 11px; }
.insights-split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.insight-definition-list { display: grid; gap: 11px; margin: 20px 0 14px; }
.insight-definition-list > div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.insight-definition-list dt { color: var(--muted); }
.insight-definition-list dd { margin: 0; font-weight: 900; }
.sync-readiness-panel { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 28px; align-items: center; }
.sync-readiness-panel p { max-width: 720px; color: var(--muted); line-height: 1.75; }
.sync-status { display: grid; gap: 5px; padding: 18px; border-radius: 14px; background: var(--surface-muted); }
.sync-status span, .sync-status small { color: var(--muted); }
.insights-privacy-note { margin: 0; padding: 0 6px; color: var(--muted); font-size: 12px; }
.insights-empty { grid-column: 1 / -1; padding: 30px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; }

@media (max-width: 860px) {
  .flagship-reading-map, .insight-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flagship-guide-grid, .sync-readiness-panel { grid-template-columns: 1fr; }
  .insight-book-list { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .search-match-reason { display: none; }
  .flagship-guide-heading { display: grid; gap: 12px; }
  .flagship-badge { justify-self: start; }
  .flagship-reading-map, .insight-metric-grid, .insights-split-grid { grid-template-columns: 1fr; }
  .flagship-reading-map article { min-height: 0; }
  .flagship-chapter-list a { grid-template-columns: 68px minmax(0, 1fr); }
  .chapter-completion-progress { grid-template-columns: 1fr; }
  .speech-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .speech-dialog .dialog-heading { padding: 16px 17px 13px; }
  .speech-dialog-body { gap: 13px; padding: 15px 17px 18px; }
  .speech-current-text { min-height: 68px; max-height: 124px; font-size: 14px; }
  .speech-primary-controls { grid-template-columns: 1fr 1.25fr 1fr; gap: 6px; }
  .speech-primary-controls .btn { min-width: 0; padding-inline: 8px; }
  .note-dialog-footer { align-items: stretch; flex-direction: column; }
  .note-dialog-footer > div, .note-dialog-footer .btn { flex: 1; }
  .insights-chart-panel, .insights-reading-panel { padding: 17px; }
  .reading-week-chart { gap: 5px; }
  .reading-week-chart > div { grid-template-rows: 125px auto auto; }
  .reading-week-chart > div > span { height: 125px; padding: 3px; }
  .reading-week-chart i { width: 70%; }
}
/* Static chapter landing pages keep full text indexable while handing reading
   preferences, progress, notes and speech back to the interactive reader. */
.chapter-seo-page {
  background: var(--page, #f5f1e8);
}

.chapter-seo-hero {
  border-bottom: 1px solid var(--border, #d9d2c4);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(223, 165, 63, 0.08));
  padding: clamp(2rem, 5vw, 4.5rem) 0;
}

.chapter-seo-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8.5rem;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
}

.chapter-seo-hero h1 {
  max-width: 22ch;
  margin: 0.5rem 0 0.75rem;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1.12;
}

.chapter-seo-hero p {
  margin: 0;
  color: var(--muted, #5e675f);
}

.chapter-seo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.chapter-seo-cover {
  display: block;
  overflow: hidden;
  border-radius: 0.75rem;
  box-shadow: 0 1rem 2.5rem rgba(32, 37, 34, 0.18);
}

.chapter-seo-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.chapter-seo-band {
  padding: clamp(2rem, 5vw, 5rem) 0;
}

.chapter-seo-layout {
  display: grid;
  grid-template-columns: minmax(0, 46rem) minmax(15rem, 22rem);
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}

.chapter-seo-content,
.chapter-seo-layout aside > section {
  border: 1px solid var(--border, #d9d2c4);
  border-radius: 1rem;
  background: var(--surface, #fffdf8);
}

.chapter-seo-content {
  padding: clamp(1.5rem, 5vw, 4rem);
  font-family: var(--font-reading, "Noto Serif SC", "Songti SC", serif);
  font-size: clamp(1.08rem, 1.2vw, 1.25rem);
  line-height: 2;
}

.chapter-seo-content header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border, #d9d2c4);
}

.chapter-seo-content header span,
.chapter-seo-layout aside > section > span {
  color: var(--accent, #0f766e);
  font: 700 0.78rem/1.3 var(--font-sans, sans-serif);
  letter-spacing: 0.08em;
}

.chapter-seo-content h2 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
}

.chapter-seo-content p {
  margin: 0 0 1.35em;
  scroll-margin-top: 6rem;
}

.chapter-seo-layout aside {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 6rem;
}

.chapter-seo-layout aside > section {
  padding: 1.25rem;
}

.chapter-seo-layout aside h2 {
  margin: 0.35rem 0 0.85rem;
  font-size: 1.2rem;
}

.chapter-seo-summary {
  color: var(--text, #202521);
  font-weight: 650;
}

.chapter-seo-guide details {
  margin-top: 1rem;
}

.chapter-seo-guide summary {
  cursor: pointer;
  color: var(--accent, #0f766e);
  font-weight: 750;
}

.chapter-seo-guide details p,
.chapter-seo-guide details ul {
  margin-top: 1rem;
  color: var(--muted, #5e675f);
  line-height: 1.75;
}

.chapter-seo-related > div {
  display: grid;
  gap: 0.5rem;
}

.chapter-seo-related a {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem;
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--accent, #0f766e) 7%, transparent);
}

.chapter-seo-related small,
.chapter-seo-book p {
  color: var(--muted, #5e675f);
  line-height: 1.55;
}

.chapter-seo-book a {
  color: var(--accent, #0f766e);
  font-weight: 750;
}

.chapter-seo-nav {
  width: min(100% - 2rem, 72rem);
  margin: clamp(2rem, 5vw, 4rem) auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.chapter-seo-nav > * {
  min-width: 0;
  min-height: 5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--border, #d9d2c4);
  border-radius: 0.85rem;
  background: var(--surface, #fffdf8);
}

.chapter-seo-nav small {
  color: var(--muted, #5e675f);
}

.chapter-seo-nav strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-seo-reader-link {
  color: #fff;
  border-color: var(--accent, #0f766e) !important;
  background: var(--accent, #0f766e) !important;
  text-align: center;
}

.chapter-seo-reader-link small {
  color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 820px) {
  .chapter-seo-hero-grid {
    grid-template-columns: minmax(0, 1fr) 5.5rem;
    align-items: start;
  }

  .chapter-seo-layout {
    grid-template-columns: 1fr;
  }

  .chapter-seo-layout aside {
    position: static;
  }
}

@media (max-width: 560px) {
  .chapter-seo-hero-grid {
    grid-template-columns: 1fr;
  }

  .chapter-seo-cover {
    display: none;
  }

  .chapter-seo-actions .btn {
    flex: 1 1 10rem;
  }

  .chapter-seo-content {
    border-inline: 0;
    border-radius: 0;
    padding-inline: 1.15rem;
  }

  .chapter-seo-band > .container {
    width: 100%;
  }

  .chapter-seo-nav {
    grid-template-columns: 1fr 1fr;
  }

  .chapter-seo-reader-link {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}
/* Search-indexable category landing pages */
.category-seo-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding-top: 1.5rem;
}

.category-seo-hero-grid h1 {
  margin: .45rem 0 .8rem;
}

.category-seo-hero-grid > div > p {
  max-width: 48rem;
  font-size: clamp(1rem, 1.4vw, 1.16rem);
  color: var(--muted);
}

.category-seo-facts {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1.25rem;
}

.category-seo-facts span {
  padding: .48rem .72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--muted);
  font-size: .84rem;
}

.category-seo-featured {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(28, 44, 40, .09);
}

.category-seo-featured img {
  width: 112px;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: .7rem;
}

.category-seo-featured span,
.category-seo-featured strong,
.category-seo-featured em { display: block; }
.category-seo-featured small { color: var(--accent); }
.category-seo-featured strong { margin: .35rem 0; font-family: var(--font-serif); font-size: 1.25rem; }
.category-seo-featured em { color: var(--muted); font-style: normal; }

.category-seo-feature-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1.25rem 1rem;
}

.category-seo-book { min-width: 0; }
.category-seo-cover { display: block; overflow: hidden; border-radius: .75rem; background: var(--soft); box-shadow: 0 9px 22px rgba(28, 44, 40, .08); }
.category-seo-cover img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; transition: transform .28s ease; }
.category-seo-book:hover .category-seo-cover img { transform: scale(1.025); }
.category-seo-book > div { padding-top: .7rem; }
.category-seo-book > div > span { color: var(--muted); font-size: .75rem; }
.category-seo-book h2 { margin: .3rem 0; font-size: 1rem; line-height: 1.35; }
.category-seo-book h2 a { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.category-seo-book p { margin: 0 0 .55rem; color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-seo-book .text-link { font-size: .82rem; }

.category-seo-routes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.category-seo-routes a {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--surface);
}

.category-seo-routes span { color: var(--muted); font-size: .84rem; }

.category-seo-index {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem 1rem;
  padding: 0;
  list-style: none;
}

.category-seo-index a {
  display: flex;
  justify-content: space-between;
  gap: .7rem;
  padding: .72rem .8rem;
  border-bottom: 1px solid var(--line);
}

.category-seo-index strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-seo-index span { flex: 0 0 auto; color: var(--muted); font-size: .8rem; }
.category-seo-related { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 2rem; }
.category-seo-related a { padding: .5rem .75rem; border-radius: 999px; background: var(--soft); }

@media (max-width: 1180px) {
  .category-seo-feature-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .category-seo-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .category-seo-hero-grid { grid-template-columns: 1fr; gap: 1.3rem; }
  .category-seo-featured { grid-template-columns: 80px minmax(0, 1fr); }
  .category-seo-featured img { width: 80px; }
  .category-seo-feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem .65rem; }
  .category-seo-book h2 { font-size: .9rem; }
  .category-seo-book > div > span, .category-seo-book p, .category-seo-book .text-link { font-size: .72rem; }
  .category-seo-routes { grid-template-columns: 1fr 1fr; }
  .category-seo-index { grid-template-columns: 1fr; }
}

/* Indexable reading-route pages */
.route-page-hero { overflow: hidden; padding-block: clamp(2.2rem, 5vw, 4.8rem); }
.route-page-hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.route-page-hero h1 { max-width: 16ch; margin: .45rem 0 .8rem; font-size: clamp(2.5rem, 5.5vw, 5rem); line-height: .98; }
.route-page-hero-grid > div > p { max-width: 54rem; color: var(--muted); font-size: 1.05rem; line-height: 1.8; }
.route-page-facts { display: flex; flex-wrap: wrap; gap: .65rem; margin: 1.5rem 0; }
.route-page-facts span { min-width: 116px; padding: .72rem .85rem; border: 1px solid var(--line); border-radius: .9rem; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--muted); }
.route-page-facts strong { display: block; color: var(--ink); font-size: 1.05rem; }
.route-page-progress { max-width: 34rem; margin: 1.2rem 0; }
.route-page-progress > div { display: flex; justify-content: space-between; margin-bottom: .45rem; }
.route-page-progress > i { display: block; height: 6px; overflow: hidden; border-radius: 999px; background: var(--soft); }
.route-page-progress em { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.route-page-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }
.route-page-cover-stack { position: relative; min-height: 390px; }
.route-page-cover-stack img { position: absolute; left: 50%; top: 50%; width: min(43%, 170px); aspect-ratio: 3 / 4; object-fit: cover; border: 5px solid var(--surface); border-radius: 1rem; box-shadow: 0 22px 55px rgba(17, 35, 31, .2); transform: translate(-50%, -50%); }
.route-page-cover-stack .route-cover-1 { z-index: 5; transform: translate(-50%, -50%) rotate(-2deg); }
.route-page-cover-stack .route-cover-2 { z-index: 4; transform: translate(-90%, -45%) rotate(-10deg); }
.route-page-cover-stack .route-cover-3 { z-index: 3; transform: translate(-12%, -45%) rotate(9deg); }
.route-page-cover-stack .route-cover-4 { z-index: 2; transform: translate(-112%, -42%) rotate(-16deg); }
.route-page-cover-stack .route-cover-5 { z-index: 1; transform: translate(12%, -42%) rotate(15deg); }
.route-page-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.route-page-steps { display: grid; gap: 1rem; }
.route-page-step { display: grid; grid-template-columns: 58px 112px minmax(0, 1fr); gap: 1rem; align-items: start; padding: 1.2rem; border: 1px solid var(--line); border-radius: 1.2rem; background: var(--surface); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.route-page-step:hover, .route-page-step.is-current { border-color: color-mix(in srgb, var(--teal) 55%, var(--line)); box-shadow: 0 16px 38px rgba(17, 35, 31, .09); transform: translateY(-2px); }
.route-page-step.is-complete { background: color-mix(in srgb, var(--teal) 8%, var(--surface)); }
.route-step-index { display: flex; flex-direction: column; align-items: center; height: 100%; color: var(--teal); font-weight: 800; }
.route-step-index span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--teal) 12%, var(--surface)); }
.route-step-index i { flex: 1; width: 1px; min-height: 70px; margin-top: .65rem; background: var(--line); }
.route-step-cover img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: .7rem; box-shadow: 0 10px 25px rgba(17, 35, 31, .11); }
.route-step-meta { display: flex; flex-wrap: wrap; gap: .55rem; color: var(--muted); font-size: .78rem; }
.route-step-copy h2 { margin: .35rem 0 .15rem; font-size: clamp(1.35rem, 2.6vw, 2rem); }
.route-step-author { margin: 0 0 .6rem; color: var(--teal); }
.route-step-copy > p:not(.route-step-author) { color: var(--muted); line-height: 1.75; }
.route-step-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-top: .9rem; }
.route-page-aside { position: sticky; top: 92px; display: grid; gap: 1rem; }
.route-week-plan { display: grid; gap: 0; padding: 0; list-style: none; }
.route-week-plan li { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: .55rem; padding: .7rem 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.route-week-plan span, .route-week-plan small { color: var(--muted); font-size: .76rem; }
.route-page-related { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.route-page-related a { display: flex; min-height: 150px; flex-direction: column; justify-content: flex-end; padding: 1.1rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
.route-page-related span, .route-page-related small { color: var(--muted); font-size: .78rem; }
.route-page-related strong { margin: .35rem 0; font-family: var(--font-serif); font-size: 1.22rem; }
.author-alternate-names { margin: -.2rem 0 .8rem; color: var(--muted); }
.flagship-milestones, .flagship-discussion { margin-top: 1.25rem; padding: 1rem; border-radius: 1rem; background: var(--soft); }
.flagship-milestones ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin: .7rem 0 0; padding: 0; list-style: none; counter-reset: milestone; }
.flagship-milestones li { padding: .75rem; border-radius: .75rem; background: var(--surface); counter-increment: milestone; }
.flagship-milestones li::before { content: counter(milestone, decimal-leading-zero); display: block; margin-bottom: .3rem; color: var(--teal); font-weight: 800; }
.flagship-discussion p { margin: .55rem 0 0; padding-left: 1rem; border-left: 3px solid var(--teal); }
.insight-discovery-panel { margin-top: 1.2rem; }
.insight-discovery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.insight-discovery-grid article { padding: 1rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--soft); }
.insight-discovery-grid strong, .insight-discovery-grid span, .insight-discovery-grid small { display: block; }
.insight-discovery-grid strong { font-size: 1.6rem; }
.insight-discovery-grid span { margin: .2rem 0; font-weight: 750; }
.insight-discovery-grid small { color: var(--muted); }

@media (max-width: 960px) {
  .route-page-hero-grid, .route-page-layout { grid-template-columns: 1fr; }
  .route-page-cover-stack { min-height: 300px; max-width: 440px; width: 100%; margin-inline: auto; }
  .route-page-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-page-related, .insight-discovery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .route-page-hero { padding-block: 1.5rem 2rem; }
  .route-page-hero h1 { font-size: clamp(2.25rem, 13vw, 3.5rem); }
  .route-page-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-page-facts span { min-width: 0; }
  .route-page-cover-stack { min-height: 240px; }
  .route-page-cover-stack img { width: 36%; border-width: 3px; }
  .route-page-step { grid-template-columns: 38px 72px minmax(0, 1fr); gap: .7rem; padding: .85rem; }
  .route-step-index span { width: 34px; height: 34px; }
  .route-step-copy h2 { font-size: 1.1rem; }
  .route-step-copy > p:not(.route-step-author) { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font-size: .84rem; }
  .route-step-actions .btn { min-height: 40px; padding-inline: .7rem; }
  .route-page-aside { grid-template-columns: 1fr; }
  .route-page-related { grid-template-columns: 1fr 1fr; gap: .65rem; }
  .route-page-related a { min-height: 130px; padding: .85rem; }
  .flagship-milestones ol { grid-template-columns: 1fr; }
  .insight-discovery-grid { grid-template-columns: 1fr 1fr; }
}
