:root,
html[data-theme="light"] {
    color-scheme: light;
    --page-bg: #f2eadc;
    --page-text: #1c1917;
    --backdrop: radial-gradient(circle at top left, rgba(166, 124, 82, .24), transparent 34%), linear-gradient(120deg, rgba(255, 255, 255, .56), transparent 42%);
    --header-bg: rgba(255, 249, 239, .92);
    --header-border: rgba(69, 26, 3, .12);
    --title: #1c1917;
    --subtitle: #57534e;
    --kicker: #92400e;
    --toggle-bg: #ffffff;
    --toggle-text: #292524;
    --toggle-border: rgba(120, 53, 15, .22);
    --catalog-bg: rgba(255, 253, 247, .96);
    --catalog-border: rgba(69, 26, 3, .13);
    --catalog-head-bg: linear-gradient(90deg, #f1d7a7, #fff4da);
    --catalog-head-text: #2f1b0c;
    --catalog-kicker: #92400e;
    --summary-bg: rgba(120, 53, 15, .1);
    --summary-text: #3f250f;
    --pagination-bg: #fffaf0;
    --pagination-text: #78350f;
    --pagination-border: rgba(69, 26, 3, .18);
    --pagination-active-bg: #78350f;
    --pagination-active-text: #fff7ed;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --page-bg: #16120f;
    --page-text: #f5f5f4;
    --backdrop: radial-gradient(circle at top left, rgba(180, 128, 72, .16), transparent 36%), linear-gradient(120deg, rgba(255, 255, 255, .04), transparent 44%);
    --header-bg: rgba(33, 26, 21, .92);
    --header-border: rgba(254, 243, 199, .1);
    --title: #fafaf9;
    --subtitle: #d6d3d1;
    --kicker: #fcd34d;
    --toggle-bg: #1c1917;
    --toggle-text: #f5f5f4;
    --toggle-border: rgba(254, 243, 199, .16);
    --catalog-bg: rgba(37, 29, 23, .95);
    --catalog-border: rgba(254, 243, 199, .11);
    --catalog-head-bg: linear-gradient(90deg, #7c2d12, #1c1917);
    --catalog-head-text: #fffbeb;
    --catalog-kicker: #fde68a;
    --summary-bg: rgba(254, 243, 199, .14);
    --summary-text: #fffbeb;
    --pagination-bg: #1c1917;
    --pagination-text: #fcd34d;
    --pagination-border: rgba(254, 243, 199, .16);
    --pagination-active-bg: #fcd34d;
    --pagination-active-text: #1c1917;
}

* {
    box-sizing: border-box;
}

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-body {
    background: var(--page-bg);
    color: var(--page-text);
}

.site-backdrop {
    background: var(--backdrop);
}

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

.site-title {
    color: var(--title);
}

.site-subtitle {
    color: var(--subtitle);
}

.site-kicker {
    color: var(--kicker);
}

.theme-toggle {
    border: 1px solid var(--toggle-border);
    background: var(--toggle-bg);
    color: var(--toggle-text);
}

.catalog-panel {
    border: 1px solid var(--catalog-border);
    background: var(--catalog-bg);
    box-shadow: 0 22px 48px rgba(75, 46, 23, .12);
}

html[data-theme="dark"] .catalog-panel {
    box-shadow: 0 22px 48px rgba(0, 0, 0, .24);
}

.catalog-panel-head {
    border-bottom: 1px solid var(--catalog-border);
    background: var(--catalog-head-bg);
    color: var(--catalog-head-text);
}

.catalog-kicker {
    color: var(--catalog-kicker);
}

.summary-pill {
    background: var(--summary-bg);
    color: var(--summary-text);
}

.theme-loading * {
    transition: none !important;
}

.bookstore-mark {
    box-shadow: inset 4px 0 0 rgba(255, 255, 255, .22), inset -8px 0 0 rgba(0, 0, 0, .14), 0 16px 32px rgba(82, 48, 20, .18);
}

.mode-dot {
    display: inline-block;
    width: .65rem;
    height: .65rem;
    border-radius: 999px;
    background: rgb(180 83 9);
    box-shadow: 0 0 0 4px rgba(180, 83, 9, .14);
}

html[data-theme="dark"] .mode-dot {
    background: rgb(252 211 77);
    box-shadow: 0 0 0 4px rgba(252, 211, 77, .14);
}

.filter-label {
    display: block;
    margin-bottom: .5rem;
    color: rgb(120 53 15);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .18em;
    text-transform: uppercase;
}

html[data-theme="dark"] .filter-label {
    color: rgb(252 211 77);
}

.book-input {
    width: 100%;
    height: 3rem;
    border: 1px solid rgba(69, 26, 3, .16);
    border-radius: .375rem;
    background: rgb(255 255 255);
    color: rgb(28 25 23);
    font-size: .875rem;
    font-weight: 700;
    outline: none;
    padding: 0 .875rem;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.book-input:focus {
    border-color: rgb(146 64 14);
    box-shadow: 0 0 0 4px rgba(146, 64, 14, .15);
}

html[data-theme="dark"] .book-input {
    border-color: rgba(254, 243, 199, .16);
    background: rgb(12 10 9);
    color: rgb(250 250 249);
}

html[data-theme="dark"] .book-input:focus {
    border-color: rgb(252 211 77);
    box-shadow: 0 0 0 4px rgba(252, 211, 77, .14);
}

.book-grid {
    display: grid;
    gap: 1.15rem;
    grid-template-columns: repeat(auto-fill, minmax(205px, 225px));
    justify-content: center;
    opacity: 1;
    transition: opacity .16s ease;
}

.book-grid.loading {
    opacity: .42;
}

.book-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(69, 26, 3, .12);
    border-radius: .5rem;
    background: rgba(255, 253, 247, .96);
    box-shadow: 0 18px 34px rgba(75, 46, 23, .11);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.book-card::after {
    content: "";
    position: absolute;
    inset: auto .8rem 0;
    height: .45rem;
    border-radius: .45rem .45rem 0 0;
    background: linear-gradient(90deg, rgba(120, 53, 15, .2), rgba(180, 83, 9, .34), rgba(120, 53, 15, .2));
}

.book-card:hover {
    transform: translateY(-4px);
    border-color: rgba(146, 64, 14, .32);
    box-shadow: 0 24px 46px rgba(75, 46, 23, .18);
}

html[data-theme="dark"] .book-card {
    border-color: rgba(254, 243, 199, .11);
    background: rgba(35, 28, 22, .94);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .34);
}

html[data-theme="dark"] .book-card:hover {
    border-color: rgba(252, 211, 77, .34);
}

.book-cover {
    position: relative;
    display: flex;
    height: 350px;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .18), transparent 18%),
        linear-gradient(135deg, #d7c3a4, #f7eddc);
}

.book-cover-frame {
    position: relative;
}

.cover-unavailable-badge {
    position: absolute;
    right: .65rem;
    bottom: .65rem;
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: .35rem;
    background: rgba(153, 27, 27, .92);
    color: white;
    box-shadow: 0 10px 22px rgba(41, 21, 8, .26);
    font-size: .68rem;
    font-weight: 900;
    line-height: 1;
    padding: .42rem .55rem;
    text-transform: uppercase;
}

html[data-theme="dark"] .cover-unavailable-badge {
    border-color: rgba(255, 255, 255, .24);
    background: rgba(185, 28, 28, .9);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .34);
}

.book-cover::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 12px;
    background: linear-gradient(90deg, rgba(55, 30, 12, .18), transparent);
    z-index: 1;
}

html[data-theme="dark"] .book-cover {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .08), transparent 18%),
        linear-gradient(135deg, #3a2c22, #1e1814);
}

.book-cover img {
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    object-position: top center;
    transition: transform .22s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.035);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: white;
    font-size: .68rem;
    font-weight: 900;
    line-height: 1;
    padding: .36rem .5rem;
    text-decoration: none;
}

.status-pill.available {
    background: rgb(20 108 83);
}

.status-pill.sold {
    background: rgb(154 83 28);
}

.status-pill.missing {
    background: rgb(153 27 27);
}

.status-pill.muted {
    background: rgb(245 239 228);
    color: rgb(87 83 78);
}

html[data-theme="dark"] .status-pill.muted {
    background: rgba(255, 255, 255, .1);
    color: rgb(214 211 209);
}

.keyword-chip {
    display: inline-block;
    max-width: 100px;
    overflow: hidden;
    border: 1px solid rgba(120, 53, 15, .14);
    border-radius: 999px;
    background: rgba(245, 239, 228, .82);
    color: rgb(87 83 78);
    font-size: .68rem;
    font-weight: 800;
    line-height: 1;
    padding: .32rem .48rem;
    text-overflow: ellipsis;
    text-decoration: none;
    vertical-align: top;
    white-space: nowrap;
}

.keyword-chip:hover,
.catalog-meta-link:hover,
.catalog-inline-link:hover {
    color: rgb(120 53 15);
    text-decoration: underline;
    text-underline-offset: .16rem;
}

html[data-theme="dark"] .keyword-chip {
    border-color: rgba(254, 243, 199, .12);
    background: rgba(255, 255, 255, .08);
    color: rgb(214 211 209);
}

html[data-theme="dark"] .keyword-chip:hover,
html[data-theme="dark"] .catalog-meta-link:hover,
html[data-theme="dark"] .catalog-inline-link:hover {
    color: rgb(252 211 77);
}

.catalog-meta-link,
.catalog-inline-link {
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
}

.gallery-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .48);
    border-radius: 999px;
    background: rgba(255, 255, 255, .64);
    color: rgb(69 26 3);
    box-shadow: 0 10px 24px rgba(41, 21, 8, .22);
    transition: background-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.gallery-button:hover {
    background: rgba(255, 255, 255, .86);
    color: rgb(120 53 15);
    box-shadow: 0 14px 30px rgba(41, 21, 8, .28);
    transform: translateY(-1px);
}

html[data-theme="dark"] .gallery-button {
    border-color: rgba(255, 255, 255, .22);
    background: rgba(28, 25, 23, .58);
    color: rgb(245 245 244);
}

html[data-theme="dark"] .gallery-button:hover {
    background: rgba(28, 25, 23, .82);
    color: rgb(252 211 77);
}

.gallery-button svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.gallery-float-button {
    position: absolute;
    top: .65rem;
    right: .65rem;
    z-index: 4;
    width: 2.35rem;
    height: 2.35rem;
    backdrop-filter: blur(10px);
}

.detail-gallery-button {
    top: .85rem;
    right: .85rem;
    width: 2.75rem;
    height: 2.75rem;
}

.gallery-open {
    overflow: hidden;
}

.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.gallery-modal.hidden {
    display: none;
}

.gallery-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(28, 25, 23, .72);
    backdrop-filter: blur(4px);
}

.gallery-panel {
    position: relative;
    display: flex;
    width: min(1040px, 100%);
    max-height: min(860px, calc(100vh - 2rem));
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(254, 243, 199, .18);
    border-radius: .5rem;
    background: rgb(255 253 247);
    box-shadow: 0 32px 80px rgba(0, 0, 0, .34);
}

html[data-theme="dark"] .gallery-panel {
    background: rgb(28 25 23);
}

.gallery-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid rgba(120, 53, 15, .14);
    padding: .9rem 1rem;
}

html[data-theme="dark"] .gallery-head {
    border-bottom-color: rgba(254, 243, 199, .12);
}

.gallery-head h2 {
    color: rgb(28 25 23);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.25;
}

html[data-theme="dark"] .gallery-head h2 {
    color: rgb(250 250 249);
}

.gallery-close {
    border-radius: 999px;
    background: rgb(120 53 15);
    color: rgb(255 247 237);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .12em;
    padding: .55rem .8rem;
    text-transform: uppercase;
}

html[data-theme="dark"] .gallery-close {
    background: rgb(252 211 77);
    color: rgb(28 25 23);
}

.gallery-body {
    display: grid;
    min-height: 0;
    grid-template-columns: 116px minmax(0, 1fr);
}

.gallery-thumbs {
    display: flex;
    max-height: calc(100vh - 9rem);
    flex-direction: column;
    gap: .65rem;
    overflow-y: auto;
    border-right: 1px solid rgba(120, 53, 15, .14);
    background: rgba(245, 239, 228, .72);
    padding: .75rem;
}

html[data-theme="dark"] .gallery-thumbs {
    border-right-color: rgba(254, 243, 199, .12);
    background: rgba(12, 10, 9, .58);
}

.gallery-thumb {
    display: flex;
    aspect-ratio: 2 / 3;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: .35rem;
    background: rgb(255 251 235);
    padding: .2rem;
}

.gallery-thumb.active {
    border-color: rgb(217 119 6);
}

html[data-theme="dark"] .gallery-thumb {
    background: rgb(12 10 9);
}

html[data-theme="dark"] .gallery-thumb.active {
    border-color: rgb(252 211 77);
}

.gallery-thumb img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.gallery-full-wrap {
    display: flex;
    min-height: 0;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .24), transparent 18%),
        linear-gradient(135deg, #d7c3a4, #fff8ea);
    padding: 1rem;
}

html[data-theme="dark"] .gallery-full-wrap {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .08), transparent 18%),
        linear-gradient(135deg, #3a2c22, #15110e);
}

.gallery-full-image {
    max-height: calc(100vh - 10rem);
    max-width: 100%;
    object-fit: contain;
}

.back-link {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: rgb(120 53 15);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

html[data-theme="dark"] .back-link {
    color: rgb(252 211 77);
}

.detail-shell {
    display: grid;
    grid-template-columns: minmax(280px, 430px) minmax(0, 1fr);
    gap: 2rem;
    border: 1px solid var(--catalog-border);
    border-radius: .5rem;
    background: var(--catalog-bg);
    box-shadow: 0 22px 48px rgba(75, 46, 23, .12);
    padding: 1.25rem;
}

.detail-gallery {
    min-width: 0;
}

.detail-cover-frame {
    position: relative;
    display: flex;
    min-height: 420px;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    border-radius: .45rem;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .18), transparent 18%),
        linear-gradient(135deg, #d7c3a4, #f7eddc);
}

.detail-image-missing {
    align-self: center;
    color: rgb(120 53 15);
    font-size: .8rem;
    font-weight: 950;
    letter-spacing: .14em;
    text-transform: uppercase;
}

html[data-theme="dark"] .detail-cover-frame {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .08), transparent 18%),
        linear-gradient(135deg, #3a2c22, #1e1814);
}

html[data-theme="dark"] .detail-image-missing {
    color: rgb(252 211 77);
}

.detail-cover-image {
    width: 100%;
    height: auto;
    max-height: 620px;
    object-fit: contain;
    object-position: top center;
}

.detail-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: .6rem;
    margin-top: .8rem;
}

.detail-thumb-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 88px;
    border: 2px solid rgba(120, 53, 15, .14);
    border-radius: .35rem;
    background: rgba(255, 251, 235, .74);
    padding: .25rem;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.detail-thumb-button:hover,
.detail-thumb-button.active {
    border-color: rgb(217 119 6);
    box-shadow: 0 10px 22px rgba(75, 46, 23, .16);
    transform: translateY(-1px);
}

.detail-thumb-button img {
    width: 100%;
    max-height: 110px;
    object-fit: contain;
}

html[data-theme="dark"] .detail-thumb-button {
    border-color: rgba(254, 243, 199, .12);
    background: rgba(12, 10, 9, .48);
}

html[data-theme="dark"] .detail-thumb-button:hover,
html[data-theme="dark"] .detail-thumb-button.active {
    border-color: rgb(252 211 77);
}

.detail-summary {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1rem;
    padding: .35rem .25rem;
}

.detail-summary h1 {
    color: var(--title);
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 950;
    letter-spacing: 0;
    line-height: .98;
}

.detail-price {
    color: rgb(120 53 15);
    font-size: 1.7rem;
    font-weight: 950;
}

html[data-theme="dark"] .detail-price {
    color: rgb(252 211 77);
}

.detail-designer,
.detail-muted {
    color: var(--subtitle);
    font-size: .95rem;
    font-weight: 700;
}

.source-cta {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    border-radius: .35rem;
    background: rgb(120 53 15);
    color: rgb(255 247 237);
    font-size: .8rem;
    font-weight: 950;
    letter-spacing: .14em;
    padding: .85rem 1rem;
    text-transform: uppercase;
}

html[data-theme="dark"] .source-cta {
    background: rgb(252 211 77);
    color: rgb(28 25 23);
}

.detail-section {
    border-top: 1px solid var(--catalog-border);
    padding-top: 1rem;
}

.detail-section h2,
.detail-panel h2 {
    color: var(--title);
    font-size: .82rem;
    font-weight: 950;
    letter-spacing: .16em;
    margin-bottom: .75rem;
    text-transform: uppercase;
}

.detail-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.detail-chip {
    max-width: 170px;
}

.detail-source-card {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: .85rem;
    align-items: start;
    border: 1px solid var(--catalog-border);
    border-radius: .45rem;
    background: rgba(245, 239, 228, .6);
    padding: .85rem;
}

html[data-theme="dark"] .detail-source-card {
    background: rgba(255, 255, 255, .06);
}

.detail-source-logo,
.source-site-logo-wrap,
.admin-source-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(120, 53, 15, .14);
    border-radius: .45rem;
    background: rgb(255 251 235);
}

html[data-theme="dark"] .detail-source-logo,
html[data-theme="dark"] .source-site-logo-wrap,
html[data-theme="dark"] .admin-source-logo {
    border-color: rgba(254, 243, 199, .12);
    background: rgba(12, 10, 9, .5);
}

.detail-source-logo {
    width: 74px;
    height: 74px;
}

.detail-source-logo img,
.source-site-logo,
.admin-source-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.detail-source-logo span,
.source-site-logo-fallback,
.admin-source-logo span {
    color: rgb(120 53 15);
    font-size: 1.35rem;
    font-weight: 950;
}

html[data-theme="dark"] .detail-source-logo span,
html[data-theme="dark"] .source-site-logo-fallback,
html[data-theme="dark"] .admin-source-logo span {
    color: rgb(252 211 77);
}

.detail-source-card p,
.source-site-key,
.admin-source-key {
    color: var(--subtitle);
    font-size: .7rem;
    font-weight: 950;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.detail-source-card h2 {
    color: var(--title);
    font-size: 1.05rem;
    font-weight: 950;
    margin-top: .1rem;
}

.detail-source-card span {
    display: block;
    color: var(--subtitle);
    font-size: .88rem;
    font-weight: 650;
    line-height: 1.45;
    margin-top: .35rem;
}

.detail-source-card a {
    display: inline-flex;
    color: rgb(120 53 15);
    font-size: .76rem;
    font-weight: 950;
    margin-top: .45rem;
    text-transform: uppercase;
}

html[data-theme="dark"] .detail-source-card a {
    color: rgb(252 211 77);
}

.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.detail-panel {
    min-width: 0;
    border: 1px solid var(--catalog-border);
    border-radius: .5rem;
    background: var(--catalog-bg);
    padding: 1rem;
}

.detail-panel-wide {
    grid-column: 1 / -1;
}

.detail-facts {
    display: grid;
    gap: .65rem;
}

.detail-facts div {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: .75rem;
}

.detail-facts dt {
    color: var(--subtitle);
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.detail-facts dd {
    min-width: 0;
    color: var(--title);
    font-size: .9rem;
    font-weight: 700;
}

.detail-image-records {
    display: grid;
    gap: .7rem;
}

.detail-image-record {
    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1fr);
    gap: .55rem;
    align-items: start;
}

.detail-image-record span {
    color: rgb(120 53 15);
    font-size: .75rem;
    font-weight: 950;
}

html[data-theme="dark"] .detail-image-record span {
    color: rgb(252 211 77);
}

.detail-image-record a {
    min-width: 0;
    overflow: hidden;
    color: var(--title);
    font-size: .82rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-image-record em {
    grid-column: 2;
    color: var(--subtitle);
    font-size: .75rem;
    font-style: normal;
    font-weight: 800;
}

#cover-pagination nav {
    width: 100%;
}

#cover-pagination .pagination,
#cover-pagination nav > div,
#cover-pagination nav > div > span {
    gap: .4rem;
}

#cover-pagination a,
#cover-pagination span[aria-current] span,
#cover-pagination span[aria-disabled] span {
    border-radius: .375rem !important;
}

#cover-pagination a {
    border-color: var(--pagination-border) !important;
    background: var(--pagination-bg) !important;
    color: var(--pagination-text) !important;
    font-weight: 800;
}

#cover-pagination span[aria-current] span {
    border-color: var(--pagination-active-bg) !important;
    background: var(--pagination-active-bg) !important;
    color: var(--pagination-active-text) !important;
    font-weight: 900;
}

#cover-pagination span[aria-disabled] span {
    border-color: var(--pagination-border) !important;
    background: rgba(120, 53, 15, .06) !important;
    color: rgba(87, 83, 78, .68) !important;
}

html[data-theme="dark"] #cover-pagination span[aria-disabled] span {
    background: rgba(255, 255, 255, .06) !important;
    color: rgba(214, 211, 209, .65) !important;
}

.site-footer {
    border-top: 1px solid var(--header-border);
    background: var(--header-bg);
    margin-top: 2rem;
}

.site-footer-inner {
    display: grid;
    gap: 1rem;
    max-width: 80rem;
    margin: 0 auto;
    padding: 1.25rem 1rem;
}

.footer-copy {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .75rem;
    align-items: baseline;
    color: var(--subtitle);
    font-size: .86rem;
    font-weight: 700;
}

.footer-copy strong {
    color: var(--title);
    font-weight: 950;
}

.source-line {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .55rem;
    align-items: center;
    line-height: 1.8;
}

.source-site-link,
.footer-admin a {
    border: 0;
    background: transparent;
    color: rgb(120 53 15);
    font-size: .78rem;
    font-weight: 900;
    padding: 0;
    text-decoration: underline;
    text-decoration-color: rgba(120, 53, 15, .28);
    text-underline-offset: .18rem;
}

html[data-theme="dark"] .source-site-link,
html[data-theme="dark"] .footer-admin a {
    color: rgb(252 211 77);
    text-decoration-color: rgba(252, 211, 77, .34);
}

.footer-admin {
    font-size: .78rem;
}

.source-site-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.source-site-modal.hidden {
    display: none;
}

.source-site-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(28, 25, 23, .68);
    backdrop-filter: blur(4px);
}

.source-site-panel {
    position: relative;
    display: grid;
    width: min(520px, 100%);
    gap: .65rem;
    border: 1px solid var(--catalog-border);
    border-radius: .55rem;
    background: var(--catalog-bg);
    box-shadow: 0 32px 80px rgba(0, 0, 0, .34);
    padding: 1.15rem;
}

.source-site-close {
    justify-self: end;
    border-radius: 999px;
    background: rgb(120 53 15);
    color: rgb(255 247 237);
    font-size: .68rem;
    font-weight: 950;
    letter-spacing: .12em;
    padding: .45rem .7rem;
    text-transform: uppercase;
}

html[data-theme="dark"] .source-site-close {
    background: rgb(252 211 77);
    color: rgb(28 25 23);
}

.source-site-logo-wrap {
    width: 92px;
    height: 92px;
}

.source-site-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.source-site-panel h2 {
    color: var(--title);
    font-size: 1.65rem;
    font-weight: 950;
    line-height: 1.05;
}

.source-site-about {
    color: var(--subtitle);
    font-size: .95rem;
    font-weight: 650;
    line-height: 1.55;
}

.source-site-homepage {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: .35rem;
    background: rgb(120 53 15);
    color: rgb(255 247 237);
    font-size: .76rem;
    font-weight: 950;
    letter-spacing: .14em;
    margin-top: .35rem;
    padding: .75rem .9rem;
    text-transform: uppercase;
}

html[data-theme="dark"] .source-site-homepage {
    background: rgb(252 211 77);
    color: rgb(28 25 23);
}

.admin-shell {
    border: 1px solid var(--catalog-border);
    border-radius: .5rem;
    background: var(--catalog-bg);
    box-shadow: 0 22px 48px rgba(75, 46, 23, .12);
    padding: 1.25rem;
}

.admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--catalog-border);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

.admin-head h2 {
    color: var(--title);
    font-size: 1.5rem;
    font-weight: 950;
}

.admin-login,
.admin-source-form {
    display: grid;
    gap: 1rem;
}

.admin-source-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 1rem;
    border: 1px solid var(--catalog-border);
    border-radius: .45rem;
    padding: 1rem;
}

.admin-source-logo {
    width: 112px;
    height: 112px;
}

.admin-source-fields {
    display: grid;
    gap: .8rem;
}

.admin-category-section {
    border: 1px solid var(--catalog-border);
    border-radius: .45rem;
    padding: 1rem;
}

.admin-section-head {
    border-bottom: 1px solid var(--catalog-border);
    margin-bottom: 1rem;
    padding-bottom: .8rem;
}

.admin-section-head h3 {
    color: var(--title);
    font-size: 1.15rem;
    font-weight: 950;
}

.admin-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: .75rem;
}

.admin-category-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    align-items: center;
    gap: .75rem;
    color: var(--subtitle);
    font-size: .86rem;
    font-weight: 800;
}

.admin-category-row span {
    min-width: 0;
}

.admin-category-row em {
    display: block;
    margin-top: .15rem;
    color: color-mix(in srgb, var(--subtitle), transparent 28%);
    font-size: .68rem;
    font-style: normal;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.admin-category-row .book-input {
    text-align: right;
}

.admin-textarea {
    min-height: 7rem;
    height: auto;
    line-height: 1.45;
    padding-top: .75rem;
}

.admin-file {
    width: 100%;
    color: var(--subtitle);
    font-size: .86rem;
    font-weight: 700;
}

.admin-secondary-button {
    border-radius: 999px;
    border: 1px solid var(--catalog-border);
    color: var(--subtitle);
    font-size: .75rem;
    font-weight: 900;
    padding: .55rem .8rem;
    text-transform: uppercase;
}

.admin-status,
.admin-warning,
.admin-error {
    border-radius: .4rem;
    font-size: .88rem;
    font-weight: 800;
    margin-bottom: 1rem;
    padding: .75rem .9rem;
}

.admin-status {
    background: rgba(20, 108, 83, .12);
    color: rgb(20 108 83);
}

.admin-warning,
.admin-error {
    background: rgba(153, 27, 27, .1);
    color: rgb(153 27 27);
}

@media (max-width: 640px) {
    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
        gap: .85rem;
    }

    .book-cover {
        height: min(350px, 72vw);
    }

    .book-cover img {
        max-height: min(350px, 72vw);
    }

    .gallery-body {
        grid-template-columns: 1fr;
    }

    .gallery-thumbs {
        max-height: none;
        flex-direction: row;
        border-right: 0;
        border-bottom: 1px solid rgba(120, 53, 15, .14);
        overflow-x: auto;
        overflow-y: hidden;
    }

    .gallery-thumb {
        width: 74px;
        flex: 0 0 74px;
    }

    .detail-shell,
    .detail-info-grid {
        grid-template-columns: 1fr;
    }

    .detail-cover-frame {
        min-height: min(520px, 100vw);
    }

    .detail-facts div {
        grid-template-columns: 1fr;
        gap: .2rem;
    }

    .detail-source-card,
    .admin-source-card {
        grid-template-columns: 1fr;
    }
}
