/* ==========================================================================
   Library layout: left rail + main column, shared by the book browse pages.
   Tile tones (.lib-tone--*) come from base.css.
   ========================================================================== */

/* Every shelf shares the landing page's colours; shelves keep their own colour only in their rail icon and tiles */
.library-page { --tone: var(--jg-stage-tint); --tone-ink: var(--jg-accent); }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.library {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: clamp(1.75rem, 3vw, 2.75rem);
    align-items: start;
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

.library__main {
    min-width: 0;
}

/* --------------------------------------------------------------------------
   Rail
   -------------------------------------------------------------------------- */
.lib-rail {
    position: sticky;
    top: calc(var(--header-height, 64px) + 1.25rem);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.lib-rail__search {
    position: relative;
    margin-bottom: 0.75rem;
}

.lib-rail__search i {
    position: absolute;
    top: 50%;
    left: 0.9rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.lib-rail__search input {
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.9rem 0.5rem 2.4rem;
    font: inherit;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 999px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lib-rail__search input::placeholder {
    color: var(--text-muted);
}

.lib-rail__search input:focus-visible {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 25%, transparent);
}

.lib-rail__group {
    margin: 1rem 0 0.35rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
}

.lib-rail__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lib-rail__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 48px;
    padding: 0.4rem 0.6rem 0.4rem 0.4rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 14px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.lib-rail__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
    color: var(--tone-ink);
    background: var(--tone);
    border-radius: 11px;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, color 0.2s ease;
}

.lib-rail__text {
    flex: 1;
    min-width: 0;
}

.lib-rail__count {
    min-width: 1.75rem;
    padding: 0.1rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    background: var(--bg-secondary);
    border-radius: 999px;
}

.lib-rail__link:hover {
    color: var(--text-primary);
    text-decoration: none;
    background: color-mix(in srgb, var(--jg-stage-tint) 60%, transparent);
}

.lib-rail__link:hover .lib-rail__icon {
    transform: rotate(-8deg) scale(1.06);
}

.lib-rail__link[aria-current="page"] {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--jg-stage-tint);
}

.lib-rail__link[aria-current="page"] .lib-rail__icon {
    color: #fff;
    background: var(--tone-ink);
}

[data-theme="dark"] .lib-rail__link[aria-current="page"] .lib-rail__icon {
    color: var(--bg-primary);
}

.lib-rail__link[aria-current="page"] .lib-rail__count {
    color: var(--text-primary);
    background: color-mix(in srgb, var(--bg-card) 70%, transparent);
}

.lib-rail__link:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Hero: a graph-paper panel in the shelf's tone, with the shelf's own
   covers stacked as 3D books on the right
   -------------------------------------------------------------------------- */
.lib-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
    align-items: center;
    gap: 1.5rem;
    min-height: 300px;
    margin-bottom: 1.5rem;
    padding: clamp(1.75rem, 3.5vw, 2.75rem) clamp(1.75rem, 3.5vw, 3rem);
    overflow: hidden;
    background: var(--jg-stage-surface);
    border: 1px solid color-mix(in srgb, var(--jg-accent) 12%, transparent);
    border-radius: 28px;
}

.lib-hero__title {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 1.5rem + 3vw, 4rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.lib-hero__subtitle {
    max-width: 46ch;
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.lib-hero__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}

.lib-hero__facts li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.8rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    background: color-mix(in srgb, var(--bg-card) 78%, transparent);
    border-radius: 999px;
}

.lib-hero__facts i {
    font-size: 0.8rem;
    color: var(--tone-ink);
}

.lib-hero__note {
    margin: 1rem 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.lib-hero__note a {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--tone-ink);
    text-underline-offset: 3px;
}

.lib-hero .page-search-form {
    margin-top: 1.25rem;
}

/* The stack: three books standing at different angles; hovering the hero fans them out */
.lib-hero__stack {
    position: relative;
    align-self: stretch;
    min-height: 230px;
    perspective: 1200px;
}

.lib-hero__stack::after {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: 4px;
    height: 26px;
    background: radial-gradient(closest-side, rgba(14, 27, 44, 0.32), transparent);
    filter: blur(4px);
}

.lib-hero__book {
    --tile-ink: var(--tone-ink);
    position: absolute;
    bottom: 16px;
    left: 50%;
    width: 46%;
    max-width: 190px;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.lib-hero__book--1 { z-index: 3; transform: translateX(-50%); }
.lib-hero__book--2 { z-index: 2; transform: translateX(-104%) translateY(-6px) rotate(-7deg) scale(0.86); }
.lib-hero__book--3 { z-index: 1; transform: translateX(2%) translateY(-6px) rotate(7deg) scale(0.86); }

.lib-hero:hover .lib-hero__book--1 { transform: translateX(-50%) translateY(-10px); }
.lib-hero:hover .lib-hero__book--2 { transform: translateX(-116%) translateY(-2px) rotate(-11deg) scale(0.86); }
.lib-hero:hover .lib-hero__book--3 { transform: translateX(14%) translateY(-2px) rotate(11deg) scale(0.86); }

.lib-hero__book .book3d {
    --t: 16px;
}

.lib-hero__book--2 .book3d { transform: rotateY(18deg) rotateX(2deg); }
.lib-hero__book--2 .book3d__pages { right: auto; left: calc(var(--t) / -2 + 2px); }

/* Toolbar: count on the left, sort on the right */
.lib-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    margin: 0 0 1.25rem;
}

.lib-toolbar__count {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.lib-toolbar__count strong {
    font-weight: 700;
    color: var(--text-primary);
}

.lib-sort {
    display: inline-flex;
    gap: 2px;
    padding: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 999px;
}

.lib-sort__link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 0.95rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    border-radius: 999px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.lib-sort__link:hover {
    color: var(--text-primary);
    text-decoration: none;
    background: var(--bg-secondary);
}

.lib-sort__link[aria-current="true"] {
    color: var(--jg-cta-ink);
    background: var(--jg-sun-cta);
}

.lib-sort__link:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Tablet and phone: rail becomes a scrolling strip above the hero
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .library {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.25rem;
        padding-top: 1rem;
    }

    .lib-rail {
        position: static;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        margin: 0 calc(var(--bs-gutter-x, 1.5rem) * -0.5);
        padding: 0.25rem calc(var(--bs-gutter-x, 1.5rem) * 0.5);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .lib-rail::-webkit-scrollbar {
        display: none;
    }

    .lib-rail__search,
    .lib-rail__group {
        display: none;
    }

    .lib-rail__list {
        flex-direction: row;
        gap: 0.5rem;
    }

    .lib-rail__link {
        min-height: 44px;
        padding: 0.3rem 0.85rem 0.3rem 0.3rem;
        white-space: nowrap;
        background: var(--bg-card);
        border: 1px solid var(--border-light);
        border-radius: 999px;
    }

    .lib-rail__icon {
        width: 34px;
        height: 34px;
        border-radius: 50%;
    }

    .lib-rail__count {
        display: none;
    }
}

@media (max-width: 800px) {
    .lib-hero {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .lib-hero__stack {
        min-height: 200px;
        order: -1;
        margin: -0.5rem 0 0;
    }

    .lib-hero__book {
        width: 34%;
    }
}

@media (max-width: 480px) {
    .lib-hero {
        padding: 1.5rem 1.25rem;
        border-radius: 22px;
    }

    .lib-hero__subtitle {
        font-size: 1rem;
    }

    /* Phones: get the books above the fold. The book page repeats these facts under Features. */
    .lib-hero__facts {
        display: none;
    }

    .lib-hero__title {
        font-size: 2.25rem;
    }

    .lib-hero__stack {
        min-height: 136px;
    }

    .lib-hero__book {
        width: 30%;
    }

    .lib-sort {
        width: 100%;
    }

    .lib-sort__link {
        flex: 1;
        justify-content: center;
        padding: 0 0.5rem;
        font-size: 0.8125rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lib-rail__icon,
    .lib-hero__book {
        transition: none;
    }
}

/* --------------------------------------------------------------------------
   Shared tile colours. Class names on the tiles are the contract with
   users/js/books/new_books.js — keep them stable.
   -------------------------------------------------------------------------- */
.library-page {
    --act-download: #10a37f;
    --act-preview: #2f80ed;
    --act-amazon: #f59e0b;
    --act-rate: #8b5cf6;
    --act-favorite: #ec4899;
    --paper-edge: #f4f1ea;
    --paper-line: #d9d4c7;
}

[data-theme="dark"] .library-page {
    --act-download: #2fc79f;
    --act-preview: #5aa2f5;
    --act-amazon: #f5b041;
    --act-rate: #a78bfa;
    --act-favorite: #f472b6;
}

.library-page .book-tile {
    --tile-tone: var(--lib-sky);
    --tile-ink: var(--lib-sky-ink);
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.library-page .book-tile[data-book-type="coloring"] { --tile-tone: var(--lib-rose); --tile-ink: var(--lib-rose-ink); }
.library-page .book-tile[data-book-type="puzzle"] { --tile-tone: var(--lib-sky); --tile-ink: var(--lib-sky-ink); }
.library-page .book-tile[data-book-type="mandala"] { --tile-tone: var(--lib-sun); --tile-ink: var(--lib-sun-ink); }

.library-page .book-cover picture {
    display: contents;
}

/* A drawn cover for books that have no image yet */
.library-page .no-cover {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: 12% 12% 10%;
    color: #fff;
    background:
        radial-gradient(circle at 85% 12%, rgba(255, 255, 255, 0.25) 0 18%, transparent 19%),
        linear-gradient(160deg, var(--tile-ink), color-mix(in srgb, var(--tile-ink) 70%, #000));
}

.library-page .no-cover__logo {
    width: 22%;
    height: auto;
    border-radius: 18%;
}

.library-page .no-cover__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.library-page .no-cover__brand {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.8;
}

.library-page .book-flag {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: var(--tile-ink);
    border-radius: 999px;
    box-shadow: 0 4px 10px -4px rgba(14, 27, 44, 0.5);
}

[data-theme="dark"] .library-page .book-flag {
    color: var(--bg-primary);
}

.library-page .book-title {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.library-page .book-title__link {
    color: inherit;
    text-decoration: none;
}

/* The whole tile opens the book; the buttons sit above this layer */
.library-page .book-title__link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
}

.library-page .book-title__link:focus-visible {
    outline: none;
}

.library-page .book-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.85rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.library-page .book-rating,
.library-page .book-downloads {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.library-page .book-rating {
    font-weight: 600;
    color: var(--text-primary);
}

.library-page .book-rating i {
    color: #f5b301;
}

.library-page .book-downloads i {
    color: var(--act-preview);
}

.library-page .book-age {
    padding: 0.1rem 0.55rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: 999px;
}

/* Actions */
.library-page .book-actions {
    position: relative;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.library-page .book-actions button,
.library-page .book-actions .btn-amazon {
    --act: var(--act-preview);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 0.9rem;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    background: var(--act);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--act) 70%, transparent);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.library-page .book-actions .btn-tile-download { --act: var(--act-download); }
.library-page .book-actions .btn-preview-flip { --act: var(--act-preview); }
.library-page .book-actions .btn-amazon { --act: var(--act-amazon); }
.library-page .book-actions .btn-rate { --act: var(--act-rate); }
.library-page .book-actions .btn-tile-favorite { --act: var(--act-favorite); }
.library-page .book-actions .btn-tile-download.already-downloaded { --act: var(--act-preview); }

[data-theme="dark"] .library-page .book-actions button,
[data-theme="dark"] .library-page .book-actions .btn-amazon {
    color: #0b1220;
}

.library-page .book-actions button:hover,
.library-page .book-actions .btn-amazon:hover {
    color: #fff;
    background: color-mix(in srgb, var(--act) 88%, #000);
    box-shadow: 0 10px 20px -8px color-mix(in srgb, var(--act) 80%, transparent);
    transform: translateY(-2px) scale(1.1);
}

[data-theme="dark"] .library-page .book-actions button:hover,
[data-theme="dark"] .library-page .book-actions .btn-amazon:hover {
    color: #0b1220;
    background: color-mix(in srgb, var(--act) 85%, #fff);
}

.library-page .book-actions button:focus-visible,
.library-page .book-actions .btn-amazon:focus-visible {
    outline: 2px solid var(--act);
    outline-offset: 2px;
}

.library-page .book-actions .btn-tile-download span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.library-page .inline-rating-widget {
    z-index: 30;
    border: 1px solid var(--border-medium);
    border-radius: 16px;
    box-shadow: 0 18px 40px -18px rgba(14, 27, 44, 0.45);
}

/* --------------------------------------------------------------------------
   Grid: the full cover on a white card; the buttons pop in on hover
   -------------------------------------------------------------------------- */
.library-page .books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: clamp(1.25rem, 2vw, 1.75rem);
    margin: 0 0 3rem;
}

.library-page .books-grid .book-tile {
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(14, 27, 44, 0.06), 0 10px 28px -18px rgba(14, 27, 44, 0.3);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease, border-color 0.25s ease, opacity 0.3s ease;
}

.library-page .books-grid .book-cover {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--tile-tone);
}

.library-page .books-grid .book-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Favourited books wear a small heart on the cover */
.library-page .books-grid .book-tile.favorited .book-cover::after {
    content: "\f004";
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    font-family: "Font Awesome 6 Free";
    font-size: 0.8rem;
    font-weight: 900;
    color: #fff;
    background: var(--act-favorite);
    border-radius: 50%;
    box-shadow: 0 4px 10px -4px rgba(14, 27, 44, 0.5);
}

.library-page .books-grid .book-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.85rem 1rem 0.75rem;
}

.library-page .books-grid .book-title {
    min-height: 2.6em;
}

.library-page .books-grid .book-meta {
    gap: 0.35rem 0.75rem;
}

/* Dots stand in for the buttons until the card is hovered or focused */
.library-page .book-dock {
    position: relative;
    display: grid;
    place-items: center;
    height: 44px;
    margin-top: 0.4rem;
}

.library-page .book-dock__hint {
    display: flex;
    gap: 7px;
    transition: opacity 0.2s ease, transform 0.3s ease;
}

.library-page .book-dock__hint i {
    width: 6px;
    height: 6px;
    background: var(--border-strong);
    border-radius: 50%;
}

.library-page .book-dock .book-actions {
    position: absolute;
    inset: 0;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 4px;
}

.library-page .book-dock .book-actions > * {
    margin: 0;
    opacity: 0;
    transform: translateY(10px) scale(0.6);
}

.library-page .book-dock .book-actions > :nth-child(2) { transition-delay: 30ms; }
.library-page .book-dock .book-actions > :nth-child(3) { transition-delay: 60ms; }
.library-page .book-dock .book-actions > :nth-child(4) { transition-delay: 90ms; }
.library-page .book-dock .book-actions > :nth-child(5) { transition-delay: 120ms; }

.library-page .books-grid .book-tile:hover .book-dock__hint,
.library-page .books-grid .book-tile:focus-within .book-dock__hint,
.library-page .books-grid .book-tile.preview-active .book-dock__hint {
    opacity: 0;
    transform: scale(0.6);
}

.library-page .books-grid .book-tile:hover .book-dock .book-actions > *,
.library-page .books-grid .book-tile:focus-within .book-dock .book-actions > *,
.library-page .books-grid .book-tile.preview-active .book-dock .book-actions > * {
    opacity: 1;
    transform: none;
}

.library-page .books-grid .book-tile .book-dock .book-actions > :hover {
    transform: translateY(-2px) scale(1.12);
    transition-delay: 0ms;
}

.library-page .books-grid .book-tile:has(.book-title__link:focus-visible) {
    outline: 3px solid var(--brand-primary);
    outline-offset: 3px;
}

@media (hover: hover) {
    .library-page .books-grid .book-tile:hover {
        border-color: color-mix(in srgb, var(--tile-ink) 45%, transparent);
        box-shadow: 0 2px 4px rgba(14, 27, 44, 0.08), 0 28px 50px -22px rgba(14, 27, 44, 0.5);
        transform: translateY(-6px);
    }

    .library-page .books-grid .book-tile:hover .book-cover img {
        transform: scale(1.06);
    }

    .library-page .books-grid .book-tile:hover .book-title__link {
        color: var(--tile-ink);
    }

    /* The rest of the shelf steps back while you look at one book */
    .library-page .books-grid:has(.book-tile:hover) .book-tile:not(:hover) {
        opacity: 0.72;
    }
}

/* Touch screens have no hover: show the buttons straight away */
@media (hover: none) {
    .library-page .book-dock__hint {
        display: none;
    }

    .library-page .book-dock .book-actions > * {
        opacity: 1;
        transform: none;
    }
}

/* Flip-through preview plays over the cover */
.library-page .flipbook-container {
    inset: 0;
    z-index: 4;
    background: #fff;
}

.library-page .coloring-page,
.library-page .flip-page {
    inset: 0;
    border: 0;
    border-radius: 0;
}

/* --------------------------------------------------------------------------
   The 3D hardcover, used in the hero stack and on the book page. It takes the
   shape of its cover image, so square and portrait covers both work.
   -------------------------------------------------------------------------- */
.library-page .book-stage {
    position: relative;
    perspective: 1400px;
}

.library-page .book-stage::after {
    content: "";
    position: absolute;
    left: 8%;
    right: 2%;
    bottom: 14px;
    height: 30px;
    background: radial-gradient(closest-side, rgba(14, 27, 44, 0.38), transparent);
    filter: blur(3px);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease;
}

.library-page .book3d {
    --t: 22px;
    position: relative;
    z-index: 1;
    width: 100%;
    transform-style: preserve-3d;
    transform: rotateY(-22deg) rotateX(3deg);
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Back board, showing as a coloured rim behind the pages */
.library-page .book3d::before {
    content: "";
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--tile-ink) 75%, #000);
    border-radius: 2px 6px 6px 2px;
    transform: translateZ(calc(var(--t) / -2));
    box-shadow: 18px 18px 30px -12px rgba(14, 27, 44, 0.45);
}

.library-page .book3d__front {
    position: relative;
    aspect-ratio: auto;
    overflow: hidden;
    border: 0;
    background: #fff;
    border-radius: 2px 6px 6px 2px;
    transform: translateZ(calc(var(--t) / 2));
}

/* Hinge crease and a soft sheen */
.library-page .book3d__front::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0, rgba(255, 255, 255, 0.4) 1.6%, rgba(0, 0, 0, 0.12) 3.4%, transparent 7%),
        linear-gradient(118deg, rgba(255, 255, 255, 0.3) 0, transparent 38%);
    border-radius: inherit;
}

.library-page .book3d__front img {
    display: block;
    width: 100%;
    height: auto;
}

.library-page .book3d .no-cover {
    aspect-ratio: 8.5 / 11;
    height: auto;
    padding-left: 16%;
}

/* Page block on the right-hand edge */
.library-page .book3d__pages {
    position: absolute;
    top: 3px;
    bottom: 3px;
    right: calc(var(--t) / -2 + 2px);
    width: calc(var(--t) - 2px);
    background: repeating-linear-gradient(90deg, var(--paper-edge) 0 2px, var(--paper-line) 2px 3px);
    transform: rotateY(90deg);
}

/* --------------------------------------------------------------------------
   Smaller screens
   -------------------------------------------------------------------------- */
/* Phones: two covers per row, buttons always showing */
@media (max-width: 480px) {
    .library-page .books-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    /* books.css turns tiles into rows on phones; keep the card */
    .library-page .books-grid .book-tile {
        flex-direction: column;
        gap: 0;
        padding: 0;
        border: 1px solid var(--border-light);
        border-radius: 14px;
    }

    .library-page .books-grid .book-cover {
        flex: none;
        align-self: stretch;
    }

    .library-page .books-grid .book-info {
        padding: 0.65rem 0.6rem 0.6rem;
    }

    .library-page .books-grid .book-title {
        font-size: 0.9rem;
    }

    .library-page .book-dock {
        height: 34px;
    }

    .library-page .book-dock .book-actions button,
    .library-page .book-dock .book-actions .btn-amazon {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .library-page .book-dock .book-actions > *::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .library-page .books-grid .book-tile,
    .library-page .books-grid .book-cover img,
    .library-page .book3d,
    .library-page .book-stage::after,
    .library-page .book-actions button,
    .library-page .book-actions .btn-amazon,
    .library-page .book-dock__hint {
        transition: none;
    }

    .library-page .books-grid .book-tile:hover,
    .library-page .books-grid .book-tile:hover .book-cover img {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Category chips
   -------------------------------------------------------------------------- */
.lib-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
}

.lib-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 40px;
    padding: 0 0.6rem 0 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lib-chip span {
    min-width: 1.6rem;
    padding: 0.05rem 0.45rem;
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    background: var(--bg-secondary);
    border-radius: 999px;
}

.lib-chip:hover {
    color: var(--text-primary);
    text-decoration: none;
    border-color: var(--tone-ink);
    transform: translateY(-1px);
}

.lib-chip[aria-current="true"] {
    color: var(--text-primary);
    background: var(--tone);
    border-color: var(--tone-ink);
}

.lib-chip[aria-current="true"] span {
    color: var(--text-primary);
    background: color-mix(in srgb, var(--bg-card) 70%, transparent);
}

.lib-chip:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .lib-chips {
        flex-wrap: nowrap;
        margin-right: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
        padding-right: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .lib-chips::-webkit-scrollbar {
        display: none;
    }

    .lib-chip {
        flex: none;
    }
}

/* --------------------------------------------------------------------------
   Cover extras: loading shimmer, New flag, Downloaded badge
   -------------------------------------------------------------------------- */
.library-page .books-grid .book-cover {
    background:
        linear-gradient(100deg, transparent 30%, color-mix(in srgb, #fff 45%, transparent) 50%, transparent 70%) 0 0 / 250% 100%,
        var(--tile-tone);
    animation: lib-shimmer 1.6s linear infinite;
}

.library-page .books-grid .book-cover.is-loaded,
.library-page .books-grid .book-cover:has(.no-cover) {
    animation: none;
}

@keyframes lib-shimmer {
    to { background-position: -150% 0, 0 0; }
}

.library-page .book-flag--new {
    background: var(--act-download);
}

.library-page .book-owned {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: color-mix(in srgb, #0b1220 72%, transparent);
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

/* --------------------------------------------------------------------------
   Pick up where you left off
   -------------------------------------------------------------------------- */
.lib-recent {
    margin: 0 0 1.75rem;
}

.lib-recent__title {
    margin: 0 0 0.85rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.lib-recent__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lib-recent__item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 0.85rem;
    align-items: center;
    padding: 0.55rem;
    color: inherit;
    text-decoration: none;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    transition: border-color 0.2s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.lib-recent__item:hover {
    color: inherit;
    text-decoration: none;
    border-color: var(--tone-ink);
    transform: translateY(-2px);
}

.lib-recent__item img {
    grid-row: span 2;
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
}

.lib-recent__name {
    overflow: hidden;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.lib-recent__hint {
    font-size: 0.8125rem;
    color: var(--act-download);
}

.lib-recent__item:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Need less than a whole book? Two landing-style tiles at the end of a shelf:
   single pages (sun) and make-your-own tools (sky)
   -------------------------------------------------------------------------- */
.lib-next {
    margin: 3.5rem 0 1rem;
}

.lib-next__head {
    margin-bottom: 1.5rem;
}

.lib-next__head h2 {
    margin: 0 0 0.4rem;
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: var(--text-primary);
}

.lib-next__head p {
    max-width: 52ch;
    margin: 0;
    font-size: 1.0625rem;
    color: var(--text-secondary);
}

.lib-next__tiles {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 1.25rem;
}

.lib-next__tiles--one {
    grid-template-columns: minmax(0, 1fr);
}

.lib-next__tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 320px;
    padding: clamp(1.5rem, 2.4vw, 2.1rem);
    overflow: hidden;
    color: var(--text-primary);
    border-radius: 28px;
    isolation: isolate;
    min-width: 0;
}

.lib-next__tile--pages {
    background: var(--lib-sun);
    text-decoration: none;
}

.lib-next__tile--tools {
    background: var(--lib-sky);
}

.lib-next__tile h3 {
    margin: 0 0 0.5rem;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 1.1rem + 1vw, 1.9rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

.lib-next__text p {
    max-width: 30ch;
    margin: 0;
    line-height: 1.5;
    color: var(--text-secondary);
}

.lib-next__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.1rem;
    padding: 0.6rem 1.1rem;
    font-weight: 700;
    color: var(--jg-cta-ink);
    background: var(--jg-sun-cta);
    border-radius: 999px;
    box-shadow: 0 8px 18px -10px rgba(168, 106, 0, 0.7);
}

.lib-next__cta span {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.lib-next__tile--pages:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.lib-next__tile--pages:hover .lib-next__cta span {
    transform: translateX(3px);
}

/* Up to three real sheets fanned in the bottom-right corner; hovering spreads them */
.lib-next__fan {
    position: absolute;
    z-index: -1;
    right: 0;
    bottom: 0;
    width: 62%;
    height: 82%;
}

.lib-next__fan img {
    position: absolute;
    bottom: -22%;
    width: 50%;
    aspect-ratio: 8.5 / 11;
    object-fit: cover;
    object-position: top;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(14, 27, 44, 0.1), 0 18px 40px -14px rgba(14, 27, 44, 0.35);
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.lib-next__fan img:nth-child(1) { right: 34%; transform: rotate(-9deg); }
.lib-next__fan img:nth-child(2) { right: 18%; transform: rotate(-1deg) translateY(-6%); }
.lib-next__fan img:nth-child(3) { right: 2%; transform: rotate(8deg); }
.lib-next__fan img:nth-child(2):last-child { right: 6%; transform: rotate(6deg); }

.lib-next__tile--pages:hover .lib-next__fan img:nth-child(1) { transform: rotate(-13deg) translate(-8%, -8%); }
.lib-next__tile--pages:hover .lib-next__fan img:nth-child(2) { transform: rotate(-1deg) translateY(-16%); }
.lib-next__tile--pages:hover .lib-next__fan img:nth-child(3) { transform: rotate(12deg) translate(6%, -8%); }

.lib-next__tile--pages:focus-visible,
.lib-next__tools a:focus-visible,
.lib-next__all:focus-visible {
    outline: 3px solid var(--brand-primary);
    outline-offset: 3px;
}

/* Tool rows: a sample sheet, the name and one line of what it makes */
.lib-next__tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}

/* Tools on their own: the list on the left, their sample sheets fanned on the right */
.lib-next__tiles--one .lib-next__tile--tools > :not(.lib-next__fan) {
    max-width: min(460px, 52%);
}

.lib-next__fan--tools {
    width: 42%;
    height: 100%;
}

.lib-next__fan--tools img {
    bottom: -14%;
    width: 46%;
    padding: 5%;
    object-fit: contain;
}

.lib-next__fan--tools img:nth-child(1) { right: 46%; }
.lib-next__fan--tools img:nth-child(2) { right: 28%; }
.lib-next__fan--tools img:nth-child(3) { right: 10%; }

.lib-next__fan--tools img:only-child {
    right: 20%;
    width: 50%;
    transform: rotate(-5deg);
}

.lib-next__tile--tools:hover .lib-next__fan--tools img:nth-child(1) { transform: rotate(-12deg) translate(-6%, -6%); }
.lib-next__tile--tools:hover .lib-next__fan--tools img:nth-child(2) { transform: rotate(-1deg) translateY(-12%); }
.lib-next__tile--tools:hover .lib-next__fan--tools img:nth-child(3) { transform: rotate(11deg) translate(6%, -6%); }
.lib-next__tile--tools:hover .lib-next__fan--tools img:only-child { transform: rotate(-2deg) translateY(-8%); }

.lib-next__tools a {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.55rem 0.9rem 0.55rem 0.6rem;
    color: var(--text-primary);
    text-decoration: none;
    background: color-mix(in srgb, var(--bg-card) 72%, transparent);
    border-radius: 16px;
    transition: background-color 0.2s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.lib-next__tools a::after {
    content: "↗";
    margin-left: auto;
    color: var(--text-muted);
    transition: transform 0.25s ease, color 0.2s ease;
}

.lib-next__tools a:hover {
    text-decoration: none;
    background: var(--bg-card);
    transform: translateX(3px);
}

.lib-next__tools a:hover::after {
    color: var(--jg-accent);
    transform: translate(2px, -2px);
}

.lib-next__tools img {
    flex: none;
    width: 40px;
    height: 52px;
    object-fit: cover;
    object-position: top;
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(14, 27, 44, 0.12), 0 6px 14px -8px rgba(14, 27, 44, 0.45);
    transform: rotate(-4deg);
}

.lib-next__tools span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lib-next__tools strong {
    font-weight: 700;
    line-height: 1.25;
}

.lib-next__tools small {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--text-secondary);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.lib-next__all {
    align-self: flex-start;
    margin-top: auto;
    padding-top: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--jg-accent);
    text-underline-offset: 4px;
}

.lib-next__all:hover {
    color: var(--jg-accent);
}

@media (max-width: 900px) {
    .lib-next__tiles {
        grid-template-columns: minmax(0, 1fr);
    }

    .lib-next__tile {
        min-height: 0;
    }

    .lib-next__tile--pages {
        min-height: 300px;
    }

    .lib-next__fan {
        width: 50%;
    }

    .lib-next__tiles--one .lib-next__tile--tools > :not(.lib-next__fan) {
        max-width: none;
    }

    .lib-next__fan--tools {
        display: none;
    }
}

@media (max-width: 480px) {
    .lib-next__tile--pages {
        min-height: 360px;
    }

    .lib-next__fan {
        width: 88%;
        height: 58%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lib-next__fan img,
    .lib-next__tools a,
    .lib-next__cta span {
        transition: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .library-page .books-grid .book-cover {
        animation: none;
    }

    .lib-recent__item,
    .lib-chip {
        transition: none;
    }
}

/* --------------------------------------------------------------------------
   Activity pages: sheet tiles, the refine row and the hero's fanned sheets
   -------------------------------------------------------------------------- */
.library-page .pages-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* The top of a letter-size sheet peeking out of the card; the full sheet is one click away */
.library-page .pages-grid .book-cover {
    aspect-ratio: 1 / 1.08;
    padding: 10px 10px 0;
    background:
        linear-gradient(var(--jg-stage-grid) 1px, transparent 1px) 0 0 / 18px 18px,
        linear-gradient(90deg, var(--jg-stage-grid) 1px, transparent 1px) 0 0 / 18px 18px,
        var(--jg-stage);
    border: 0;
    border-radius: 0;
    overflow: hidden;
}

.library-page .pages-grid .book-cover.is-loaded {
    animation: none;
}

.library-page .page-sheet-tile .book-cover img,
.library-page .page-sheet-tile .no-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    background: #fff;
    border: 0;
    border-radius: 3px 3px 0 0;
    box-shadow: 0 1px 2px rgba(14, 27, 44, 0.1), 0 10px 22px -12px rgba(14, 27, 44, 0.4);
}

@media (hover: hover) {
    .library-page .pages-grid .page-sheet-tile:hover .book-cover img {
        transform: translateY(-4px) rotate(-1deg);
    }
}

.library-page .page-sheet-tile .no-cover {
    display: grid;
    place-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.library-page .book-type {
    margin-right: auto;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.library-page .book-actions .btn-tile-print { --act: var(--act-amazon); }

/* Sheet cards are shorter than book cards: type and downloads sit where the dock's dots would be */
.library-page .pages-grid .book-info {
    gap: 0.2rem;
    padding: 0.75rem 0.9rem 0.55rem;
}

.library-page .pages-grid .book-dock {
    margin-top: 0;
}

.library-page .pages-grid .book-dock .book-meta {
    width: 100%;
    transition: opacity 0.2s ease, transform 0.3s ease;
}

.library-page .pages-grid .book-tile:hover .book-dock .book-meta,
.library-page .pages-grid .book-tile:focus-within .book-dock .book-meta,
.library-page .pages-grid .book-tile.preview-active .book-dock .book-meta {
    opacity: 0;
    transform: translateY(-4px);
}

@media (hover: none) {
    .library-page .pages-grid .book-dock {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        height: auto;
    }

    .library-page .pages-grid .book-dock .book-actions {
        position: static;
    }

    .library-page .pages-grid .book-tile .book-dock .book-meta {
        opacity: 1;
        transform: none;
    }
}

/* Refine: category, difficulty and age as quiet pill selects */
.lib-refine {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
}

.lib-refine__field select {
    min-height: 38px;
    padding: 0 2.1rem 0 0.95rem;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238796a5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.85rem center;
    border: 1px solid var(--border-medium);
    border-radius: 999px;
    appearance: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.lib-refine__field select:hover {
    color: var(--text-primary);
    border-color: var(--jg-accent);
}

.lib-refine__field select[data-set] {
    color: var(--text-primary);
    background-color: var(--jg-stage-tint);
    border-color: var(--jg-accent);
}

.lib-refine__field select:focus-visible,
.lib-refine__clear:focus-visible {
    outline: 3px solid var(--brand-primary);
    outline-offset: 2px;
}

.lib-refine__clear {
    padding: 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--jg-accent);
    text-underline-offset: 3px;
}

.lib-refine__apply {
    min-height: 38px;
    padding: 0 1rem;
    font-weight: 600;
    color: var(--jg-cta-ink);
    background: var(--jg-sun-cta);
    border: 0;
    border-radius: 999px;
}

/* Hero: three real sheets, fanned; hovering the hero spreads them */
.lib-hero__sheets {
    position: relative;
    align-self: stretch;
    min-height: 240px;
}

.lib-hero__sheets img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42%;
    height: auto;
    aspect-ratio: 8.5 / 11;
    object-fit: cover;
    object-position: top;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(14, 27, 44, 0.1), 0 22px 44px -16px rgba(14, 27, 44, 0.45);
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.lib-hero__sheets img:nth-child(1) { z-index: 3; transform: translate(-50%, -50%) rotate(-2deg); }
.lib-hero__sheets img:nth-child(2) { z-index: 2; transform: translate(-100%, -46%) rotate(-10deg) scale(0.9); }
.lib-hero__sheets img:nth-child(3) { z-index: 1; transform: translate(0%, -46%) rotate(9deg) scale(0.9); }

.lib-hero:hover .lib-hero__sheets img:nth-child(1) { transform: translate(-50%, -54%) rotate(-1deg); }
.lib-hero:hover .lib-hero__sheets img:nth-child(2) { transform: translate(-112%, -44%) rotate(-14deg) scale(0.9); }
.lib-hero:hover .lib-hero__sheets img:nth-child(3) { transform: translate(12%, -44%) rotate(13deg) scale(0.9); }

/* Whole-books tile: square covers instead of letter sheets */
.lib-next__fan--covers img {
    bottom: 10%;
    width: 44%;
    aspect-ratio: 1;
    border-radius: 3px 8px 8px 3px;
    box-shadow: inset 6px 0 8px -6px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(14, 27, 44, 0.1), 0 18px 40px -14px rgba(14, 27, 44, 0.45);
}

@media (max-width: 800px) {
    .lib-hero__sheets {
        order: -1;
        min-height: 190px;
    }

    .lib-hero__sheets img {
        width: 30%;
    }
}

@media (max-width: 480px) {
    .library-page .pages-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .library-page .pages-grid .book-cover {
        padding: 6px 6px 0;
    }

    .lib-hero__sheets {
        min-height: 150px;
    }

    .lib-refine__field {
        flex: 1 1 calc(50% - 0.5rem);
    }

    .lib-refine__field select {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lib-hero__sheets img {
        transition: none;
    }
}
