:root {
    --bg: #f4f1eb;
    --paper: #fffdf8;
    --ink: #1d1b18;
    --muted: #69625b;
    --line: #ddd4c7;
    --accent: #b02f2f;
    --accent-strong: #8b2020;
    --green: #247a55;
    --shadow: 0 24px 70px rgba(42, 31, 18, 0.22);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
}

button,
input,
textarea {
    font: inherit;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px clamp(18px, 4vw, 46px);
    border-bottom: 1px solid rgba(29, 27, 24, 0.1);
}

.shelf-page .topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 20;
    justify-content: flex-start;
    min-height: 72px;
    background: rgba(244, 241, 235, 0.88);
    box-shadow: 0 14px 36px rgba(42, 31, 18, 0.12);
    transform: translateY(-100%);
    transition: transform 260ms ease;
    backdrop-filter: blur(14px);
}

.shelf-page.shelf-topbar-visible .topbar,
.shelf-page .topbar:hover,
.shelf-page .topbar:focus-within {
    transform: translateY(0);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 2px solid var(--ink);
    border-radius: 6px;
    background: var(--paper);
    font-size: 13px;
    letter-spacing: 0;
}

.topbar-actions {
    display: flex;
    gap: 10px;
}

.ghost-button,
.primary-button,
.small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 16px;
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.ghost-button:hover,
.primary-button:hover,
.small-button:hover {
    transform: translateY(-1px);
    border-color: rgba(29, 27, 24, 0.35);
}

.primary-button {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    font-weight: 700;
}

.primary-button:hover {
    background: var(--accent-strong);
}

.small-button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

.small-button.danger {
    border-color: rgba(176, 47, 47, 0.35);
    color: var(--accent-strong);
}

.shelf-wrap,
.admin-wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 64px;
}

.shelf-wrap {
    width: min(1320px, calc(100% - 32px));
    padding-top: 40px;
}

.shelf-intro,
.admin-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.shelf-intro {
    display: block;
    max-width: 720px;
}

.shelf-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.shelf-head h1 {
    margin-bottom: 0;
    font-size: clamp(26px, 3vw, 42px);
    line-height: 1.05;
    letter-spacing: 0;
}

.shelf-count {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255, 253, 248, 0.72);
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.shelf-copy {
    max-width: 760px;
    margin-bottom: 28px;
}

.shelf-copy h1 {
    margin-bottom: 10px;
    font-size: clamp(28px, 4vw, 54px);
    line-height: 1.02;
    letter-spacing: 0;
}

.shelf-copy p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.5;
}

.shelf-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 250px);
    align-items: start;
    gap: clamp(22px, 5vw, 70px);
}

.rubric-panel {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 8px;
    justify-self: stretch;
}

.rubric-panel a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--muted);
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.rubric-panel a:hover,
.rubric-panel a.active {
    border-color: var(--line);
    background: rgba(255, 253, 248, 0.72);
    color: var(--ink);
}

.rubric-panel span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rubric-panel b {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #fff;
    color: var(--accent-strong);
    font-size: 13px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

.shelf-intro h1,
.admin-head h1 {
    margin-bottom: 12px;
    font-size: clamp(34px, 5vw, 64px);
    line-height: 0.98;
    letter-spacing: 0;
}

.shelf-intro p,
.admin-head p,
.muted {
    color: var(--muted);
}

.empty-state,
.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 253, 248, 0.76);
    padding: clamp(18px, 4vw, 34px);
}

.empty-state {
    max-width: 620px;
}

.magazine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.magazine-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: 0 16px 38px rgba(42, 31, 18, 0.1);
}

.cover-link {
    display: block;
    padding: 12px;
    background: #d8d0c4;
    text-decoration: none;
}

.cover-art {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 0.72;
    border-radius: 4px;
    overflow: hidden;
    padding: 14px;
    background:
        linear-gradient(135deg, rgba(176, 47, 47, 0.95), rgba(28, 28, 30, 0.92)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 18px);
    color: #fff;
    box-shadow: 0 18px 42px rgba(28, 25, 21, 0.28);
}

.cover-canvas {
    position: relative;
    z-index: 4;
    display: block;
    max-width: 100%;
    max-height: 100%;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(28, 25, 21, 0.24);
    opacity: 0;
    transition: opacity 180ms ease;
}

.cover-frame {
    position: absolute;
    inset: 14px;
    z-index: 3;
    width: calc(100% - 28px);
    height: calc(100% - 28px);
    border: 0;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(28, 25, 21, 0.24);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.cover-fallback {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px;
}

.cover-rendered {
    background: linear-gradient(135deg, #d7d0c5, #eee9de);
}

.cover-rendered .cover-canvas {
    opacity: 1;
}

.cover-rendered .cover-fallback,
.cover-native .cover-fallback {
    opacity: 0;
}

.cover-native {
    background: linear-gradient(135deg, #d7d0c5, #eee9de);
}

.cover-native .cover-frame {
    opacity: 1;
}

.cover-art strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 30px;
    line-height: 1.04;
}

.cover-kicker,
.cover-art span:last-child {
    font-size: 13px;
    font-weight: 700;
    opacity: 0.82;
}

.magazine-card-body {
    padding: 14px 16px 16px;
}

.magazine-card-body h2 {
    margin-bottom: 6px;
    overflow-wrap: anywhere;
    font-size: 18px;
    line-height: 1.18;
}

.magazine-card-body p {
    color: var(--muted);
}

.card-meta,
.admin-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    color: var(--muted);
    font-size: 14px;
}

.card-meta a,
.admin-links a {
    color: var(--accent-strong);
    font-weight: 700;
}

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

.admin-limit {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 14px;
    background: var(--paper);
    color: var(--muted);
    font-size: 14px;
}

.notice {
    margin-bottom: 14px;
    border-radius: 6px;
    padding: 12px 14px;
    font-weight: 700;
}

.notice.success {
    border: 1px solid rgba(36, 122, 85, 0.24);
    background: rgba(36, 122, 85, 0.1);
    color: var(--green);
}

.notice.error {
    border: 1px solid rgba(176, 47, 47, 0.22);
    background: rgba(176, 47, 47, 0.09);
    color: var(--accent-strong);
}

.panel + .panel {
    margin-top: 22px;
}

.panel h2 {
    font-size: 24px;
}

.upload-form {
    display: grid;
    gap: 18px;
}

.upload-form label {
    display: grid;
    gap: 8px;
}

.upload-form label span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.upload-form input[type="text"],
.upload-form input[type="file"],
.upload-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    padding: 12px 13px;
    color: var(--ink);
}

.upload-form textarea {
    resize: vertical;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    color: var(--muted);
}

.check-row label {
    display: inline-flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
}

.admin-list {
    display: grid;
    gap: 12px;
}

.admin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    padding: 16px;
}

.admin-item h3 {
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

.admin-item p {
    margin-bottom: 8px;
    color: var(--muted);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.admin-meta-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.admin-meta-form label {
    display: grid;
    gap: 5px;
}

.admin-meta-form span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.admin-meta-form input {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 9px;
}

.reader-page {
    min-height: 100vh;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(20, 20, 22, 0.92), rgba(38, 35, 31, 0.95)),
        #242220;
    color: #fff;
}

.reader-shell {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    height: 100vh;
}

.reader-toolbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 12;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) clamp(12px, 2vw, 22px) 12px;
    background: rgba(20, 19, 18, 0.86);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
    transform: translateY(-110%);
    transition: transform 260ms ease, opacity 220ms ease;
    opacity: 0;
    backdrop-filter: blur(14px);
}

.reader-shell.top-controls-visible .reader-toolbar,
.reader-toolbar:hover,
.reader-toolbar:focus-within {
    opacity: 1;
    transform: translateY(0);
}

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

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

.reader-title strong {
    font-size: 16px;
}

.reader-title span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
}

.reader-actions {
    display: flex;
    gap: 8px;
}

.icon-button,
.small-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
}

.icon-button:hover,
.small-icon:hover {
    background: rgba(255, 255, 255, 0.16);
}

.back-link {
    font-size: 30px;
    line-height: 1;
}

.reader-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 0;
    overflow: auto;
    padding: 20px 72px 26px;
}

.book-frame {
    position: relative;
    display: grid;
    place-items: center;
    width: min(1580px, 100%);
    height: 100%;
    min-height: 340px;
}

.book-spread {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 0;
    align-items: center;
    justify-items: stretch;
    isolation: isolate;
    width: 100%;
    height: 100%;
    perspective: 1800px;
    transform-style: preserve-3d;
}

.book-spread.single {
    grid-template-columns: minmax(0, 1fr);
    width: min(720px, 100%);
}

.book-spread:not(.single)::after {
    content: "";
    position: absolute;
    top: var(--spine-top, 0);
    left: 50%;
    z-index: 3;
    width: 18px;
    height: var(--spine-height, 100%);
    pointer-events: none;
    transform: translateX(-50%);
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.18), rgba(255, 255, 255, 0.2) 48%, rgba(0, 0, 0, 0.22)),
        linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.18), transparent);
    opacity: 0.62;
    mix-blend-mode: multiply;
}

.book-spread.turn-next .page-slot canvas,
.book-spread.turn-prev .page-slot canvas {
    animation: pageSettle 520ms cubic-bezier(0.2, 0.82, 0.22, 1);
}

.page-slot {
    position: relative;
    display: grid;
    align-items: center;
    justify-items: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    overflow: visible;
}

.page-slot[data-slot="left"] {
    justify-items: end;
}

.page-slot[data-slot="right"] {
    justify-items: start;
}

.page-slot.hidden {
    display: none;
}

.page-slot canvas {
    display: block;
    background: var(--paper);
    box-shadow: var(--shadow);
    backface-visibility: hidden;
    transform-origin: center center;
}

.page-slot:first-child canvas {
    border-radius: 4px 0 0 4px;
}

.page-slot:last-of-type canvas {
    border-radius: 0 4px 4px 0;
}

.book-spread.single canvas {
    border-radius: 4px;
}

.turn-sheet {
    position: absolute;
    z-index: 6;
    display: block;
    background: var(--paper);
    pointer-events: none;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
    filter: brightness(1);
}

.turn-sheet::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.2));
}

.turn-sheet-next {
    transform-origin: left center;
    animation: pageFlipNext 720ms cubic-bezier(0.16, 0.8, 0.18, 1) forwards;
}

.turn-sheet-prev {
    transform-origin: right center;
    animation: pageFlipPrev 720ms cubic-bezier(0.16, 0.8, 0.18, 1) forwards;
}

.page-label {
    position: absolute;
    right: 12px;
    bottom: 10px;
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.54);
    color: rgba(255, 255, 255, 0.86);
    font-size: 12px;
}

.loader {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

.loader.hidden {
    display: none;
}

.nav-button {
    position: fixed;
    top: 50%;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 52px;
    height: 74px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: rgba(20, 19, 18, 0.64);
    color: #fff;
    cursor: pointer;
    font-size: 42px;
    transform: translateY(-50%);
}

.nav-button:hover {
    background: rgba(20, 19, 18, 0.86);
}

.nav-prev {
    left: 14px;
}

.nav-next {
    right: 14px;
}

.reader-bottom {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9;
    display: grid;
    gap: 10px;
    padding: 18px 16px 14px;
    background: rgba(20, 19, 18, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -20px 48px rgba(0, 0, 0, 0.34);
    opacity: 0.7;
    transform: translateY(calc(100% - 18px));
    transition: transform 260ms ease, opacity 220ms ease;
    backdrop-filter: blur(14px);
}

.reader-bottom::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04)),
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    cursor: ns-resize;
}

.reader-shell.controls-visible .reader-bottom,
.reader-bottom:hover,
.reader-bottom:focus-within {
    opacity: 1;
    transform: translateY(0);
}

.page-controls {
    display: grid;
    grid-template-columns: auto minmax(90px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
}

.small-icon {
    width: 32px;
    height: 32px;
    font-size: 24px;
}

#pageRange {
    width: 100%;
    accent-color: var(--accent);
}

#pageCounter {
    min-width: 86px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    text-align: right;
}

.thumb-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.thumb-button {
    position: relative;
    flex: 0 0 auto;
    width: 58px;
    height: 76px;
    border: 2px solid transparent;
    border-radius: 5px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.thumb-button canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 3px;
    object-fit: cover;
    background: #fff;
}

.thumb-button span {
    position: absolute;
    right: 3px;
    bottom: 3px;
    border-radius: 999px;
    padding: 1px 5px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 10px;
}

.thumb-button.active {
    border-color: #fff;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 54px;
    z-index: 10;
    max-width: min(420px, calc(100% - 24px));
    border-radius: 6px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@keyframes pageFlipNext {
    0% {
        transform: rotateY(0deg);
        opacity: 1;
        filter: brightness(1);
    }
    42% {
        transform: translateX(-18px) rotateY(-78deg) skewY(-1deg);
        opacity: 0.96;
        filter: brightness(0.82);
    }
    100% {
        transform: translateX(-54px) rotateY(-168deg) skewY(-2deg);
        opacity: 0;
        filter: brightness(0.7);
    }
}

@keyframes pageFlipPrev {
    0% {
        transform: rotateY(0deg);
        opacity: 1;
        filter: brightness(1);
    }
    42% {
        transform: translateX(18px) rotateY(78deg) skewY(1deg);
        opacity: 0.96;
        filter: brightness(0.82);
    }
    100% {
        transform: translateX(54px) rotateY(168deg) skewY(2deg);
        opacity: 0;
        filter: brightness(0.7);
    }
}

@keyframes pageSettle {
    0% {
        opacity: 0.58;
        filter: brightness(0.92);
        transform: translateY(4px) scale(0.992);
    }
    100% {
        opacity: 1;
        filter: brightness(1);
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 820px) {
    .shelf-intro h1,
    .admin-head h1 {
        font-size: 38px;
        line-height: 1.04;
    }

    .shelf-intro,
    .shelf-head,
    .shelf-layout,
    .admin-head,
    .admin-item {
        display: grid;
    }

    .rubric-panel {
        position: static;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        order: -1;
    }

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

    .admin-actions {
        justify-content: flex-start;
    }

    .reader-toolbar {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .reader-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .reader-stage {
        padding: 12px 12px 18px;
    }

    .book-frame {
        height: 100%;
    }

    .book-spread {
        grid-template-columns: minmax(0, 1fr);
        width: min(680px, 100%);
    }

    .nav-button {
        display: none;
    }

    .page-slot:first-child canvas,
    .page-slot:last-of-type canvas {
        border-radius: 4px;
    }

    .page-slot[data-slot="left"],
    .page-slot[data-slot="right"] {
        justify-items: center;
    }

    .reader-bottom {
        max-height: min(48vh, 310px);
        padding: 16px 10px 10px;
        transform: translateY(calc(100% - 16px));
    }

    .reader-bottom::before {
        height: 16px;
    }

    .thumb-strip {
        gap: 7px;
    }

    .thumb-button {
        width: 48px;
        height: 66px;
    }

    .cover-art {
        min-height: 0;
    }
}

@media (max-width: 520px) {
    .topbar {
        padding-inline: 14px;
    }

    .brand span:last-child {
        display: inline;
    }

    .shelf-wrap,
    .admin-wrap {
        width: min(100% - 24px, 1180px);
        padding-top: 28px;
    }

    .magazine-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 14px;
    }

    .shelf-head {
        align-items: start;
    }

    .shelf-head h1 {
        font-size: 28px;
    }

    .magazine-card-body h2 {
        font-size: 16px;
    }

    .page-controls {
        grid-template-columns: auto minmax(80px, 1fr) auto;
    }

    #pageCounter {
        grid-column: 1 / -1;
        min-width: 0;
        text-align: center;
    }

    .reader-bottom {
        padding-inline: 10px;
    }
}
