:root {
    color-scheme: light;
    --cream: #e8dfc3;
    --paper: #f3ecd7;
    --paper-dark: #d7c89f;
    --ink: #27261f;
    --ink-soft: #555143;
    --olive: #4f5d42;
    --olive-dark: #2f3a2f;
    --olive-light: #788268;
    --rust: #a84f2c;
    --mustard: #d8a52d;
    --turquoise: #3d8582;
    --wood: #5e4029;
    --wood-light: #8b6541;
    --metal: #7a7d74;
    --black: #11120f;
    --focus: #ffd755;
    --department-width: 190px;
    --checkout-width: 350px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

html,
body {
    width: 100%;
    min-width: 280px;
    height: 100%;
}

body {
    overflow: hidden;
    background: #20271f;
    color: var(--ink);
    font-family: "Atkinson Hyperlegible", Arial, sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    border-radius: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.media-card:focus-visible {
    outline: 4px solid var(--focus);
    outline-offset: 3px;
}

button:disabled {
    cursor: default;
    opacity: 0.38;
}

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

#app-shell {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--cream);
}

#app-shell::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 18%, rgb(80 66 38 / 0.09) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 66%, rgb(80 66 38 / 0.07) 0 1px, transparent 2px),
        repeating-linear-gradient(95deg, transparent 0 5px, rgb(73 66 45 / 0.025) 5px 6px);
    background-size: 170px 130px, 130px 190px, auto;
    mix-blend-mode: multiply;
}

/* Advertisement bulletin board */

.ad-board {
    position: relative;
    z-index: 100;
    justify-self: center;
    display: grid;
    justify-items: center;
    gap: 2px;
    width: max-content;
    max-width: 100%;
    margin: 4px 0;
    padding: 5px 12px 8px;
    background:
        radial-gradient(circle, rgb(255 255 255 / 0.08) 0 1px, transparent 1.5px) 0 0 / 9px 9px,
        #75563a;
    border: 5px solid #3e2c1e;
    box-shadow: 0 3px 8px rgb(0 0 0 / 0.35);
}

.ad-board__label {
    color: #f0e1c1;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 2px;
}

.ad-board__tack {
    position: absolute;
    top: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #c6a23e;
    box-shadow: inset 1px 1px 1px rgb(255 255 255 / 0.45), 1px 2px 2px rgb(0 0 0 / 0.4);
}

.ad-board__tack--left {
    left: 6px;
}

.ad-board__tack--right {
    right: 6px;
}

.ad-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ad-gap, 12px);
    width: min(100%, var(--ad-total-width, 468px));
    min-height: var(--ad-height, 50px);
    overflow: hidden;
}

.ad-slot ins {
    display: block;
    flex: 0 0 auto;
    background: #171612;
}

/* Store header */

.storefront-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 82px;
    padding: 10px 24px;
    background:
        linear-gradient(rgb(255 255 255 / 0.05), rgb(0 0 0 / 0.08)),
        var(--olive-dark);
    color: #f5ebca;
    border-top: 1px solid #76806d;
    border-bottom: 7px solid #1e261f;
    box-shadow: 0 5px 12px rgb(0 0 0 / 0.3);
}

.store-brand__eyebrow {
    margin-bottom: 1px;
    color: #c6cbb7;
    font-family: "IBM Plex Mono", monospace;
    font-size: clamp(10px, 1vw, 13px);
    letter-spacing: 2px;
}

.store-brand__name {
    font-family: "Barlow Condensed", sans-serif;
    font-size: clamp(37px, 4vw, 58px);
    font-weight: 700;
    line-height: 0.86;
    letter-spacing: 2px;
}

.storefront-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.price-tag-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 37px;
    padding: 5px 8px;
    cursor: pointer;
    background: #d8a52d;
    border: 2px solid #29271e;
    color: #2b2618;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.7px;
    box-shadow: 2px 2px 0 rgb(0 0 0 / 0.28);
}

.price-tag-toggle[aria-pressed="false"] {
    background: #756f5d;
    color: #f0e6c9;
}

.price-tag-toggle__icon {
    display: inline-grid;
    place-items: center;
    width: 19px;
    height: 19px;
    background: #f1dc77;
    border: 1px solid #493b13;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    transform: rotate(-3deg);
}

.open-sign {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #20271f;
    border: 2px solid #8e927d;
    color: #e9d897;
    font-family: "IBM Plex Mono", monospace;
    font-size: 14px;
    letter-spacing: 2px;
    box-shadow: inset 0 0 12px rgb(0 0 0 / 0.4);
}

.open-sign__light {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #91c46b;
    box-shadow: 0 0 9px #a6e277;
}

/* Three-column store */

.store-layout {
    position: relative;
    display: grid;
    grid-template-columns: var(--department-width) minmax(0, 1fr) var(--checkout-width);
    min-height: 0;
    overflow: hidden;
}

.department-rail {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 18px 12px 20px;
    overflow: auto;
    background:
        linear-gradient(90deg, rgb(255 255 255 / 0.04), transparent 12%, transparent 88%, rgb(0 0 0 / 0.13)),
        var(--olive);
    border-right: 8px solid #313b30;
}

.rail-heading {
    margin-bottom: 14px;
    color: #e8ddbd;
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    letter-spacing: 2px;
    text-align: center;
}

.department-nav {
    display: grid;
    gap: 12px;
}

.department-button {
    position: relative;
    width: 100%;
    min-height: 70px;
    padding: 12px 9px;
    cursor: pointer;
    background: #ece0bc;
    border: 3px solid #322f25;
    color: #26251f;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 25px;
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: 1px;
    text-align: left;
    box-shadow: 3px 4px 0 rgb(0 0 0 / 0.28);
    transition: transform 140ms ease, background-color 140ms ease;
}

.department-button::after {
    content: attr(data-count) " ITEMS";
    display: block;
    margin-top: 7px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
}

.department-button:nth-child(3n + 2) {
    background: #d8b65f;
}

.department-button:nth-child(3n + 3) {
    background: #8eb0a0;
}

.department-button[aria-pressed="true"] {
    background: #f0d664;
    box-shadow: 5px 5px 0 #20251f;
    transform: translateX(4px);
}

.store-note {
    margin-top: auto;
    padding: 12px 8px;
    background: #e7d9ad;
    border: 2px dashed #4c4637;
    color: #4b4638;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    line-height: 1.55;
    text-align: center;
}

@media (hover: hover) {
    .department-button:hover {
        transform: translateX(3px);
    }
}

/* Browse column and catalog */

.browse-column {
    position: relative;
    container-name: catalog;
    container-type: inline-size;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgb(91 76 44 / 0.05), transparent 25%, transparent 75%, rgb(91 76 44 / 0.06)),
        var(--cream);
}

.aisle-header {
    position: relative;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 92px;
    padding: 12px 20px;
    background: rgb(239 231 204 / 0.96);
    border-bottom: 2px solid #8f8468;
    box-shadow: 0 4px 10px rgb(68 55 31 / 0.12);
}

.aisle-number {
    margin-bottom: 1px;
    color: var(--rust);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
}

.aisle-header h1 {
    font-family: "Barlow Condensed", sans-serif;
    font-size: clamp(32px, 3.6vw, 50px);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: 1px;
}

.result-count {
    margin-top: 5px;
    color: var(--ink-soft);
    font-size: 14px;
}

.utility-button {
    position: relative;
    flex: 0 0 auto;
    min-height: 48px;
    padding: 10px 14px;
    cursor: pointer;
    background: #4a5c4a;
    border: 3px solid #263027;
    color: #fbf1d5;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 3px 3px 0 rgb(0 0 0 / 0.2);
}

.utility-button--muted {
    align-self: end;
    background: #8d6e48;
    border-color: #503b28;
}

.filter-count {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    min-height: 22px;
    margin-left: 6px;
    padding-inline: 4px;
    background: var(--mustard);
    border: 1px solid #33260e;
    border-radius: 50%;
    color: #201b10;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
}

.filter-label-short {
    display: none;
}

.filter-drawer {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(220px, 1.7fr) repeat(3, minmax(130px, 1fr)) 105px 105px auto;
    align-items: end;
    gap: 10px;
    padding: 25px 16px 13px;
    background:
        linear-gradient(rgb(255 255 255 / 0.14), rgb(0 0 0 / 0.05)),
        #c5af7b;
    border-bottom: 8px solid #5d432b;
    box-shadow: 0 6px 14px rgb(0 0 0 / 0.18);
}

.catalog-tab {
    position: absolute;
    top: 0;
    left: 16px;
    padding: 3px 16px 4px;
    background: #79613d;
    border: 0;
    color: #fff2ce;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
}

.filter-field {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.filter-field label {
    color: #403925;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.8px;
}

.filter-field input,
.filter-field select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 8px;
    background: #f4ecd6;
    border: 2px solid #66583a;
    border-radius: 0;
    color: var(--ink);
    font-size: 15px;
}

.filter-drawer .utility-button {
    min-height: 44px;
    padding-block: 8px;
}

/* Local viewing history */

.recently-watched {
    position: relative;
    z-index: 4;
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 7px 14px 8px;
    background:
        linear-gradient(90deg, rgb(255 255 255 / 0.12), transparent 30%, rgb(77 57 30 / 0.06)),
        #d2bf8e;
    border-bottom: 6px solid #5d432b;
    box-shadow: 0 4px 9px rgb(0 0 0 / 0.16);
}

.recently-watched__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.recently-watched__kicker {
    color: #725230;
    font-family: "IBM Plex Mono", monospace;
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 1.6px;
}

.recently-watched h2 {
    color: #28271f;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 19px;
    line-height: 0.9;
    letter-spacing: 0.8px;
}

.recently-watched__clear {
    min-height: 25px;
    padding: 3px 7px;
    cursor: pointer;
    background: #7c6846;
    border: 2px solid #463822;
    color: #fff0cb;
    font-family: "IBM Plex Mono", monospace;
    font-size: 8px;
    letter-spacing: 0.8px;
}

.recent-list {
    display: flex;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-color: #7c6846 transparent;
    scrollbar-width: thin;
    scroll-snap-type: inline proximity;
}

.recent-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    flex: 0 0 218px;
    min-width: 0;
    height: 52px;
    padding: 4px 7px 4px 4px;
    cursor: pointer;
    scroll-snap-align: start;
    background: #f2e8ca;
    border: 2px solid #564a31;
    color: #2b2a22;
    text-align: left;
    box-shadow: 2px 2px 0 rgb(57 43 24 / 0.25);
}

.recent-card__thumbnail {
    display: grid;
    place-items: center;
    width: 32px;
    height: 42px;
    justify-self: center;
    overflow: hidden;
    background: #374037;
    border: 1px solid #22271f;
    color: #f3e8c8;
}

.recent-card__thumbnail.is-square {
    width: 40px;
    height: 40px;
}

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

.recent-card__fallback {
    font-family: "IBM Plex Mono", monospace;
    font-size: 8px;
    letter-spacing: 0.5px;
}

.recent-card__copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.recent-card__title,
.recent-card__detail {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-card__title {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.recent-card__detail {
    color: #665537;
    font-family: "IBM Plex Mono", monospace;
    font-size: 8px;
    line-height: 1.1;
}

.recent-card__progress {
    display: block;
    height: 4px;
    overflow: hidden;
    background: #b9ad8e;
    border: 1px solid #76684a;
}

.recent-card__progress span {
    display: block;
    height: 100%;
    background: var(--rust);
}

.browse-scroll {
    position: relative;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: #786343 #ded3b5;
    scrollbar-width: thin;
}

.browse-scroll::-webkit-scrollbar {
    width: 12px;
}

.browse-scroll::-webkit-scrollbar-track {
    background: #ded3b5;
}

.browse-scroll::-webkit-scrollbar-thumb {
    background: #786343;
    border: 3px solid #ded3b5;
}

.wall-message {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    max-width: calc(100% - 40px);
    padding: 12px 16px;
    transform: translate(-50%, -50%);
    background: #eee1bb;
    border: 3px solid #5f543a;
    color: #4d4738;
    font-family: "IBM Plex Mono", monospace;
    font-size: 14px;
    text-align: center;
    box-shadow: 4px 4px 0 rgb(0 0 0 / 0.16);
}

/* Physical media wall */

.media-wall {
    --cell-min: 132px;
    --row-height: 246px;
    --case-width: 108px;
    --case-height: 188px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--cell-min), 1fr));
    grid-auto-rows: var(--row-height);
    width: 100%;
    min-height: 100%;
    padding: 8px 18px 34px;
    list-style: none;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(var(--row-height) - 36px),
            #3d2a1b calc(var(--row-height) - 36px),
            #7b5737 calc(var(--row-height) - 31px),
            #5d3e27 calc(var(--row-height) - 9px),
            #2c2118 calc(var(--row-height) - 1px),
            transparent var(--row-height)
        );
}

.media-wall.format-laserdisc {
    --cell-min: 205px;
    --row-height: 245px;
    --case-width: 184px;
    --case-height: 184px;
}

.media-slot {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-width: 0;
    height: var(--row-height);
    padding: 0 7px 40px;
}

.media-card {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: var(--case-width);
    height: var(--case-height);
    padding: 0;
    cursor: pointer;
    background: #2a241c;
    border: 0;
    color: inherit;
    box-shadow: 0 10px 14px rgb(0 0 0 / 0.42);
    transform-origin: bottom center;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.media-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #24231e;
    border: 3px solid #292821;
}

.media-card[aria-pressed="true"] {
    z-index: 2;
    box-shadow: 0 0 0 4px #f0c84f, 0 15px 20px rgb(0 0 0 / 0.52);
    transform: translateY(-9px) scale(1.035);
}

.price-sticker {
    position: absolute;
    z-index: 3;
    top: 7px;
    right: -7px;
    display: grid;
    place-items: center;
    min-width: 41px;
    min-height: 27px;
    padding: 3px 5px;
    background: var(--mustard);
    border: 1px solid #514013;
    color: #33290f;
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    font-weight: 500;
    line-height: 1;
    box-shadow: 1px 2px 2px rgb(0 0 0 / 0.25);
    transform: rotate(2deg);
    transition: opacity 150ms ease, visibility 150ms ease, transform 150ms ease;
    pointer-events: none;
}

.price-tags-hidden .price-sticker {
    visibility: hidden;
    opacity: 0;
    transform: scale(0.82);
}

.sticker-1 {
    top: 15px;
    right: -5px;
    background: #df7658;
    transform: rotate(-3deg);
}

.sticker-2 {
    top: 8px;
    right: auto;
    left: -6px;
    background: #78bbb2;
    transform: rotate(-2deg);
}

.sticker-3 {
    top: auto;
    right: -6px;
    bottom: 16px;
    background: #e5cf70;
    transform: rotate(3deg);
}

.case-title {
    position: absolute;
    right: 6px;
    bottom: 10px;
    left: 6px;
    display: -webkit-box;
    min-height: 25px;
    max-height: 25px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: #fff0c7;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.05;
    text-align: center;
    text-shadow: 0 1px 1px #24170f;
    pointer-events: none;
}

.homemade-label {
    position: absolute;
    top: 27%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35%;
    height: 46%;
    overflow: hidden;
    transform: translateX(-50%);
    color: #3b372f;
    font-family: "IBM Plex Mono", monospace;
    font-size: 8px;
    line-height: 1;
    text-align: center;
    text-orientation: mixed;
    writing-mode: vertical-rl;
    pointer-events: none;
}

.cover-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 8px;
    background: #44483a;
    border: 3px solid #252b23;
    color: #f0e3bd;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
}

.media-card.image-error img,
.media-card.image-error .homemade-label {
    display: none;
}

.media-card.image-error .cover-fallback {
    display: flex;
}

@media (hover: hover) {
    .media-card:hover {
        box-shadow: 0 14px 19px rgb(0 0 0 / 0.5);
        transform: translateY(-7px);
    }

    .media-card[aria-pressed="true"]:hover {
        transform: translateY(-9px) scale(1.035);
    }

    .utility-button:hover,
    .station-button:hover,
    .machine-button:not(:disabled):hover {
        filter: brightness(1.12);
    }
}

/* Checkout counter */

.checkout-panel {
    position: relative;
    z-index: 7;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 16px 16px 22px;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgb(255 255 255 / 0.04), transparent 14%),
        #263128;
    border-left: 9px solid #172018;
    color: #f2e8cb;
    box-shadow: -6px 0 14px rgb(0 0 0 / 0.23);
}

.checkout-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 11px;
    border-bottom: 2px dashed #7b886d;
}

.checkout-kicker {
    margin-bottom: 2px;
    color: #bbc5a8;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 2px;
}

#checkout-title {
    font-family: "Barlow Condensed", sans-serif;
    font-size: clamp(27px, 2.4vw, 34px);
    font-weight: 700;
    line-height: 0.96;
}

.icon-button {
    display: none;
    width: 38px;
    height: 38px;
    cursor: pointer;
    background: #5a674e;
    border: 2px solid #aab396;
    color: #fff5d9;
    font-size: 27px;
    line-height: 1;
}

.checkout-empty {
    display: grid;
    place-items: center;
    gap: 20px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 24px;
    color: #c4cbb8;
    font-family: "IBM Plex Mono", monospace;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.counter-bell {
    position: relative;
    width: 76px;
    height: 38px;
    background: radial-gradient(ellipse at top, #c0b584, #68654f 72%);
    border-radius: 50% 50% 8px 8px;
    border-bottom: 6px solid #191e19;
    box-shadow: 0 8px 10px rgb(0 0 0 / 0.35);
}

.counter-bell::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 50%;
    width: 16px;
    height: 14px;
    transform: translateX(-50%);
    background: #aaa276;
    border: 3px solid #585546;
    border-radius: 50%;
}

.checkout-details {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-top: 14px;
}

.checkout-visual {
    position: relative;
    flex: 0 0 auto;
    align-self: center;
    width: min(100%, 180px);
    aspect-ratio: 4 / 6.8;
    margin-bottom: 14px;
    background: #171b17;
    box-shadow: 0 12px 18px rgb(0 0 0 / 0.48);
}

.checkout-visual.is-square {
    width: min(100%, 205px);
    aspect-ratio: 1;
}

.checkout-visual img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 4px solid #151814;
}

.checkout-visual .homemade-label {
    font-size: 10px;
}

.checkout-visual.image-error img,
.checkout-visual.image-error .homemade-label {
    display: none;
}

.checkout-visual.image-error .cover-fallback {
    display: flex;
}

.checkout-copy {
    min-height: 0;
    overflow: auto;
    scrollbar-color: #839078 transparent;
    scrollbar-width: thin;
}

.metadata-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.metadata-tags span {
    padding: 3px 7px;
    background: #d3b85e;
    border: 1px solid #69591f;
    color: #28230f;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
}

.checkout-label {
    margin-bottom: 9px;
    color: #b9c3a7;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
}

.checkout-description {
    color: #f1e6c9;
    font-size: 15px;
    line-height: 1.34;
}

.checkout-playlist {
    margin-top: 11px;
    padding: 7px 8px;
    background: #394638;
    border-left: 4px solid var(--mustard);
    color: #e9deb9;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    line-height: 1.4;
}

.station-button {
    flex: 0 0 auto;
    width: 100%;
    min-height: 54px;
    margin-top: 14px;
    padding: 9px 12px;
    cursor: pointer;
    background: var(--rust);
    border: 3px solid #5d2716;
    color: #fff2d1;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.8px;
    box-shadow: 4px 4px 0 #141a14;
}

.sheet-handle,
.sheet-scrim {
    display: none;
}

/* Testing station */

#station-dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    padding:
        max(12px, env(safe-area-inset-top))
        max(12px, env(safe-area-inset-right))
        max(12px, env(safe-area-inset-bottom))
        max(12px, env(safe-area-inset-left));
    overflow: auto;
    border: 0;
    background: rgb(13 15 12 / 0.95);
    color: #eee7d1;
}

#station-dialog::backdrop {
    background: rgb(5 7 5 / 0.9);
}

.testing-station {
    display: grid;
    gap: 10px;
    width: min(100%, 930px);
    margin: auto;
    padding: clamp(12px, 2vw, 20px);
    background:
        linear-gradient(145deg, rgb(255 255 255 / 0.11), transparent 24%),
        #6e746b;
    border: clamp(9px, 1.3vw, 14px) solid #3d423c;
    box-shadow: 0 0 0 3px #94998e, 0 24px 70px rgb(0 0 0 / 0.75);
}

.station-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    padding: 10px 12px;
    background: #353c35;
    border: 2px solid #a1a79b;
    color: #f1e8ce;
}

.station-header__label {
    color: #c7cbbf;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 2px;
}

#station-title {
    font-family: "Barlow Condensed", sans-serif;
    font-size: clamp(28px, 3.1vw, 38px);
    font-weight: 700;
    line-height: 0.95;
}

#station-episode {
    margin-top: 4px;
    color: #d5cba9;
    font-family: "IBM Plex Mono", monospace;
    font-size: clamp(11px, 1.4vw, 14px);
}

.station-header__actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.monitor-frame {
    position: relative;
    width: 100%;
    max-height: calc(100dvh - 300px);
    aspect-ratio: 4 / 3;
    margin-inline: auto;
    overflow: hidden;
    background: #000;
    border: clamp(12px, 2vw, 20px) solid #1d211d;
    box-shadow: inset 0 0 0 2px #747a70, inset 0 0 28px rgb(255 255 255 / 0.04);
}

#media-player {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
    object-fit: contain;
}

.player-message {
    position: absolute;
    z-index: 3;
    top: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    padding: 4px 8px;
    background: rgb(13 15 12 / 0.86);
    color: #efdea6;
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    line-height: 1.2;
    pointer-events: none;
}

.player-message:empty {
    display: none;
}

.insert-animation {
    position: absolute;
    z-index: 4;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 18px;
    visibility: hidden;
    background: #161a16;
    color: #d5c9a6;
    font-family: "IBM Plex Mono", monospace;
    font-size: 13px;
    letter-spacing: 3px;
    opacity: 0;
    pointer-events: none;
}

.insert-slot {
    position: relative;
    width: min(52vw, 360px);
    height: 42px;
    background: #070807;
    border: 8px solid #343a34;
    box-shadow: inset 0 0 0 3px #000;
}

.insert-slot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 76%;
    height: 28px;
    transform: translate(-50%, -50%);
    background: #353a33;
    border: 2px solid #777d70;
}

.testing-station.is-inserting .insert-animation {
    visibility: visible;
    animation: insert-media 800ms ease both;
}

@keyframes insert-media {
    0%,
    12% {
        opacity: 1;
    }
    72% {
        opacity: 1;
    }
    100% {
        visibility: hidden;
        opacity: 0;
    }
}

.machine-button {
    min-height: 46px;
    padding: 9px 14px;
    cursor: pointer;
    background: #4c514b;
    border: 3px solid #252925;
    color: #f4ead0;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.7px;
    box-shadow: inset 0 1px rgb(255 255 255 / 0.13), 2px 3px 0 #242724;
}

.machine-button--small {
    min-height: 40px;
    padding: 7px 11px;
    font-size: 17px;
}

.machine-button--eject {
    background: #8c472e;
    border-color: #4c2317;
}

.playlist-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.playlist-controls .machine-button {
    width: 100%;
    min-width: 0;
}

.playlist-controls .machine-button[aria-pressed="true"] {
    background: #d0a53a;
    border-color: #564312;
    color: #241c0a;
}

.custom-controls {
    display: grid;
    grid-template-columns: auto minmax(130px, 1fr) auto auto minmax(90px, 145px) auto;
    align-items: center;
    gap: 9px;
    padding: 9px;
    background: #303630;
    border: 3px solid #171b17;
}

.seek-control,
.volume-control {
    display: flex;
    align-items: center;
    min-width: 0;
}

input[type="range"] {
    width: 100%;
    min-height: 30px;
    cursor: pointer;
    accent-color: #d4a73b;
}

.time-display {
    min-width: 112px;
    color: #eee1bd;
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.native-controls .custom-controls {
    display: none;
}

/* Mobile store */

@media (max-width: 1080px) {
    :root {
        --department-width: 165px;
        --checkout-width: 310px;
    }

    .filter-drawer {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }

    .filter-field--search {
        grid-column: span 2;
    }
}

@media (max-width: 900px) {
    #app-shell {
        grid-template-rows: auto auto minmax(0, 1fr);
    }

    .storefront-header {
        min-height: 72px;
        padding-inline: 14px;
    }

    .store-brand__name {
        font-size: clamp(34px, 7vw, 48px);
    }

    .store-layout {
        display: block;
        min-height: 0;
        overflow: hidden;
    }

    .browse-column {
        width: 100%;
        height: 100%;
        padding-bottom: calc(76px + env(safe-area-inset-bottom));
    }

    .department-rail {
        position: absolute;
        z-index: 45;
        right: 0;
        bottom: 0;
        left: 0;
        display: block;
        height: calc(76px + env(safe-area-inset-bottom));
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        overflow-x: auto;
        overflow-y: hidden;
        background: var(--olive-dark);
        border: 0;
        border-top: 6px solid #1d261e;
        scrollbar-width: none;
    }

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

    .rail-heading,
    .store-note {
        display: none;
    }

    .department-nav {
        display: flex;
        gap: 8px;
        width: max-content;
    }

    .department-button {
        flex: 0 0 auto;
        width: auto;
        min-width: 105px;
        min-height: 54px;
        padding: 7px 10px;
        font-size: 20px;
    }

    .department-button::after {
        margin-top: 3px;
        font-size: 8px;
    }

    .department-button[aria-pressed="true"] {
        transform: translateY(-2px);
    }

    .checkout-panel {
        position: fixed;
        z-index: 80;
        right: 0;
        bottom: 0;
        left: 0;
        display: block;
        width: 100%;
        max-height: min(74dvh, 660px);
        padding: 12px 14px calc(16px + env(safe-area-inset-bottom));
        overflow: auto;
        border: 0;
        border-top: 8px solid #172018;
        box-shadow: 0 -16px 40px rgb(0 0 0 / 0.48);
        transform: translateY(calc(100% + 24px));
        transition: transform 220ms ease;
        visibility: hidden;
    }

    .checkout-panel.is-open {
        visibility: visible;
        transform: translateY(0);
    }

    .checkout-panel.is-dragging {
        transition: none;
    }

    .sheet-handle {
        display: block;
        width: 100%;
        height: 28px;
        margin: -7px 0 3px;
        cursor: grab;
        border: 0;
        background: transparent;
    }

    .sheet-handle span {
        display: block;
        width: 64px;
        height: 5px;
        margin: auto;
        background: #819078;
        border-radius: 4px;
    }

    .icon-button {
        display: block;
    }

    .sheet-scrim {
        position: fixed;
        z-index: 70;
        inset: 0;
        display: block;
        cursor: pointer;
        background: rgb(8 11 8 / 0.62);
        border: 0;
    }

    .checkout-empty {
        display: none;
    }

    .checkout-details {
        display: grid;
        grid-template-columns: minmax(115px, 165px) minmax(0, 1fr);
        gap: 14px;
        padding-top: 12px;
    }

    .checkout-visual,
    .checkout-visual.is-square {
        grid-row: 1 / span 2;
        width: 100%;
        margin: 0;
    }

    .station-button {
        grid-column: 2;
        align-self: end;
        margin-top: 0;
    }

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

    .seek-control {
        grid-column: 2;
    }

    .time-display {
        grid-column: 1 / -1;
        grid-row: 2;
        min-width: 0;
    }

    #mute-button {
        grid-column: 1;
        grid-row: 3;
    }

    .volume-control {
        grid-column: 2;
        grid-row: 3;
    }

    #fullscreen-button {
        grid-column: 1 / -1;
        grid-row: 4;
    }
}

@media (max-width: 600px) {
    .ad-board {
        width: 100%;
        margin-block: 2px;
        padding: 3px 0 5px;
        border-width: 3px 0;
    }

    .ad-board__tack {
        display: none;
    }

    .storefront-header {
        gap: 8px;
        min-height: 62px;
        padding: 7px 10px;
        border-bottom-width: 5px;
    }

    .store-brand__eyebrow {
        font-size: 8px;
    }

    .store-brand__name {
        font-size: clamp(30px, 10vw, 40px);
    }

    .storefront-actions {
        gap: 5px;
    }

    .price-tag-toggle {
        gap: 3px;
        min-height: 31px;
        padding: 3px 5px;
        font-size: 11px;
    }

    .price-tag-toggle__icon {
        width: 15px;
        height: 15px;
        font-size: 8px;
    }

    .open-sign {
        padding: 4px 6px;
        font-size: 10px;
    }

    .aisle-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 7px;
        min-height: 82px;
        padding: 10px 11px;
    }

    .aisle-header h1 {
        font-size: clamp(28px, 8.8vw, 36px);
        overflow-wrap: anywhere;
    }

    .department-word {
        display: none;
    }

    .result-count {
        font-size: 12px;
    }

    .utility-button {
        min-height: 44px;
        padding: 8px 7px;
        font-size: 15px;
    }

    .filter-label-full {
        display: none;
    }

    .filter-label-short {
        display: inline;
    }

    .filter-drawer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: min(52dvh, 430px);
        padding: 17px 10px 11px;
        overflow: auto;
    }

    .filter-field--search {
        grid-column: 1 / -1;
    }

    .filter-drawer .utility-button {
        align-self: end;
    }

    .recently-watched {
        gap: 4px;
        padding: 5px 7px 6px;
        border-bottom-width: 5px;
    }

    .recently-watched__kicker {
        display: none;
    }

    .recently-watched h2 {
        font-size: 17px;
    }

    .recently-watched__clear {
        min-height: 23px;
        font-size: 7px;
    }

    .recent-card {
        flex-basis: 190px;
    }

    .media-wall {
        --cell-min: 104px;
        --row-height: 196px;
        --case-width: 84px;
        --case-height: 146px;
        padding-inline: 7px;
    }

    .media-wall.format-laserdisc {
        --cell-min: 145px;
        --row-height: 185px;
        --case-width: 132px;
        --case-height: 132px;
    }

    .media-slot {
        padding-inline: 4px;
    }

    .price-sticker {
        min-width: 34px;
        min-height: 23px;
        font-size: 7px;
    }

    .checkout-panel {
        max-height: 78dvh;
    }

    .checkout-details {
        grid-template-columns: minmax(95px, 125px) minmax(0, 1fr);
        gap: 10px;
    }

    .checkout-description {
        font-size: 14px;
    }

    .station-header {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }

    .station-header__actions {
        width: 100%;
    }

    .station-header__actions .machine-button {
        flex: 1 1 50%;
    }

    .testing-station {
        gap: 7px;
        padding: 8px;
        border-width: 7px;
    }

    .monitor-frame {
        border-width: 8px;
    }

    .playlist-controls {
        gap: 5px;
    }

    .playlist-controls .machine-button {
        padding-inline: 4px;
        font-size: 16px;
    }

    .custom-controls {
        gap: 6px;
        padding: 7px;
    }

    .custom-controls .machine-button {
        min-height: 38px;
        padding: 7px 8px;
        font-size: 16px;
    }
}

@media (max-height: 620px) and (orientation: landscape) {
    .ad-board {
        display: none;
    }

    .storefront-header {
        min-height: 55px;
        padding-block: 5px;
    }

    .store-brand__name {
        font-size: 32px;
    }

    .testing-station {
        width: min(100%, 780px);
        gap: 5px;
        padding: 7px;
        border-width: 6px;
    }

    .station-header {
        padding: 5px 8px;
    }

    .station-header__label {
        font-size: 8px;
    }

    #station-title {
        font-size: 23px;
    }

    #station-episode {
        margin-top: 1px;
        font-size: 10px;
    }

    .station-header .machine-button,
    .playlist-controls .machine-button,
    .custom-controls .machine-button {
        min-height: 32px;
        padding: 5px 7px;
        font-size: 16px;
    }

    .monitor-frame {
        max-height: 38dvh;
        margin-inline: auto;
        border-width: 7px;
    }

    .custom-controls {
        grid-template-columns: auto minmax(130px, 1fr) auto auto minmax(80px, 125px) auto;
        gap: 5px;
        padding: 5px;
    }

    .custom-controls .seek-control,
    .custom-controls .time-display,
    .custom-controls #mute-button,
    .custom-controls .volume-control,
    .custom-controls #fullscreen-button {
        grid-column: auto;
        grid-row: auto;
    }

    .time-display {
        min-width: 96px;
        font-size: 10px;
    }
}

@container catalog (max-width: 1180px) {
    .filter-drawer {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .filter-field--search {
        grid-column: span 6;
    }

    .filter-field--genre,
    .filter-field--label {
        grid-column: span 3;
    }

    .filter-field--sort,
    .filter-drawer .utility-button {
        grid-column: span 4;
    }

    .filter-field--year {
        grid-column: span 2;
    }
}

@container catalog (max-width: 720px) {
    .filter-field--search {
        grid-column: span 12;
    }

    .filter-field--genre,
    .filter-field--label {
        grid-column: span 6;
    }

    .filter-field--sort {
        grid-column: span 6;
    }

    .filter-field--year {
        grid-column: span 3;
    }

    .filter-drawer .utility-button {
        grid-column: span 12;
    }
}

@container catalog (max-width: 430px) {
    .filter-field--genre,
    .filter-field--label,
    .filter-field--sort {
        grid-column: span 12;
    }

    .filter-field--year {
        grid-column: span 6;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
