@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap");

:root {
  --ink: #173c2e;
  --ink-soft: #416354;
  --paper: #f7f2e8;
  --cream: #fffaf1;
  --orange: #ef9d4f;
  --orange-dark: #d77c2e;
  --line: rgba(23, 60, 46, 0.14);
  --shadow: 0 18px 50px rgba(46, 42, 31, 0.13);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 5%, rgba(239, 157, 79, 0.18), transparent 24rem),
    var(--paper);
  font-family: "DM Sans", system-ui, sans-serif;
  min-height: 100vh;
  padding-bottom: calc(82px + var(--safe-bottom));
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.topbar {
  height: 72px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand img { border-radius: 13px; box-shadow: 0 5px 15px rgba(23, 60, 46, 0.18); }
.brand span { display: grid; line-height: .95; }
.brand strong { font-family: "Playfair Display", serif; font-size: 18px; }
.brand small { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; margin-top: 5px; }

.icon-button {
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--cream); display: grid; place-items: center; cursor: pointer;
}
.icon-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

main { width: min(100%, 1120px); margin: 0 auto; }

.hero {
  margin: 10px 16px 24px;
  min-height: 250px;
  border-radius: 28px;
  background: var(--ink);
  color: var(--cream);
  padding: 30px 26px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}

.hero::before {
  content: ""; position: absolute; width: 270px; height: 270px; border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%; right: -70px; top: -100px; box-shadow: 0 0 0 48px rgba(255,255,255,.035), 0 0 0 96px rgba(255,255,255,.025);
}
.hero-copy { position: relative; z-index: 1; max-width: 620px; }
.eyebrow { display: block; font-size: 10px; font-weight: 700; letter-spacing: .19em; color: var(--orange); margin-bottom: 8px; }
.hero h1 { font-family: "Playfair Display", serif; font-size: clamp(31px, 8vw, 54px); line-height: 1.02; margin: 0; max-width: 660px; }
.hero p { margin: 15px 0 0; color: rgba(255,255,255,.72); line-height: 1.55; max-width: 470px; font-size: 14px; }
.hero-mark { position: absolute; right: 16px; bottom: -22px; font: 700 92px/1 "Playfair Display", serif; color: rgba(255,255,255,.045); }

.search-section { padding: 0 16px; }
.search-box {
  min-height: 54px; display: flex; align-items: center; gap: 12px; background: var(--cream);
  border: 1px solid var(--line); border-radius: 17px; padding: 0 17px; box-shadow: 0 8px 22px rgba(55, 49, 35, .05);
}
.search-box svg { width: 21px; flex: 0 0 auto; fill: none; stroke: var(--ink-soft); stroke-width: 1.8; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.search-box input::placeholder { color: #819087; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 1px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; border: 1px solid var(--line); background: transparent; padding: 9px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; }
.chip.active { background: var(--ink); border-color: var(--ink); color: white; }

.catalog { padding: 25px 16px 16px; }
.section-title { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.section-title h2, .dialog-heading h2 { font-family: "Playfair Display", serif; font-size: 27px; margin: 0; }
.count-pill { border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; font-size: 11px; color: var(--ink-soft); }

.book-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
.book-card { min-width: 0; position: relative; }
.cover-button { width: 100%; display: block; padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; }
.cover-wrap { aspect-ratio: .68; border-radius: 7px 18px 18px 7px; overflow: hidden; box-shadow: 0 12px 28px rgba(45, 42, 31, .17); background: #ddd; position: relative; transform: translateZ(0); }
.cover-wrap::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 7px; background: linear-gradient(90deg, rgba(0,0,0,.25), transparent); }
.cover-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.cover-button:active .cover-wrap img { transform: scale(.98); }
.book-info { padding: 11px 2px 0; }
.book-category { font-size: 9px; font-weight: 700; letter-spacing: .13em; color: var(--orange-dark); text-transform: uppercase; }
.book-title { font: 600 16px/1.15 "Playfair Display", serif; margin: 4px 30px 4px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-author { margin: 0; color: var(--ink-soft); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.favorite-button { position: absolute; right: 0; bottom: 2px; width: 30px; height: 30px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.favorite-button svg { width: 18px; fill: none; stroke: var(--ink-soft); stroke-width: 1.8; }
.favorite-button.active svg { fill: var(--orange); stroke: var(--orange-dark); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--ink-soft); }
.empty-state > span { font-size: 42px; }
.empty-state h3 { color: var(--ink); margin: 10px 0 4px; }
.empty-state p { margin: 0; font-size: 13px; }

.install-card { margin: 25px 16px 15px; padding: 17px; display: flex; align-items: center; gap: 12px; border-radius: 20px; background: #f0dfc8; }
.install-card img { border-radius: 16px; flex: 0 0 auto; }
.install-card div { min-width: 0; flex: 1; }
.install-card strong { font: 600 15px "Playfair Display", serif; }
.install-card p { font-size: 11px; line-height: 1.35; margin: 4px 0 0; color: var(--ink-soft); }
.install-card button { border: 0; border-radius: 999px; padding: 10px 14px; background: var(--ink); color: white; font-size: 11px; font-weight: 700; cursor: pointer; }

.bottom-nav {
  position: fixed; z-index: 30; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 600px);
  min-height: calc(66px + var(--safe-bottom)); padding: 7px 18px var(--safe-bottom); background: rgba(255,250,241,.94);
  border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; backdrop-filter: blur(18px);
  display: grid; grid-template-columns: repeat(4, 1fr); box-shadow: 0 -8px 30px rgba(42, 36, 25, .08);
}
.bottom-nav a, .bottom-nav button { border: 0; background: transparent; text-decoration: none; color: #75847c; display: grid; place-items: center; gap: 2px; padding: 4px; cursor: pointer; }
.bottom-nav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav span { font-size: 9px; font-weight: 600; }
.bottom-nav .active { color: var(--ink); }

.sheet { width: min(100% - 18px, 570px); max-height: 92vh; margin: auto auto 0; border: 0; border-radius: 26px 26px 0 0; padding: 29px 20px calc(24px + var(--safe-bottom)); color: var(--ink); background: var(--cream); box-shadow: var(--shadow); overflow-y: auto; }
.sheet::backdrop { background: rgba(11, 28, 22, .58); backdrop-filter: blur(3px); }
.sheet-handle { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 38px; height: 4px; border-radius: 99px; background: #d2cabc; }
.close-button { position: absolute; top: 16px; right: 17px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(23,60,46,.08); font-size: 23px; line-height: 1; cursor: pointer; z-index: 2; }
.detail-top { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: end; padding-right: 28px; }
.detail-top img { width: 120px; aspect-ratio: .68; object-fit: cover; border-radius: 6px 15px 15px 6px; box-shadow: 0 12px 25px rgba(0,0,0,.2); }
.detail-top h2 { font: 700 26px/1.04 "Playfair Display", serif; margin: 5px 0 7px; }
.detail-top p { margin: 0; font-size: 12px; color: var(--ink-soft); }
.detail-description { line-height: 1.62; font-size: 13px; color: var(--ink-soft); margin: 22px 0; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 11px; }
.detail-meta span { padding: 6px 9px; background: rgba(23,60,46,.07); border-radius: 99px; font-size: 10px; }
.action-row { display: grid; grid-template-columns: 1fr 48px; gap: 9px; }
.primary-button { min-height: 50px; border: 0; border-radius: 15px; background: var(--ink); color: white; font-weight: 700; cursor: pointer; padding: 0 18px; }
.share-button { border: 1px solid var(--line); border-radius: 15px; background: transparent; font-size: 20px; cursor: pointer; }

.manage-sheet { padding-bottom: calc(32px + var(--safe-bottom)); }
.dialog-heading { padding-right: 40px; }
.dialog-heading p { color: var(--ink-soft); font-size: 12px; line-height: 1.5; margin: 8px 0 20px; }
#book-form { display: grid; gap: 14px; }
#book-form > label { display: grid; gap: 6px; font-size: 11px; font-weight: 700; }
#book-form input, #book-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; background: white; outline: 0; padding: 13px; color: var(--ink); font-weight: 400; resize: vertical; }
#book-form input:focus, #book-form textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(239,157,79,.14); }
.file-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.file-field { min-height: 84px; border: 1px dashed rgba(23,60,46,.3); border-radius: 14px; display: grid; place-content: center; text-align: center; cursor: pointer; font-size: 12px; font-weight: 700; padding: 10px; }
.file-field span { color: var(--ink-soft); font-size: 9px; font-weight: 400; margin-top: 3px; }
.file-field input { position: absolute; width: 1px !important; height: 1px; opacity: 0; pointer-events: none; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(84px + var(--safe-bottom)); transform: translate(-50%, 25px); background: #102a20; color: white; padding: 12px 17px; border-radius: 12px; font-size: 12px; opacity: 0; pointer-events: none; transition: .25s ease; box-shadow: var(--shadow); white-space: nowrap; max-width: calc(100% - 30px); overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 680px) {
  body { padding-bottom: 30px; }
  .topbar { padding-inline: 28px; }
  .hero { margin-inline: 28px; min-height: 320px; padding: 45px; }
  .search-section, .catalog { padding-inline: 28px; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 22px; }
  .install-card { margin-inline: 28px; }
  .bottom-nav { bottom: 18px; border-radius: 22px; min-height: 68px; padding-bottom: 7px; }
  .sheet { margin: auto; border-radius: 26px; }
}

@media (min-width: 960px) {
  .book-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hero-mark { font-size: 150px; }
}

@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); height: calc(72px + env(safe-area-inset-top)); }
  #install-button, .install-card { display: none !important; }
}

/* Estrutura da Biblioteca de Fé — reaproveita a identidade visual inicial. */
#app:focus { outline: none; }
.hero-compact { min-height: 205px; }
.hero-compact h1 { font-size: clamp(31px, 8vw, 48px); }
.structure-section { padding-top: 28px; }
.structure-empty { display: block; border: 1px dashed rgba(23, 60, 46, .24); border-radius: 20px; background: rgba(255, 250, 241, .55); padding: 38px 22px; }
.structure-empty > span { display: block; font-size: 34px; color: var(--orange-dark); }

.structure-links { padding: 4px 16px 14px; display: grid; gap: 10px; }
.structure-links a { display: grid; grid-template-columns: 34px 1fr 22px; align-items: center; gap: 10px; min-height: 76px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--cream); color: var(--ink); text-decoration: none; }
.structure-links a > span { font: 700 11px "DM Sans", sans-serif; color: var(--orange-dark); }
.structure-links a div { display: grid; gap: 3px; }
.structure-links strong { font: 600 16px "Playfair Display", serif; }
.structure-links small { color: var(--ink-soft); font-size: 10px; line-height: 1.35; }
.structure-links b { font-size: 20px; font-weight: 400; }

.featured-book { display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: center; color: var(--ink); text-decoration: none; padding: 15px; border: 1px solid var(--line); border-radius: 20px; background: var(--cream); box-shadow: 0 10px 28px rgba(55, 49, 35, .07); }
.featured-book img { width: 112px; aspect-ratio: .704; object-fit: cover; border-radius: 5px 13px 13px 5px; box-shadow: 0 9px 20px rgba(45, 42, 31, .18); }
.featured-book h3 { font: 700 22px/1.08 "Playfair Display", serif; margin: 4px 0 7px; }
.featured-book p { margin: 0 0 11px; color: var(--ink-soft); font-size: 11px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.featured-book strong { color: var(--orange-dark); font-size: 10px; }

.cover-button { color: inherit; text-decoration: none; }
.standalone-empty { padding-top: 17vh; text-align: center; }
.inline-action { display: inline-grid; place-items: center; text-decoration: none; margin-top: 18px; padding: 0 24px; }

.book-page { padding: 34px 20px 40px; display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 24px; }
.book-cover-placeholder, .book-page-cover { width: 124px; aspect-ratio: .68; border-radius: 7px 17px 17px 7px; box-shadow: var(--shadow); }
.book-cover-placeholder { display: grid; place-items: center; background: linear-gradient(145deg, #ead7bc, #d4b98f); border: 1px solid rgba(23, 60, 46, .15); }
.book-cover-placeholder span { color: var(--ink-soft); font-size: 10px; font-weight: 700; letter-spacing: .18em; }
.book-page-cover { object-fit: cover; justify-self: center; }
.book-page-copy { min-width: 0; }
.book-page-copy h1, .book-page-copy h2 { font: 700 28px/1.05 "Playfair Display", serif; margin: 4px 0 8px; }
.book-page-author { margin: 0; color: var(--ink-soft); font-size: 12px; }
.included-box { margin: 18px 0; padding: 16px; border-radius: 15px; background: rgba(23, 60, 46, .065); font-size: 12px; }
.included-box strong { font-family: "Playfair Display", serif; }
.included-box ul { margin: 9px 0 0; padding-left: 18px; color: var(--ink-soft); line-height: 1.7; }
.book-page .primary-button { width: 100%; display: grid; place-items: center; text-decoration: none; }
.book-page .primary-button:disabled { opacity: .48; cursor: not-allowed; }
.template-note { display: block; margin-top: 10px; color: var(--ink-soft); font-size: 9px; line-height: 1.4; }
.book-actions { display: grid; gap: 9px; }
.save-button { min-height: 46px; border: 1px solid var(--line); border-radius: 14px; background: transparent; font-weight: 700; cursor: pointer; }
.save-button.active { background: rgba(239, 157, 79, .14); border-color: var(--orange); }

.audio-experience { margin: 22px 0 14px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--cream); box-shadow: 0 10px 24px rgba(55, 49, 35, .06); }
.audio-experience h2 { font-size: 24px; margin-bottom: 7px; }
.audio-experience p { margin: 0 0 15px; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.audio-experience audio { display: block; width: 100%; height: 44px; }
.text-download { display: inline-block; margin-top: 12px; color: var(--orange-dark); font-size: 11px; font-weight: 700; }
.audio-placeholder { width: 100%; min-height: 46px; border: 1px dashed rgba(23, 60, 46, .25); border-radius: 13px; background: rgba(23, 60, 46, .045); color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.offer-card { margin: 14px 0 20px; padding: 20px; border-radius: 18px; color: var(--cream); background: var(--ink); transition: transform .3s ease, box-shadow .3s ease; }
.offer-card h2 { color: white; font-size: 23px; margin: 4px 0 9px; }
.offer-card p { margin: 0 0 16px; color: rgba(255, 255, 255, .72); font-size: 12px; line-height: 1.55; }
.offer-button { width: 100%; min-height: 46px; display: grid; place-items: center; padding: 0 15px; border: 0; border-radius: 13px; background: var(--orange); color: #173c2e; text-decoration: none; font-size: 12px; font-weight: 800; cursor: pointer; }
.offer-button:disabled { cursor: not-allowed; opacity: .62; }
.offer-card.highlighted { transform: scale(1.015); box-shadow: 0 0 0 4px rgba(239, 157, 79, .28), var(--shadow); }

@media (min-width: 680px) {
  .structure-links { padding-inline: 28px; grid-template-columns: repeat(3, 1fr); }
  .structure-links a { grid-template-columns: 30px 1fr 20px; }
  .book-page { grid-template-columns: 210px minmax(0, 520px); justify-content: center; gap: 42px; padding-top: 65px; }
  .book-cover-placeholder, .book-page-cover { width: 210px; }
  .book-page-cover { justify-self: start; }
  .book-page-copy h1, .book-page-copy h2 { font-size: 39px; }
  .featured-book { grid-template-columns: 150px 1fr; padding: 20px; }
  .featured-book img { width: 150px; }
  .featured-book h3 { font-size: 29px; }
  .audio-experience, .offer-card { padding: 22px; }
}

/* Fase 1 — interfaz pública es-ES, accesibilidad y componentes escalables. */
html { overflow-x: hidden; }
body { overflow-x: hidden; }
a, button, input, select { outline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(239, 157, 79, .72); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 200; left: 12px; top: 10px; transform: translateY(-160%); padding: 10px 14px; border-radius: 10px; background: white; color: var(--ink); font-weight: 700; }
.skip-link:focus { transform: none; }
.offline-banner { position: relative; z-index: 45; padding: 9px 16px; background: #8d5d25; color: white; text-align: center; font-size: 11px; line-height: 1.4; }
.header-actions { display: flex; gap: 8px; }
.icon-button { color: var(--ink); text-decoration: none; }
.hero-action { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; margin-top: 22px; padding: 0 16px; border: 1px solid rgba(255, 255, 255, .24); border-radius: 999px; color: white; text-decoration: none; font-size: 12px; font-weight: 700; }
.hero-action:hover { background: rgba(255, 255, 255, .08); }

.initial-skeleton { margin: 10px 16px; height: 260px; padding: 28px; border-radius: 28px; background: #e7dfd1; overflow: hidden; }
.initial-skeleton div, .initial-skeleton span { display: block; border-radius: 8px; background: linear-gradient(90deg, rgba(255,255,255,.3), rgba(255,255,255,.78), rgba(255,255,255,.3)); background-size: 240% 100%; animation: skeleton 1.5s ease infinite; }
.initial-skeleton div { width: 62%; height: 38px; margin-top: 100px; }
.initial-skeleton span { width: 82%; height: 12px; margin-top: 14px; }
.initial-skeleton span:last-child { width: 58%; }
@keyframes skeleton { to { background-position: -240% 0; } }

.format-chips, .mini-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.format-chips { margin: 10px 0; }
.format-chips span, .mini-chips span { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border-radius: 999px; background: rgba(23, 60, 46, .075); color: var(--ink); font-size: 9px; font-weight: 700; }
.book-excerpt { margin: 7px 0 9px; color: var(--ink-soft); font-size: 11px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-link { display: inline-block; margin-top: 9px; color: var(--orange-dark); font-size: 10px; }
.remove-shelf { margin-top: 10px; min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }

.topic-section { padding-inline: 16px; }
.topic-list { display: flex; gap: 9px; flex-wrap: wrap; }
.topic-list a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 17px; border: 1px solid var(--line); border-radius: 999px; background: var(--cream); color: var(--ink); text-decoration: none; font-size: 12px; font-weight: 700; }

.filter-panel { margin: 0 16px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 250, 241, .72); }
.filter-panel .search-box { padding-inline: 14px; }
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chips button { min-height: 42px; padding: 0 15px; border: 1px solid var(--line); border-radius: 999px; background: transparent; white-space: nowrap; cursor: pointer; font-size: 11px; font-weight: 700; }
.filter-chips button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: white; }
.select-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 13px; }
.select-row label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.select-row select, .audio-tools select { width: 100%; min-height: 44px; padding: 0 11px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); font-size: 11px; }
.clear-filters { display: block; min-height: 44px; margin: -28px auto 28px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--cream); color: var(--ink); font-weight: 700; cursor: pointer; }

.book-page { padding-bottom: 28px; }
.book-visual { position: relative; width: 168px; justify-self: center; }
.book-page-cover { width: 168px; }
.free-badge { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); padding: 6px 11px; border-radius: 999px; background: var(--orange); color: var(--ink); box-shadow: 0 6px 14px rgba(23, 60, 46, .15); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.book-subtitle { margin: 0 0 13px; color: var(--ink-soft); font: 600 15px/1.35 "Playfair Display", serif; }
.detail-description { margin: 17px 0; }
.audio-unavailable { margin: 18px 0; padding: 15px 16px; border: 1px dashed rgba(23, 60, 46, .26); border-radius: 15px; background: rgba(255, 250, 241, .52); }
.audio-unavailable p { margin: 9px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.status-pill { display: inline-flex; align-items: center; min-height: 29px; padding: 5px 11px; border-radius: 999px; background: rgba(239, 157, 79, .18); color: #9f591f; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.status-pill.light { background: rgba(255, 255, 255, .12); color: white; }
.download-actions { display: grid; gap: 9px; margin: 18px 0; }
.primary-button, .secondary-button { min-height: 50px; display: grid; place-items: center; padding: 0 18px; border-radius: 15px; text-decoration: none; font-weight: 700; text-align: center; }
.secondary-button { border: 1px solid var(--line); background: transparent; color: var(--ink); }
.included-box h2 { margin: 0; font: 600 17px "Playfair Display", serif; }
.share-button-text, .youtube-link { min-height: 46px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: transparent; color: var(--ink); text-align: center; text-decoration: none; font-size: 12px; font-weight: 700; cursor: pointer; }
.local-notice { margin: 0 16px; padding: 13px 15px; border-left: 3px solid var(--orange); border-radius: 0 12px 12px 0; background: rgba(239, 157, 79, .09); color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.recent-section, .related-section { padding-top: 8px; }

.audio-tools { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: end; margin-top: 12px; }
.audio-tools button { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: 11px; font-weight: 700; cursor: pointer; }
.audio-tools label { display: grid; gap: 4px; color: var(--ink-soft); font-size: 9px; font-weight: 700; }
.audio-error { color: #8d312b !important; }

.product-grid { display: grid; gap: 15px; }
.product-card { padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--cream); }
.product-card img { width: 110px; aspect-ratio: .68; object-fit: cover; border-radius: 6px 14px 14px 6px; }
.product-card h2 { margin: 5px 0 8px; font: 700 23px/1.08 "Playfair Display", serif; }
.product-card p { color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.product-page { display: grid; gap: 25px; max-width: 760px; margin-inline: auto; }
.product-page h1 { font: 700 38px/1.05 "Playfair Display", serif; }
.product-page p { color: var(--ink-soft); line-height: 1.65; }
.product-page small { display: block; margin-top: 10px; color: var(--ink-soft); }
.product-cover { width: 190px; justify-self: center; border-radius: 7px 17px 17px 7px; box-shadow: var(--shadow); }

.development-section { margin-top: 4px; border-top: 1px solid var(--line); }
.audiobook-card { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 18px; align-items: start; }
.audiobook-card img { width: 104px; }
.audiobook-card .primary-button { width: fit-content; min-height: 44px; margin-top: 14px; font-size: 11px; }
.audiobook-page { display: grid; gap: 25px; padding: 34px 20px 24px; }
.audiobook-visual { position: relative; width: min(68vw, 250px); justify-self: center; }
.audiobook-cover { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px 20px 20px 8px; box-shadow: var(--shadow); }
.cover-status { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); width: max-content; padding: 7px 12px; border-radius: 999px; background: var(--cream); border: 1px solid var(--line); box-shadow: 0 7px 18px rgba(23, 60, 46, .12); font-size: 8px; font-weight: 800; letter-spacing: .11em; }
.audiobook-copy { min-width: 0; }
.audiobook-copy h1 { margin: 7px 0 10px; font: 700 clamp(34px, 10vw, 54px)/1.02 "Playfair Display", serif; }
.audiobook-badges { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 20px; }
.premium-badge, .production-badge, .local-only-pill { display: inline-flex; align-items: center; min-height: 29px; padding: 5px 11px; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.premium-badge { background: var(--ink); color: white; }
.production-badge { background: rgba(239, 157, 79, .2); color: #9f591f; }
.theme-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; }
.theme-chips span { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 250, 241, .65); font-size: 10px; font-weight: 700; }
.purchase-status { display: grid; gap: 13px; margin-top: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--cream); }
.purchase-status strong { font: 700 19px "Playfair Display", serif; }
.purchase-status p { margin: 5px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.chapter-section { padding: 18px 16px 30px; }
.chapter-list { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.chapter-item { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 250, 241, .68); }
.chapter-summary { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 13px; align-items: center; padding: 16px; }
.chapter-number { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: rgba(23, 60, 46, .075); color: var(--ink); font: 700 16px "Playfair Display", serif; }
.chapter-summary h3 { margin: 0 0 5px; font: 600 17px/1.22 "Playfair Display", serif; }
.chapter-status { font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.chapter-status.ready { color: #397153; }
.chapter-status.pending { color: var(--ink-soft); }
.premium-audio { padding: 18px; border-top: 1px solid var(--line); background: var(--cream); }
.variant-heading { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.variant-heading h3 { margin: 0; font: 700 22px "Playfair Display", serif; }
.local-only-pill { flex: 0 0 auto; background: rgba(23, 60, 46, .08); color: var(--ink-soft); }
.variant-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.variant-button { min-height: 59px; display: grid; justify-items: start; align-content: center; gap: 2px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 13px; background: white; cursor: pointer; }
.variant-button strong { font-size: 11px; }
.variant-button span { color: var(--ink-soft); font-size: 9px; }
.variant-button.active { border-color: var(--orange-dark); box-shadow: inset 0 0 0 1px var(--orange-dark); background: rgba(239, 157, 79, .08); }
.premium-audio audio { display: block; width: 100%; height: 46px; }
.protected-note { margin: 12px 0 0; color: var(--ink-soft); font-size: 9px; line-height: 1.5; }
.preview-restricted { margin: 0 16px 16px 75px; padding: 14px; border: 1px dashed rgba(23, 60, 46, .24); border-radius: 14px; }
.preview-restricted strong { font-size: 11px; }
.preview-restricted p { margin: 5px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }

.benefit-grid, .install-guide, .prose-page { padding-inline: 20px; }
.benefit-grid { display: grid; gap: 12px; }
.benefit-grid article, .install-guide article, .prose-page article { padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255, 250, 241, .72); }
.benefit-grid article > span { color: var(--orange-dark); font-size: 24px; }
.benefit-grid h2, .install-guide h2, .prose-page h2 { margin: 7px 0; font: 600 21px "Playfair Display", serif; }
.benefit-grid p, .install-guide p, .prose-page p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.install-guide { display: grid; gap: 12px; max-width: 760px; margin-inline: auto; }
.install-guide > .primary-button { width: 100%; border: 0; cursor: pointer; }
.install-note, .installed-message { padding: 16px; border-radius: 15px; background: rgba(23, 60, 46, .07); }
.installed-message strong { font-family: "Playfair Display", serif; }
.prose-page { display: grid; gap: 12px; max-width: 800px; margin-inline: auto; }

.install-card { display: grid; grid-template-columns: 58px 1fr; }
.install-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.install-actions button { min-height: 42px; }
.install-actions .js-install-button { flex: 1; }
.install-later { border: 1px solid var(--line) !important; background: transparent !important; color: var(--ink) !important; }

.secondary-link { min-height: 44px; display: inline-flex; align-items: center; margin-top: 16px; padding: 0 17px; border-radius: 999px; background: var(--ink); color: white; text-decoration: none; font-size: 11px; font-weight: 700; }
.site-footer { margin: 45px 16px 25px; padding: 24px 20px; border-radius: 22px; background: #e8dfd0; }
.site-footer strong { font: 700 20px "Playfair Display", serif; }
.site-footer p { margin: 6px 0 18px; color: var(--ink-soft); font-size: 11px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 9px 16px; padding: 15px 0; border-block: 1px solid var(--line); }
.site-footer nav a { color: var(--ink); font-size: 11px; font-weight: 700; }
.footer-privacy-button { padding: 0; border: 0; background: transparent; color: var(--ink); text-decoration: underline; font-size: 11px; font-weight: 700; cursor: pointer; }
.site-footer small { display: block; margin-top: 15px; color: var(--ink-soft); font-size: 9px; line-height: 1.5; }

.consent-banner { position: fixed; z-index: 120; left: 12px; right: 12px; bottom: calc(86px + var(--safe-bottom)); max-width: 720px; margin-inline: auto; display: grid; gap: 15px; padding: 18px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 20px; background: #173c2e; color: white; box-shadow: 0 22px 60px rgba(20, 35, 28, .34); }
.consent-banner strong { font: 700 20px "Playfair Display", serif; }
.consent-banner p { margin: 7px 0; color: rgba(255, 255, 255, .76); font-size: 11px; line-height: 1.55; }
.consent-banner a { color: #f6bc83; font-size: 10px; font-weight: 700; }
.consent-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; }
.consent-actions button { min-height: 46px; padding: 0 12px; border-radius: 13px; font-size: 11px; font-weight: 800; cursor: pointer; }
.consent-reject { border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: white; }
.consent-accept { border: 1px solid var(--orange); background: var(--orange); color: var(--ink); }

@media (max-width: 360px) {
  .select-row { grid-template-columns: 1fr; }
  .book-page { padding-inline: 16px; }
  .audio-tools { grid-template-columns: 1fr 1fr; }
  .audio-tools label { grid-column: 1 / -1; }
  .bottom-nav { padding-inline: 8px; }
  .bottom-nav span { font-size: 8px; }
}

@media (min-width: 680px) {
  .topic-section { padding-inline: 28px; }
  .filter-panel { margin-inline: 28px; }
  .book-visual { width: 210px; justify-self: start; }
  .book-page-cover { width: 210px; }
  .download-actions { grid-template-columns: 1.25fr .75fr; }
  .local-notice { margin-inline: 28px; }
  .benefit-grid { grid-template-columns: repeat(3, 1fr); padding-inline: 28px; }
  .prose-page { padding-inline: 28px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-page { grid-template-columns: 210px 1fr; }
  .product-cover { width: 210px; justify-self: start; }
  .audiobook-page { grid-template-columns: 250px minmax(0, 590px); justify-content: center; gap: 48px; padding-top: 65px; }
  .audiobook-visual { width: 250px; justify-self: start; }
  .audiobook-copy h1 { font-size: 54px; }
  .purchase-status { grid-template-columns: 1fr auto; align-items: center; }
  .chapter-section { max-width: 890px; margin-inline: auto; padding-inline: 28px; }
  .chapter-summary { padding: 19px 22px; }
  .premium-audio { padding: 22px; }
  .site-footer { margin: 65px 28px 110px; }
  .consent-banner { bottom: 26px; grid-template-columns: 1fr auto; align-items: center; padding: 20px 22px; }
  .consent-actions { min-width: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
