/* ========================================
   1. TOKENS
======================================== */

:root {
    /* =========================================================
       CORE BRAND
    ========================================================= */
    --nav: #004358;

    /* =========================================================
       PAGE / SURFACE SYSTEM
       Light teal page + near-white cards
    ========================================================= */
    --bg: #ffffff;
    --card: #fcfdfd;
    --border: rgba(0, 67, 88, 0.14);

    /* Secondary warm/cool surfaces */
    --paper: #f8f3ea;
    --paper-deep: #edf5f6;
    --surface-subtle: #f1f7f8;
    --table-head: #e7f0f2;
    --table-head-text: #27434a;

    /* =========================================================
       TEXT
    ========================================================= */
    --text: #2a2a2a;
    --muted: #6f6a60;
    --text-muted: #6b7280;
    --text-muted-soft: rgba(102, 115, 125, 0.82);
    --text-subtle: #98a5ae;

    /* Inverse text */
    --text-inverse: #ffffff;
    --text-muted-inverse: rgba(255, 255, 255, 0.85);
    --text-subtle-inverse: rgba(255, 255, 255, 0.62);

    /* =========================================================
       ACCENT SYSTEM
       Teal pulled from brand/nav
    ========================================================= */
    --accent: #2e6874;
    --accent-hover: #255561;

    --accent-rgb: 46, 104, 116;
    --focus-rgb: 140, 185, 195;

    --accent-02: rgba(var(--accent-rgb), 0.02);
    --accent-04: rgba(var(--accent-rgb), 0.04);
    --accent-05: rgba(var(--accent-rgb), 0.05);
    --accent-06: rgba(var(--accent-rgb), 0.06);
    --accent-08: rgba(var(--accent-rgb), 0.08);
    --accent-10: rgba(var(--accent-rgb), 0.10);
    --accent-12: rgba(var(--accent-rgb), 0.12);
    --accent-18: rgba(var(--accent-rgb), 0.18);
    --accent-22: rgba(var(--accent-rgb), 0.22);
    --accent-26: rgba(var(--accent-rgb), 0.26);

    --focus: #8fb8c2;
    --focus-18: rgba(var(--focus-rgb), 0.18);

    /* =========================================================
       WHITE OVERLAYS
    ========================================================= */
    --white: #ffffff;
    --white-95: rgba(255, 255, 255, 0.95);
    --white-92: rgba(255, 255, 255, 0.92);
    --white-90: rgba(255, 255, 255, 0.90);
    --white-88: rgba(255, 255, 255, 0.88);
    --white-82: rgba(255, 255, 255, 0.82);
    --white-76: rgba(255, 255, 255, 0.76);
    --white-72: rgba(255, 255, 255, 0.72);
    --white-68: rgba(255, 255, 255, 0.68);
    --white-62: rgba(255, 255, 255, 0.62);
    --white-45: rgba(255, 255, 255, 0.45);
    --white-22: rgba(255, 255, 255, 0.22);
    --white-18: rgba(255, 255, 255, 0.18);
    --white-16: rgba(255, 255, 255, 0.16);
    --white-14: rgba(255, 255, 255, 0.14);
    --white-12: rgba(255, 255, 255, 0.12);
    --white-10: rgba(255, 255, 255, 0.10);
    --white-08: rgba(255, 255, 255, 0.08);
    --white-04: rgba(255, 255, 255, 0.04);

    /* =========================================================
       MEMBER LIST COLORS
       Kept readable against lighter UI
    ========================================================= */
    --list1-bg: #d9e6ea;
    --list1-fg: #33434a;
    --list1-border: rgba(51, 67, 74, 0.16);
    --list1-active: #7d95a0;

    --list2-bg: #ece4d6;
    --list2-fg: #4a4236;
    --list2-border: rgba(74, 66, 54, 0.18);
    --list2-active: #a48755;

    --list3-bg: #d7e6e2;
    --list3-fg: #27413c;
    --list3-border: rgba(39, 65, 60, 0.16);
    --list3-active: #6f8f87;

    /* =========================================================
       HERO
       Still rich enough for contrast, but smoother
    ========================================================= */
    --hero-bg: #5f8f99;
    --hero-bg-top: #567f88;
    --hero-bg-bottom: #6f9fa8;

    --hero-bg-gradient: linear-gradient(
        180deg,
        var(--hero-bg-top) 0%,
        var(--hero-bg) 55%,
        var(--hero-bg-bottom) 100%
        );

    --hero-glow: rgba(255, 255, 255, 0.05);

    /* Membership hero / pricing surfaces */
    --hero-surface-top: rgba(255, 255, 255, 0.55);
    --hero-surface-bottom: rgba(243, 248, 249, 0.52);
    --hero-surface-bottom-strong: rgba(243, 248, 249, 0.62);

    --plan-top: #f7fbfb;
    --plan-featured-top: #e3f0f3;

    /* =========================================================
       EFFECTS
    ========================================================= */
    --shadow: none  ;
    --shadow-strong: 0 14px 30px rgba(21, 42, 48, 0.10);
    --cover-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    --tap-highlight: rgba(var(--accent-rgb), 0.14);

    /* =========================================================
       DIVIDERS / STATES
    ========================================================= */
    --divider: rgba(0, 67, 88, 0.10);

    --black-06: rgba(0, 0, 0, 0.06);
    --black-05: rgba(0, 0, 0, 0.05);

    /* =========================================================
       UI ELEMENTS
    ========================================================= */
    --chip-bg: #eef5f6;

    --search-shadow: 0 1px 0 var(--white-04) inset;
    --search-shadow-focus: 0 0 0 3px var(--focus-18);

    --search-icon-size: 18px;
    --search-icon-left: var(--s-6);

    --search-input-pad-left: 42px;
    --search-input-pad-y: var(--s-6);
    --search-input-pad-x: var(--s-8);

    --control-height: 38px;

    /* =========================================================
       RADIUS
    ========================================================= */
    --radius: 12px;
    --input-radius: 12px;
    --menu-btn-radius: 10px;
    --chip-radius: 999px;
    --book-row-radius: 6px;
    --cover-radius: 8px;
    --surface-radius-sm: 8px;

    /* =========================================================
       LAYOUT
    ========================================================= */
    --page-max: 1180px;
    --header-min-h: 64px;
    --header-min-h-lg: 70px;
    --menu-btn-size: 40px;
    --rail-w: 320px;
    --measure-compact: 360px;
    --measure-content: 520px;

    /* =========================================================
       SPACING SCALE
    ========================================================= */
    --s-0: 0;
    --s-1: 2px;
    --s-2: 4px;
    --s-3: 6px;
    --s-4: 8px;
    --s-5: 10px;
    --s-6: 12px;
    --s-7: 14px;
    --s-8: 16px;
    --s-9: 18px;
    --s-10: 20px;
    --s-11: 24px;
    --s-12: 28px;
    --s-13: 32px;
    --s-14: 40px;

    --section-gap: var(--s-8);
    --section-gap-lg: var(--s-11);
    --content-gap: var(--s-5);
    --tight-gap: var(--s-3);

    /* =========================================================
       RATINGS
    ========================================================= */
    --rating-gold: #a8924f;
    --rating-fill: rgba(46, 104, 116, 0.75);
    --rating-empty: rgba(31, 41, 51, 0.14);
    --rating-user: var(--accent);
}

/* ========================================
   2. BASE
======================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

a:hover {
    text-decoration: underline;
}

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

p {
    font-size: 0.97rem;
    line-height: 1.72;
    margin: 0;
}

/* ========================================
   BASE / RESET
======================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Remove default mobile tap highlight */
* {
    -webkit-tap-highlight-color: transparent;
}
/* ========================================
   INTERACTION / TOUCH FEEDBACK
======================================== */

.auth-btn,
.auth-btn-secondary,
.menu-link,
.book-row {
    -webkit-tap-highlight-color: var(--tap-highlight);
}

/* ========================================
   3. UTILITIES
======================================== */

.container {
    width: min(100% - var(--s-11), var(--page-max));
    margin: 0 auto;
}

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

.stack > * + * {
    margin-top: var(--stack-space, var(--s-4));
}

/* ========================================
   4. SITE CHROME
======================================== */

/* Header */

.site-top {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header {
    background: var(--nav);
    color: var(--white);
    border-bottom: 1px solid var(--white-12);
}

.header-inner {
    min-height: var(--header-min-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-6);
    padding: 0 var(--s-2);
}

.logo {
    display: inline-flex;
    align-items: center;
}

.logo img {
    width: 150px;
    height: auto;
}

.desktop-nav,
.desktop-search {
    display: none;
}

.desktop-nav {
    align-items: center;
    gap: var(--s-10);
    height: 100%;
}

.desktop-nav a {
    color: var(--white-88);
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* Header actions container */
.header-actions {
    display: none;
    align-items: center;
    gap: var(--s-6);
    margin-left: var(--s-6);
}

/* Base style for header links */
.header-actions a {
    font-size: 0.9rem;
    color: var(--white-72);
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    line-height: 1;
}

/* Hover */
.header-actions a:hover {
    color: var(--white);
}

/* Signed-in stacked account (override base) */
.account-link--signed-in {
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    line-height: 1.1;
    min-height: auto; /* override 40px */
}

/* Account text */
.account-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--white);
}

.account-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--white-72);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Search */

.desktop-search {
    min-width: 320px;
    max-width: 420px;
    width: 100%;
    margin-left: auto;
}

.search-field {
    position: relative;
    display: block;
    width: 100%;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: var(--search-icon-left);
    width: var(--search-icon-size);
    height: var(--search-icon-size);
    transform: translateY(-50%);
    stroke: var(--white-68);
    stroke-width: 2;
    fill: none;
    pointer-events: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.18s ease;
}

.desktop-search input,
.search-input {
    width: 100%;
    border: 1px solid var(--white-16);
    background: linear-gradient(
        180deg,
        var(--white-12) 0%,
        var(--white-08) 100%
        );
    color: var(--white);
    border-radius: var(--input-radius);
    padding:
        var(--search-input-pad-y)
        var(--search-input-pad-x)
        var(--search-input-pad-y)
        var(--search-input-pad-left);
    font: inherit;
    box-shadow: var(--search-shadow);
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}

.desktop-search input::placeholder,
.search-input::placeholder {
    color: var(--white-68);
}

.desktop-search input:hover,
.search-input:hover {
    border-color: var(--white-22);
    background: linear-gradient(
        180deg,
        var(--white-14) 0%,
        var(--white-08) 100%
        );
}

.desktop-search input:focus-visible,
.search-input:focus-visible {
    outline: none;
    border-color: var(--focus);
    background: linear-gradient(
        180deg,
        var(--white-18) 0%,
        var(--white-08) 100%
        );
    box-shadow: var(--search-shadow-focus);
}

.search-field:focus-within .search-icon {
    stroke: var(--white);
}

/* Menu */

.menu-toggle {
    appearance: none;
    border: 0;
    background: var(--white-08);
    color: var(--white);
    width: var(--menu-btn-size);
    height: var(--menu-btn-size);
    border-radius: var(--menu-btn-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.menu-toggle:hover {
    background: var(--white-12);
}

.hamburger {
    width: 18px;
    height: 14px;
    position: relative;
}

.hamburger span {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}

.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 6px;
}

.hamburger span:nth-child(3) {
    top: 12px;
}

.menu-toggle[aria-expanded="true"] .hamburger span:nth-child(1) {
    top: 6px;
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .hamburger span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .hamburger span:nth-child(3) {
    top: 6px;
    transform: rotate(-45deg);
}

.mobile-menu {
    display: none;
    background: var(--nav);
    color: var(--white);
    padding-bottom: var(--s-7);
    border-bottom: 1px solid var(--white-12);
}

.mobile-menu.open {
    display: block;
}

.search-wrap {
    margin-bottom: var(--s-6);
}

.menu-links {
    display: grid;
    gap: var(--s-2);
}

.menu-link {
    display: block;
    padding: var(--s-5) var(--s-1);
    color: var(--white-90);
    font-size: 0.94rem;
    border-bottom: 1px solid var(--white-08);
}

.menu-link:last-child {
    border-bottom: none;
}

.menu-divider {
    height: 1px;
    background: var(--white-12);
    margin: var(--s-3) 0;
}

/* Breadcrumb */

.breadcrumb-wrap {
    background: var(--nav);
    padding: var(--s-4) 0 var(--s-5);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--tight-gap);
    font-size: 0.78rem;
    color: var(--white-72);
}

.breadcrumb a {
    color: var(--white-82);
}

.breadcrumb-sep {
    color: var(--white-45);
}

.breadcrumb-current {
    color: var(--white-95);
}

/* Focus */

.menu-toggle:focus-visible,
.search-input:focus-visible,
.desktop-search input:focus-visible,
.menu-link:focus-visible,
.book-link:focus-visible,
.toc a:focus-visible,
.view-btn:focus-visible,
.sort-btn:focus-visible,
.connect-btn:focus-visible,
.footer-group a:focus-visible,
.footer-logo:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* ========================================
   5. LAYOUT
======================================== */

.page {
    padding: var(--s-5) 0 var(--s-12);
    padding-top: var(--s-3);
}

.content-layout {
    display: block;
}

.main-col {
    min-width: 0;
}

.sidebar {
    margin-top: var(--s-6);
    position: static;
}

.sidebar .section h2 {
    font-size: 1rem;
    line-height: 1.3;
}

.ad-rail {
    display: none;
}

@media (min-width: 992px) {
    .sidebar {
        margin-top: 0;
    }

    .content-layout.layout-1col {
        display: block;
    }

    .content-layout.layout-2col {
        display: grid;
        grid-template-columns: minmax(0, 1fr) var(--rail-w);
        gap: var(--s-11);
        align-items: start;
    }

    .content-layout.layout-3col {
        display: grid;
        grid-template-columns: minmax(0, 1fr) var(--rail-w);
        gap: var(--s-11);
        align-items: start;
    }

    .content-layout.layout-3col .ad-rail {
        display: none;
    }

    .content-layout.layout-2col.layout--wide-main {
        --rail-w: 260px;
    }

    .sidebar--sticky {
        position: sticky;
        top: 90px;
        max-height: calc(100vh - 110px);
        overflow: auto;
    }
    .sidebar--sticky-no-scroll {
        position: sticky;
        top: 90px;
    }

}

@media (min-width: 992px) and (max-width: 1199px) {
    .page-book .book-layout.layout-3col {
        grid-template-columns: minmax(0, 1fr) 280px;
        gap: var(--s-10);
    }

    .page-book .book-layout .ad-rail {
        display: none;
    }
}

@media (min-width: 1200px) {
    .content-layout.layout-3col {
        grid-template-columns: minmax(0, 1fr) var(--rail-w) var(--rail-w);
    }
    
    .content-layout.layout-3col.layout--wide-main {
        grid-template-columns: minmax(0, 1fr) 240px 300px;
        gap: var(--s-8);
    }    

    .content-layout.layout-3col .ad-rail {
        display: block;
    }

    .page-book .book-layout.layout-3col {
        grid-template-columns: minmax(0, 1fr) 280px 300px;
        gap: var(--s-10);
    }
}

/* ========================================
   6. COMPONENTS
======================================== */

.author {
    font-size: 0.92rem;
    color: var(--white-72);
    margin-bottom: var(--s-3);
}

.series-status {
    color: var(--white-62);
    font-weight: 500;
}
/* ========================================
   HERO SYSTEM
======================================== */

.hero {
    background: var(--hero-bg-gradient);
    color: var(--white);
    padding: var(--s-10) 0 var(--s-5);
    padding-bottom: var(--s-4);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--white-08);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, var(--hero-glow) 0%, transparent 50%);
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        120% 60% at 50% 0%,
        var(--hero-glow),
        transparent 70%
        );
    pointer-events: none;
}

.hero-inner {
    display: block;
}

.hero-content {
    min-width: 0;
}

.hero-cover {
    display: none;
}

.hero-cover img {
    border-radius: var(--cover-radius);
    box-shadow: var(--cover-shadow);
}

.hero h1 {
    font-size: clamp(1.7rem, 3.2vw, 2.4rem);
    line-height: 1.15;
    margin: 0 0 var(--s-2);
    letter-spacing: -0.025em;
}

.hero .summary {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--white-88);
    max-width: 62ch;
    margin-top: 0;
}

.hero-meta {
    margin-top: var(--s-5);
    font-size: 0.88rem;
    line-height: 1.4;
    font-weight: 600;
    color: var(--white-92);
}

.hero-meta strong {
    color: var(--white);
}

@media (min-width: 768px) {
    .hero {
        padding: var(--s-12) 0 var(--s-6);
    }
}

@media (min-width: 768px) {
    .hero--media .hero-inner {
        display: grid;
        grid-template-columns: 126px minmax(0, 1fr);
        gap: var(--s-10);
        align-items: start;
    }

    .hero--media .hero-cover {
        display: block;
    }

    .hero--media .hero-cover img {
        width: 126px;
    }
}

@media (min-width: 992px) {
    .hero--media .hero-inner {
        grid-template-columns: 125px minmax(0, 1fr);
        gap: var(--s-12);
    }

    .hero--media .hero-cover img {
        width: 125px;
    }
}

.hero--simple .hero-content {
    max-width: 760px;
}

.hero--simple .summary {
    max-width: none;
}

/* Compact hero */
.hero--compact {
    padding: var(--s-8) 0 var(--s-4);
}

.hero--compact h1 {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.hero--compact .summary {
    font-size: 0.96rem;
    line-height: 1.6;
}

/* Split hero */
.hero--split .hero-inner {
    display: grid;
    gap: var(--s-8);
    align-items: start;
}

.hero--split .hero-content,
.hero--split .hero-side {
    min-width: 0;
}

@media (min-width: 992px) {
    .hero--split .hero-inner {
        grid-template-columns: minmax(0, 1.2fr) minmax(280px, 420px);
        gap: var(--s-12);
    }
}
/* Section shells */

.section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s-8);
    margin-bottom: var(--section-gap);
    box-shadow: var(--shadow);
}

.list-section {
    margin-bottom: var(--section-gap);
    padding: var(--s-4) var(--tight-gap);
}

.section p + p {
    margin-top: var(--content-gap);
}

.section-meta {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 400;
    white-space: nowrap;
}

.book-count-extra {
    color: var(--muted-strong);
}

.section-submeta {
    font-size: 0.9rem;
    color: var(--muted);
    margin: -4px 0 var(--s-4);
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-submeta strong {
    color: var(--text);
    font-weight: 600;
}

.meta-divider {
    opacity: 0.6;
}

/* ========================================
   SECTION TYPOGRAPHY
======================================== */

.section-intro {
    margin-top: var(--s-2);
    margin-bottom: var(--s-5);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted);
    max-width: var(--measure-content);
}

.section > h2,
.list-section > h2,
.section-title {
    font-size: 1.25rem;
    line-height: 1.3;
    font-weight: 650;
    letter-spacing: -0.015em;
    margin: 0 0 var(--s-4);
}

.section > h3 {
    font-size: 0.88rem;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    color: var(--muted);
    margin: var(--s-6) 0 var(--s-2);
}

.section > h2 + h3 {
    margin-top: var(--s-3);
}

.section > p + h3 {
    margin-top: var(--s-6);
}

.section > h3 + p {
    margin-top: 0;
}

.section p {
    line-height: 1.7;
}

.section-link {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);

    margin-top: var(--s-6);

    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;

    color: var(--accent);
    text-decoration: none;

    transition: color 0.15s ease;
}

.section-link::after {
    content: "→";
    font-size: 0.9em;
    line-height: 1;
    transition: transform 0.15s ease;
}

.section-link:hover {
    text-decoration: underline;
}

.section-link:hover::after {
    transform: translateX(2px);
}

/* accessibility */
.section-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-18);
    border-radius: var(--surface-radius-sm);
}

/* Book list */

.book-list-surface {
    background: var(--card);
    border-top: 1px solid var(--black-06);
    border-bottom: 1px solid var(--black-06);
    border-radius: var(--surface-radius-sm);
    padding: 0;
    overflow: hidden;
}

.book-item {
    border-top: 1px solid var(--black-05);
}

.book-item:first-child {
    border-top: none;
}

.book-row {
    display: grid;
    gap: var(--s-4);
    align-items: center;
    padding: 8px var(--tight-gap);
    transition: background-color 0.15s ease, transform 0.05s ease;
    border-radius: var(--book-row-radius);
}

/* Interaction */
.book-row:hover {
    background-color: var(--accent-04);
}

.book-row:active {
    background-color: var(--accent-06);
    transform: scale(0.997);
}

/* Layout variants */
.book-row--numbered {
    grid-template-columns: minmax(4ch, auto) minmax(0, 1fr) auto;
}

.book-row--plain {
    grid-template-columns: minmax(0, 1fr) max-content;
}

/* Small mobile */
@media (max-width: 380px) {
    .book-row {
        gap: var(--s-2);
    }

    .book-row--numbered {
        grid-template-columns: minmax(4ch, auto) minmax(0, 1fr) auto;
    }

    .book-row--plain {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

/* Tablet */
@media (min-width: 768px) {
    .book-row {
        gap: var(--s-5);
    }

    .book-row--numbered {
        grid-template-columns: 30px minmax(0, 1fr) max-content;
    }

    .book-row--plain {
        grid-template-columns: minmax(0, 1fr) max-content;
    }
}

/* Desktop */
@media (min-width: 992px) {
    .book-row {
        padding: 9px var(--s-4);
        border-radius: 0;
        gap: var(--s-4);
    }

    .book-row--numbered {
        grid-template-columns: 32px minmax(0, 1fr) max-content;
    }

    .book-row--plain {
        grid-template-columns: minmax(0, 1fr) max-content;
    }
}
.book-num {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.88rem;
    text-align: right;
    text-align: left;
}

.book-link {
    font-weight: 600;
    font-size: 0.97rem;
    line-height: 1.28;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-link:hover {
    text-decoration: underline;
}

.book-date {
    font-variant-numeric: tabular-nums;
    font-size: 0.76rem;
    color: var(--text-muted-soft);
    white-space: nowrap;
}

.book-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s-3);
    white-space: nowrap;
}

.book-rating {
    display: inline-flex;
    align-items: center;
    gap: var(--tight-gap);
    min-width: 0;
    font-size: 0.78rem;
    margin-top: var(--tight-gap);
    opacity: 0.85;
    line-height: 1.2;
}

.book-rating span {
    color: var(--muted);
}

@media (min-width: 992px) {

    .book-link {
        font-size: 1rem;
        line-height: 1.3;
    }

    .book-num {
        width: 32px;
        flex: 0 0 32px;
    }

    .book-date {
        font-size: 0.78rem;
    }

    .book-meta {
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        gap: var(--s-3);
        min-width: 140px;
    }
}

/* Stars */

.stars {
    --percent: 0%;
    position: relative;
    display: inline-block;
    width: 69px;
    height: 13px;
    background: var(--rating-empty);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 69 13'%3E%3Cpath d='M6.5.7l1.58 3.2 3.54.52-2.56 2.5.61 3.52-3.17-1.67-3.17 1.67.61-3.52L1.38 4.42l3.54-.52L6.5.7zm14 0l1.58 3.2 3.54.52-2.56 2.5.61 3.52-3.17-1.67-3.17 1.67.61-3.52-2.56-2.5 3.54-.52L20.5.7zm14 0l1.58 3.2 3.54.52-2.56 2.5.61 3.52-3.17-1.67-3.17 1.67.61-3.52-2.56-2.5 3.54-.52L34.5.7zm14 0l1.58 3.2 3.54.52-2.56 2.5.61 3.52-3.17-1.67-3.17 1.67.61-3.52-2.56-2.5 3.54-.52L48.5.7zm14 0l1.58 3.2 3.54.52-2.56 2.5.61 3.52-3.17-1.67-3.17 1.67.61-3.52-2.56-2.5 3.54-.52L62.5.7z'/%3E%3C/svg%3E") left center / 69px 13px no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 69 13'%3E%3Cpath d='M6.5.7l1.58 3.2 3.54.52-2.56 2.5.61 3.52-3.17-1.67-3.17 1.67.61-3.52L1.38 4.42l3.54-.52L6.5.7zm14 0l1.58 3.2 3.54.52-2.56 2.5.61 3.52-3.17-1.67-3.17 1.67.61-3.52-2.56-2.5 3.54-.52L20.5.7zm14 0l1.58 3.2 3.54.52-2.56 2.5.61 3.52-3.17-1.67-3.17 1.67.61-3.52-2.56-2.5 3.54-.52L34.5.7zm14 0l1.58 3.2 3.54.52-2.56 2.5.61 3.52-3.17-1.67-3.17 1.67.61-3.52-2.56-2.5 3.54-.52L48.5.7zm14 0l1.58 3.2 3.54.52-2.56 2.5.61 3.52-3.17-1.67-3.17 1.67.61-3.52-2.56-2.5 3.54-.52L62.5.7z'/%3E%3C/svg%3E") left center / 69px 13px no-repeat;
}

.stars::before {
    content: "";
    position: absolute;
    inset: 0;
    width: var(--percent);
    background: var(--rating-fill);
}

.stars.is-empty {
    opacity: 0.35;
}

.list-intro {
    margin-bottom: var(--s-4);
}

.list-intro-text {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--muted);
}

.list-intro-text a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.list-intro-text a:hover {
    text-decoration: underline;
}

.list-note {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0 0 var(--s-2);
    padding: 0;
    border: none;
    opacity: 0.9;
}

.list-footer {
    margin-top: var(--s-2);
    padding: var(--s-3) var(--tight-gap) var(--s-4);
    border-top: 1px solid var(--border);
}

.list-note::before {
    content: "Note:";
    font-weight: 600;
    margin-right: 4px;
}

/* List controls */

.list-controls {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    margin-top: var(--s-3);
    padding: 0;
    border: none;
}

.view-switcher {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
}


.view-btn,
.sort-btn {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    border-radius: 10px;
    min-height: 40px;
    padding: 0 var(--s-5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-3);
    cursor: pointer;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
}

.view-btn {
    width: 56px;
    padding: 0;
}

.view-btn svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: currentColor;
    flex: 0 0 auto;
}

.view-btn svg rect,
.view-btn svg path {
    fill: currentColor;
    stroke: none;
}

.sort-btn svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.view-btn:hover,
.sort-btn:hover {
    border-color: var(--accent-22);
    color: var(--accent);
    background: var(--accent-04);
}

.view-btn.is-active {
    background: #7b8390;
    border-color: #7b8390;
    color: var(--white);
}

.sort-btn {
    background: #0f5b78;
    border-color: #0f5b78;
    color: var(--white);
    font-weight: 600;
    margin-left: auto;
}

.sort-btn:hover {
    background: #0c4f68;
    border-color: #0c4f68;
    color: var(--white);
}

@media (max-width: 640px) {
    .list-controls {
        flex-wrap: wrap;
        row-gap: var(--s-3);
    }

    .sort-btn {
        margin-left: 0;
    }
}

/* Meta list */

.meta-list {
    display: grid;
    gap: var(--s-6);
}

.meta-row {
    display: grid;
    gap: 2px;
    font-size: 0.92rem;
}

.meta-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.meta-value {
    font-weight: 600;
    text-align: left;
    line-height: 1.35;
}

/* TOC */

.toc {
    display: none;
}

.toc a {
    display: block;
    padding: var(--s-3) 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    border-bottom: 1px solid var(--black-05);
}

.toc a:last-child {
    border-bottom: none;
}

.toc a:hover {
    color: var(--accent);
    text-decoration: none;
}

.toc a::after {
    content: "→";
    float: right;
    color: var(--muted);
    font-size: 0.85rem;
}

/* Connect actions */

.connect-actions {
    display: grid;
    gap: var(--s-4);
}

.connect-item {
    display: grid;
    gap: var(--s-2);
}

.connect-btn {
    display: block;
    width: 100%;
    padding: var(--s-4);
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        color 0.18s ease,
        background 0.18s ease;
}

.connect-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-04);
}

.connect-note {
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
    margin-top: var(--s-2);
}

/* Tags */

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-4);
}

.tags span {
    display: inline-flex;
    align-items: center;
    padding: var(--s-4) var(--s-5);
    border-radius: var(--chip-radius);
    background: var(--chip-bg);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
}

/* FAQ */

.faq-item {
    margin-bottom: var(--content-gap);
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-item strong {
    display: block;
    margin-bottom: var(--tight-gap);
    font-size: 0.96rem;
    line-height: 1.4;
}

/* Related series */

.related-series-section .section-intro {
    color: var(--muted);
    margin-bottom: var(--s-8);
}

.related-series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--s-8);
}

.related-series-card {
    min-width: 0;
}

.related-series-link {
    display: block;
    text-decoration: none;
}

.related-series-link:hover {
    text-decoration: none;
}

.related-series-cover {
    width: 100%;
    max-width: 128px;
    margin: 0 auto var(--s-4);
}

.related-series-cover img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: var(--cover-radius);
    box-shadow: var(--shadow);
}

.related-series-body {
    text-align: center;
}

.related-series-title {
    font-size: 0.92rem;
    line-height: 1.35;
    font-weight: 600;
    margin: 0 0 var(--s-2);
    color: var(--accent);
}

.related-series-link:hover .related-series-title {
    text-decoration: underline;
}

.related-series-author {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0;
}

.related-series-cta {
    display: block;
    margin-top: var(--s-9);
    padding: var(--s-4) var(--s-5);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--card);
    text-decoration: none;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        color 0.18s ease;
}

.related-series-cta:hover {
    border-color: var(--accent-22);
    background: var(--accent-04);
    text-decoration: none;
}

/* Ads */

.ad-slot {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 250px;
    margin-bottom: var(--section-gap);
    box-shadow: var(--shadow);
}

/* Footer */

/* ========================================
   FOOTER
======================================== */

.site-footer {
    margin-top: var(--s-12);
    background: var(--nav);
    color: var(--white-82);
    border-top: 1px solid var(--white-08);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-8);
    padding: var(--s-10) 0 var(--s-8);
}

.footer-brand {
    grid-column: 1 / -1;
    max-width: none;
    padding-bottom: var(--s-6);
    border-bottom: 1px solid var(--white-08);
}

.footer-logo {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--white);
    text-decoration: none;
    margin-bottom: var(--s-4);
}

.footer-logo:hover {
    text-decoration: none;
}

.footer-tagline {
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--white-72);
    margin: 0;
    max-width: 42ch;
}

.footer-group {
    display: grid;
    gap: var(--s-2);
    align-content: start;
}

.footer-group h2 {
    margin: 0 0 var(--s-3);
    font-size: 0.78rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--white);
}

.footer-group a {
    color: var(--white-76);
    font-size: 0.92rem;
    line-height: 1.5;
    text-decoration: none;
}

.footer-group a:hover {
    color: var(--white);
    text-decoration: underline;
}

.footer-bottom {
    padding: var(--s-5) 0 var(--s-8);
    border-top: 1px solid var(--white-08);
}

.footer-bottom p {
    margin: 0;
    font-size: 0.84rem;
    color: var(--white-62);
    text-align: center;
}

/* Mobile: better stack after intro */
@media (max-width: 767px) {
    .footer-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--s-8);
        row-gap: var(--s-7);
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* Desktop */
/* Desktop */
@media (min-width: 768px) {
    .footer-inner {
        grid-template-columns: minmax(320px, 1.6fr) repeat(3, max-content);
        justify-content: space-between;
        align-items: start;
        column-gap: var(--s-11);
        row-gap: var(--s-8);
        padding-top: var(--s-13);
        padding-bottom: var(--s-11);
    }

    .footer-brand {
        max-width: 32rem;
        padding-bottom: 0;
        border-bottom: 0;
    }

    .footer-bottom {
        padding: var(--s-6) 0 var(--s-10);
    }

    .footer-bottom p {
        text-align: left;
    }
}

/* ========================================
   7. RESPONSIVE
======================================== */

@media (max-width: 380px) {

    .book-meta {
        justify-content: flex-end;
        min-width: auto;
    }

    .book-date {
        display: block;
        font-size: 0.72rem;
        white-space: nowrap;
    }

    .book-link {
        font-size: 0.92rem;
    }

    .list-controls {
        gap: var(--s-4);
    }

    .view-switcher {
        gap: var(--s-3);
    }

    .view-btn {
        width: 48px;
    }

    .sort-btn {
        padding-inline: var(--s-4);
    }
}

@media (max-width: 640px) {
    .book-rating {
        display: none;
    }
}

@media (max-width: 991px) {
    .toc-section {
        display: none;
    }
}

@media (min-width: 768px) {
    .container {
        width: min(100% - var(--s-14), var(--page-max));
    }

    .page {
        padding-top: var(--s-9);
    }

    .section,
    .list-section {
        margin-bottom: var(--section-gap-lg);
    }

    .book-link {
        font-size: 1rem;
    }

    .footer-inner {
        grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(140px, 1fr));
        align-items: start;
        gap: var(--s-12);
        padding-top: var(--s-13);
        padding-bottom: var(--s-11);
    }
}

@media (min-width: 992px) {
    .header-inner {
        min-height: var(--header-min-h-lg);
        gap: var(--s-9);
        align-items: center;
    }

    .logo img {
        width: 180px;
    }

    .menu-toggle,
    .mobile-menu {
        display: none !important;
    }

    .desktop-nav,
    .desktop-search {
        display: flex;
        align-items: center;
    }

    .desktop-nav {
        gap: var(--s-10);
        transform: translateY(4px);
    }

    .desktop-search {
        min-width: 360px;
        max-width: 460px;
        width: 100%;
        margin-left: auto;
        align-self: center;
    }

    .desktop-search input {
        padding-top: var(--s-6);
        padding-bottom: var(--s-6);
    }

    .header-actions {
        display: flex;
        transform: translateY(4px);
    }

    .breadcrumb-wrap {
        padding-top: var(--s-5);
        padding-bottom: var(--s-6);
    }

    .toc {
        display: flex;
        flex-direction: column;
        gap: var(--s-3);
    }

}

/* ========================================
   AUTHOR PAGE EXTENSIONS
======================================== */

/* =========================
   SERIES ORGANIZED SECTION
========================= */

.series-organized-section .section-intro {
    color: var(--muted);
    margin-bottom: var(--s-7);
}

.series-block {
    padding: var(--s-5) 0 var(--s-6);
    border-bottom: 1px solid var(--border);
}

.series-block:first-of-type {
    padding-top: 0;
}

.series-block:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.series-block-title {
    font-size: 1.02rem;
    line-height: 1.3;
    font-weight: 700;
    margin: 0 0 var(--s-3);
}

.series-block-title a {
    color: var(--accent);
    text-decoration: none;
}

.series-block-title a:hover {
    text-decoration: underline;
}

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

.series-book-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: var(--s-5);
    align-items: baseline;
    padding: 2px 0;
    border-bottom: 0;
}

.series-book-title {
    min-width: 0;
    font-size: 0.94rem;
    line-height: 1.45;
    color: var(--text);
}

.series-organized-section .book-date {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--muted);
    white-space: nowrap;
}

.standalone-block .series-block-title {
    margin-top: 0;
}

.series-organized-section .section-subtitle {
    margin-top: var(--s-7);
}

@media (max-width: 640px) {
    .series-book-list li {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 3px 0;
    }

    .series-organized-section .book-date {
        font-size: 0.76rem;
        white-space: normal;
    }
}


/* =========================
   ALL SERIES (GROUPED)
========================= */

.series-group {
    margin-top: var(--s-7);
}

.series-group-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--muted);
    margin-bottom: var(--s-3);
}

.all-series-list {
    display: grid;
    gap: var(--s-2);
}

.series-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    text-decoration: none;
    transition: all 0.15s ease;
}

.series-row:hover {
    border-color: var(--accent-22);
    background: var(--accent-04);
}

.series-name {
    font-weight: 600;
    color: var(--text);
}

.series-meta {
    font-size: 0.78rem;
    color: var(--muted);
}


/* =========================
   IDENTITY / PSEUDONYMS
========================= */

.identity-section .section-intro {
    color: var(--muted);
    margin-bottom: var(--s-7);
}

.identity-groups {
    display: grid;
    gap: var(--s-7);
}

.identity-group-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--muted);
    margin-bottom: var(--s-3);
}

.identity-list {
    display: grid;
    gap: var(--s-2);
}

.identity-row {
    display: flex;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    text-decoration: none;
    transition: all 0.15s ease;
}

.identity-row:hover {
    border-color: var(--accent-22);
    background: var(--accent-04);
}

.identity-name {
    font-weight: 600;
    color: var(--text);
}

.identity-meta {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: right;
}


/* =========================
   AWARDS
========================= */

.awards-section h2 {
    margin-bottom: var(--s-5);
}

.awards-list {
    display: grid;
    gap: var(--s-2);
}

.award-item {
    padding-bottom: var(--s-2);
    border-bottom: 1px solid var(--border);
}

.award-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.award-book-title {
    margin: 0 0 var(--s-1);
    font-size: 0.98rem;
    line-height: 1.35;
    font-weight: 600;
    margin-bottom: 0;
}

.award-book-title a {
    color: var(--text);
    text-decoration: none;
}

.award-book-title a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.award-book-meta {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--muted);
}

.award-book-meta-list {
    display: grid;
    gap: 1px;
    margin-top: 1px;
}

.awards-section p + p {
    margin-top: 0;
}

/* =========================
   MOBILE TWEAKS
========================= */

@media (max-width: 640px) {

    .identity-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .identity-meta {
        text-align: left;
    }

    .series-book-list li {
        flex-direction: column;
        align-items: flex-start;
    }

    .book-date {
        white-space: normal;
    }
}

/* =========================
   AUTHOR JUMP LINKS (INLINE + TAP SAFE)
========================= */

.author-jump-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0 0 var(--s-6);
    margin-bottom: var(--s-4);
    font-size: 0.85rem;
    color: var(--muted);
}

.author-jump-links > span {
    display: inline-flex;
    align-items: center;
}

.author-jump-links > span + span::before {
    content: "•";
    margin: 0 var(--s-3);
    color: var(--border);
}

.author-jump-links a {
    position: relative;
    display: inline-block;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    line-height: 1.5;
    border-bottom: 1px solid transparent;
}

.author-jump-links a:hover {
    color: var(--accent);
    border-bottom-color: currentColor;
}

.author-jump-links a::after {
    content: "";
    position: absolute;
    top: -6px;
    bottom: -6px;
    left: -4px;
    right: -4px;
}
.author-jump-links {
    padding-left: var(--tight-gap);
    padding-right: var(--tight-gap);
}

/* =========================
   LIST-FIRST LAYOUT
========================= */

.author-books-section h2 {
    margin-bottom: var(--s-3);
}

/* BOOK LIST FIRST */
.author-books-section .book-list-surface {
    margin-top: 0;
}

/* META BLOCK (moves BELOW first books) */
.author-list-meta {
    margin-top: var(--s-6);
    padding-top: var(--s-4);
    border-top: 1px solid var(--border);
}

/* kicker */
.list-kicker {
    margin: 0 0 var(--s-3);
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: var(--s-2);
}

/* jump links now secondary */
.author-list-meta .author-jump-links {
    margin: 0 0 var(--s-3);
    font-size: 0.82rem;
}

/* controls at bottom of block */
.author-list-meta .list-controls {
    justify-content: flex-start;
    gap: var(--s-3);
}
#books,
#latest,
#series,
#all-series,
#names,
#about,
#awards,
#faq,
#browse,
#author-series,
#popular-series,
#publisher-series,
#multi-author-series,
#similar-authors {
    scroll-margin-top: 100px;
}

.list-row[id^="book-"] {
    scroll-margin-top: 100px;
}

.author-book-submeta {
    margin-top: 2px;
    font-size: 0.75rem;
    line-height: 1.2;
    color: var(--muted);
    opacity: 0.8;
    min-width: 0;
}

.author-book-submeta a {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.author-book-submeta a:hover {
    text-decoration: underline;
}

.series-label,
.series-num {
    display: inline;
    white-space: nowrap;
}

/* =========================
   LATEST RELEASE MODULE
========================= */

.author-latest-release {
    margin: 0 0 var(--s-4);
    padding: 0;
}

.latest-release-card {
    display: grid;
    gap: 2px;
    padding: var(--s-5) var(--s-6);
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    text-decoration: none;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        color 0.18s ease;
}

.latest-release-card:hover {
    border-color: var(--accent-22);
    background: var(--accent-04);
    text-decoration: none;
}

.latest-release-label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.latest-release-title {
    font-size: 0.98rem;
    line-height: 1.3;
    font-weight: 600;
    color: var(--text);
}

.latest-release-meta {
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--muted);
}
.author-jump-links,
.author-books-section h2 {
    padding-left: var(--tight-gap);
    padding-right: var(--tight-gap);
}
/* ========================================
   BOOK PAGE EXTENSIONS
======================================== */

.page-book #about,
.page-book #series-reading-order,
.page-book #genres-themes,
.page-book #editions {
    scroll-margin-top: 100px;
}

/* ========================================
   BOOK HERO
======================================== */

.book-hero-inner {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: var(--s-6);
    align-items: start;
}

.book-hero-cover img,
.book-cover-trigger img {
    width: 88px;
}

.book-hero-content {
    min-width: 0;
    --stack-space: var(--s-4);
}

.book-kicker {
    font-size: 0.72rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--white-62);
}

.book-hero-content h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    font-weight: 800;
    margin: 0;
}

.book-byline {
    color: var(--text-muted-inverse);
    font-size: 0.95rem;
    line-height: 1.4;
}

.book-byline a {
    color: var(--white);
    text-decoration: none;
}

.book-byline a:hover {
    text-decoration: underline;
}

.book-hero-buy {
    --stack-space: var(--s-5);
}

.buy-btn-primary.buy-btn-primary--hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: var(--measure-compact);
    padding: var(--s-5) var(--s-6);
    border-radius: 12px;
    background: var(--white);
    color: var(--accent);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.buy-btn-primary.buy-btn-primary--hero:hover {
    text-decoration: none;
    background: var(--white-95);
}

.buy-btn-primary.buy-btn-primary--hero span {
    font-size: 0.82rem;
    color: var(--text-muted);
    opacity: 1;
    font-weight: 600;
    margin-left: var(--s-4);
    white-space: nowrap;
}

.book-hero-series {
    display: grid;
    gap: var(--s-4);
    max-width: var(--measure-compact);
}

.book-hero-series-item {
    display: grid;
    gap: 2px;
}

.book-hero-series-label {
    font-size: 0.72rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--white-62);
}

.book-hero-series-value {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--s-2);
    font-size: 0.95rem;
    line-height: 1.4;
    font-weight: 600;
    color: var(--white-90);
    max-width: var(--measure-compact);
}

.book-hero-series-value a {
    color: var(--white);
    text-decoration: none;
    overflow-wrap: break-word;
}

.book-hero-series-value a:hover {
    text-decoration: underline;
}

.book-hero-series-num {
    font-size: 0.84rem;
    line-height: 1.2;
    color: var(--white-72);
    white-space: nowrap;
}

.book-hero-buy + .book-hero-series {
    margin-top: var(--s-7);
}

    .book-hero-cover-note {
    display: block;
    margin-top: var(--s-1);
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--white-62);
    text-align: center;
}

@media (hover: hover) and (pointer: fine) {
    .book-hero-cover-note {
        display: none;
    }
}

.book-hero-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-cover-trigger {
    display: inline-block;
    padding: 0;
    border: 0;
    background: transparent;
}

.cover-modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-modal-body img {
    max-width: 100%;
    height: auto;
    display: block;
}

.media-fallback--cover {
    width: 126px;
    aspect-ratio: 2 / 3;
    object-fit: cover;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: var(--cover-radius);
    box-shadow: var(--cover-shadow);

    background: linear-gradient(
        180deg,
        var(--white-16),
        var(--white-08)
        );
    border: 1px solid var(--white-16);

    color: var(--white-82);
    text-align: center;
    padding: var(--s-4);

    font-size: 0.68rem;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Book hero details - horizontal strip */
.book-hero-details {
    display: grid;
    grid-template-columns: auto minmax(180px, auto) auto auto;
    justify-content: start;
    align-items: start;
    gap: var(--s-8);
    max-width: var(--measure-content);
}

.book-hero-detail {
    position: relative;
    display: grid;
    gap: 2px;
    min-width: 0;
    padding-right: var(--s-6);
}

.book-hero-detail:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 18%;
    bottom: 18%;
    width: 1px;
    background: var(--white-16);
}

.book-hero-detail-label {
    font-size: 0.72rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--white-62);
}

.book-hero-detail-value {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--s-2);

    font-size: 0.95rem;
    line-height: 1.4;
    font-weight: 600;
    color: var(--white-90);
}

.book-hero-detail-value--truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: none;
}

.book-hero-detail-rating {
    display: flex;
    align-items: center;
    gap: var(--s-2);    
}

.book-hero-detail-rating .stars {
    flex: 0 0 auto;
    display: block;
    line-height: 1;
    background: var(--white-22);
    transform: translateY(4px);
}

.book-hero-detail-rating .stars::before {
    background: var(--white-90);
}

.book-hero-detail-rating .rating-value {
    color: var(--white-90);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    display: flex;
    align-items: center;    
}

.book-hero-detail-rating .rating-count {
    color: var(--white-72);
    font-size: 0.84rem;
}

.book-hero-detail-subvalue {
    margin-top: 2px;
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--white-72);
}

@media (max-width: 767px) {
    
    .book-hero-details {
        grid-template-columns: 1fr 1.4fr;
        gap: var(--s-4) var(--s-6);
    }

    /* remove desktop dividers */
    .book-hero-detail::after {
        display: none;
    }    

    .book-hero-detail--compact .book-hero-detail-value--inline {
        display: flex;
        flex-wrap: wrap;
        gap: var(--s-2);
        color: var(--white-82);
        font-size: 0.88rem;
    }

    .book-hero-detail-sep {
        color: var(--white-45);
    }
}

@media (min-width: 768px) {
    .book-hero .book-hero-detail-value--truncate {
        max-width: none;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;   
    }
}

@media (min-width: 992px) {
    .book-hero-details {
        gap: var(--s-4) var(--s-8);
    }
}   

@media (min-width: 768px) {
    .book-hero-inner {
        grid-template-columns: 126px minmax(0, 1fr);
        gap: var(--s-10);
        align-items: start;
    }

    .book-hero-cover {
        display: block;
    }

    .book-hero-cover img,
    .book-cover-trigger img {
        width: 126px;
    }
}

@media (min-width: 992px) {
    .book-hero-inner {
        grid-template-columns: 180px minmax(0, var(--measure-content));
        gap: var(--s-12);
        align-items: start;
    }

    .book-hero-cover img,
    .book-cover-trigger img {
        width: 180px;
    }

    .book-hero-cover-note {
        text-align: left;
    }

    .buy-btn-primary.buy-btn-primary--hero {
        max-width: var(--measure-compact);
    }
}
/* ========================================
   BOOK HERO ORGANIZE
======================================== */

.book-hero-organize {
    width: 100%;
    max-width: var(--measure-compact);
    padding: var(--s-5) var(--s-6);
    border: 1px solid var(--white-22);
    border-radius: 12px;
    background: var(--white);
    color: var(--text);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.book-hero-organize .book-organize-label {
    margin-bottom: var(--s-3);
    color: var(--accent);
    font-size: 0.78rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.book-hero-organize .organize-rail {
    width: 100%;
}

/* ========================================
   BOOK TRACK CTA (LOGGED OUT)
======================================== */

.book-cta-track {
    margin-top: var(--s-5);
    margin-bottom: var(--section-gap-lg)
}

.book-cta-track-inner {
    display: grid;
    gap: var(--s-4);
    padding: var(--s-5) var(--s-6);

    border: 1px dashed var(--border);
    border-radius: 12px;

    background: var(--surface-subtle);
}

.book-cta-track-label {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
}

.book-cta-track-copy p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--muted);
}

.book-cta-track-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;
    padding: 0 var(--s-5);

    border-radius: 10px;
    border: 1px solid var(--accent);

    background: var(--accent);
    color: var(--white);

    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;

    transition:
        background-color 0.18s ease,
        border-color 0.18s ease;
}

.book-cta-track-btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    text-decoration: none;
}

/* Desktop alignment with hero rhythm */
@media (min-width: 768px) {
    .book-cta-track-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
}
/* Detail strip */

.book-detail-strip {
    padding-top: var(--s-6);
    padding-bottom: var(--s-6);
}

.book-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-6) var(--s-8);
}

.book-detail-item {
    min-width: 0;
}

/* Series fit */

.series-fit-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: var(--s-6);
    background: var(--card);
    margin-top: var(--s-5);
}

.series-fit-card:first-of-type {
    margin-top: 0;
}

.series-fit-head {
    display: flex;
    justify-content: space-between;
    gap: var(--s-5);
    align-items: start;
    margin-bottom: var(--s-4);
}

.series-fit-title {
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 700;
}

.series-fit-title a {
    color: var(--text);
    text-decoration: none;
}

.series-fit-title a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.series-fit-num {
    flex: 0 0 auto;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.84rem;
    white-space: nowrap;
}

.series-fit-copy {
    color: var(--text);
}

.series-fit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-5);
    margin-top: var(--s-4);
}

.series-fit-actions a {
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 600;
}

/* Editions */

.edition-group + .edition-group {
    margin-top: var(--s-8);
    padding-top: var(--s-8);
    border-top: 1px solid var(--border);
}

.edition-group h3 {
    margin: 0 0 var(--s-5);
    font-size: 1rem;
    line-height: 1.3;
}

.edition-row {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: var(--s-6);
    padding: var(--s-4) 0;
    border-top: 1px solid var(--black-05);
}

.edition-row:first-of-type {
    border-top: none;
    padding-top: 0;
}

.edition-main {
    min-width: 0;
}

.edition-main strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.3;
}

.edition-submeta {
    margin-top: 2px;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--muted);
}

.edition-meta {
    flex: 0 0 auto;
    text-align: right;
}

.edition-isbn {
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--muted);
}

/* Compact sidebar list */

.compact-book-list .book-link {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 0.92rem;
}

.compact-book-list .book-row {
    align-items: start;
}

/* Responsive */

@media (max-width: 767px) {
    .book-detail-grid {
        grid-template-columns: 1fr 1fr;
    }

    .series-fit-head,
    .edition-row {
        flex-direction: column;
    }

    .edition-meta {
        text-align: left;
    }
}

@media (min-width: 992px) {
    .book-detail-grid {
        display: grid;
        grid-template-columns: repeat(4, auto);
        justify-content: start;
        gap: var(--s-8); /* tighter control */
    }

    .book-detail-item {
        padding-right: 0;
        border-right: 1px solid var(--border);
        text-align: left;
        position: relative;
        padding-right: var(--s-6);
    }

    .book-detail-item:last-child {
        border-right: 0;
        padding-right: 0;
    }

    .book-detail-item:not(:last-child)::after {
        content: "";
        position: absolute;
        right: 0;
        top: 20%;
        bottom: 20%;
        width: 1px;
        background: var(--border);
        opacity: 0.6;
    }

    .book-detail-item .meta-label,
    .book-detail-item .meta-value {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .book-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .book-action-btn {
        width: 100%;
    }

    .book-hero-badges {
        gap: var(--s-2);
    }

    .book-hero-badges span {
        font-size: 0.78rem;
    }
}
/* ========================================
   TAP-TO-EXPAND COVER
======================================== */

.book-cover-trigger {
    appearance: none;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    display: block;
    width: 100%;
    cursor: zoom-in;
    border-radius: var(--cover-radius);
}

.book-cover-trigger img {
    display: block;
    width: 100%;
    border-radius: var(--cover-radius);
    box-shadow: var(--cover-shadow);
}

.book-cover-trigger:focus-visible,
.cover-modal-close:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* Modal shell */

.cover-modal[hidden] {
    display: none;
}

.cover-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.cover-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(2px);
}

.cover-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 420px);
    max-height: 88vh;
    margin: 6vh auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}

.cover-modal-body {
    position: relative;
    width: 100%;
    padding: 24px;
    box-sizing: border-box;
}

.cover-modal-body img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(88vh - 48px);
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.cover-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cover-modal-close:hover {
    background: var(--white);
}

/* Keep this primarily mobile-driven.
   On desktop the button still works, but the UX benefit is mostly mobile. */
@media (min-width: 992px) {
    .cover-modal-dialog {
        width: min(78vw, 520px);
    }
}

@media (max-width: 420px) {
    .cover-modal-dialog {
        padding: 16px;
    }

    .cover-modal-close {
        top: 14px;
        right: 14px;
    }
}

/* ========================================
   SMART BUY MODULE
======================================== */

.book-buy {
    padding-top: var(--s-6);
}

/* PRIMARY CTA */

.buy-primary {
    margin-bottom: var(--s-5);
}

.buy-btn-primary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--s-5) var(--s-6);
    border-radius: 12px;
    background: var(--accent);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
}

.buy-btn-primary span {
    font-size: 0.82rem;
    opacity: 0.9;
}

/* SECONDARY LINKS */

.buy-secondary {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-3);
}

.buy-link {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: var(--s-4) var(--s-5);
    border-radius: 10px;

    background: var(--card);
    border: 1px solid var(--border);

    text-decoration: none;
    color: var(--text);
}

.buy-link:hover {
    background: var(--accent-04);
}

.buy-link:first-child {
    border-color: var(--accent-18);
    background: var(--accent-04);
}

.buy-store {
    font-weight: 600;
}

.buy-format {
    font-size: 0.8rem;
    color: var(--muted);
}

.meta-rating {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    flex-wrap: wrap;
    line-height: 1.2;
}

.meta-rating .stars {
    flex: 0 0 auto;
}

.meta-rating .star {
    width: 13px;
    height: 13px;
}

.rating-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.rating-count {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.meta-value--truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   FOLLOW TOGGLE (SITEWIDE)
======================================== */

.follow-toggle {
    appearance: none;
    border: 1px solid var(--white-22);
    background: var(--white-12);
    color: var(--white);
    border-radius: 999px;
    min-height: 38px;
    padding: 0 var(--s-5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
}

.follow-toggle:hover {
    background: var(--white-18);
    border-color: var(--white-45);
}

.follow-toggle.is-active {
    background: var(--white);
    border-color: var(--white);
    color: var(--accent);
}

.follow-toggle.is-active:hover {
    background: var(--white-95);
    border-color: var(--white-95);
}

.follow-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    flex: 0 0 16px;
    font-size: 18px;
    line-height: 1;
    font-weight: 800;
    transform: translateY(-1px);
}

.follow-toggle-text {
    line-height: 1;
    font-weight: 600;
}

.follow-toggle.is-active .follow-toggle-icon {
    font-size: 16px;
}

/* ========================================
   FOLLOW BOX (SITEWIDE)
======================================== */
.member-hero-follow {
    margin-top: var(--s-5);
}

.member-follow-box {
    display: grid;
    gap: var(--s-4);
}

.member-follow-box-title {
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 700;
    color: var(--text);
}

.member-follow-box-copy {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--muted);
    margin: 0;
}

.member-follow-box-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-4);
}

.member-follow-box-manage {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.member-follow-box-manage:hover {
    text-decoration: underline;
}

/* ========================================
   MEDIA SLOT
   Shared image / fallback system
======================================== */

.media-slot {
    flex: 0 0 auto;
    min-width: 0;
}

.media-slot img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--cover-radius);
    box-shadow: var(--cover-shadow);
}

/* Square media (author photos, avatars, icons) */
.media-slot--square {
    width: 126px;
}

.media-slot--square img,
.media-slot--square .media-fallback {
    width: 126px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Book cover style */
.media-slot--cover {
    width: 126px;
}

.media-slot--cover img,
.media-slot--cover .media-fallback {
    width: 126px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

/* Hero-specific sizing hook if you want it later */
.media-slot--hero {
    flex: 0 0 auto;
}

/* Fallback block */
.media-fallback {
    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: var(--cover-radius);
    box-shadow: var(--cover-shadow);

    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.16) 0%,
        rgba(255, 255, 255, 0.08) 100%
        );
    border: 1px solid var(--white-16);

    color: var(--white-92);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Initials fallback */
.media-fallback--initials {
    font-size: 1.3rem;
}

/* Generic icon fallback */
.media-fallback--icon {
    font-size: 2rem;
    line-height: 1;
}





/* book hero media */
.book-cover-trigger {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    display: block;
    cursor: pointer;
}

.book-cover-trigger img,
.book-cover-trigger .media-fallback--cover {
    width: 126px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: var(--cover-radius);
    box-shadow: var(--cover-shadow);
    display: block;
}

.book-cover-trigger--empty {
    cursor: default;
}

/* ========================================
   NEXT BOOK CALLOUT
   Reusable support component
======================================== */

.next-book-callout {
    display: grid;
    gap: var(--s-4);
    padding: var(--s-6);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-subtle);
    box-shadow: var(--shadow);
    margin: var(--s-6) 0 var(--s-7);
}

.next-book-callout-title {
    font-size: 0.96rem;
    line-height: 1.3;
    font-weight: 700;
    color: var(--text);
}

.next-book-callout-text {
    margin: 4px 0 0;
    font-size: 0.86rem;
    line-height: 1.55;
    color: var(--muted);
    max-width: 56ch;
}

.next-book-callout-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 40px;
    padding: 0 var(--s-5);
    border-radius: 10px;
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--white);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        transform 0.08s ease;
}

.next-book-callout-link:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    text-decoration: none;
}

.next-book-callout-link:active {
    transform: scale(0.98);
}

@media (min-width: 768px) {
    .next-book-callout {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: var(--s-6);
    }
}

/* ========================================
   PAGINATION
   Reusable sitewide component
======================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-3);
    margin-top: var(--s-8);
    margin-bottom: var(--s-8);
    flex-wrap: wrap;
}

.pagination-list {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination-btn,
.pagination-page {
    min-height: 38px;
    min-width: 38px;
    padding: 0 var(--s-4);
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.84rem;
    line-height: 1;
    font-weight: 700;
    text-decoration: none;
}

.pagination-btn:hover,
.pagination-page:hover {
    border-color: var(--accent-22);
    background: var(--accent-04);
    color: var(--accent);
    text-decoration: none;
}

.pagination-page.is-current {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

.pagination-ellipsis,
.pagination-status {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.pagination-status {
    padding: 0 var(--s-3);
}

.pagination-btn[aria-disabled="true"],
.pagination-btn.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

@media (max-width: 560px) {

    .pagination {
        display: none;
    }
    .pagination--compact {
        display: flex;
    }

    .pagination-btn {
        flex: 1 1 0;
        min-width: 0;
    }

    .pagination-status {
        flex: 0 0 auto;
    }
}
@media (min-width: 561px) {

    .pagination {
        display: flex;
    }

    .pagination--compact {
        display: none;
    }
}

.series-pagination--top {
    margin: 0 0 var(--s-5);
}

.series-pagination--top .pagination-list {
    display: none;
}

@media (min-width: 768px) {
    .series-pagination--top .pagination-list {
        display: inline-flex;
    }
}
/* ========================================
   BOOK CELL
   Shared book-list cell primitives
======================================== */
.book-main {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.book-main-text {
    min-width: 0;
    flex: 1 1 auto;
}

.book-title {
    display: block;
    width: 100%;
    max-width: 100%;
    color: var(--text);
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.book-title:hover {
    text-decoration: underline;
}

.book-mobile-meta {
    display: none;
    margin-top: 4px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--muted);
    flex-wrap: wrap;
    gap: 0;
}

.book-mobile-author {
    color: inherit;
    text-decoration: none;
}

.book-mobile-author:hover {
    text-decoration: underline;
}

.book-mobile-sep {
    padding: 0 6px;
    color: var(--text-subtle);
}

.book-flags {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    margin-left: auto;
}

.book-icon-btn {
    appearance: none;
    border: 0;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--white);
    font-size: 0.78rem;
    line-height: 1;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.book-series-check {
    color: #5c8f80;
    font-size: 1rem;
    line-height: 1;
    font-weight: 700;
}

.book-genre-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--accent);
    font-size: 0.74rem;
    line-height: 1;
    font-weight: 700;
}

/* ========================================
   ORGANIZE RAIL
======================================== */

.organize-rail {
    --segment-gap: 6px;
    display: inline-flex;
    align-items: center;
    gap: var(--segment-gap);
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: nowrap;
}

.organize-segment {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.organize-segment + .organize-segment::before {
    content: "";
    position: absolute;
    left: calc(var(--segment-gap) / -2);
    top: 50%;
    width: 1px;
    height: 14px;
    background: var(--border);
    transform: translate(-50%, -50%);
}

.organize-segment--status {
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    margin-right: 2px;
}

.organize-segment--lists {
    padding: 3px 6px;
    background: linear-gradient(
        180deg,
        rgba(46, 104, 116, 0.04) 0%,
        rgba(46, 104, 116, 0.08) 100%
        );
    border: 1px solid rgba(46, 104, 116, 0.12);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

.organize-segment--lists .organize-btn.is-active {
    border-color: transparent;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

.organize-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.organize-group--lists {
    gap: 5px;
}

.organize-segment--manage {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 53px;
    justify-content: flex-start;
    padding: 3px 5px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
}

.organize-segment--manage.has-visible-actions {
    background: linear-gradient(
        180deg,
        rgba(255,255,255,0.9) 0%,
        rgba(255,255,255,0.75) 100%
        );
    border-color: var(--border);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.organize-btn {
    appearance: none;
    border: 1px solid transparent;
    padding: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    font-weight: 800;
    cursor: pointer;
    opacity: 0.7;
    letter-spacing: -0.5px;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.08s ease,
        box-shadow 0.18s ease,
        opacity 0.18s ease;
}

.organize-btn:hover {
    box-shadow: inset 0 0 0 999px rgba(255,255,255,0.08);
    opacity: 0.85;
}

.organize-btn:active {
    transform: scale(0.96);
    opacity: 1;
}

.organize-btn.is-active {
    opacity: 1;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.04);
}

.organize-btn--status {
    font-size: 16px;
    font-weight: 700;
    border-color: #8a8e95;
    background: #f5f6f7;
    color: #666b73;
}

.organize-btn--status.is-active {
    background: #6f757e;
    border-color: #6f757e;
    color: var(--white);
}

.organize-btn--list1 {
    background: var(--list1-bg);
    color: var(--list1-fg);
    border-color: var(--list1-border);
}

.organize-btn--list1.is-active {
    background: var(--list1-active);
    border-color: var(--list1-active);
    color: var(--white);
}

.organize-btn--list2 {
    background: var(--list2-bg);
    color: var(--list2-fg);
    border-color: var(--list2-border);
}

.organize-btn--list2.is-active {
    background: var(--list2-active);
    border-color: var(--list2-active);
    color: var(--white);
}

.organize-btn--list3 {
    background: var(--list3-bg);
    color: var(--list3-fg);
    border-color: var(--list3-border);
}

.organize-btn--list3.is-active {
    background: var(--list3-active);
    border-color: var(--list3-active);
    color: var(--white);
}

.organize-btn--list1:hover {
    background: #c7dde1;
    border-color: rgba(0, 67, 88, 0.24);
    color: #173033;
}

.organize-btn--list1.is-active:hover {
    background: #245b64;
    border-color: #245b64;
    color: #ffffff;
}

.organize-btn--list2:hover {
    background: #e3d7c2;
    border-color: rgba(74, 67, 54, 0.24);
    color: #433c31;
}

.organize-btn--list2.is-active:hover {
    background: #a18553;
    border-color: #a18553;
    color: #ffffff;
}

.organize-btn--list3:hover {
    background: #d2ded3;
    border-color: rgba(62, 74, 63, 0.24);
    color: #374139;
}

.organize-btn--list3.is-active:hover {
    background: #7b907c;
    border-color: #7b907c;
    color: #ffffff;
}

.organize-btn--edit,
.organize-btn--delete {
    background: #f3f5f7;
    color: #66707a;
    border-color: rgba(102,112,122,0.16);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.organize-btn--delete {
    color: #9a5e56;
    border-color: rgba(154,94,86,0.14);
}

.organize-btn--edit.is-visible,
.organize-btn--delete.is-visible {
    visibility: visible;
    opacity: 0.75;
    pointer-events: auto;
}

.organize-segment--lists .organize-btn--list1,
.organize-segment--lists .organize-btn--list2,
.organize-segment--lists .organize-btn--list3 {
    border-color: transparent;
    box-shadow: none;
}

.organize-segment--lists .organize-btn + .organize-btn {
    position: relative;
}

.organize-segment--lists .organize-btn + .organize-btn::before {
    content: "";
    position: absolute;
    left: -3px;
    top: 50%;
    width: 1px;
    height: 14px;
    background: rgba(0,0,0,0.08);
    transform: translateY(-50%);
}

.edit-icon {
    transform: scaleX(-1);
}

/* ========================================
   LIST SYSTEM (CORE)
   Shared across public + member
======================================== */

.list {
    display: block;
}

.list-surface {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.list--table {
    --col-order: 48px;
    --col-author: minmax(110px, 0.75fr);
    --col-title: minmax(180px, 1.7fr);
    --col-genre: 56px;
    --col-date: 86px;
    --col-rating: 106px;
    --col-organize: minmax(190px, auto);

    --list-table-cols:
        var(--col-order)
        var(--col-author)
        var(--col-title)
        var(--col-genre)
        var(--col-date)
        var(--col-rating)
        var(--col-organize);
}

/* Header */

.list-table-head {
    display: grid;
    grid-template-columns: var(--list-table-cols);
    gap: var(--s-4);
    align-items: center;
    padding: 12px 8px;
    background: var(--table-head);
    color: var(--table-head-text);
    border-bottom: 1px solid var(--border);
}

.list-th {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.85rem;
    line-height: 1.3;
    font-weight: 700;
    text-align: left;
    padding: 0;
    cursor: pointer;
}

.list-th:hover {
    color: var(--accent);
}

.list-th.col-order {
    text-align: center;
}

.list-th.col-organize {
    cursor: default;
}

/* Rows */

.list-row {
    display: grid;
    grid-template-columns: var(--list-table-cols);
    gap: var(--s-4);
    align-items: center;
    padding: 12px 8px;
    border-top: 1px solid var(--black-05);
    transition: background-color 0.15s ease;
}

.list-row:first-child {
    border-top: none;
}

.list-row:hover {
    background: var(--accent-04);
}

.list-row:target {
    background: var(--accent-06);
    outline: 2px solid var(--accent-22);
}

/* Columns */

.col-order {
    text-align: center;
    font-weight: 700;
    color: var(--accent);
}

.col-author,
.col-date,
.col-rating,
.col-organize {
    min-width: 0;
}

.col-title {
    min-width: 0;
}

.col-author {
    font-size: 0.9rem;
    line-height: 1.35;
}

.col-genre {
    text-align: left;
}

.list-row .col-date {
    white-space: nowrap;
    font-size: 0.8rem;
    color: var(--muted);
}

.col-rating {
    white-space: nowrap;
}

.col-organize {
    justify-self: end;
}

.book-submeta {
    margin-top: 2px;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--muted);
}

.book-submeta a {
    color: var(--accent);
    font-weight: 500;
}

.book-submeta a:hover {
    text-decoration: underline;
}

/* Mobile table becomes card-like rows */

@media (max-width: 767px) {
    .list-table-head {
        display: none;
    }

    .list-row {
        grid-template-columns: max-content minmax(0, 1fr);
        grid-template-areas:
            "title title"
            "rating organize";
        column-gap: 10px;
        row-gap: 8px;
        padding: var(--s-5) var(--s-6);
    }

    .list-row .col-order,
    .list-row .col-author,
    .list-row .col-genre,
    .list-row .col-date {
        display: none;
    }

    .list-row .col-title {
        grid-area: title;
    }

    .list-row .col-rating {
        grid-area: rating;
        justify-self: start;
    }

    .list-row .col-organize {
        grid-area: organize;
        justify-self: end;
    }
}

@media (max-width: 340px) {
    .list-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "rating"
            "organize";
    }

    .list-row .col-organize {
        justify-self: start;
    }
}
.list-th.col-organize {
    text-align: left;
    justify-self: start;
}

/* ========================================
   LIST COLUMN MODIFIERS (GENERIC)
======================================== */

/* Default list: order, title, date, rating */
.list--cols-default {
    --list-table-cols:
        var(--col-order)
        var(--col-title)
        var(--col-date)
        var(--col-rating);
}

/* Add author */
.list--with-author {
    --col-author: minmax(120px, 0.85fr);

    --list-table-cols:
        var(--col-order)
        var(--col-author)
        var(--col-title)
        var(--col-date)
        var(--col-rating);
}

/* Add genre */
.list--with-genre {
    --list-table-cols:
        var(--col-order)
        var(--col-title)
        var(--col-genre)
        var(--col-date)
        var(--col-rating);
}

/* Add author + genre */
.list--with-author.list--with-genre {
    --col-author: minmax(120px, 0.85fr);

    --list-table-cols:
        var(--col-order)
        var(--col-author)
        var(--col-title)
        var(--col-genre)
        var(--col-date)
        var(--col-rating);
}

/* Add organize/actions */
.list--with-organize {
    --list-table-cols:
        var(--col-order)
        var(--col-title)
        var(--col-date)
        var(--col-rating)
        var(--col-organize);
}

/* Author + organize */
.list--with-author.list--with-organize {
    --col-author: minmax(120px, 0.85fr);

    --list-table-cols:
        var(--col-order)
        var(--col-author)
        var(--col-title)
        var(--col-date)
        var(--col-rating)
        var(--col-organize);
}

/* Genre + organize */
.list--with-genre.list--with-organize {
    --list-table-cols:
        var(--col-order)
        var(--col-title)
        var(--col-genre)
        var(--col-date)
        var(--col-rating)
        var(--col-organize);
}

/* Author + genre + organize */
.list--with-author.list--with-genre.list--with-organize {
    --col-author: minmax(120px, 0.85fr);

    --list-table-cols:
        var(--col-order)
        var(--col-author)
        var(--col-title)
        var(--col-genre)
        var(--col-date)
        var(--col-rating)
        var(--col-organize);
}

/* Remove order column */
.list--no-order {
    --list-table-cols:
        var(--col-title)
        var(--col-date)
        var(--col-rating);
}

.list--no-order.list--with-author {
    --list-table-cols:
        var(--col-author)
        var(--col-title)
        var(--col-date)
        var(--col-rating);
}

.list--no-order.list--with-genre {
    --list-table-cols:
        var(--col-title)
        var(--col-genre)
        var(--col-date)
        var(--col-rating);
}

.list--no-order.list--with-author.list--with-genre {
    --list-table-cols:
        var(--col-author)
        var(--col-title)
        var(--col-genre)
        var(--col-date)
        var(--col-rating);
}

.list--no-order.list--with-organize {
    --list-table-cols:
        var(--col-title)
        var(--col-date)
        var(--col-rating)
        var(--col-organize);
}

.list--no-order.list--with-author.list--with-organize {
    --list-table-cols:
        var(--col-author)
        var(--col-title)
        var(--col-date)
        var(--col-rating)
        var(--col-organize);
}

.list--no-order.list--with-genre.list--with-organize {
    --list-table-cols:
        var(--col-title)
        var(--col-genre)
        var(--col-date)
        var(--col-rating)
        var(--col-organize);
}

.list--no-order.list--with-author.list--with-genre.list--with-organize {
    --list-table-cols:
        var(--col-author)
        var(--col-title)
        var(--col-genre)
        var(--col-date)
        var(--col-rating)
        var(--col-organize);
}

.list--no-rating .col-rating,
.list--no-rating .list-th.col-rating {
    display: none;
}

/* ========================================
   PUBLIC BOOK LIST TABLE
======================================== */

.list--public {
    --col-order: 56px;
    --col-title: minmax(0, 1fr);
    --col-date: 88px;
    --col-rating: 96px;
}

.public-list-header {
    padding: 0 var(--tight-gap);
    margin-bottom: var(--s-4);
}

.public-list-header h2 {
    margin: 0;
}

.public-list-header h2 span {
    color: var(--muted);
    font-weight: 600;
}

.list--public .book-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    min-width: 0;
}

.list--public .book-main-text {
    min-width: 0;
}

.list--public .book-title {
    font-size: 0.98rem;
    line-height: 1.3;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.list--public .book-title:hover {
    color: var(--accent);
    text-decoration: underline;
}

.list--public .book-mobile-meta {
    display: none;
}

.list--public .book-icon-btn {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    color: var(--accent);
    font-size: 0.78rem;
    line-height: 1;
    font-weight: 800;
    cursor: pointer;
}

.list--public .book-icon-btn:hover {
    border-color: var(--accent-22);
    background: var(--accent-04);
}

.list--public .col-rating {
    display: flex;
    align-items: center;
}

@media (max-width: 767px) {
    .list--public .list-row {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        grid-template-areas:
            "order title date";
        column-gap: var(--s-3);
        row-gap: 2px;
        padding: var(--s-4) var(--s-5);
        align-items: baseline;
    }

    .list--public .col-order {
        grid-area: order;
        display: block;
        text-align: left;
    }

    .list--public .col-title {
        grid-area: title;
        min-width: 0;
    }

    .list--public .col-date {
        grid-area: date;
        display: block;
        justify-self: end;
        white-space: nowrap;
        font-size: 0.76rem;
        color: var(--muted);
    }

    .list--public .col-author,
    .list--public .col-genre,
    .list--public .col-rating,
    .list--public .col-organize {
        display: none;
    }

    .list--public .book-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .list--public .book-mobile-meta {
        display: flex;
        margin-top: 2px;
        font-size: 0.76rem;
        line-height: 1.3;
        color: var(--muted);
    }

    .list--public.list--no-order .list-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "title date";
    }

    .list--public.list--no-order .col-title {
        grid-area: title;
    }

    .list--public.list--no-order .col-date {
        grid-area: date;
    }

}
/* ========================================
   MEMBER BOOK LIST TABLE
======================================== */

.list--member {
    --col-order: 48px;
    --col-author: minmax(110px, 0.75fr);
    --col-title: minmax(180px, 1.7fr);
    --col-genre: 56px;
    --col-date: 86px;
    --col-rating: 106px;
    --col-organize: minmax(190px, auto);
}

/* ========================================
   READING ORDER BADGES
======================================== */

.reading-order-badge {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-2);

    font-size: 0.88rem;
    line-height: 1.35;
    font-weight: 600;
}

.reading-order-badge-icon {
    font-size: 1rem;
    line-height: 1;
}

.reading-order-badge-label {
    font-weight: 700;
}

.reading-order-badge-text {
    font-weight: 500;
}

/* Hero version */
.reading-order-badge--hero {
    color: var(--white-92);
}

.reading-order-badge--hero .reading-order-badge-label {
    color: var(--white);
}

.reading-order-badge--hero .reading-order-badge-text {
    color: var(--white-82);
}

/* Section version */
.reading-order-badge--section {
    padding: var(--s-3) var(--s-4);
    margin-bottom: var(--s-4);
    border-radius: 8px;
    background: var(--accent-04);
    color: var(--text);
}

.reading-order-badge--section .reading-order-badge-text {
    color: var(--muted);
}

.reading-order-badge--section .reading-order-badge-label {
    font-weight: 700;
}

.reading-order-badge--section .reading-order-badge-text {
    color: var(--muted);
}

/* ========================================
   RELATED SERIES
======================================== */

.related-series-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-5);
    margin-top: var(--s-5);
}

.related-series-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 190px;
    padding: var(--s-4);
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--surface-radius-sm);
    background: var(--card);
}

.related-series-cover {
    width: 72px;
    margin: 0 auto var(--s-3);
}

.related-series-cover img {
    width: 72px;
    height: 108px;
    object-fit: cover;
    border-radius: var(--cover-radius);
}

.related-series-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.related-series-title {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.25;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(0.86rem * 1.25 * 2);
}

.related-series-author {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.3;
    color: var(--muted);

    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-series-cta {
    display: inline-block;
    margin-top: var(--s-6);
}

@media (min-width: 768px) {
    .related-series-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .related-series-link {
        display: grid;
        grid-template-columns: 72px minmax(0, 1fr);
        gap: var(--s-5);
        align-items: center;
        min-height: 0;
        text-align: left;
    }

    .related-series-cover {
        margin: 0;
    }

    .related-series-title {
        min-height: 0;
    }
}

/* ========================================
   SIDEBAR LINK LIST
======================================== */

.sidebar-section {
    /* inherits .section styling */
}

.sidebar-link-list {
    list-style: none;
    margin: var(--s-4) 0 0;
    padding: 0;
}

.sidebar-link-list li {
    margin: 0;
    padding: 0;
}

.sidebar-link-list a {
    display: block;
    padding: var(--s-3) 0;

    font-size: 0.9rem;
    line-height: 1.3;

    color: var(--text);
    text-decoration: none;

    border-bottom: 1px solid var(--border);
}

.sidebar-link-list li:last-child a {
    border-bottom: none;
}

.sidebar-link-list a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ========================================
   SIDEBAR META LIST
======================================== */

.meta-list {
    margin-top: var(--s-4);
}

.meta-row {
    display: grid;
    grid-template-columns: minmax(92px, 0.85fr) minmax(0, 1.15fr);
    gap: var(--s-4);

    padding: var(--s-3) 0;
    border-bottom: 1px solid var(--border);
}

.meta-row:last-child {
    border-bottom: none;
}

.meta-label {
    font-size: 0.76rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    color: var(--muted);
}

.meta-value {
    min-width: 0;
    font-size: 0.88rem;
    line-height: 1.35;
    font-weight: 500;
    color: var(--text);
    text-align: right;
}

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

.meta-value a:hover {
    color: var(--accent);
    text-decoration: underline;
}

@media (max-width: 767px) {
    .meta-row {
        grid-template-columns: 1fr;
        gap: var(--s-1);
    }

    .meta-value {
        text-align: left;
    }
}
.page-book .sidebar .meta-row {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: var(--s-4);
}


/* ========================================
   TAG GROUPS
======================================== */

.tag-section {
    margin-top: var(--section-gap);
}

.tag-group + .tag-group {
    margin-top: var(--s-8);
}

.tag-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 var(--s-4);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
}

.tag-list a,
.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.82rem;
    line-height: 1.2;
    color: var(--text);
    background: var(--chip-bg);
    border-radius: var(--chip-radius);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.tag-list a:hover,
.tag-chip:hover {
    background: var(--accent-10);
    color: var(--accent);
}

.tag-list a:focus-visible,
.tag-chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--focus-18);
}

/* ========================================
   CONNECT / ACTIONS
======================================== */

.connect-actions {
    display: flex;
    flex-direction: column;
    gap: var(--s-6);
}

/* group item */
.connect-item {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

/* button style */
.connect-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: var(--control-height);

    padding: 0 var(--s-8);

    font-size: 0.9rem;
    font-weight: 500;

    color: var(--accent);
    background: var(--accent-04);

    border: 1px solid var(--accent-12);
    border-radius: var(--surface-radius-sm);

    text-decoration: none;
    cursor: pointer;

    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* hover */
.connect-btn:hover {
    background: var(--accent-08);
    border-color: var(--accent-22);
    color: var(--accent-hover);
}

/* focus */
.connect-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--focus-18);
}

/* note under button */
.connect-note {
    font-size: 0.75rem;
    color: var(--muted);
}

#share-btn {
    background: transparent;
    border-style: dashed;
}

/* ========================================
   SHARE MODAL
======================================== */

.share-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.share-modal[hidden] {
    display: none !important;
}

.share-modal-inner {
    background: var(--card);
    border-radius: var(--radius);
    padding: var(--s-10);
    width: min(90%, 360px);
    box-shadow: var(--shadow-strong);
    text-align: center;
}

.share-title {
    margin: 0;
    font-size: 1rem;
}

.share-actions {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    margin-top: var(--s-8);
}

.share-link,
.share-link-copy {
    display: block;
    width: 100%;
    text-align: center;
    padding: var(--s-6);
    border-radius: var(--surface-radius-sm);
    background: var(--accent-04);
    border: 1px solid var(--accent-12);
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.share-link:hover,
.share-link-copy:hover {
    background: var(--accent-08);
    border-color: var(--accent-22);
}

.share-close {
    margin-top: var(--s-8);
    background: none;
    border: none;
    font-size: 0.8rem;
    color: var(--muted);
    cursor: pointer;
}

.series-block-title a {
    color: var(--accent);
    text-decoration: none;
}

.series-block-title a:hover {
    text-decoration: underline;
}

.series-block {
    padding: var(--s-5) 0 var(--s-6);
    border-bottom: 1px solid var(--border);
}

.series-block:first-of-type {
    padding-top: 0;
}

.series-block:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.author-bio {
    font-size: 0.97rem;
    line-height: 1.7;
    color: var(--text);
}

.author-bio p + p {
    margin-top: var(--content-gap);
}

.award-book-meta-list {
    display: grid;
    gap: 4px;
    margin-top: 2px;
}

.reading-order-note {
    max-width: 62ch;
    margin-top: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--surface-radius-sm);
    background: var(--white-10);
    border: 1px solid var(--white-16);
    color: var(--white-88);
    font-size: 0.9rem;
    line-height: 1.45;
}

.reading-order-note strong {
    color: var(--white);
    font-weight: 700;
    margin-right: 4px;
}

.reading-order-note span {
    color: var(--white-82);
}

.genre-short {
    display: none;
}

@media (max-width: 767px) {
    .genre-full {
        display: none;
    }

    .genre-short {
        display: inline;
    }
}

.book-description {
    font-size: 0.97rem;
    line-height: 1.72;
    color: var(--text);
}

.book-description br + br {
    display: block;
    content: "";
    margin-top: var(--content-gap);
}

.editions-section .section-intro {
    margin-bottom: var(--s-6);
}

.edition-cover-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(132px, 150px);
    gap: var(--s-5);

    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;

    padding-bottom: var(--s-4);
}

.edition-card {
    scroll-snap-align: start;

    display: grid;
    gap: var(--s-4);

    min-width: 0;
    padding: var(--s-4);

    border: 1px solid var(--border);
    border-radius: var(--surface-radius-sm);
    background: var(--card);
}

.edition-cover {
    width: 100%;
    aspect-ratio: 2 / 3;

    display: flex;
    align-items: end;
    justify-content: center;

    overflow: hidden;
    border-radius: var(--cover-radius);
    background: var(--surface-subtle);
}

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

.edition-card-body {
    display: grid;
    gap: var(--s-2);
}

.edition-card-title {
    font-size: 0.88rem;
    line-height: 1.25;
    font-weight: 700;
    color: var(--text);
}

.edition-card-meta {
    display: grid;
    gap: 2px;

    font-size: 0.76rem;
    line-height: 1.35;
    color: var(--muted);
}

.edition-badge {
    color: var(--accent);
    font-weight: 700;
}

.edition-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 34px;
    margin-top: var(--s-2);
    padding: 0 var(--s-4);

    border-radius: var(--surface-radius-sm);
    border: 1px solid var(--accent-18);
    background: var(--accent-04);

    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.edition-buy:hover {
    background: var(--accent-08);
    border-color: var(--accent-22);
    text-decoration: none;
}

/* Cover container */
.edition-cover {
    width: 100%;
    aspect-ratio: 2 / 3;

    display: flex;
    align-items: end;
    justify-content: center;

    overflow: hidden;
    border-radius: var(--cover-radius);

    /* 👇 placeholder background */
    background: var(--surface-subtle);
}

/* Image */
.edition-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;

    /* 👇 smooth fade-in */
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* When loaded */
.edition-cover-img[src] {
    opacity: 1;
}

/* Horizontal edition rail polish */
.edition-cover-rail {
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-22) transparent;
}

.edition-cover-rail::-webkit-scrollbar {
    height: 8px;
}

.edition-cover-rail::-webkit-scrollbar-track {
    background: transparent;
}

.edition-cover-rail::-webkit-scrollbar-thumb {
    background: var(--accent-18);
    border-radius: 999px;
}

.edition-cover-rail::-webkit-scrollbar-thumb:hover {
    background: var(--accent-22);
}

/* Subtle scroll hint */
.edition-group {
    position: relative;
}

@media (min-width: 992px) {
    .edition-group::after {
        width: 44px;
    }
}

.meta-title {
    display: block;
    line-height: 1.35;
}

.meta-subvalue {
    display: block;
    margin-top: 2px;
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--muted);
    font-weight: 500;
}

/* ========================================
   GENRE CHIPS
======================================== */

.genre-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-4);
}

.genre-chip-list a,
.genre-chip-list .genre-chip {
    display: inline-flex;
    align-items: center;
    padding: var(--s-4) var(--s-5);
    border-radius: var(--chip-radius);
    background: var(--chip-bg);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

.genre-chip-list a:hover {
    text-decoration: none;
    background: var(--accent-04);
}

.genre-chip-list .genre-chip.is-active {
    background: var(--accent);
    color: var(--white);
    font-weight: 700;
}

/* ========================================
   AUTOSUGGEST
======================================== */

.search-shell {
    position: relative;
}

.autosuggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 50;

    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-strong);

    overflow: hidden;
    display: none;
}

.autosuggest.is-open {
    display: block;
}

.autosuggest-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: min(70vh, 520px);
    overflow-y: auto;
}

.autosuggest-item {
    border-bottom: 1px solid var(--border);
}

.autosuggest-item:last-child {
    border-bottom: 0;
}

.autosuggest-link {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;

    padding: 12px 14px;

    text-decoration: none;
    color: var(--text);
    background: var(--card);
}

.autosuggest-link:hover,
.autosuggest-link.is-active {
    background: #f7fafb;
}

.ac-thumb {
    width: 40px;
    height: 52px;

    border-radius: 8px;
    border: 1px solid var(--border);

    background: var(--paper);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 0.72rem;
    font-weight: 700;

    color: var(--muted);

    overflow: hidden;
}

.ac-thumb.is-author {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #eef6ea;
    color: #2f6b3d;
}

.ac-thumb.is-series {
    background: var(--accent-04);
    color: var(--accent);
}

.ac-thumb.is-anthology {
    background: #f3eefc;
    color: #6a4fb3;
}

.ac-thumb.is-book {
    background: #f3f4f6;
    color: #4b5563;
}

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

.ac-title {
    display: block;

    font-size: 0.96rem;
    font-weight: 600;
    line-height: 1.25;

    color: var(--text);

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-meta {
    display: block;
    margin-top: 3px;

    font-size: 0.84rem;
    line-height: 1.35;

    color: var(--muted);

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-type {
    display: inline-flex;
    align-items: center;

    min-height: 24px;
    padding: 0 8px;

    border-radius: 999px;

    background: var(--accent-04);
    color: var(--accent);

    font-size: 0.72rem;
    font-weight: 700;

    white-space: nowrap;
}

.ac-type.is-book {
    background: #f3f4f6;
    color: #4b5563;
}

.ac-type.is-author {
    background: #eef6ea;
    color: #2f6b3d;
}

.ac-type.is-anthology {
    background: #f3eefc;
    color: #6a4fb3;
}

.ac-thumb svg {
    width: 18px;
    height: 18px;

    display: block;

    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;

    flex: 0 0 auto;
}

@media (max-width: 767px) {

    .autosuggest-link {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 11px 12px;
    }

    .ac-thumb {
        width: 36px;
        height: 48px;
    }

    .ac-type {
        font-size: 0.68rem;
        padding: 0 7px;
    }
}

.desktop-search.search-shell,
.desktop-search .autosuggest-form,
.desktop-search .search-field {
    width: 100%;
}

.desktop-search .search-input {
    color-scheme: dark;
}

.home-hero-search .search-field {
    position: relative;
    min-width: 0;
}

.home-hero-search .autosuggest-input {
    width: 100%;
}

.home-hero-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
}

.home-hero-search {
    width: min(100%, 760px);
    margin: var(--s-8) auto 0;
}

.home-hero-search .search-input {
    min-height: 58px;
    font-size: 1.05rem;
    padding-left: 48px;
}

.home-hero-search .search-icon {
    left: 16px;
}

.hero--home,
.home-hero-content,
.home-hero-search.search-shell {
    position: relative;
    z-index: 20;
}

.autosuggest {
    z-index: 2000;
}

.hero--home {
    overflow: visible;
}

.home-hero-search .search-input {
    background: #ffffff;
    color: var(--text);

    border: 1px solid rgba(0, 67, 88, 0.14);

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.12),
        0 1px 0 rgba(255,255,255,0.9) inset;
}

.home-hero-search .search-input::placeholder {
    color: var(--text-muted);
}

.home-hero-search .search-icon {
    stroke: var(--text-muted);
}

.home-hero-search .search-input:hover {
    border-color: rgba(0, 67, 88, 0.22);
    background: #ffffff;
}

.home-hero-search .search-input:focus-visible {
    background: #ffffff;
    border-color: var(--focus);

    box-shadow:
        0 0 0 3px var(--focus-18),
        0 12px 30px rgba(0, 0, 0, 0.12);
}

/* ========================================
   DISCOVERY CARD SYSTEM
   Shared visual browsing grids
======================================== */

.discovery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-5);
}

.discovery-card {
    display: grid;
    gap: var(--s-4);

    min-width: 0;
    padding: var(--s-4);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--card);

    text-decoration: none;

    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        transform 0.08s ease;
}

.discovery-card:hover {
    border-color: var(--accent-22);
    background: var(--accent-04);
    text-decoration: none;
}

.discovery-card:active {
    transform: scale(0.995);
}

.discovery-card .media-slot {
    margin-inline: auto;
}

.discovery-body {
    display: grid;
    gap: 2px;

    min-width: 0;

    text-align: center;
}

.discovery-title {
    font-size: 0.9rem;
    line-height: 1.3;
    font-weight: 700;

    color: var(--text);

    overflow-wrap: anywhere;
}

.discovery-meta {
    font-size: 0.78rem;
    line-height: 1.35;

    color: var(--muted);
}

/* Tablet */
@media (min-width: 768px) {

    .discovery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--s-6);
    }
}

/* Desktop */
@media (min-width: 1200px) {

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

/* Mobile: list-first */
@media (max-width: 640px) {

    .discovery-grid {
        grid-template-columns: 1fr;
        gap: var(--s-3);
    }

    .discovery-card {
        grid-template-columns: 72px minmax(0, 1fr);
        align-items: center;
        gap: var(--s-4);

        padding: var(--s-4);
    }

    .discovery-card .media-slot {
        margin: 0;
    }

    .discovery-card .media-slot--cover,
    .discovery-card .media-slot--cover img,
    .discovery-card .media-slot--cover .media-fallback {
        width: 72px;
    }

    .discovery-body {
        text-align: left;
    }

    .discovery-title {
        font-size: 0.96rem;
    }

    .discovery-meta {
        font-size: 0.8rem;
    }
}
#top-series,
#top-authors,
#top-books,
#related-genres,
#about-genre {
    scroll-margin-top: 100px;
}

#major-awards,
#browse-genres,
#browse-years,
#about-awards {
    scroll-margin-top: 100px;
}