@import url("https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,500;0,600;0,650;0,700;1,400&display=swap");

:root {
  color-scheme: light;
  --ink: #233027;
  --muted: #667068;
  --paper: #f5f0e5;
  --panel: #fbf8f0;
  --line: #d2c9ba;
  --sage: #78836a;
  --sage-dark: #34483b;
  --rose: #a85c46;
  --amber: #a67c43;
  --shadow: 0 18px 46px rgba(42, 46, 38, 0.12);
  font-family: "Crimson Pro", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 3%, rgba(166, 124, 67, 0.1), transparent 27rem),
    linear-gradient(130deg, rgba(251, 248, 240, 0.96), rgba(239, 239, 229, 0.92)),
    var(--paper);
  color: var(--ink);
  padding-bottom: 32px;
}

body.has-player {
  padding-bottom: 112px;
}

body.visual-mode {
  padding-bottom: 32px;
}

body.visual-mode .player-bar {
  display: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
}

.site-header {
  position: relative;
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 0;
  border-bottom: 1px solid rgba(52, 72, 59, 0.18);
  text-align: left;
}

body.book-route .site-header {
  min-height: 88px;
  flex-direction: row;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(52, 72, 59, 0.24);
  text-align: left;
}

body.book-route .brand-logo {
  width: 218px;
}

body.book-route .brand {
  flex-direction: row;
  gap: 0;
}

body.book-route .brand-copy,
body.book-route #backBtn {
  display: none;
}

.header-library-link {
  display: none;
  color: var(--sage-dark);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

body.book-route .header-library-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
}

.brand {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: min(244px, 44vw);
  height: auto;
  object-fit: contain;
}

.brand-copy {
  display: block;
  padding-left: 24px;
  border-left: 1px solid rgba(52, 72, 59, 0.28);
}

.brand-name,
.brand-subtitle,
.panel-label,
.player-info span,
.time-row,
.chapter-meta {
  display: block;
}

.brand-name {
  font-family: "Crimson Pro", Georgia, "Times New Roman", serif;
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.brand-subtitle,
.section-heading p,
.book-card p,
.book-description,
.chapter-meta,
.player-info span,
.time-row,
.resume-panel span {
  color: var(--muted);
}

.brand-subtitle,
.panel-label,
.eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand-subtitle {
  margin-top: 2px;
  font-family: "Crimson Pro", Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
}

#headerContinueBtn {
  position: absolute;
  top: 38px;
  right: 0;
}

.library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.85fr);
  align-items: stretch;
  gap: 26px;
  height: 520px;
  min-height: 520px;
  padding: 0;
}

.eyebrow {
  color: var(--rose);
  font-weight: 800;
  margin: 0 0 24px;
  font-size: 0.73rem;
  letter-spacing: 0.13em;
}

.featured-visual {
  position: relative;
  display: grid;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  place-items: center;
  background: #d8d1c2;
}

.featured-scene {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.featured-visual.cover-only {
  background:
    radial-gradient(circle at 70% 24%, rgba(168, 92, 70, 0.26), transparent 40%),
    linear-gradient(145deg, #28372e, #879070);
}

.featured-visual.cover-only .featured-scene {
  width: min(245px, 44%);
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  box-shadow: 0 28px 68px rgba(22, 28, 23, 0.36);
}

.featured-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(52, 72, 59, 0.38);
  background: rgba(251, 248, 240, 0.72);
  min-height: 0;
  padding: 32px clamp(30px, 3.3vw, 48px);
}

.slide-enter .featured-scene {
  animation: featured-image-reveal 520ms ease both;
}

.slide-enter .hero-copy {
  animation: featured-copy-reveal 420ms ease both;
}

@keyframes featured-image-reveal {
  from { opacity: 0.58; transform: scale(1.012); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes featured-copy-reveal {
  from { opacity: 0.35; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

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

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-family: "Crimson Pro", Georgia, "Times New Roman", serif;
  font-size: clamp(2.05rem, 4.8vw, 4.25rem);
  line-height: 1.03;
  font-weight: 600;
  letter-spacing: 0;
}

.library-hero h1 {
  max-width: 340px;
  font-size: clamp(2.05rem, 3.15vw, 3.15rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.featured-author {
  margin: 15px 0 0;
  color: var(--sage-dark);
  font-family: "Crimson Pro", Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
}

.hero-description {
  max-width: 310px;
  min-height: 2.9em;
  margin: 18px 0 0;
  color: var(--muted);
  font-family: "Crimson Pro", Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.featured-button {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  text-decoration: none;
}

.featured-navigation {
  display: grid;
  grid-template-columns: 34px minmax(56px, auto) auto 34px;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  margin-top: 18px;
}

.featured-arrow {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.featured-arrow:hover,
.featured-arrow:focus-visible {
  border-color: var(--sage-dark);
  background: var(--sage-dark);
  color: var(--paper);
}

.featured-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.featured-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(52, 72, 59, 0.28);
  cursor: pointer;
  transition: width 180ms ease, background 180ms ease;
}

.featured-dot.active {
  width: 22px;
  background: var(--sage-dark);
}

.featured-status {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.featured-panel .resume-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label action"
    "title action"
    "meta action";
  align-items: center;
  column-gap: 14px;
  margin-top: 16px;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.featured-panel .resume-panel .panel-label {
  grid-area: label;
}

.featured-panel #resumeTitle {
  grid-area: title;
  min-width: 0;
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.featured-panel #resumeMeta {
  grid-area: meta;
  min-width: 0;
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.featured-panel #heroContinueBtn {
  grid-area: action;
  min-height: 38px;
  margin: 0;
  padding: 0 14px;
  white-space: nowrap;
}

h2 {
  font-size: 1.45rem;
  margin-bottom: 0;
}

.resume-panel {
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.resume-panel strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 1.15rem;
}

.section-heading {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 34px 0 38px;
}

.section-heading h2 {
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-rule {
  height: 1px;
  flex: 1 1 auto;
  background: rgba(52, 72, 59, 0.34);
}

.library-tools {
  position: absolute;
  top: 24px;
  right: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 320px));
  gap: 22px;
  justify-content: start;
  align-items: stretch;
}

.book-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 13px;
  width: 100%;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.76);
  color: inherit;
  text-align: left;
  padding: 10px 10px 12px;
  box-shadow: 0 10px 30px rgba(68, 56, 42, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.book-card:hover,
.book-card:focus-within {
  transform: translateY(-3px);
  border-color: rgba(111, 131, 116, 0.7);
  box-shadow: var(--shadow);
  outline: none;
}

.book-open {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  color: inherit;
}

.book-open:focus-visible,
.small-button:focus-visible,
.hide-book-button:focus-visible {
  outline: 3px solid rgba(111, 131, 116, 0.35);
  outline-offset: 3px;
}

.book-card img,
.book-cover-large,
#playerCover {
  object-fit: cover;
  background: #ebe3d4;
}

.book-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
}

.book-card[data-book-id="hon-nhan-hoan-hao"] img {
  object-fit: contain;
  background: #17130f;
}

.book-card h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 650;
  line-height: 1.25;
}

.book-card p {
  margin-bottom: 8px;
  line-height: 1.45;
}

.book-byline {
  margin: 8px 0 0;
  color: var(--sage-dark);
  font-size: 0.88rem;
  font-weight: 760;
  line-height: 1.35;
}

.format-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.format-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 0 10px;
  border: 1px solid rgba(52, 72, 59, 0.25);
  border-radius: 999px;
  background: rgba(52, 72, 59, 0.06);
  color: var(--sage-dark);
  font-size: 0.75rem;
  font-weight: 760;
  letter-spacing: 0.015em;
}

.format-badge.visual {
  border-color: rgba(166, 124, 67, 0.34);
  background: rgba(166, 124, 67, 0.08);
  color: #76592f;
}

.detail-byline {
  margin-top: 6px;
  font-size: 0.98rem;
}

.book-more {
  margin-top: 8px;
  color: var(--muted);
}

.book-more summary {
  width: max-content;
  cursor: pointer;
  color: var(--sage-dark);
  font-size: 0.86rem;
  font-weight: 780;
  list-style: none;
}

.book-more summary::-webkit-details-marker {
  display: none;
}

.book-more summary::after {
  content: " +";
}

.book-more[open] summary::after {
  content: " -";
}

.book-more .book-meta-list {
  margin-top: 8px;
}

.book-more .book-meta-list span:first-child {
  max-width: 100%;
}

.card-meta {
  display: block;
  color: var(--sage-dark);
  font-size: 0.88rem;
  font-weight: 700;
}

.book-meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.book-meta-list span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(111, 131, 116, 0.22);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.58);
  color: var(--sage-dark);
  font-size: 0.78rem;
  font-weight: 760;
}

.detail-meta {
  margin: 12px 0 0;
}

.detail-more {
  margin-top: 0;
}

.detail-more .compact-action {
  margin-top: 10px;
}

.detail-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 11px;
}

.detail-controls .detail-more[open] {
  flex-basis: 100%;
  order: 2;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.small-button {
  min-height: 36px;
  padding: 0 16px;
  font-size: 0.88rem;
  margin-top: 0;
}

.small-text-button {
  min-height: 32px;
  padding: 0;
  color: var(--sage-dark);
  font-size: 0.86rem;
}

.hide-book-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  min-height: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(222, 216, 204, 0.74);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.82);
  color: var(--sage-dark);
  opacity: 0;
  transition: opacity 140ms ease, background 140ms ease, border-color 140ms ease;
}

.hide-book-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.book-card:hover .hide-book-button,
.book-card:focus-within .hide-book-button {
  opacity: 1;
}

.hide-book-button:hover {
  border-color: rgba(184, 115, 104, 0.46);
  background: rgba(255, 253, 248, 0.96);
}

.hidden-books {
  display: grid;
  gap: 8px;
  max-width: 420px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(222, 216, 204, 0.7);
}

.hidden-book-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.hidden-book-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-view {
  padding-top: 18px;
}

.text-button,
.ghost-button,
.primary-button,
.round-button {
  border: 0;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 17px;
  font-weight: 650;
}

.text-button {
  background: transparent;
  color: var(--sage-dark);
  padding-left: 0;
}

.ghost-button {
  background: rgba(255, 253, 248, 0.76);
  color: var(--sage-dark);
  border: 1px solid var(--line);
}

.primary-button,
.round-button {
  background: var(--sage-dark);
  color: #fffdf8;
}

.primary-button {
  margin-top: 16px;
}

.book-detail {
  display: grid;
  gap: 18px;
  max-width: 1160px;
  padding-bottom: 34px;
}

.book-heading {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.book-heading.multimodal {
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.book-heading.multimodal .book-cover-small {
  width: 138px;
}

.book-heading-copy {
  min-width: 0;
}

.book-heading.multimodal .book-heading-copy {
  padding-top: 1px;
}

.book-detail h1 {
  max-width: 940px;
  margin-bottom: 5px;
  font-size: clamp(1.85rem, 3vw, 2.7rem);
  line-height: 1.02;
}

.book-detail h2 {
  max-width: 760px;
  margin: 0;
  color: var(--sage-dark);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  line-height: 1.35;
  font-family: "Crimson Pro", Georgia, "Times New Roman", serif;
  font-weight: 760;
}

.book-cover-small {
  width: 86px;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(55, 48, 38, 0.12);
}

.book-description {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.detail-accent {
  display: block;
  width: 34px;
  height: 2px;
  margin: 10px 0 10px;
  background: var(--sage-dark);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
}

.compact-action {
  min-height: 36px;
  padding: 0 15px;
  font-size: 0.86rem;
}

.chapter-list {
  display: grid;
  gap: 10px;
  max-width: 860px;
}

.offline-book-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 860px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(52, 72, 59, 0.22);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.52);
}

.offline-book-tools > div {
  display: grid;
  gap: 2px;
}

.offline-book-tools strong {
  color: var(--sage-dark);
  font-size: 0.9rem;
}

.offline-book-tools span {
  color: var(--muted);
  font-size: 0.78rem;
}

.offline-book-button,
.offline-chapter-button {
  border: 1px solid rgba(52, 72, 59, 0.38);
  color: var(--sage-dark);
  background: rgba(255, 253, 248, 0.86);
  font: inherit;
  font-weight: 800;
}

.offline-book-button {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.76rem;
}

.offline-book-button:hover,
.offline-chapter-button:hover,
.offline-chapter-button.saved {
  border-color: var(--sage-dark);
  background: var(--sage-dark);
  color: #fffdf8;
}

.offline-book-button:disabled,
.offline-chapter-button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.format-panel[data-format-panel="audio"] {
  max-width: 860px;
}

.format-tabs {
  display: flex;
  gap: 2px;
  width: max-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid rgba(52, 72, 59, 0.26);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.54);
}

.book-heading-copy .format-tabs {
  margin-top: 0;
}

.format-tab {
  min-height: 32px;
  margin-bottom: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.format-tab.active {
  background: var(--sage-dark);
  color: #fffdf8;
}

.format-tab:focus-visible,
.visual-chapter-row:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid rgba(111, 131, 116, 0.35);
  outline-offset: 3px;
}

.visual-book-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.8fr);
  gap: 24px;
  align-items: stretch;
}

.visual-player-shell {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #111813;
  box-shadow: 0 18px 48px rgba(30, 34, 28, 0.16);
  aspect-ratio: 16 / 9;
}

.visual-player-shell video,
.visual-player-shell iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.visual-player-shell video {
  object-fit: contain;
  background: #111813;
}

.visual-player-shell.unavailable video {
  opacity: 0.42;
}

.visual-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(16, 22, 18, 0.28), rgba(16, 22, 18, 0.78));
  color: #fffdf8;
  text-align: center;
}

.visual-placeholder strong {
  font-size: 1.12rem;
}

.visual-placeholder span:last-child {
  max-width: 420px;
  color: rgba(255, 253, 248, 0.78);
  font-size: 0.88rem;
  line-height: 1.45;
}

.visual-play-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  padding-left: 3px;
  border: 1px solid rgba(255, 253, 248, 0.8);
  border-radius: 50%;
}

.visual-chapter-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 248, 240, 0.64);
}

.visual-now {
  display: grid;
  gap: 4px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
}

.visual-now span {
  color: var(--rose);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.visual-now strong {
  color: var(--sage-dark);
  font-size: 1.05rem;
}

.visual-chapter-list {
  display: grid;
  max-height: 272px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(52, 72, 59, 0.42) transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.visual-chapter-list::-webkit-scrollbar {
  width: 8px;
}

.visual-chapter-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(52, 72, 59, 0.42);
  background-clip: padding-box;
}

.visual-chapter-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 34px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 68px;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.visual-chapter-row:hover,
.visual-chapter-row.active {
  background: rgba(52, 72, 59, 0.065);
}

.visual-chapter-number {
  color: var(--sage-dark);
  font-weight: 700;
  text-align: center;
}

.visual-chapter-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.visual-chapter-copy strong {
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.visual-chapter-copy small {
  color: var(--muted);
  font-size: 0.76rem;
}

.visual-row-play {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding-left: 2px;
  border: 1px solid rgba(52, 72, 59, 0.46);
  border-radius: 50%;
  color: var(--sage-dark);
  font-size: 0.7rem;
}

.visual-external-link {
  display: inline-flex;
  margin: auto 18px 0;
  padding: 14px 0 16px;
  color: var(--sage-dark);
  text-decoration: none;
}

.chapter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px;
  background: rgba(255, 253, 248, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.chapter-row:hover,
.chapter-row:focus-within {
  border-color: rgba(111, 131, 116, 0.72);
  background: rgba(255, 253, 248, 0.95);
  outline: none;
  transform: translateY(-1px);
}

.chapter-play {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 5px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.chapter-play:focus-visible,
.offline-book-button:focus-visible,
.offline-chapter-button:focus-visible {
  outline: 3px solid rgba(111, 131, 116, 0.35);
  outline-offset: 2px;
}

.chapter-copy {
  min-width: 0;
}

.offline-chapter-button {
  display: grid;
  min-width: 68px;
  min-height: 48px;
  place-items: center;
  align-content: center;
  gap: 1px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 0.67rem;
}

.offline-icon {
  font-size: 1rem;
  line-height: 1;
}

.chapter-number {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ece5d9;
  color: var(--sage-dark);
  font-weight: 800;
}

.chapter-row h3 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.offline-notice {
  position: fixed;
  z-index: 30;
  right: 18px;
  bottom: 112px;
  width: min(390px, calc(100vw - 36px));
  padding: 13px 16px;
  border: 1px solid rgba(52, 72, 59, 0.34);
  border-radius: 10px;
  background: #fdfaf2;
  color: var(--sage-dark);
  box-shadow: 0 14px 42px rgba(39, 35, 29, 0.2);
  font-size: 0.86rem;
  font-weight: 700;
}

.offline-notice[data-state="error"] {
  border-color: rgba(153, 75, 55, 0.5);
  color: #7a3628;
}

.share-landing {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 28px;
  text-align: center;
}

.share-landing img {
  width: min(260px, 70vw);
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 22px 70px rgba(39, 35, 29, 0.18);
}

.share-landing h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(2rem, 8vw, 4rem);
}

.share-landing p {
  margin: 0;
  color: var(--muted);
}

.player-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 32px));
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.5fr);
  gap: 20px;
  align-items: center;
  padding: 12px;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 70px rgba(39, 35, 29, 0.22);
  backdrop-filter: blur(16px);
  z-index: 10;
}

body.mini-player .player-bar {
  width: min(520px, calc(100% - 22px));
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px;
  bottom: 10px;
}

body.mini-player .timeline {
  display: none;
}

body.mini-player #playerCover {
  width: 42px;
  height: 42px;
}

body.mini-player .round-button {
  width: 52px;
  min-height: 52px;
}

.player-info,
.player-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

#playerCover {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  flex: 0 0 auto;
}

.player-info div,
.timeline {
  min-width: 0;
  width: 100%;
}

.player-info strong,
.player-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-button {
  width: 58px;
  padding: 0;
}

#seekBar {
  width: 100%;
  accent-color: var(--sage-dark);
}

.time-row {
  margin-top: 2px;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.empty-state {
  padding: 36px 0;
  color: var(--muted);
}

@media (max-width: 760px) {
  body.has-player {
    padding-bottom: 150px;
  }

  .app-shell,
  .player-bar {
    width: min(100% - 22px, 1120px);
  }

  .site-header {
    min-height: 86px;
    padding: 14px 0;
  }

  body.book-route .site-header {
    min-height: 74px;
    padding: 10px 0;
  }

  body.book-route .brand-logo {
    width: min(168px, 54vw);
  }

  .header-library-link {
    min-height: 38px;
    font-size: 0.8rem;
  }

  .brand-logo {
    width: min(184px, 48vw);
  }

  .brand-name {
    font-size: 0.98rem;
  }

  .brand-subtitle {
    display: block;
    max-width: 126px;
    font-size: 0.74rem;
    line-height: 1.18;
  }

  .brand {
    gap: 12px;
  }

  .brand-copy {
    padding-left: 12px;
  }

  .library-hero,
  .player-bar {
    grid-template-columns: 1fr;
  }

  .library-hero {
    height: auto;
    min-height: 0;
    gap: 0;
    padding: 0;
  }

  .featured-visual {
    width: 100%;
    min-width: 0;
    min-height: 260px;
    height: 260px;
  }

  .featured-visual.cover-only .featured-scene {
    width: min(160px, 36%);
  }

  .featured-panel {
    padding: 29px 24px 32px;
  }

  .featured-navigation {
    margin-top: 22px;
  }

  .eyebrow {
    margin-bottom: 16px;
  }

  .library-hero h1 {
    font-size: clamp(1.9rem, 9vw, 2.8rem);
  }

  .section-heading {
    align-items: center;
    flex-direction: row;
    gap: 14px;
    margin: 28px 0 40px;
  }

  .library-tools {
    top: 22px;
    width: 100%;
    justify-content: space-between;
  }

  .book-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .book-card {
    grid-template-columns: clamp(118px, 36vw, 148px) minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: start;
    gap: 14px;
    border-color: rgba(222, 216, 204, 0.78);
    padding: 10px 12px 12px 10px;
    box-shadow: 0 8px 20px rgba(68, 56, 42, 0.07);
  }

  .book-card > div {
    min-width: 0;
    padding-right: 30px;
  }

  .hide-book-button {
    top: 10px;
    right: 10px;
    width: 25px;
    height: 25px;
    border-color: rgba(222, 216, 204, 0.58);
    background: rgba(255, 253, 248, 0.64);
    opacity: 0.82;
  }

  .hide-book-button svg {
    width: 14px;
    height: 14px;
    stroke-width: 1.65;
  }

  .book-card:hover,
  .book-card:focus-within {
    transform: none;
  }

  .book-card img {
    aspect-ratio: 3 / 4;
    min-height: 0;
    border-radius: 5px;
  }

  .book-card h3 {
    display: -webkit-box;
    margin: 1px 0 7px;
    overflow: hidden;
    font-size: clamp(1rem, 4.15vw, 1.32rem);
    line-height: 1.14;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .book-byline {
    margin-top: 6px;
    font-size: 0.78rem;
  }

  .format-badges {
    gap: 5px;
    margin-top: 9px;
  }

  .format-badge {
    min-height: 23px;
    padding: 0 7px;
    font-size: 0.66rem;
  }

  .book-more {
    margin-top: 7px;
  }

  .book-more summary {
    font-size: 0.78rem;
  }

  .book-meta-list {
    gap: 5px;
    margin-top: 0;
  }

  .book-meta-list span {
    min-height: 21px;
    padding: 0 7px;
    font-size: 0.66rem;
    line-height: 1;
  }

  .book-more .book-meta-list span:first-child {
    width: 100%;
    justify-content: flex-start;
    white-space: normal;
    line-height: 1.25;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .card-actions {
    margin-top: 12px;
  }

  .small-button {
    min-height: 31px;
    padding: 0 14px;
    font-size: 0.78rem;
  }

  .small-text-button {
    min-height: 32px;
    font-size: 0.82rem;
  }

  .chapter-row {
    min-height: 86px;
  }

  .chapter-play {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
  }

  .offline-chapter-button {
    min-width: 58px;
  }

  .offline-book-tools {
    align-items: flex-start;
    gap: 10px;
    padding: 11px;
  }

  .offline-book-tools span {
    max-width: 190px;
  }

  .format-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    width: 100%;
  }

  .format-tab {
    min-height: 44px;
    padding: 0 8px;
    font-size: 0.74rem;
  }

  .visual-book-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .visual-player-shell {
    border-radius: 6px;
  }

  .visual-placeholder {
    gap: 7px;
    padding: 18px;
  }

  .visual-placeholder strong {
    font-size: 0.94rem;
  }

  .visual-placeholder span:last-child {
    font-size: 0.76rem;
  }

  .visual-play-mark {
    width: 42px;
    height: 42px;
  }

  .visual-chapter-row {
    grid-template-columns: 24px minmax(0, 1fr) 30px;
  }

  .book-detail h1 {
    margin-bottom: 6px;
    font-size: clamp(1.35rem, 5.2vw, 1.72rem);
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .book-detail h2 {
    font-size: 1rem;
    line-height: 1.34;
  }

  .book-heading {
    grid-template-columns: clamp(88px, 28vw, 112px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
  }

  .book-heading.multimodal {
    grid-template-columns: clamp(88px, 28vw, 112px) minmax(0, 1fr);
    gap: 14px;
  }

  .book-heading.multimodal .book-cover-small {
    width: 100%;
  }

  .book-heading.multimodal .book-heading-copy {
    padding-top: 0;
  }

  .detail-accent {
    width: 26px;
    margin: 12px 0 10px;
  }

  .book-description {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.82rem;
    line-height: 1.38;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .book-heading-copy .format-tabs {
    display: inline-flex;
    grid-template-columns: none;
    width: auto;
    margin-top: 0;
    margin-left: 0;
  }

  .detail-controls {
    gap: 7px;
    margin-top: 9px;
  }

  .detail-controls .format-tab {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.66rem;
  }

  .book-cover-small {
    width: 100%;
    border-radius: 7px;
  }

  .player-bar {
    bottom: 10px;
    gap: 10px;
    padding: 10px;
  }

  body.mini-player .player-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px;
  }

  .player-controls {
    gap: 10px;
  }

  .round-button {
    width: 54px;
    min-height: 54px;
    flex: 0 0 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide-enter .featured-scene,
  .slide-enter .hero-copy {
    animation: none;
  }
}
:root .shared-library-menu { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px 36px; margin: 0 0 32px; padding: 16px 8px; border-block: 1px solid #c6cbbf; }
:root .shared-library-menu a { color: #344f3e; font-size: 16px; text-decoration: none; line-height: 1.5; }
:root .shared-library-menu a[aria-current] { font-weight: 700; border-bottom: 2px solid currentColor; }
:root .shared-library-menu a:hover { text-decoration: underline; }
