/* Doll studio: base components, states and responsive layouts. */
:root {
    color-scheme: light;
    --ease-out: cubic-bezier(.23, 1, .32, 1);
    --ease-in-out: cubic-bezier(.77, 0, .175, 1);
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    color: var(--ink);
    --paper: #faf7f2;
    --white: #faf7f2;
    --ink: #3f291f;
    --muted: #968579;
    --accent: #ef6866;
    --line: #e8ddd2;
    --display-font: "Songti SC", "STSong", "SimSun", serif;
    background: rgb(238, 229, 219);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0px;
    background: rgb(238, 229, 219);
}

button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    font: inherit;
    cursor: pointer;
    flex-shrink: 0;
}

a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button:disabled {
    cursor: wait;
    opacity: 0.5;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
    outline-style: solid;
    outline-width: 3px;
    outline-offset: 3px;
    outline-color: var(--accent);
}

svg {
    flex-shrink: 0;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentcolor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

h1 {
    margin: 0px;
    display: flex;
    align-items: center;
    font-family: var(--display-font);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.3px;
    gap: 12px;
    white-space: nowrap;
}

h2 {
    margin: 0px;
    font-size: 13px;
    font-weight: 650;
}

p,
dl,
dd {
    margin: 0px;
}

[hidden] {
    display: none !important;
}

.studio {
    max-width: 1120px;
    height: 100vh;
    height: 100dvh;
    min-height: 540px;
    margin: auto;
    display: flex;
    flex-direction: column;
    background: var(--paper);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 28px;
    flex-shrink: 0;
    border-bottom: 0px;
    background: var(--paper);
    gap: 12px;
}

.brand-logo {
    display: block;
    object-fit: contain;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}

.brand-mark {
    color: var(--muted);
    display: block;
    min-width: 0px;
    text-align: right;
    text-wrap: balance;
    font-size: 12px;
    line-height: 1.6;
}

.workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1 1 0%;
    min-height: 0px;
}

.preview-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0px;
    padding: 0px;
    background: url("../assets/brand/studio-backdrop.webp?v=2") center top / 100% calc(119% + 10px) no-repeat rgb(233, 216, 197);
}

.preview-tools {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: absolute;
    inset: 16px 18px auto;
    z-index: 4;
    pointer-events: none;
}

.preview-heading {
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--muted);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 19px;
    font-size: 13px;
    line-height: 20px;
    text-decoration: none;
    transition: transform 120ms var(--ease-out), background-color 160ms ease;
    border-radius: 13px;
    font-weight: 600;
}

.button:active {
    transform: scale(0.97);
}

.button-outline {
    border-top-width: 1px;
    border-right-width: 1px;
    border-bottom-width: 1px;
    border-left-width: 1px;
    border-top-style: solid;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: solid;
    border-image-source: none;
    border-image-slice: 100%;
    border-image-width: 1;
    border-image-outset: 0;
    border-image-repeat: stretch;
    color: var(--accent);
    background: transparent;
    border-color: var(--accent);
}

.button-primary {
    border: 1px solid var(--accent);
    color: white;
    background: var(--accent);
    border-color: var(--accent);
}

.stage {
    touch-action: pan-y;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    flex: 1 1 0%;
    min-height: 0px;
    perspective: 1200px;
    isolation: isolate;
    overflow: hidden;
    width: 100%;
}

.turntable {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: doll-breathe 3.6s ease-in-out infinite;
    animation-play-state: paused;
    transform-origin: 50% 85%;
}

.stage.is-alive .turntable { animation-play-state: running; }

@keyframes doll-breathe {
    0%, 100% { transform: rotateZ(-0.8deg) scale3d(1, 1, 1); }
    50% { transform: rotateZ(0.8deg) scale3d(1.015, 1.045, 1); }
}

.doll-bubble {
    position: absolute;
    z-index: 20;
    top: 10px;
    max-width: 168px;
    padding: 11px 14px;
    border: 2px solid #704b3b;
    border-radius: 19px 21px 19px 15px;
    background: #fffdf5;
    color: #573626;
    box-shadow: 3px 4px 0 rgba(112, 75, 59, 0.18), 0 6px 16px rgba(93, 56, 38, 0.12);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    overflow-wrap: break-word;
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px) scale(0.96);
    transform-origin: left 70%;
    transition: opacity 180ms ease, transform 250ms var(--ease-out);
}

.doll-bubble::before,
.doll-bubble::after {
    content: '';
    position: absolute;
    top: var(--tail-top, 20px);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 19px solid #704b3b;
    left: -19px;
}

.doll-bubble::after {
    left: -14px;
    border-right-color: #fffdf5;
    border-right-width: 16px;
}

.doll-bubble.is-visible { opacity: 1; transform: translateY(0) scale(1); }

.stage.is-rotating { cursor: grabbing; }
.stage.is-rotating .face { transition: none; }

.style-card.is-out-of-stock {
    position: relative;
    cursor: not-allowed;
    opacity: 1;
}
.style-card.is-out-of-stock .selected-mark { display: none; }
.stock-status {
    position: absolute;
    right: 4px;
    top: 4px;
    padding: 3px 6px;
    border: 1px solid #e8d9c9;
    border-radius: 5px;
    background: #fff8ef;
    color: #8b6346;
    font-size: 10px;
    line-height: 1.4;
    font-weight: 600;
    text-align: center;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .stage .face { transition: none; }
    .turntable { animation: none; }
    .doll-bubble { transform: none; transition: opacity 150ms ease; }
}

.turntable.is-back .face.front {
    transform: rotateY(180deg);
}

.turntable.is-back .face.back {
    transform: rotateY(0deg);
}

.face {
    position: absolute;
    inset: 0px;
    transform: rotateY(0deg);
    will-change: transform;
    transition: transform 280ms var(--ease-in-out);
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.face.back {
    transform: rotateY(-180deg);
}

.face.fabric-edge,
.face.fabric-surface {
    pointer-events: none;
}

.face.fabric-edge {
    backface-visibility: visible;
}

.face.fabric-edge canvas {
    filter: none;
}

.turntable.has-component-depth > .face.front > canvas,
.turntable.has-component-depth > .face.back > canvas {
    opacity: 0;
}

.face canvas {
    max-width: none;
    flex-shrink: 0;
    position: relative;
    width: auto;
    height: 165%;
    top: 0px;
    filter: drop-shadow(rgba(93, 56, 38, 0.17) 1px 3px 2px);
}

.render-status {
    position: absolute;
    bottom: 42px;
    left: 16px;
    right: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--accent);
    background: rgba(255, 249, 239, 0.91);
    border-radius: 8px;
    padding: 5px;
}

.render-status:empty,
.style-card[aria-pressed="false"] .selected-mark,
.plans-status:empty {
    display: none;
}

.retry {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
}

.is-loading .face {
    opacity: 0.4;
}

.catalog-panel {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 10px;
    min-height: 0px;
    border-left: 1px solid var(--line);
    padding: 0px 22px;
    background: var(--paper);
}

.catalog-header {
    display: flex;
    grid-column: 1;
    grid-row: 2;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
    padding-bottom: 0;
    gap: 8px;
    flex-shrink: 0;
}

.category-tabs {
    display: flex;
    flex-direction: column;
    border-radius: 999px;
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    background: none;
    padding: 0px;
    gap: 9px;
}

.category-tabs button {
    border: 0px;
    flex: 0 0 auto;
    font-weight: 600;
    border-radius: 11px;
    padding: 12px 0;
    color: var(--ink);
    background: rgb(240, 232, 223);
    font-family: var(--display-font);
    font-size: 16px;
}

.category-tabs button[aria-selected="true"] {
    color: white;
    background: var(--accent);
    box-shadow: rgba(255, 255, 255, 0.24) 0px 0px 0px 1px inset;
}

.catalog-count {
    white-space: nowrap;
    color: var(--muted);
    font-size: 10px;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0px, 1fr));
    align-content: start;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    contain: content;
    gap: 10px;
    padding: 1px 1px 12px;
    scrollbar-color: rgb(219, 203, 189) transparent;
}

#catalog {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    flex: 1 1 0%;
    min-height: 0px;
    scrollbar-gutter: stable;
    overflow-anchor: none;
}

.style-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0px;
    transition: border-color 140ms, background-color 140ms;
    border: 1px solid transparent;
    border-radius: 14px;
    background: rgb(242, 236, 228);
    padding: 7px 4px 8px;
}

.style-card[aria-pressed="true"],
.plan-card .style-card[aria-pressed="true"] {
    border: 1px solid var(--accent);
    box-shadow: inset 0 0 0 .5px var(--accent);
    background: rgb(255, 240, 235);
    padding: 7px 4px 8px;
}

.style-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    pointer-events: none;
    height: auto;
}

.style-card .part-thumbnail,
.style-card[data-family="cloth"] .part-thumbnail {
    transform: none;
}

.selected-mark {
    position: absolute;
    background: var(--accent);
    color: white;
    display: grid;
    place-items: center;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    right: 5px;
    top: 5px;
}

.selected-mark svg {
    stroke-width: 2;
    width: 11px;
    height: 11px;
}

.bottom-panel {
    border-top: 1px solid var(--line);
    z-index: 2;
    padding: 15px 26px 20px;
    background: var(--paper);
}

.selection-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.copy-button {
    display: inline-flex;
    align-items: center;
    background: none;
    border: 0px;
    padding: 4px 0px 4px 10px;
    font-size: 12px;
    color: var(--ink);
    gap: 5px;
    min-height: 30px;
}

.copy-button svg {
    width: 18px;
    height: 18px;
}

.sku-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 17px;
}

.sku-list > div {
    align-items: center;
    gap: 12px;
    position: relative;
    display: block;
    min-height: 48px;
    padding-left: 58px;
    padding-top: 6px;
}

.sku-list dt {
    font-family: var(--display-font);
    font-size: 12px;
    color: var(--ink);
    margin-bottom: 5px;
}

.sku-list dd {
    font-family: ui-monospace, Consolas, monospace;
    white-space: nowrap;
    font-size: 10px;
    letter-spacing: -0.35px;
    color: rgb(121, 99, 88);
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.actions .button {
    min-height: 46px;
    padding: 10px 24px;
    font-size: 14px;
}

.actions .button-primary {
    min-width: 250px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 190px;
    transform: translate(-50%, 8px);
    background: var(--ink);
    color: rgb(255, 255, 255);
    padding: 11px 18px;
    border-radius: 10px;
    max-width: 90vw;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms var(--ease-out);
    z-index: 10;
}

.toast.visible {
    opacity: 1;
    transform: translate(-50%, 0px);
}

dialog {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
    width: min(540px, -24px + 100vw);
    max-height: 90dvh;
    overflow: auto;
    color: var(--ink);
    background: var(--paper);
}

dialog::backdrop {
    background: rgba(47, 33, 26, 0.533);
}

.dialog-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dialog-heading h2 {
    font-size: 17px;
}

#close-export {
    width: 28px;
    height: 28px;
    padding: 0px;
    flex-shrink: 0;
}

dialog p {
    font-size: 12px;
    color: var(--muted);
    margin: 14px 0px;
    text-align: center;
}

dialog img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
}

dialog > a {
    width: 100%;
    margin-top: 14px;
}

.list-sentinel {
    grid-column: 1 / -1;
    text-align: center;
    overflow-anchor: none;
    font-size: 10px;
    color: rgb(172, 156, 144);
    min-height: 22px;
    padding: 5px 0px;
}

.outfit-thumbnail img {
    aspect-ratio: 1 / 1;
    position: absolute;
    inset: 0px;
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    transform: scale(1.45);
    transform-origin: 50% 57%;
}

.mode-tabs {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    flex-shrink: 0;
    justify-content: space-between;
    gap: 0px;
    margin: 0px -22px 14px;
    padding: 0px 22px;
    border-bottom: 1px solid var(--line);
}

.mode-tabs button {
    border-top-width: 0px;
    border-right-width: 0px;
    border-left-width: 0px;
    border-style: none none solid;
    border-color: currentcolor currentcolor transparent;
    border-image: none;
    background: transparent;
    font-weight: 600;
    flex: 1 1 0%;
    padding: 19px 0px 14px;
    font-family: var(--display-font);
    font-size: 16px;
    color: var(--ink);
    border-bottom-width: 2px;
}

.mode-tabs button[aria-pressed="true"] {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.selection-tools {
    display: flex;
    align-items: center;
    gap: 15px;
}

.selection-tools .copy-button {
    padding-left: 0px;
}

.plans-panel {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    display: flex;
    flex: 1 1 0%;
    flex-direction: column;
    min-height: 0px;
}

.plans-status {
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 12px;
    font-size: 11px;
}

.plans-grid {
    flex: 1 1 0%;
    min-height: 0px;
}

.plan-card {
    min-width: 0px;
    display: flex;
    flex-direction: column;
    align-self: start;
}

.plan-card .style-card {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 14px;
    background: rgb(242, 236, 228);
    padding: 7px 4px 8px;
}

.outfit-thumbnail {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    pointer-events: none;
}

.plan-name {
    font-size: 12px;
    line-height: 1.6;
    padding-top: 4px;
    color: var(--ink);
}

.plan-current {
    color: var(--accent);
    font-size: 10px;
    margin-top: 3px;
    min-height: 16px;
}

.delete-outfit {
    background: none;
    border: 0px;
    color: var(--muted);
    font-size: 11px;
    padding: 9px 4px;
    align-self: center;
}

.delete-outfit:active {
    color: var(--accent);
}

#retry-presets {
    align-self: flex-start;
    margin-bottom: 16px;
}

.skeleton {
    display: block;
    background: linear-gradient(100deg, rgb(238, 232, 224) 25%, rgb(248, 245, 240) 45%, rgb(238, 232, 224) 65%) 0% 0% / 220% 100%;
    animation: 1.6s ease-in-out 0s infinite normal none running skeleton-shimmer;
    border-radius: 8px;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 1 / 1;
}

.skeleton-label {
    width: 65%;
    height: 10px;
    margin-top: 8px;
}

.preview-skeleton {
    position: absolute;
    inset: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.skeleton-head {
    width: 38%;
    height: 36%;
    border-radius: 45%;
}

.skeleton-body {
    width: 31%;
    height: 40%;
    border-radius: 24% 24% 35% 35%;
}

.image-pending {
    background: rgb(238, 232, 224);
    border-radius: 8px;
}

.image-failed {
    background: rgb(241, 236, 230);
}

.skeleton-card {
    pointer-events: none;
}

.part-thumbnail {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
    pointer-events: none;
}

.style-card .part-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    transform-origin: 50% 50%;
    padding: 3px;
}

.outfit-layers {
    position: absolute;
    inset: 0px;
    transform: scale(1.55);
    transform-origin: 50% 57%;
}

.outfit-thumbnail .outfit-layers img {
    transform: none;
    max-width: none;
    max-height: none;
}

.page-header > div {
    flex-shrink: 0;
}

.preview-tools .button {
    pointer-events: auto;
    color: var(--ink);
    border: 1px solid rgba(255, 245, 231, 0.7);
    background: rgba(255, 249, 239, 0.91);
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: rgba(119, 84, 58, 0.024) 0px 2px 12px;
}

.selection-heading h2 {
    font-family: var(--display-font);
    font-size: 16px;
}

.selection-tools .copy-button + .copy-button {
    border-left: 1px solid rgb(201, 185, 169);
    padding-left: 15px;
}

.sku-list dt img {
    position: absolute;
    left: 0px;
    top: 0px;
    width: 48px;
    height: 48px;
    padding: 3px;
    border: 1px solid rgb(234, 223, 211);
    border-radius: 10px;
    background: rgb(244, 238, 230);
    object-fit: contain;
}

@media (max-width: 700px) {
    .brand-logo {
        width: 32px;
        height: 32px;
    }

    .studio {
        min-height: 540px;
    }

    .page-header {
        padding: 9px 16px;
    }

    h1 {
        font-size: 20px;
        gap: 8px;
        line-height: 32px;
    }

    .brand-mark {
        font-size: 10px;
        line-height: 1.5;
    }

    .workspace {
        display: flex;
        flex-direction: column;
    }

    .preview-panel {
        flex: 0 0 clamp(180px, 35.5dvh, 360px);
        padding: 0px;
        background-size: 100% calc(112% + 8px);
    }

    .preview-tools {
        inset: 8px 14px auto;
    }

    .preview-tools .button {
        font-size: 11px;
        line-height: 18px;
        padding: 5px 10px;
        gap: 5px;
    }

    .preview-tools svg,
    .copy-button svg {
        width: 16px;
        height: 16px;
    }

    .preview-heading,
    h2 {
        font-size: 11px;
    }

    .face canvas {
        top: -6%;
    }

    .catalog-panel {
        flex: 1 1 0%;
        border-left: 0px;
        padding: 0px 15px;
        border-top: 0px;
    }

    .catalog-header {
        padding-bottom: 0;
    }

    .category-tabs {
        padding: 0px;
        gap: 8px;
    }

    .category-tabs button {
        padding: 11px 0;
        font-size: 14px;
        line-height: 20px;
    }

    .style-grid {
        gap: 9px;
        padding-bottom: 9px;
    }

    .style-card,
    .style-card[aria-pressed="true"],
    .plan-card .style-card,
    .plan-card .style-card[aria-pressed="true"] {
        padding: 5px 3px 6px;
        border-radius: 12px;
    }

    .style-card img {
        max-height: 88px;
    }

    .bottom-panel {
        padding: 10px 15px calc(13px + env(safe-area-inset-bottom));
    }

    .selection-heading {
        margin-bottom: 10px;
    }

    .copy-button {
        font-size: 10px;
        min-height: 26px;
    }

    .sku-list {
        margin-bottom: 15px;
        gap: 6px;
    }

    .sku-list > div {
        min-width: 0px;
        min-height: 41px;
        padding-left: 44px;
        padding-top: 4px;
    }

    .sku-list dt {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .sku-list dd {
        font-size: 9px;
        letter-spacing: -0.5px;
    }

    .actions {
        gap: 8px;
    }

    .actions .button {
        padding: 10px 9px;
        font-size: 13px;
        min-height: 46px;
        border-radius: 12px;
    }

    .actions .button-primary {
        flex: 1 1 0%;
        min-width: 0px;
    }

    .actions .button-outline {
        flex: 0 0 37%;
    }

    .actions svg {
        width: 20px;
        height: 20px;
    }

    .toast {
        bottom: 177px;
    }

    .render-status {
        bottom: 29px;
        font-size: 10px;
    }

    .mode-tabs {
        margin: 0px -15px 12px;
        padding: 0px 15px;
    }

    .mode-tabs button {
        padding: 13px 0px 12px;
        font-size: 14px;
        line-height: 20px;
    }

    .plan-name {
        font-size: 10px;
    }

    .plan-current {
        font-size: 9px;
    }

    .selection-tools {
        gap: 12px;
    }

    .part-thumbnail {
        width: min(100%, clamp(45px, 32.25dvh - 192px, 106px));
    }

    .selection-heading h2 {
        font-size: 14px;
    }

    .selection-tools .copy-button + .copy-button {
        padding-left: 12px;
    }

    .sku-list dt img {
        width: 38px;
        height: 41px;
        padding: 2px;
        border-radius: 9px;
    }
}

@media (hover: hover) and (pointer: fine) {
    .style-card:hover {
        border-color: var(--accent);
        background: rgb(249, 238, 229);
    }

    .button-outline:hover {
        background: rgb(252, 233, 227);
    }

    .button-primary:hover {
        background: rgb(223, 91, 89);
    }
}

@media (max-height: 650px) and (max-width: 700px) {
    .page-header p {
        display: none;
    }

    .style-card img {
        max-height: 66px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .face {
        transition: none;
    }

    .button,
    .toast {
        transition: opacity 120ms, background-color 120ms;
    }

    .button:active {
        transform: none;
    }

    .skeleton {
        animation: auto ease 0s 1 normal none running none;
    }
}

@media (min-width: 701px) {
    .studio {
        box-shadow: rgba(93, 56, 38, 0.063) 0px 0px 60px;
    }

    .preview-panel {
        min-width: 0px;
    }

    .face canvas {
        height: 110%;
        margin: auto;
        top: -80px;
    }

    .preview-tools .button {
        font-size: 13px;
    }

    .part-thumbnail {
        width: min(100%, 126px);
    }
}

@media (max-width: 360px) {
    h1 {
        font-size: 18px;
    }

    .brand-mark,
    .sku-list dd {
        font-size: 9px;
    }

    .copy-button {
        font-size: 9px;
        gap: 3px;
    }

    .selection-tools {
        gap: 8px;
    }

    .selection-tools .copy-button + .copy-button {
        padding-left: 8px;
    }

    .sku-list > div {
        padding-left: 0px;
        min-height: 32px;
    }

    .sku-list dt img {
        display: none;
    }
}

@media (max-height: 700px) and (max-width: 700px) {
    .page-header {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .preview-panel {
        flex-basis: 30dvh;
    }

    .mode-tabs {
        margin-bottom: 8px;
    }

    .mode-tabs button {
        padding-top: 9px;
        padding-bottom: 8px;
    }

    .category-tabs button {
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .catalog-header {
        padding-bottom: 0;
    }

    .part-thumbnail {
        width: min(100%, 57px);
    }

    .bottom-panel {
        padding-top: 7px;
        padding-bottom: calc(9px + env(safe-area-inset-bottom));
    }

    .selection-heading {
        margin-bottom: 4px;
    }

    .sku-list {
        margin-bottom: 9px;
    }

    .actions .button {
        min-height: 40px;
        padding-top: 7px;
        padding-bottom: 7px;
        font-size: 12px;
    }
}

@media (max-height: 600px) and (max-width: 700px) {
    .preview-panel {
        flex-basis: 27dvh;
    }

    .part-thumbnail {
        width: min(100%, 45px);
    }
}

@keyframes skeleton-shimmer {
  0% { background-position: 180% 0px; }
  100% { background-position: -40% 0px; }
}

/* Motion effects and reduced-motion preferences. */
/* Temporary overlays never take part in the studio's layout. */
.motion-flight,
.motion-stamp {
    position: fixed;
    z-index: 20;
    pointer-events: none;
    transform-origin: center;
    filter: drop-shadow(0 5px 4px #493b3226)
}

.motion-stamp {
    opacity: 0
}

.motion-covered {
    visibility: hidden
}

.motion-scene {
    position: absolute;
    z-index: 2;
    pointer-events: none
}

.motion-part {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform-origin: 50% 50%
}

.motion-confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 3;
    pointer-events: none
}

.motion-confetti-piece {
    position: absolute;
    width: 6px;
    height: 10px;
    opacity: 0
}

.motion-heart {
    position: fixed;
    z-index: 20;
    width: 24px;
    height: 24px;
    color: #c57471;
    pointer-events: none
}

.motion-heart svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    stroke: white;
    stroke-width: 1
}

/* Keep the existing doll visible while the next pair is loading and flying in. */
.stage.is-changing .face {
    opacity: 1
}

#random[aria-busy=true] {
    background: #f1e8df
}

#export-image {
    border: 8px solid white;
    border-bottom-width: 20px;
    border-radius: 4px;
    box-shadow: 0 5px 18px #493b321a;
    transform-origin: 50% 30%
}

@media (prefers-reduced-motion: reduce) {
    .face, .button, .toast {
        transition-duration: 0ms
    }

    .motion-flight,
    .motion-stamp {
        display: none
    }
}
