:root {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-muted: #f6f6f3;
    --ink: #121316;
    --ink-soft: #474b53;
    --muted: #747983;
    --line: #e5e2dc;
    --accent: #f05a35;
    --accent-dark: #c63d20;
    --green: #167f5f;
    --blue: #2457c5;
    --shadow: 0 18px 45px rgba(16, 17, 20, 0.09);
    --header-height: 70px;
    --player-height: 124px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100%;
    padding-bottom: 24px;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body.menu-open {
    overflow: hidden;
}

body.player-visible {
    padding-bottom: calc(var(--player-height) + 24px);
}

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

a:hover {
    color: var(--blue);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

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

[hidden] {
    display: none !important;
}

.visually-hidden {
    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;
    top: 12px;
    left: 12px;
    z-index: 1000;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    transform: translateY(-140%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px clamp(18px, 5vw, 58px);
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(18, 19, 22, 0.08);
    backdrop-filter: blur(18px);
}

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

.brand img {
    width: 42px;
    height: 42px;
    border-radius: 8px;
}

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

.brand strong {
    font-size: 21px;
    line-height: 1.05;
    letter-spacing: 0;
}

.brand-copy span {
    color: var(--muted);
    font-size: 15px;
    white-space: nowrap;
}

.brand-stat {
    margin-left: 2px;
    padding-left: 14px;
    border-left: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

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

.site-nav a,
.nav-category-button,
.nav-library-button {
    padding: 9px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 760;
    font-size: 16px;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.nav-category-button:hover,
.nav-category-button:focus-visible,
.nav-category-button[aria-expanded="true"],
.nav-library-button:hover,
.nav-library-button:focus-visible {
    background: var(--surface-muted);
    color: var(--ink);
}

.nav-category-menu {
    position: relative;
}

.nav-category-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(2, minmax(190px, 1fr));
    gap: 18px;
    width: min(560px, calc(100vw - 36px));
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

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

.nav-category-group h3 {
    margin: 0 0 10px;
    color: var(--green);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-category-list {
    display: grid;
    gap: 6px;
}

.nav-category-list a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 36px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    text-align: left;
    padding: 7px 9px;
    text-decoration: none;
}

.nav-category-list a:hover,
.nav-category-list a:focus-visible {
    border-color: var(--line);
    background: var(--surface-muted);
    color: var(--ink);
}

.menu-button {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    place-items: center;
    padding: 10px;
}

.menu-button span:not(.visually-hidden) {
    display: block;
    width: 20px;
    height: 2px;
    margin: 3px auto;
    background: var(--ink);
}

main {
    width: min(1220px, calc(100% - 36px));
    margin: 0 auto;
}

.catalog-hero {
    display: grid;
    grid-template-columns: minmax(0, 880px);
    justify-content: center;
    align-items: start;
    gap: 22px;
    padding: clamp(30px, 4.5vw, 54px) 0 clamp(14px, 2vw, 22px);
    text-align: center;
}

.hero-copy {
    display: grid;
    justify-items: center;
    min-width: 0;
}

body.search-active .catalog-hero {
    grid-template-columns: minmax(0, 760px);
    padding-top: clamp(22px, 3.2vw, 34px);
    padding-bottom: 4px;
}

body.search-active .hero-covers,
body.search-active .quick-searches,
body.search-active .stats-strip,
body.search-active .new-books-section,
body.search-active .shelves-section,
body.search-active .category-section,
body.search-active .directory-section {
    display: none;
}

body.search-active .results-section {
    padding-top: 12px;
}

body.search-active .results-heading {
    display: none;
}

body.search-active.category-active .results-heading {
    display: flex;
    padding-bottom: 12px;
}

body.search-active.category-active .book-grid {
    margin-top: 14px;
}

body.search-active .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(146px, 168px));
    gap: 28px 18px;
    align-items: start;
    margin-top: 0;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--green);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.eyebrow a:hover,
.eyebrow a:focus-visible {
    text-decoration: underline;
}

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

h1 {
    max-width: 780px;
    margin-bottom: 14px;
    font-size: clamp(42px, 4.7vw, 60px);
    line-height: 1.02;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 0;
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: 0;
}

h3 {
    font-size: 18px;
    line-height: 1.25;
}

.hero-lede {
    max-width: 700px;
    margin-bottom: 14px;
    color: var(--ink-soft);
    font-size: 18px;
}

.search-form {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    width: 100%;
    max-width: 860px;
    min-height: 64px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 14px 38px rgba(16, 17, 20, 0.08);
}

.search-form:focus-within {
    border-color: rgba(36, 87, 197, 0.42);
    box-shadow: 0 0 0 3px rgba(36, 87, 197, 0.12), 0 14px 38px rgba(16, 17, 20, 0.08);
}

.search-icon {
    width: 18px;
    height: 18px;
    margin-left: 18px;
    border: 2px solid var(--muted);
    border-radius: 50%;
    position: relative;
}

.search-icon::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 2px;
    right: -7px;
    bottom: -4px;
    background: var(--muted);
    transform: rotate(45deg);
    border-radius: 2px;
}

.search-form input {
    width: 100%;
    min-width: 0;
    height: 50px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 17px;
    padding-left: 8px;
    outline: 0;
}

.search-form input::placeholder {
    color: #8b9099;
}

.search-form button,
.load-more,
.player-toggle,
.playlist-create button {
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    transition: background 140ms ease, transform 140ms ease;
}

.search-form button {
    height: 50px;
    padding: 0 22px;
}

.search-form button:hover,
.load-more:hover,
.player-toggle:hover,
.playlist-create button:hover {
    background: var(--accent-dark);
}

.search-form button:active,
.load-more:active,
.player-toggle:active,
.playlist-create button:active {
    transform: translateY(1px);
}

.quick-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
}

.quick-searches button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-soft);
    padding: 8px 11px;
    font-size: 14px;
    font-weight: 700;
}

.quick-searches button:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.hero-covers {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
    justify-items: center;
    padding: 10px;
}

.hero-covers img {
    width: min(100%, 190px);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero-covers img:first-child {
    grid-column: 1 / -1;
    width: min(72%, 250px);
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.stats-strip div {
    min-width: 0;
    padding: 22px;
    background: var(--surface);
}

.stats-strip strong {
    display: block;
    font-size: 26px;
    line-height: 1;
}

.stats-strip span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-weight: 650;
}

.category-section,
.results-section,
.new-books-section,
.shelves-section,
.directory-section {
    padding: 42px 0 0;
}

.section-heading {
    max-width: 760px;
}

.section-heading p:not(.eyebrow) {
    margin: 12px 0 0;
    color: var(--ink-soft);
}

.category-list,
.directory-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.category-list a,
.directory-links a {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-soft);
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

.category-list a[aria-current="true"] {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.category-count {
    color: var(--muted);
    font-weight: 700;
}

.category-list a[aria-current="true"] .category-count {
    color: rgba(255, 255, 255, 0.76);
}

.results-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 16px;
}

.results-count,
.shelf-count {
    margin: 0;
    color: var(--muted);
    font-weight: 750;
    text-align: right;
}

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

body:not(.search-active) .book-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(146px, 168px);
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0 12px;
    scroll-snap-type: x proximity;
}

.book-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    min-height: 148px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

body:not(.search-active) .book-card {
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    scroll-snap-align: start;
}

body.search-active .book-card {
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

body:not(.search-active) .book-card:hover {
    transform: none;
    border-color: transparent;
    box-shadow: none;
}

.book-card:hover {
    transform: translateY(-2px);
    border-color: rgba(18, 19, 22, 0.28);
    box-shadow: 0 12px 30px rgba(16, 17, 20, 0.08);
}

body.search-active .book-card:hover {
    transform: none;
    border-color: transparent;
    box-shadow: none;
}

.cover-wrap {
    position: relative;
    align-self: start;
    width: 92px;
    height: 92px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-muted);
}

body:not(.search-active) .cover-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    margin-bottom: 10px;
}

body.search-active .cover-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    margin-bottom: 10px;
}

.cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-wrap .cover-play-button {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 16px rgba(18, 19, 22, 0.22);
}

.cover-wrap .cover-play-button::before {
    content: "";
    width: 0;
    height: 0;
    margin-left: 3px;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 10px solid currentColor;
}

.book-body {
    min-width: 0;
}

.book-card h3 {
    margin: 0 0 7px;
}

.book-card h3 a {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink);
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

body:not(.search-active) .book-card h3 {
    margin-bottom: 5px;
    font-size: 15px;
    line-height: 1.25;
}

body.search-active .book-card h3 {
    margin-bottom: 5px;
    font-size: 15px;
    line-height: 1.25;
}

body:not(.search-active) .book-card h3 a {
    -webkit-line-clamp: 2;
}

body.search-active .book-card h3 a {
    -webkit-line-clamp: 2;
}

.book-card h3 a:hover {
    color: var(--blue);
}

.book-meta {
    display: grid;
    gap: 4px;
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
}

body:not(.search-active) .book-meta {
    margin-bottom: 0;
    font-size: 13px;
}

body.search-active .book-meta {
    margin-bottom: 0;
    font-size: 13px;
}

body:not(.search-active) .book-meta span:last-child,
body:not(.search-active) .book-actions,
body.search-active .book-meta span:last-child,
body.search-active .book-actions {
    display: none;
}

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

.book-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.listen-button,
.affiliate-link {
    min-height: 36px;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 800;
}

.listen-button {
    border: 0;
    background: var(--ink);
    color: #fff;
}

.affiliate-link {
    border: 1px solid var(--line);
    color: var(--blue);
    background: #fff;
}

.library-action {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 800;
    padding: 8px 10px;
}

.library-action:hover,
.library-action[aria-pressed="true"] {
    border-color: var(--ink);
    color: var(--ink);
}

.home-shelves {
    display: grid;
    gap: 34px;
    margin-top: 18px;
}

.home-shelf {
    display: grid;
    gap: 12px;
}

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

.shelf-heading > div {
    min-width: 0;
}

.shelf-heading h2,
.shelf-heading h3 {
    margin: 0;
}

.shelf-heading h3 {
    font-size: 22px;
}

.shelf-heading button {
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-soft);
    font-weight: 820;
    padding: 7px 9px;
}

.shelf-heading button:hover,
.shelf-heading button:focus-visible {
    background: var(--surface-muted);
    color: var(--ink);
}

.shelf-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(146px, 168px);
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0 12px;
    scroll-snap-type: x proximity;
}

.shelf-row.is-expanded {
    grid-auto-flow: row;
    grid-auto-columns: initial;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 4px;
    scroll-snap-type: none;
}

.new-books-section .shelf-row {
    grid-auto-columns: 146px;
}

.new-books-section .shelf-row.is-expanded {
    grid-auto-columns: initial;
}

.book-grid::-webkit-scrollbar,
.shelf-row::-webkit-scrollbar {
    height: 8px;
}

.book-grid::-webkit-scrollbar-thumb,
.shelf-row::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: #d5d2ca;
}

.shelf-card {
    min-width: 0;
    scroll-snap-align: start;
}

.shelf-row.is-expanded .shelf-card {
    scroll-snap-align: none;
}

.shelf-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--surface-muted);
}

.shelf-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shelf-cover .cover-play-button {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 16px rgba(18, 19, 22, 0.2);
}

.shelf-cover .cover-play-button::before {
    content: "";
    width: 0;
    height: 0;
    margin-left: 3px;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 10px solid currentColor;
}

.book-detail-cover-wrap {
    position: relative;
    align-self: start;
    width: 100%;
    max-width: 260px;
}

.book-detail-cover-wrap .book-detail-cover {
    width: 100%;
}

.shelf-card h3 {
    margin: 0 0 5px;
    font-size: 15px;
    line-height: 1.25;
}

.shelf-card h3 a {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.shelf-card h3 a:hover {
    color: var(--blue);
}

.shelf-card p {
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.shelf-footer {
    display: flex;
    justify-content: flex-end;
}

.results-footer {
    margin-top: 16px;
}

.shelf-show-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    font-weight: 820;
    padding: 9px 13px;
    text-decoration: none;
}

.shelf-show-more:hover,
.shelf-show-more:focus-visible {
    border-color: var(--ink);
}

.shelf-show-more[hidden] {
    display: none;
}

.library-action[aria-pressed="true"] {
    background: var(--surface-muted);
}

.library-drawer {
    position: fixed;
    inset: 0;
    z-index: 90;
}

.library-drawer[hidden],
.playlist-modal[hidden] {
    display: none;
}

.library-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 17, 20, 0.28);
}

.library-panel {
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    align-content: start;
    gap: 18px;
    width: min(460px, 100%);
    height: 100%;
    overflow: auto;
    padding: 24px;
    background: var(--surface);
    box-shadow: -24px 0 60px rgba(16, 17, 20, 0.18);
}

.library-header,
.library-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.library-header h2,
.library-section-heading h3 {
    margin: 0;
}

.icon-button,
.secondary-action {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 800;
    padding: 9px 11px;
}

.account-section,
.library-section {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.account-summary {
    display: grid;
    gap: 4px;
}

.account-summary span,
.auth-message,
.library-empty,
.playlist-modal-book {
    color: var(--muted);
    font-size: 14px;
}

.account-profile {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.account-profile img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
}

.account-profile > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.account-profile strong,
.account-profile span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.google-signin-button {
    min-height: 40px;
}

.native-google-signin-button {
    width: min(100%, 300px);
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    color: var(--ink);
    font: 800 16px/1 var(--font-main);
    letter-spacing: 0;
    box-shadow: 0 1px 2px rgba(16, 17, 20, 0.08);
    cursor: pointer;
}

.native-google-signin-button:hover {
    border-color: var(--ink);
}

.library-list,
.playlist-list,
.playlist-choice-list {
    display: grid;
    gap: 10px;
}

.library-item,
.playlist-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.library-item-main {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.library-item img {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface-muted);
}

.library-item h4,
.playlist-card h4 {
    margin: 0;
    font-size: 15px;
    line-height: 1.25;
}

.library-item p,
.playlist-card p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.library-item-actions,
.playlist-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.library-item-actions button,
.library-item-actions a,
.playlist-card-actions button,
.playlist-choice-list button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 800;
    padding: 7px 9px;
    text-align: center;
}

.admin-library-section {
    padding: 0;
}

.admin-dashboard-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 64px;
    padding: 14px;
    color: var(--ink);
    font-weight: 850;
}

.admin-dashboard-link span {
    color: var(--ink);
    font-size: 18px;
    line-height: 1;
}

.admin-dashboard-link strong {
    color: var(--blue);
    font-size: 15px;
}

.playlist-create {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.playlist-create input {
    min-width: 0;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    padding: 0 10px;
}

.playlist-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(16, 17, 20, 0.34);
}

.playlist-modal-panel {
    display: grid;
    gap: 14px;
    width: min(430px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    padding: 18px;
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.empty-state {
    grid-column: 1 / -1;
    padding: 32px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--ink-soft);
}

.load-more {
    display: block;
    margin: 28px auto 0;
    padding: 13px 18px;
}

.directory-section {
    padding-bottom: 48px;
}

.directory-links a:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.audio-player {
    position: fixed;
    right: 18px;
    bottom: 18px;
    left: 18px;
    z-index: 60;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    min-height: var(--player-height);
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background:
        radial-gradient(circle at 12% 0%, rgba(240, 90, 53, 0.18), transparent 32%),
        linear-gradient(135deg, rgba(27, 29, 35, 0.98), rgba(12, 13, 16, 0.96));
    color: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
}

.audio-player img {
    width: 88px;
    height: 88px;
    border-radius: 14px;
    object-fit: cover;
    background: #292b31;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36);
}

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

.player-title-link {
    display: block;
    margin: 0 0 4px;
    overflow: hidden;
    color: #fff;
    text-overflow: ellipsis;
    text-decoration: none;
    white-space: nowrap;
    font-size: 17px;
    font-weight: 850;
}

.player-title-link:hover,
.player-title-link:focus-visible {
    color: #fff;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.player-title-link[aria-disabled="true"] {
    pointer-events: none;
}

.player-copy span {
    display: block;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.72);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.player-seek {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 26px;
    margin-top: 12px;
    border-radius: 999px;
    background: transparent;
    accent-color: var(--accent);
    cursor: pointer;
}

.player-seek::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
}

.player-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    margin-top: -8px;
    border: 4px solid var(--accent);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.player-seek::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
}

.player-seek::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 4px solid var(--accent);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.player-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.player-toggle {
    display: inline-grid;
    place-items: center;
    min-width: 66px;
    min-height: 66px;
    border-radius: 18px;
    padding: 0;
}

.player-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.player-toggle span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.player-toggle::before {
    content: "";
    width: 0;
    height: 0;
    margin-left: 3px;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 17px solid currentColor;
}

.player-toggle.is-playing::before {
    width: 22px;
    height: 24px;
    margin-left: 0;
    border: 0;
    background: linear-gradient(
        to right,
        currentColor 0,
        currentColor 7px,
        transparent 7px,
        transparent 15px,
        currentColor 15px,
        currentColor 22px
    );
}

.player-link {
    display: inline-flex;
    align-items: center;
    min-height: 66px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    padding: 0 22px;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

.player-link:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.player-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 66px;
    width: 66px;
    height: 66px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    background: transparent;
    color: #fff;
    font-size: 36px;
    font-weight: 500;
    line-height: 1;
}

.player-close:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.book-page {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 48px 0 64px;
}

body.category-page .site-header {
    border-bottom: 0;
}

body.category-page .book-page {
    padding-top: 20px;
}

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

.book-detail-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface-muted);
    box-shadow: var(--shadow);
}

.book-detail-copy h1 {
    font-size: 44px;
    line-height: 1.08;
}

.book-detail-copy .author {
    color: var(--ink-soft);
    font-size: 19px;
    font-weight: 720;
}

.book-audio-player {
    display: grid;
    grid-template-columns: 34px auto minmax(180px, 1fr) 38px 38px;
    align-items: center;
    gap: 18px;
    width: 100%;
    min-height: 64px;
    margin: 24px 0 22px;
    padding: 10px 22px;
    border-radius: 999px;
    background: #f3f4f5;
    box-shadow: none;
    color: #000;
}

.book-audio-player audio {
    display: none;
}

.book-audio-toggle,
.book-audio-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #000;
    cursor: pointer;
}

.book-audio-toggle {
    width: 34px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
}

.book-audio-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
}

.book-audio-toggle::before {
    content: "";
    width: 0;
    height: 0;
    margin-left: 4px;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid currentColor;
}

.book-audio-toggle.is-playing::before {
    width: 18px;
    height: 22px;
    margin-left: 0;
    border: 0;
    background: linear-gradient(to right, currentColor 0 35%, transparent 35% 65%, currentColor 65% 100%);
}

.book-audio-toggle span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.book-audio-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 999px;
}

.book-audio-icon:hover {
    background: rgba(0, 0, 0, 0.06);
}

.book-audio-icon svg {
    display: block;
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.book-audio-airplay svg {
    width: 27px;
    height: 27px;
}

.book-audio-volume.is-muted .book-audio-volume-wave {
    display: none;
}

.book-audio-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 138px;
    color: #000;
    font-size: 23px;
    font-weight: 520;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.book-audio-seek {
    width: 100%;
    height: 7px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(to right, #5b5b5b 0%, #5b5b5b var(--progress, 0%), #d8d9db var(--progress, 0%), #d8d9db 100%);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.book-audio-seek::-webkit-slider-runnable-track {
    height: 7px;
    border-radius: 999px;
    background: transparent;
}

.book-audio-seek::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
    margin-top: -2.5px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.book-audio-seek::-moz-range-track {
    height: 7px;
    border-radius: 999px;
    background: #d8d9db;
}

.book-audio-seek::-moz-range-progress {
    height: 7px;
    border-radius: 999px;
    background: #5b5b5b;
}

.book-audio-seek::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
}

.detail-actions,
.related-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.primary-link,
.secondary-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    border-radius: 8px;
    padding: 0 14px;
    font-weight: 850;
}

.primary-link {
    background: var(--accent);
    color: #fff;
}

.primary-link:hover {
    background: var(--accent-dark);
    color: #fff;
}

.secondary-link {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
}

button.secondary-link {
    font: inherit;
    cursor: pointer;
}

.related-section {
    margin-top: 46px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.category-page-section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.book-shelf-section {
    display: grid;
    gap: 14px;
}

.book-shelf-section h2 {
    margin-bottom: 0;
}

.book-shelf-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(146px, 168px);
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0 12px;
    scroll-snap-type: x proximity;
}

.book-shelf-row::-webkit-scrollbar {
    height: 8px;
}

.book-shelf-row::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: #d5d2ca;
}

.book-shelf-card {
    min-width: 0;
}

.book-shelf-card .shelf-cover a {
    display: block;
    width: 100%;
    height: 100%;
}

.shelf-play-indicator {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 16px rgba(18, 19, 22, 0.2);
}

.shelf-play-indicator::before {
    content: "";
    width: 0;
    height: 0;
    margin-left: 3px;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 10px solid currentColor;
}

.shelf-save-action {
    min-height: 34px;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    font-weight: 820;
    padding: 7px 10px;
}

.shelf-save-action:hover,
.shelf-save-action:focus-visible {
    border-color: var(--ink);
}

.book-playlist-modal .account-section[hidden] {
    display: none;
}

.category-page-list {
    display: none;
}

.category-search-form {
    max-width: 760px;
    margin-top: 22px;
    box-shadow: none;
}

.category-book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(146px, 168px));
    gap: 28px 18px;
    align-items: start;
    margin-top: 26px;
}

.category-empty {
    margin: 26px 0 0;
    color: var(--muted);
    font-size: 17px;
}

.category-page-footer {
    margin-top: 24px;
}

@media (max-width: 980px) {
    .catalog-hero {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .hero-covers {
        max-width: 560px;
        margin: 0 auto;
    }

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

@media (max-width: 720px) {
    :root {
        --header-height: 68px;
        --player-height: 182px;
    }

    body {
        padding-bottom: 18px;
    }

    body.player-visible {
        padding-bottom: calc(var(--player-height) + 18px);
    }

    .site-header {
        padding: 10px 18px;
    }

    .brand img {
        width: 44px;
        height: 44px;
    }

    .menu-button {
        display: block;
    }

    .site-nav {
        position: fixed;
        top: var(--header-height);
        right: 18px;
        left: 18px;
        display: none;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
        box-shadow: var(--shadow);
    }

    body.menu-open .site-nav {
        display: grid;
    }

    .site-nav a,
    .nav-category-button,
    .nav-library-button {
        width: 100%;
        text-align: left;
    }

    .nav-category-menu {
        width: 100%;
    }

    .nav-category-panel {
        position: static;
        width: 100%;
        max-height: min(60vh, 520px);
        overflow: auto;
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 6px;
        padding: 12px;
        box-shadow: none;
    }

    main {
        width: min(100% - 28px, 1180px);
    }

    .catalog-hero {
        padding-top: 18px;
        padding-bottom: 4px;
        gap: 12px;
    }

    h1 {
        font-size: 40px;
        margin-bottom: 10px;
    }

    h2 {
        font-size: 25px;
    }

    .hero-lede {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .quick-searches {
        display: none;
    }

    .category-section,
    .results-section,
    .new-books-section,
    .shelves-section,
    .directory-section {
        padding-top: 18px;
    }

    .search-form {
        grid-template-columns: 38px minmax(0, 1fr);
        min-height: 58px;
        column-gap: 8px;
    }

    .search-form button {
        grid-column: 1 / -1;
        width: 100%;
        margin-top: 4px;
    }

    .stats-strip {
        grid-template-columns: 1fr;
    }

    .results-heading {
        display: grid;
        align-items: start;
        gap: 4px;
        padding-bottom: 10px;
    }

    .results-count {
        text-align: left;
    }

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

    body:not(.search-active) .book-grid,
    .shelf-row,
    .book-shelf-row {
        grid-auto-columns: minmax(136px, 152px);
        gap: 14px;
    }

    .new-books-section .shelf-row {
        grid-auto-columns: 136px;
    }

    .shelf-row.is-expanded {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .book-card {
        grid-template-columns: 82px minmax(0, 1fr);
        min-height: 132px;
    }

    .cover-wrap {
        width: 82px;
        height: 82px;
    }

    .audio-player {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 12px;
        right: 10px;
        bottom: 10px;
        left: 10px;
        padding: 14px;
        border-radius: 18px;
    }

    .audio-player img {
        width: 64px;
        height: 64px;
        border-radius: 12px;
    }

    .player-actions {
        grid-column: 1 / -1;
        justify-content: space-between;
    }

    .player-toggle,
    .player-link {
        flex: 1;
        justify-content: center;
    }

    .player-toggle,
    .player-link,
    .player-close {
        min-height: 58px;
        border-radius: 16px;
    }

    .player-toggle {
        min-width: 58px;
    }

    .player-close {
        flex-basis: 58px;
        width: 58px;
        height: 58px;
        font-size: 32px;
    }

    .book-audio-player {
        grid-template-columns: 30px minmax(82px, auto) minmax(80px, 1fr) 32px 32px;
        gap: 8px;
        min-height: 52px;
        padding: 7px 10px;
        border-radius: 999px;
    }

    .book-audio-toggle {
        width: 30px;
        height: 34px;
    }

    .book-audio-time {
        min-width: 82px;
        font-size: 15px;
        gap: 4px;
    }

    .book-audio-icon {
        width: 32px;
        height: 32px;
    }

    .book-audio-icon svg {
        width: 22px;
        height: 22px;
    }

    .library-panel {
        width: 100%;
        padding: 18px;
    }

    .book-detail {
        grid-template-columns: 1fr;
    }

    .book-detail-cover {
        width: min(260px, 78vw);
    }

    .book-detail-copy h1 {
        font-size: 34px;
    }

    .category-page-list {
        columns: 1;
    }
}

@media (max-width: 430px) {
    .brand-copy span {
        display: none;
    }

    .brand-stat {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
        font-size: 12px;
    }

    h1 {
        font-size: 34px;
    }

    .category-list a,
    .directory-links a {
        width: 100%;
        text-align: left;
    }

    .book-actions {
        display: grid;
    }

    .listen-button,
    .affiliate-link {
        width: 100%;
        text-align: center;
    }
}
