:root,
html[data-theme="light"] {
    color-scheme: light;
    --page-bg: #f8fafc;
    --page-text: #111827;
    --accent: #facc15;
    --accent-strong: #eab308;
    --accent-text: #111827;
    --backdrop: radial-gradient(circle at top left, rgba(250, 204, 21, .18), transparent 30%), linear-gradient(120deg, rgba(255, 255, 255, .86), transparent 44%);
    --header-bg: rgba(255, 255, 255, .92);
    --header-border: rgba(15, 23, 42, .08);
    --title: #0f172a;
    --subtitle: #64748b;
    --kicker: #64748b;
    --toggle-bg: #ffffff;
    --toggle-text: #111827;
    --toggle-border: rgba(15, 23, 42, .12);
    --catalog-bg: rgba(255, 255, 255, .96);
    --catalog-border: rgba(15, 23, 42, .10);
    --catalog-head-bg: linear-gradient(90deg, #ffffff, #f1f5f9);
    --catalog-head-text: #0f172a;
    --catalog-kicker: #64748b;
    --summary-bg: rgba(241, 245, 249, .95);
    --summary-text: #475569;
    --pagination-bg: #ffffff;
    --pagination-text: #334155;
    --pagination-border: rgba(15, 23, 42, .14);
    --pagination-active-bg: #facc15;
    --pagination-active-text: #111827;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --page-bg: #0f172a;
    --page-text: #f8fafc;
    --accent: #facc15;
    --accent-strong: #fde047;
    --accent-text: #111827;
    --backdrop: radial-gradient(circle at top left, rgba(250, 204, 21, .16), transparent 34%), linear-gradient(120deg, rgba(255, 255, 255, .05), transparent 44%);
    --header-bg: rgba(15, 23, 42, .92);
    --header-border: rgba(226, 232, 240, .12);
    --title: #f8fafc;
    --subtitle: #cbd5e1;
    --kicker: #fcd34d;
    --toggle-bg: #111827;
    --toggle-text: #f8fafc;
    --toggle-border: rgba(226, 232, 240, .16);
    --catalog-bg: rgba(15, 23, 42, .95);
    --catalog-border: rgba(226, 232, 240, .12);
    --catalog-head-bg: linear-gradient(90deg, #111827, #1e293b);
    --catalog-head-text: #f8fafc;
    --catalog-kicker: #fde68a;
    --summary-bg: rgba(226, 232, 240, .12);
    --summary-text: #e2e8f0;
    --pagination-bg: #111827;
    --pagination-text: #fcd34d;
    --pagination-border: rgba(226, 232, 240, .16);
    --pagination-active-bg: #fcd34d;
    --pagination-active-text: #111827;
}

* {
    box-sizing: border-box;
}

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

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

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

.site-header {
    position: relative;
    z-index: 60;
    border-bottom: 1px solid var(--header-border);
    background: var(--header-bg);
}

.site-header-inner {
    min-height: 4.75rem;
}

.site-brand-block {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: .35rem;
}

.site-logo-link {
    display: block;
    width: min(270px, 100%);
}

.site-logo {
    display: block;
    width: 100%;
    height: auto;
}

.site-header-statement {
    width: min(270px, 100%);
    color: var(--subtitle);
    font-size: .76rem;
    font-weight: 400;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
}

.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);
}

.site-header-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.site-navigation {
    display: flex;
    align-items: center;
    gap: .2rem;
}

.site-navigation > a,
.browse-menu-toggle {
    color: var(--title);
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 500;
    padding: .55rem .75rem;
    transition: background-color .16s ease, color .16s ease;
}

.site-navigation > a:hover,
.browse-menu-toggle:hover,
.browse-menu-toggle[aria-expanded="true"] {
    background: rgba(250, 204, 21, .14);
    color: var(--accent-strong);
}

.browse-menu-wrap {
    position: relative;
}

.browse-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.browse-menu-chevron {
    width: .42rem;
    height: .42rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-.12rem) rotate(45deg);
    transition: transform .16s ease;
}

.browse-menu-toggle[aria-expanded="true"] .browse-menu-chevron {
    transform: translateY(.1rem) rotate(225deg);
}

.browse-menu {
    position: absolute;
    top: calc(100% + .65rem);
    right: 0;
    z-index: 70;
    width: min(23rem, calc(100vw - 2rem));
    overflow: hidden;
    border: 1px solid var(--catalog-border);
    border-radius: .5rem;
    background: var(--catalog-bg);
    box-shadow: 0 22px 54px rgba(15, 23, 42, .16);
    padding: .65rem;
}

.browse-menu.hidden {
    display: none;
}

.browse-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .25rem .35rem .65rem;
}

.browse-menu-head span {
    color: var(--subtitle);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.browse-menu-head a {
    color: #ca8a04;
    font-size: .76rem;
    font-weight: 500;
}

.browse-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .3rem;
}

.browse-menu-grid a {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
    border-radius: .35rem;
    color: var(--title);
    font-size: .82rem;
    font-weight: 500;
    padding: .6rem .65rem;
    transition: background-color .14s ease;
}

.browse-menu-grid a:hover,
.browse-menu-grid a:focus-visible {
    background: rgba(250, 204, 21, .14);
    outline: none;
}

.browse-menu-grid a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.browse-menu-grid small {
    flex: 0 0 auto;
    color: var(--subtitle);
    font-size: .68rem;
    font-weight: 400;
}

html[data-theme="dark"] .browse-menu {
    box-shadow: 0 22px 54px rgba(0, 0, 0, .34);
}

.theme-toggle {
    font-weight: 500;
}

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

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);
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.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(15, 23, 42, .16);
}

.mode-dot {
    display: inline-block;
    width: .65rem;
    height: .65rem;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(250, 204, 21, .2);
}

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: #475569;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.filter-label-row {
    display: flex;
    min-height: 1.4rem;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
}

.filter-count-spinner {
    display: none;
    width: .85rem;
    height: .85rem;
    border: 2px solid rgba(15, 23, 42, .16);
    border-top-color: var(--accent-strong);
    border-radius: 50%;
    animation: filter-count-spin .7s linear infinite;
}

.filter-count-spinner.visible {
    display: inline-block;
}

.catalog-searching {
    overflow: hidden;
}

.catalog-search-loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.catalog-search-loader.hidden {
    display: none;
}

.catalog-search-loader-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(248, 250, 252, .88);
    backdrop-filter: blur(5px);
}

html[data-theme="dark"] .catalog-search-loader-backdrop {
    background: rgba(12, 10, 9, .88);
}

.catalog-search-loader-content {
    position: relative;
    display: flex;
    max-width: 24rem;
    align-items: center;
    flex-direction: column;
    gap: 1rem;
    color: var(--title);
    text-align: center;
}

.catalog-search-loader-content p {
    font-size: .95rem;
    font-weight: 400;
    line-height: 1.5;
}

.catalog-search-spinner {
    width: 2.75rem;
    height: 2.75rem;
    border: 3px solid rgba(100, 116, 139, .2);
    border-top-color: var(--accent-strong);
    border-radius: 50%;
    animation: catalog-search-spin .72s linear infinite;
}

html[data-theme="dark"] .catalog-search-spinner {
    border-color: rgba(226, 232, 240, .18);
    border-top-color: rgb(252 211 77);
}

@keyframes catalog-search-spin {
    to {
        transform: rotate(360deg);
    }
}

html[data-theme="dark"] .filter-count-spinner {
    border-color: rgba(252, 211, 77, .2);
    border-top-color: rgb(252 211 77);
}

@keyframes filter-count-spin {
    to {
        transform: rotate(360deg);
    }
}

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

.book-input {
    width: 100%;
    height: 3rem;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: .375rem;
    background: rgb(255 255 255);
    color: #111827;
    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: var(--accent-strong);
    box-shadow: 0 0 0 4px rgba(250, 204, 21, .22);
}

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-stack {
    display: block;
}

.catalog-view-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 1rem;
}

.catalog-view-switch {
    display: inline-flex;
    border: 1px solid var(--catalog-border);
    border-radius: .45rem;
    background: var(--catalog-bg);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
    padding: .25rem;
}

.catalog-view-button {
    display: inline-flex;
    min-height: 2.35rem;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border-radius: .3rem;
    color: var(--subtitle);
    font-size: .78rem;
    font-weight: 500;
    padding: .55rem .75rem;
    transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.catalog-view-button:hover {
    color: var(--title);
}

.catalog-view-button.active {
    background: var(--accent);
    color: var(--accent-text);
    box-shadow: 0 5px 14px rgba(202, 138, 4, .16);
}

.catalog-view-icon {
    display: grid;
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    gap: 2px;
}

.catalog-view-icon::before,
.catalog-view-icon::after {
    content: "";
    border: 1.5px solid currentColor;
}

.catalog-view-icon-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.catalog-view-icon-grid::before,
.catalog-view-icon-grid::after {
    box-shadow: 0 6px 0 -1.5px currentColor;
}

.catalog-view-icon-masonry {
    grid-template-columns: .85fr 1.15fr;
}

.catalog-view-icon-masonry::before {
    height: .62rem;
}

.catalog-view-icon-masonry::after {
    height: 1rem;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: stretch;
    opacity: 1;
    transition: opacity .16s ease;
}

.book-grid + .book-grid {
    margin-top: 1.5rem;
}

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

.catalog-view-masonry .book-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: 4px;
    gap: 1rem;
    align-items: start;
}

.catalog-view-masonry .book-card {
    display: block;
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: .25rem;
    background: transparent;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .1);
}

.catalog-view-masonry .book-card::after,
.catalog-view-masonry .catalog-card-body,
.catalog-view-masonry .cover-bottom-right-overlays {
    display: none;
}

.catalog-view-masonry .book-cover-frame {
    aspect-ratio: var(--aspect-ratio, 5 / 8);
    overflow: hidden;
}

.catalog-view-masonry .book-cover {
    height: 100%;
    overflow: hidden;
    border-radius: .25rem;
    background: transparent;
}

.catalog-view-masonry .book-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
}

.catalog-view-masonry .book-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .16);
}

.catalog-view-masonry .book-card:hover .book-cover img {
    transform: none;
}

.book-card {
    position: relative;
    display: flex;
    width: 100%;
    height: auto;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 0 0 .5rem .5rem;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 18px 34px rgba(15, 23, 42, .08);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.book-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: .45rem;
    border-radius: 0;
    background: var(--accent);
}

.book-card:hover {
    transform: translateY(-4px);
    border-color: rgba(250, 204, 21, .55);
    box-shadow: 0 24px 46px rgba(15, 23, 42, .12);
}

html[data-theme="dark"] .book-card {
    border-color: rgba(226, 232, 240, .12);
    background: rgba(17, 24, 39, .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;
    width: 100%;
    height: 100%;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .34), transparent 18%),
        linear-gradient(135deg, #e5e7eb, #f8fafc);
}

.book-cover-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 8;
    flex: 0 0 auto;
    overflow: hidden;
}

.catalog-new-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .2rem;
    background: rgb(220 38 38);
    color: rgb(255 255 255);
    font-size: .58rem;
    font-weight: 700;
    line-height: 1;
    margin-right: .4rem;
    padding: .25rem .35rem;
    text-transform: uppercase;
    vertical-align: .12em;
}

.cover-bottom-right-overlays {
    position: absolute;
    right: .65rem;
    bottom: .65rem;
    z-index: 4;
    display: flex;
    max-width: calc(100% - 1.3rem);
    flex-direction: column;
    align-items: flex-end;
    gap: .45rem;
    pointer-events: none;
}

.cover-unavailable-badge {
    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: 700;
    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);
}

.cover-new-badge {
    position: absolute;
    top: .65rem;
    left: .65rem;
    z-index: 4;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: .35rem;
    background: rgb(220, 38, 38);
    color: white;
    box-shadow: 0 10px 22px rgba(41, 21, 8, .2);
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
    padding: .42rem .55rem;
    text-transform: uppercase;
    pointer-events: none;
}

html[data-theme="dark"] .cover-new-badge {
    border-color: rgba(255, 255, 255, .24);
    background: rgb(239, 68, 68);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .3);
}


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 {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    flex: 0 0 auto;
    transition: transform .22s ease;
}

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

.card-source-logo-link {
    display: flex;
    width: fit-content;
    max-width: 150px;
    height: 36px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(.3rem);
    transition: opacity .18s ease, transform .18s ease, background-color .18s ease;
    backdrop-filter: blur(10px);
}

.book-card:hover .card-source-logo-link,
.book-card:focus-within .card-source-logo-link {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.card-source-logo-link:hover {
    background: rgba(255, 255, 255, .9);
}

.card-source-logo {
    display: block;
    width: auto;
    max-width: 150px;
    height: 36px;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

.card-source-logo-fallback {
    color: #475569;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
}

.catalog-horizontal-scroll {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    touch-action: pan-x;
    user-select: none;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.catalog-horizontal-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.catalog-horizontal-scroll.dragging {
    cursor: grabbing;
}

.catalog-horizontal-scroll:not(.dragging) {
    cursor: grab;
}

.catalog-title-scroll {
    color: #1c1917;
    min-height: 1.7rem;
    padding-bottom: .2rem;
}

.catalog-category-scroll {
    color: #57534e;
    min-height: 1.65rem;
    padding-bottom: .2rem;
}

.catalog-tag-scroll {
    display: flex;
    min-height: 2.35rem;
    gap: .5rem;
    align-items: flex-start;
    padding-top: .1rem;
    padding-bottom: .35rem;
}

.catalog-card-body {
    min-height: 0;
    height: 14.5rem;
    flex: 0 0 14.5rem;
}

.catalog-horizontal-scroll .catalog-inline-link,
.catalog-horizontal-scroll .keyword-chip {
    flex: 0 0 auto;
    max-width: none;
    white-space: nowrap;
}

.catalog-card-price {
    color: #292524;
}

html[data-theme="dark"] .catalog-title-scroll {
    color: #fafaf9;
}

html[data-theme="dark"] .catalog-category-scroll {
    color: #d6d3d1;
}

html[data-theme="dark"] .catalog-card-price {
    color: #f5f5f4;
}

html[data-theme="dark"] .card-source-logo {
    filter: brightness(1.12);
}

html[data-theme="dark"] .card-source-logo-link {
    border-color: rgba(255, 255, 255, .22);
    background: rgba(28, 25, 23, .68);
}

html[data-theme="dark"] .card-source-logo-link:hover {
    background: rgba(28, 25, 23, .88);
}

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

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

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

.status-pill.sold {
    background: rgb(202 138 4);
}

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

.status-pill.muted {
    background: rgb(241 245 249);
    color: rgb(100 116 139);
}

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: 128px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 999px;
    background: rgba(248, 250, 252, .72);
    color: rgb(100 116 139);
    font-size: .72rem;
    font-weight: 400;
    line-height: 1.25;
    padding: .34rem .58rem;
    text-overflow: ellipsis;
    text-decoration: none;
    vertical-align: top;
    white-space: nowrap;
}

.keyword-chip:hover,
.catalog-meta-link:hover,
.catalog-inline-link:hover {
    color: #ca8a04;
    text-decoration: underline;
    text-underline-offset: .16rem;
}

html[data-theme="dark"] .keyword-chip {
    border-color: rgba(226, 232, 240, .12);
    background: rgba(255, 255, 255, .06);
    color: rgb(203 213 225);
}

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;
}

.catalog-card-footer {
    margin-top: auto;
    margin-bottom: 1.1rem;
    min-height: 5rem;
    flex: 0 0 5rem;
    padding-top: 1rem;
    padding-bottom: .75rem;
}

.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: #111827;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .16);
    transition: background-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.gallery-button:hover {
    background: rgba(250, 204, 21, .9);
    color: #111827;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .2);
    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.00rem;
    height: 2.00rem;
    backdrop-filter: blur(10px);
    opacity: 0.5;
}

.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(226, 232, 240, .8);
    border-radius: .5rem;
    background: rgb(255 255 255);
    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(15, 23, 42, .10);
    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: 700;
    line-height: 1.25;
}

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

.gallery-close {
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-text);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    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(15, 23, 42, .10);
    background: rgba(248, 250, 252, .88);
    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(248 250 252);
    padding: .2rem;
}

.gallery-thumb.active {
    border-color: var(--accent);
}

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, #e2e8f0, #ffffff);
    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: #ca8a04;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    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(15, 23, 42, .08);
    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: 0rem;
}

.detail-image-missing {
    align-self: center;
    color: #ca8a04;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

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(15, 23, 42, .12);
    border-radius: .35rem;
    background: rgba(248, 250, 252, .9);
    padding: .25rem;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.detail-thumb-button:hover,
.detail-thumb-button.active {
    border-color: var(--accent);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .12);
    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: 700;
    letter-spacing: 0;
    line-height: 1.04;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.detail-summary h1.detail-title-long {
    font-size: clamp(1.8rem, 3.2vw, 2.5rem);
    line-height: 1.08;
}

.detail-summary h1.detail-title-compact {
    font-size: clamp(1.5rem, 2.8vw, 2rem);
    line-height: 1.1;
}

.detail-price {
    color: #ca8a04;
    font-size: 1.7rem;
    font-weight: 700;
}

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

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

.detail-designer a {
    color: #ca8a04;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(202, 138, 4, .35);
    text-underline-offset: .2em;
}

.detail-designer a:hover {
    text-decoration-color: currentColor;
}

html[data-theme="dark"] .detail-designer a {
    color: rgb(252 211 77);
    text-decoration-color: rgba(252, 211, 77, .35);
}

.source-cta {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    border-radius: .35rem;
    background: var(--accent);
    color: var(--accent-text);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    padding: .85rem 1rem;
    text-transform: uppercase;
}

.book-source-button {
    display: inline-flex;
    max-width: 68%;
    align-items: center;
    justify-content: center;
    border-radius: .35rem;
    background: var(--accent);
    color: var(--accent-text);
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.2;
    padding: .72rem .9rem;
    text-align: center;
    text-transform: none;
}

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

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: 700;
    letter-spacing: .10em;
    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(248, 250, 252, .82);
    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(15, 23, 42, .10);
    border-radius: .45rem;
    background: rgb(248 250 252);
}

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: #ca8a04;
    font-size: 1.35rem;
    font-weight: 700;
}

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: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.detail-source-card h2 {
    color: var(--title);
    font-size: 1.05rem;
    font-weight: 700;
    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: #ca8a04;
    font-size: .76rem;
    font-weight: 700;
    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: 700;
    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: #ca8a04;
    font-size: .75rem;
    font-weight: 700;
}

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: 600;
}

#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: 600;
}

#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: 700;
}

#cover-pagination span[aria-disabled] span {
    border-color: var(--pagination-border) !important;
    background: rgba(15, 23, 42, .04) !important;
    color: rgba(100, 116, 139, .72) !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;
}

.pagination-loading {
    border: 1px solid var(--pagination-border);
    border-radius: .375rem;
    background: var(--pagination-bg);
    color: var(--pagination-text);
    font-size: .88rem;
    font-weight: 700;
    padding: .75rem 1rem;
}

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

.site-footer-inner {
    display: grid;
    grid-template-columns: minmax(260px, 1.7fr) repeat(3, minmax(130px, .65fr));
    gap: 2rem 3rem;
    max-width: 80rem;
    margin: 0 auto;
    padding: 3rem 2rem 2.5rem;
}

.footer-brand {
    max-width: 25rem;
}

.footer-brand a {
    display: block;
    width: min(200px, 100%);
}

.footer-brand img {
    display: block;
    width: 100%;
    height: auto;
}

.footer-brand p {
    color: var(--subtitle);
    font-size: .88rem;
    line-height: 1.65;
    margin-top: .85rem;
}

.footer-brand-meta {
    display: block;
    color: var(--subtitle);
    font-size: .7rem;
    line-height: 1.4;
    margin-top: .65rem;
    opacity: .78;
}

.footer-column {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: .65rem;
}

.footer-column h2 {
    color: var(--title);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    margin-bottom: .2rem;
    text-transform: uppercase;
}

.footer-column a,
.footer-column button {
    border: 0;
    background: transparent;
    color: var(--subtitle);
    font-size: .82rem;
    font-weight: 400;
    line-height: 1.4;
    padding: 0;
    text-align: left;
    transition: color .14s ease;
}

.footer-column a:hover,
.footer-column button:hover {
    color: #ca8a04;
}

.footer-bottom {
    border-top: 1px solid var(--header-border);
}

.footer-bottom > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .65rem 1.5rem;
    max-width: 80rem;
    margin: 0 auto;
    color: var(--subtitle);
    font-size: .72rem;
    line-height: 1.5;
    padding: 1rem 2rem;
}

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

.platform-directory-modal.hidden {
    display: none;
}

.platform-directory-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .62);
    backdrop-filter: blur(4px);
}

.platform-directory-panel {
    position: relative;
    width: min(760px, 100%);
    max-height: min(760px, calc(100vh - 2rem));
    overflow: auto;
    border: 1px solid var(--catalog-border);
    border-radius: .55rem;
    background: var(--catalog-bg);
    box-shadow: 0 32px 80px rgba(0, 0, 0, .3);
    padding: 1.25rem;
}

.platform-directory-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.platform-directory-head h2 {
    color: var(--title);
    font-size: 1.45rem;
    font-weight: 600;
    margin-top: .2rem;
}

.platform-directory-close {
    display: inline-flex;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 2.35rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--subtitle);
    font-size: 1.4rem;
    line-height: 1;
}

.platform-directory-close:hover {
    background: rgba(15, 23, 42, .06);
    color: var(--title);
}

.platform-directory-intro {
    color: var(--subtitle);
    font-size: .88rem;
    line-height: 1.55;
    margin-top: .65rem;
}

.platform-directory-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
    margin-top: 1.25rem;
}

.platform-directory-item {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: .25rem;
    border: 1px solid var(--catalog-border);
    border-radius: .4rem;
    background: transparent;
    color: var(--title);
    padding: .8rem;
    text-align: left;
    transition: border-color .14s ease, background-color .14s ease;
}

.platform-directory-item:hover {
    border-color: rgba(250, 204, 21, .65);
    background: rgba(250, 204, 21, .08);
}

.platform-directory-item span {
    overflow: hidden;
    max-width: 100%;
    font-size: .84rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.platform-directory-item small {
    color: var(--subtitle);
    font-size: .7rem;
}

.legal-page {
    max-width: 68rem;
    margin: 0 auto;
}

.legal-intro {
    border-bottom: 1px solid var(--catalog-border);
    padding: 1.5rem 0 2rem;
}

.legal-intro h1 {
    color: var(--title);
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 500;
    line-height: 1.1;
    margin-top: .5rem;
}

.legal-intro > p:not(.catalog-kicker) {
    max-width: 48rem;
    color: var(--subtitle);
    font-size: 1rem;
    line-height: 1.7;
    margin-top: .8rem;
}

.legal-intro > span {
    display: block;
    color: var(--subtitle);
    font-size: .72rem;
    margin-top: 1rem;
}

.legal-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 3rem;
    padding: 2rem 0 3rem;
}

.legal-navigation {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: .25rem;
}

.legal-navigation a {
    border-left: 2px solid transparent;
    color: var(--subtitle);
    font-size: .82rem;
    padding: .55rem .75rem;
}

.legal-navigation a:hover,
.legal-navigation a.active {
    border-left-color: var(--accent);
    color: var(--title);
}

.legal-sections {
    display: grid;
    gap: 1.8rem;
}

.legal-sections section {
    border-bottom: 1px solid var(--catalog-border);
    padding-bottom: 1.8rem;
}

.legal-sections h2 {
    color: var(--title);
    font-size: 1.05rem;
    font-weight: 600;
}

.legal-sections p {
    color: var(--subtitle);
    font-size: .92rem;
    line-height: 1.75;
    margin-top: .55rem;
}

.about-page {
    display: grid;
    gap: 2rem;
}

.about-intro {
    max-width: 900px;
    padding: 1.5rem 0 .5rem;
}

.about-intro h1 {
    color: var(--title);
    font-size: clamp(2.1rem, 5vw, 4.5rem);
    font-weight: 500;
    line-height: 1.08;
    margin-top: .6rem;
}

.about-intro > p:last-child {
    max-width: 780px;
    color: var(--subtitle);
    font-size: 1.08rem;
    line-height: 1.75;
    margin-top: 1rem;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--catalog-border);
    border-bottom: 1px solid var(--catalog-border);
}

.about-stats div {
    display: grid;
    gap: .25rem;
    border-right: 1px solid var(--catalog-border);
    padding: 1.3rem;
}

.about-stats div:nth-child(3n) {
    border-right: 0;
}

.about-stats div:nth-child(n+4) {
    border-top: 1px solid var(--catalog-border);
}

.about-stats strong {
    color: #ca8a04;
    font-size: 2rem;
    font-weight: 500;
}

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

.about-stats span {
    color: var(--subtitle);
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
}

.about-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 3rem;
    max-width: 1080px;
}

.about-sections section {
    border-top: 3px solid var(--accent);
    padding-top: 1rem;
}

.about-sections h2 {
    color: var(--title);
    font-size: 1.45rem;
    font-weight: 500;
}

.about-sections p {
    color: var(--subtitle);
    line-height: 1.72;
    margin-top: .75rem;
}

.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: #ca8a04;
    font-size: .78rem;
    font-weight: 700;
    padding: 0;
    text-decoration: underline;
    text-decoration-color: rgba(202, 138, 4, .32);
    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: var(--accent);
    color: var(--accent-text);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    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: 700;
    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: var(--accent);
    color: var(--accent-text);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .08em;
    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(15, 23, 42, .08);
    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: 700;
}

.admin-head-copy {
    color: var(--subtitle);
    font-size: .9rem;
    margin-top: .25rem;
}

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

.admin-navigation-links {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.admin-navigation-links a {
    border-bottom: 2px solid transparent;
    color: var(--subtitle);
    font-size: .82rem;
    font-weight: 700;
    padding: .65rem .75rem;
}

.admin-navigation-links a.active {
    border-bottom-color: var(--accent);
    color: var(--title);
}

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

.admin-list {
    display: grid;
}

.admin-list-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, auto) auto;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--catalog-border);
    padding: .9rem .25rem;
}

.admin-list-row:first-child {
    border-top: 1px solid var(--catalog-border);
}

.admin-list-row h3 {
    color: var(--title);
    font-size: 1rem;
    font-weight: 700;
}

.admin-list-identity {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.admin-list-identity .admin-source-logo {
    width: 52px;
    height: 52px;
}

.admin-list-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .4rem .75rem;
    color: var(--subtitle);
    font-size: .74rem;
    font-weight: 600;
}

.admin-edit-button {
    border: 1px solid var(--catalog-border);
    border-radius: .35rem;
    color: var(--title);
    font-size: .76rem;
    font-weight: 700;
    padding: .58rem .85rem;
}

.admin-edit-button:hover {
    background: rgba(250, 204, 21, .16);
    border-color: var(--accent);
}

.admin-dialog {
    width: min(620px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    border: 1px solid var(--catalog-border);
    border-radius: .5rem;
    background: var(--catalog-bg);
    color: var(--subtitle);
    box-shadow: 0 28px 80px rgba(28, 25, 23, .34);
    padding: 0;
}

.admin-dialog::backdrop {
    background: rgba(28, 25, 23, .66);
}

.admin-dialog-wide {
    width: min(1100px, calc(100vw - 2rem));
}

.admin-dialog form {
    display: flex;
    max-height: calc(100vh - 2rem);
    flex-direction: column;
}

.admin-dialog-head,
.admin-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
}

.admin-dialog-head {
    border-bottom: 1px solid var(--catalog-border);
}

.admin-dialog-head h3 {
    color: var(--title);
    font-size: 1.2rem;
    font-weight: 700;
}

.admin-dialog-close {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--subtitle);
    font-size: 1.5rem;
    line-height: 1;
}

.admin-dialog-close:hover {
    background: rgba(15, 23, 42, .06);
}

.admin-dialog-body {
    display: grid;
    gap: 1rem;
    overflow-y: auto;
    padding: 1.15rem;
}

.admin-dialog-body label {
    display: grid;
    gap: .35rem;
}

.admin-dialog-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--catalog-border);
}

.admin-toggle-group {
    display: grid;
    gap: .55rem;
    border: 1px solid var(--catalog-border);
    border-radius: .4rem;
    padding: .85rem;
}

.admin-toggle-group legend {
    color: var(--title);
    font-size: .78rem;
    font-weight: 700;
    padding: 0 .25rem;
}

.admin-toggle-group label {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .86rem;
    font-weight: 600;
}

.admin-common-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 170px;
    gap: .75rem;
}

.admin-category-editor {
    border-top: 1px solid var(--catalog-border);
}

.admin-category-editor-head,
.admin-category-editor-row {
    display: grid;
    grid-template-columns: 150px minmax(170px, .8fr) minmax(150px, .7fr) minmax(260px, 1.4fr);
    gap: .65rem;
    align-items: center;
}

.admin-category-editor-head {
    color: var(--subtitle);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    padding: .7rem .25rem;
    text-transform: uppercase;
}

.admin-category-editor-row {
    border-top: 1px solid var(--catalog-border);
    padding: .65rem .25rem;
}

.admin-category-source {
    color: var(--title);
    font-size: .75rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.admin-mobile-label {
    display: none;
}

.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: 700;
}

.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: 600;
}

.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: 700;
    letter-spacing: .08em;
    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: 700;
    padding: .55rem .8rem;
    text-transform: uppercase;
}

.admin-danger-button {
    border: 1px solid rgba(153, 27, 27, .32);
    border-radius: .35rem;
    background: rgba(153, 27, 27, .1);
    color: rgb(153 27 27);
    font-size: .75rem;
    font-weight: 700;
    padding: .7rem .9rem;
    text-transform: uppercase;
}

html[data-theme="dark"] .admin-danger-button {
    border-color: rgba(248, 113, 113, .36);
    background: rgba(153, 27, 27, .2);
    color: rgb(254 202 202);
}

.admin-outbound-summary {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    color: var(--subtitle);
    margin-bottom: .85rem;
}

.admin-outbound-summary strong {
    color: var(--title);
    font-size: 1.35rem;
    font-weight: 700;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--catalog-border);
    border-radius: .4rem;
}

.admin-outbound-table {
    width: 100%;
    min-width: 1240px;
    border-collapse: collapse;
    color: var(--subtitle);
    font-size: .76rem;
    text-align: left;
}

.admin-outbound-table th,
.admin-outbound-table td {
    border-bottom: 1px solid var(--catalog-border);
    padding: .7rem .75rem;
    vertical-align: top;
}

.admin-outbound-table th {
    background: rgba(15, 23, 42, .04);
    color: var(--title);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

html[data-theme="dark"] .admin-outbound-table th {
    background: rgba(255, 255, 255, .05);
}

.admin-outbound-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-outbound-table td strong,
.admin-outbound-table td span {
    display: block;
}

.admin-outbound-table td a {
    color: var(--pagination-text);
    font-weight: 700;
}

.admin-user-agent {
    max-width: 320px;
    overflow-wrap: anywhere;
}

.admin-target-url {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-table-empty {
    color: var(--subtitle);
    padding: 2rem !important;
    text-align: center;
}

.admin-pagination {
    margin-top: 1rem;
}

.admin-status,
.admin-warning,
.admin-error {
    border-radius: .4rem;
    font-size: .88rem;
    font-weight: 600;
    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: 1024px) {
    .site-footer-inner {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

    .catalog-view-masonry .book-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 641px) and (max-width: 1023px) {
    #cover-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #cover-filters > label:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .book-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .85rem;
    }

    .book-cover-frame {
        aspect-ratio: 5 / 8;
    }

    .catalog-view-masonry .book-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .75rem;
    }

}

@media (min-width: 641px) and (max-width: 900px) {
    .detail-shell {
        grid-template-columns: 1fr;
    }

    .detail-gallery {
        width: min(520px, 100%);
        margin-inline: auto;
    }

    .detail-summary {
        padding-top: .75rem;
    }
}

@media (max-width: 640px) {
    .site-header-actions {
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .site-navigation {
        justify-content: flex-start;
    }

    .browse-menu {
        right: auto;
        left: 0;
    }

    .site-logo-link {
        width: min(270px, 100%);
    }

    .site-header-statement {
        font-size: .68rem;
    }

    .site-footer-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem 1.25rem;
        padding: 2.5rem 1rem 2rem;
    }

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

    .footer-brand a {
        width: min(200px, 100%);
    }

    .footer-column:last-child {
        grid-column: 1 / -1;
    }

    .footer-bottom > div {
        padding: 1rem;
    }

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

    .legal-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

    .about-stats,
    .about-sections {
        grid-template-columns: 1fr;
    }

    .about-stats div,
    .about-stats div:nth-child(3n) {
        border-right: 0;
        border-top: 1px solid var(--catalog-border);
    }

    .about-stats div:first-child {
        border-top: 0;
    }

    .book-source-button {
        max-width: 72%;
        font-size: .62rem;
    }

    .book-grid + .book-grid {
        margin-top: .85rem;
    }

    .catalog-view-toolbar {
        margin-bottom: .85rem;
    }

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

    .gallery-thumbs {
        max-height: none;
        flex-direction: row;
        border-right: 0;
        border-bottom: 1px solid rgba(15, 23, 42, .10);
        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;
    }

    .admin-navigation,
    .admin-head {
        align-items: flex-start;
    }

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

    .admin-list-meta {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
    }

    .admin-edit-button {
        grid-column: 2;
        grid-row: 1;
    }

    .admin-common-fields,
    .admin-category-editor-head,
    .admin-category-editor-row {
        grid-template-columns: 1fr;
    }

    .admin-category-editor-head {
        display: none;
    }

    .admin-category-editor-row {
        gap: .75rem;
        padding: 1rem .25rem;
    }

    .admin-mobile-label {
        display: block;
        color: var(--subtitle);
        font-size: .68rem;
        font-weight: 700;
        text-transform: uppercase;
    }

    .admin-dialog-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 359px) {
    .site-header-actions {
        gap: .35rem;
    }

    .site-navigation {
        gap: 0;
    }

    .site-navigation > a,
    .browse-menu-toggle {
        font-size: .82rem;
        padding: .5rem .55rem;
    }

    .theme-toggle {
        padding-right: .7rem !important;
        padding-left: .7rem !important;
    }

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

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

    .platform-directory-grid,
    .legal-navigation {
        grid-template-columns: 1fr;
    }
}
