:root {
    color-scheme: light;
    --blue: #1b7dd4;
    --blue-dark: #115b9c;
    --ink: #263238;
    --muted: #667680;
    --line: #dce5ea;
    --panel: #ffffff;
    --canvas: #edf5f8;
    --danger: #c83d4f;
    --shadow: 0 10px 30px rgba(27, 57, 75, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    color: var(--ink);
    background: var(--canvas);
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

button,
select,
input[type="color"] {
    touch-action: manipulation;
}

[hidden] {
    display: none !important;
}

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

.editor-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    height: 100dvh;
}

.sidebar {
    position: relative;
    z-index: 5;
    grid-column: 2;
    grid-row: 1;
    display: flex;
    width: 320px;
    min-width: 0;
    flex-direction: column;
    background: #f7fafb;
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.sidebar[hidden] {
    display: none;
}

.brand-row {
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--blue);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 19px;
    font-style: italic;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.editor-badge {
    padding: 5px 7px;
    color: #e9f6ff;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.sidebar-scroll {
    flex: 1;
    min-height: 0;
    padding: 14px;
    overflow: auto;
}

.panel {
    padding: 15px;
    margin-bottom: 11px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 13px;
}

.panel h2 {
    margin: 0 0 12px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.section-heading-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.save-state {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.save-state.is-dirty {
    color: #a25b00;
}

.field-label {
    display: block;
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.text-field,
.select-field {
    width: 100%;
    height: 36px;
    min-width: 0;
    padding: 0 10px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #cbd7de;
    border-radius: 8px;
    outline: none;
}

.text-field:focus,
.select-field:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(27, 125, 212, 0.13);
}

.build-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 12px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 11px;
}

.build-facts strong {
    color: var(--ink);
}

.part-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
}

.selection-readout {
    min-height: 18px;
    margin: 10px 0 8px;
    color: var(--muted);
    font-size: 11px;
}

.debug-toggle-row {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 9px;
    color: var(--ink);
    background: #f4f7f8;
    border: 1px solid #cbd7de;
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.debug-toggle-row input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--blue);
    cursor: pointer;
}

.debug-toggle-row:has(input:focus-visible) {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(27, 125, 212, 0.13);
}

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

.action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 7px;
}

.button {
    min-height: 36px;
    padding: 7px 11px;
    color: var(--ink);
    background: #f4f7f8;
    border: 1px solid #cbd7de;
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.button:hover:not(:disabled) {
    background: #e9f1f5;
}

.button:active:not(:disabled) {
    transform: translateY(1px);
}

.button.primary,
.button.save {
    color: #fff;
    background: var(--blue);
    border-color: var(--blue);
}

.button.primary:hover:not(:disabled),
.button.save:hover:not(:disabled) {
    background: var(--blue-dark);
}

.button.danger {
    color: var(--danger);
    background: #fff8f8;
    border-color: #efc7cc;
}

.button.compact {
    padding-inline: 5px;
}

.button.is-active {
    color: var(--blue-dark);
    background: #e5f2fc;
    border-color: #8fc4ec;
}

.button:disabled,
.text-field:disabled,
.select-field:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.full-width {
    width: 100%;
    margin-top: 7px;
}

.button.save {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
}

.button.save img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

kbd {
    color: inherit;
    opacity: 0.62;
    font-family: inherit;
    font-size: 8px;
    font-weight: 700;
}

.warning-panel {
    padding: 12px 14px;
    margin-bottom: 12px;
    color: #6f4a00;
    background: #fff7df;
    border: 1px solid #efd48a;
    border-radius: 10px;
    font-size: 11px;
}

.warning-panel summary {
    cursor: pointer;
    font-weight: 800;
}

.warning-panel ul {
    padding-left: 18px;
    margin: 9px 0 0;
}

.warning-panel li + li {
    margin-top: 5px;
}

.sidebar-footer {
    min-height: 42px;
    padding: 10px 14px;
    color: #53646d;
    background: #edf3f6;
    border-top: 1px solid var(--line);
    font-size: 11px;
}

.workspace {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
}

.viewport {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: radial-gradient(circle at 50% 42%, #f9fcfd 0%, #e7f1f5 70%, #dbe9ef 100%);
}

#scene-canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.viewport-close {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 4;
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    background: #0875d5;
    border-radius: 50%;
    box-shadow: 0 5px 18px rgba(21, 67, 98, 0.28);
}

.viewport-close:hover {
    background: #006bc8;
    transform: translateY(-1px);
}

.viewport-close:active {
    transform: translateY(1px);
}

.viewport-close:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.94);
    outline-offset: 3px;
}

.viewport-close img {
    display: block;
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    color: var(--ink);
    background: rgba(239, 247, 250, 0.92);
    transition: opacity 180ms ease, visibility 180ms ease;
}

.loading-overlay.is-hidden {
    visibility: hidden;
    opacity: 0;
}

.loading-overlay.is-error {
    color: #8e2835;
    background: rgba(255, 241, 243, 0.96);
}

.loading-overlay span {
    max-width: 420px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.developer-auth {
    display: flex;
    order: 1;
    max-width: min(360px, calc(100vw - 40px));
    align-items: center;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.developer-auth[hidden] {
    display: none;
}

.developer-sign-in {
    min-height: 44px;
    padding: 10px 18px;
    color: #fff;
    background: var(--blue);
    border: 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(21, 67, 98, 0.2);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.developer-sign-in:hover:not(:disabled) {
    background: #006bc8;
}

.developer-sign-in:focus-visible {
    outline: 3px solid rgba(8, 117, 213, 0.35);
    outline-offset: 3px;
}

.developer-sign-in:disabled {
    cursor: wait;
    opacity: 0.65;
}

.loading-overlay .auth-error {
    min-height: 18px;
    color: #8e2835;
}

.viewport-menu-control {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 4;
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 12px;
}

.viewport-menu-toggle {
    display: grid;
    width: 50px;
    height: 50px;
    padding: 0;
    place-items: center;
    background: #0875d5;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 5px 18px rgba(21, 67, 98, 0.28);
    cursor: pointer;
}

.viewport-menu-toggle:hover,
.viewport-menu-toggle[aria-expanded="true"] {
    background: #006bc8;
    transform: translateY(-1px);
}

.viewport-menu-toggle:focus-visible,
.viewport-menu-item:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.94);
    outline-offset: 3px;
}

.viewport-menu-toggle img {
    display: block;
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.viewport-menu {
    display: flex;
    width: min(280px, calc(100vw - 48px));
    padding: 10px;
    flex-direction: column;
    background: #0875d5;
    border-radius: 20px;
    box-shadow: 0 12px 34px rgba(21, 67, 98, 0.34);
}

.viewport-menu[hidden] {
    display: none;
}

.viewport-menu-item {
    display: flex;
    min-height: 64px;
    align-items: center;
    gap: 15px;
    padding: 8px 13px;
    color: #fff;
    background: transparent;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
}

.viewport-menu-item:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.16);
}

.viewport-menu-item:active:not(:disabled) {
    transform: translateY(1px);
}

.viewport-menu-item:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.viewport-menu-item img {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    object-fit: contain;
}

.viewport-menu-item > span:only-child {
    padding-left: 57px;
}

.unsaved-dialog {
    width: min(520px, calc(100vw - 32px));
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 0;
}

.unsaved-dialog::backdrop {
    background: rgba(16, 31, 40, 0.58);
    backdrop-filter: blur(3px);
}

.unsaved-dialog-card {
    padding: 40px 46px 42px;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 18px 56px rgba(16, 31, 40, 0.32);
}

.unsaved-dialog-card h2 {
    margin: 0;
    color: #464646;
    font-size: 24px;
    line-height: 1.25;
}

.unsaved-dialog-error {
    margin: 12px 0 0;
    color: #8e2835 !important;
    font-size: 13px;
    font-weight: 700;
}

.unsaved-dialog-error:empty {
    display: none;
}

.unsaved-dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 30px;
}

.unsaved-dialog-actions .button {
    min-height: 64px;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 3px 6px rgba(16, 31, 40, 0.24);
    font-size: 20px;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(27, 125, 212, 0.18);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.loading-overlay.is-error .spinner {
    display: none;
}

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

.voxel-tool-control {
    position: absolute;
    left: 24px;
    bottom: 24px;
    z-index: 3;
}

.voxel-tool-toggle {
    display: grid;
    width: 58px;
    height: 58px;
    padding: 3px;
    place-items: center;
    background: #0875d5;
    border: 5px solid rgba(205, 231, 250, 0.9);
    border-radius: 50%;
    box-shadow: 0 5px 18px rgba(21, 67, 98, 0.28);
    cursor: pointer;
}

.voxel-tool-toggle:hover,
.voxel-tool-toggle[aria-expanded="true"] {
    background: #006bc8;
    transform: translateY(-1px);
}

.voxel-tool-toggle:focus-visible,
.voxel-tool-option:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.94);
    outline-offset: 3px;
}

.voxel-tool-toggle img {
    display: block;
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.voxel-tool-toggle[hidden],
.voxel-tool-palette[hidden] {
    display: none;
}

.voxel-tool-palette {
    display: flex;
    min-height: 66px;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: #0875d5;
    border: 5px solid rgba(205, 231, 250, 0.9);
    border-radius: 999px;
    box-shadow: 0 5px 18px rgba(21, 67, 98, 0.28);
}

.voxel-tool-option {
    display: grid;
    width: 52px;
    height: 52px;
    padding: 3px;
    flex: 0 0 auto;
    place-items: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.voxel-tool-option:hover,
.voxel-tool-option.is-active {
    background: rgba(255, 255, 255, 0.18);
}

.voxel-tool-option img {
    display: block;
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.part-actions {
    position: absolute;
    top: 50%;
    right: 24px;
    z-index: 3;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 14px;
    transform: translateY(-50%);
}

.part-actions[hidden] {
    display: none;
}

.part-action {
    display: grid;
    width: 62px;
    height: 62px;
    padding: 7px;
    place-items: center;
    background: rgba(255, 255, 255, 0.97);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 5px 18px rgba(21, 67, 98, 0.24);
    cursor: pointer;
}

.part-action:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
}

.part-action:active:not(:disabled) {
    transform: translateY(1px);
}

.part-action:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.94);
    outline-offset: 3px;
}

.part-action:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.part-action img {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.color-palette-control {
    position: absolute;
    right: 24px;
    bottom: 24px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 14px;
}

.viewport-undo {
    min-width: 102px;
    height: 50px;
    padding: 0 24px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(191, 207, 215, 0.95);
    border-radius: 999px;
    box-shadow: 0 5px 18px rgba(21, 67, 98, 0.23);
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.viewport-undo:hover:not(:disabled) {
    background: #fff;
    border-color: #fff;
    transform: translateY(-1px);
}

.viewport-undo:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.9);
    outline-offset: 3px;
}

.viewport-undo:disabled {
    color: var(--ink);
    background: #fff;
    cursor: not-allowed;
    opacity: 1;
}

.color-palette-toggle {
    position: relative;
    display: grid;
    width: 50px;
    height: 50px;
    padding: 0;
    place-items: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(21, 67, 98, 0.2);
    cursor: pointer;
}

.color-palette-toggle:hover,
.color-palette-toggle[aria-expanded="true"] {
    background: transparent;
    transform: translateY(-1px);
}

.color-palette-toggle:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.9);
    outline-offset: 3px;
}

.color-palette-toggle img {
    display: block;
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.color-palette-indicator {
    position: absolute;
    z-index: 1;
    width: 30px;
    height: 30px;
    background: #42a5f5;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(38, 50, 56, 0.32);
    pointer-events: none;
}

.color-palette {
    position: absolute;
    right: 0;
    bottom: 62px;
    padding: 8px;
    background: #fff;
    border: 1px solid rgba(191, 207, 215, 0.95);
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(21, 67, 98, 0.3);
}

.color-palette[hidden] {
    display: none;
}

.color-palette-swatches {
    display: grid;
    grid-template-columns: repeat(8, 28px);
    grid-auto-rows: 28px;
    overflow: hidden;
    border: 1px solid rgba(38, 50, 56, 0.14);
    border-radius: 7px;
}

.color-palette-swatch {
    position: relative;
    width: 28px;
    height: 28px;
    padding: 0;
    background: var(--swatch-color);
    border: 0;
    cursor: pointer;
}

.color-palette-swatch:hover,
.color-palette-swatch:focus-visible {
    z-index: 1;
    outline: 3px solid #fff;
    outline-offset: -3px;
    box-shadow: inset 0 0 0 4px rgba(38, 50, 56, 0.46);
}

.color-palette-swatch.is-selected::after {
    position: absolute;
    inset: 5px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(38, 50, 56, 0.7);
    content: "";
}

.scan-parts-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    overflow: hidden;
}

.scan-parts-scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    opacity: 0;
    transition: opacity 240ms ease;
}

.scan-parts-overlay.is-open .scan-parts-scrim {
    opacity: 1;
}

.scan-parts-option:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.scan-parts-stage {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    padding: 74px 16px 38px;
    pointer-events: none;
}

.scan-parts-stack {
    position: relative;
    width: min(82vw, 458px);
    width: min(82vw, calc(72.028dvh - 126.77px), 458px);
    aspect-ratio: 618 / 858;
}

.scan-parts-overlay .camera-frame-card {
    width: 100%;
}

.scan-parts-camera-card,
.scan-parts-selection-card {
    position: absolute;
    inset: 0;
    will-change: transform, opacity;
}

.scan-parts-camera-card {
    z-index: 1;
    pointer-events: auto;
    transform: translateY(calc(-50dvh - 50% - 32px));
    transition: transform 600ms cubic-bezier(0.22, 0.78, 0.24, 1), opacity 240ms ease;
}

.scan-parts-overlay.is-open .scan-parts-camera-card {
    transform: translateY(0);
}

.scan-parts-overlay.is-choosing .scan-parts-camera-card {
    opacity: 0.76;
    pointer-events: none;
    transform: translate3d(-7px, 8px, 0) rotate(-3deg);
}

.scan-parts-camera-card .camera-frame-card__window,
.scan-parts-camera-card .camera-frame-card__video,
.scan-parts-camera-card .camera-frame-card__prompt {
    transition: background-color 180ms ease, opacity 180ms ease;
}

.scan-parts-overlay.is-choosing .scan-parts-camera-card .camera-frame-card__window {
    background: #f4f4f2;
}

.scan-parts-overlay.is-choosing .scan-parts-camera-card .camera-frame-card__video,
.scan-parts-overlay.is-choosing .scan-parts-camera-card .camera-frame-card__prompt {
    opacity: 0;
}

.scan-parts-selection-card {
    z-index: 2;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    opacity: 0;
    transform: translateY(calc(-50dvh - 50% - 32px)) rotate(2deg);
    transition: transform 600ms cubic-bezier(0.22, 0.78, 0.24, 1), opacity 180ms ease;
}

.scan-parts-overlay.is-choosing .scan-parts-selection-card {
    opacity: 1;
    transform: translate3d(7px, -3px, 0) rotate(2deg);
    pointer-events: auto;
}

.scan-parts-overlay.is-choosing .scan-parts-selection-card.is-dragging {
    cursor: grabbing;
    transition: none;
}

.scan-parts-overlay.is-choosing .scan-parts-selection-card.is-dismissing {
    pointer-events: none;
    transition: transform 340ms cubic-bezier(0.4, 0, 1, 1), opacity 260ms ease;
}

.scan-parts-overlay.is-completing .scan-parts-selection-card {
    opacity: 0;
    transform: translate3d(0, calc(100dvh + 100%), 0) rotate(9deg);
    transition: transform 360ms cubic-bezier(0.4, 0, 1, 1), opacity 260ms ease;
    pointer-events: none;
}

.scan-parts-overlay.is-completing .scan-parts-camera-card {
    opacity: 0;
    transform: translate3d(0, calc(100dvh + 100%), 0) rotate(-7deg);
    transition: transform 400ms cubic-bezier(0.4, 0, 1, 1), opacity 260ms ease;
}

.scan-parts-overlay.is-closing .scan-parts-camera-card,
.scan-parts-overlay.is-closing .scan-parts-selection-card {
    opacity: 0;
    transform: translateY(calc(-50dvh - 50% - 32px));
    pointer-events: none;
}

.scan-parts-selection-window {
    overflow-x: hidden;
    overflow-y: auto;
    background: #f4f4f2;
    scrollbar-color: #a9adb0 transparent;
    scrollbar-width: thin;
}

.scan-parts-grid {
    display: grid;
    min-height: 100%;
    padding: 15px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(145px, 1fr);
    gap: 12px;
}

.scan-parts-option {
    position: relative;
    min-width: 0;
    min-height: 145px;
    padding: 0;
    overflow: hidden;
    color: var(--ink);
    background-color: #f8f8f6;
    background-image:
        linear-gradient(45deg, rgba(215, 218, 219, 0.45) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(215, 218, 219, 0.45) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(215, 218, 219, 0.45) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(215, 218, 219, 0.45) 75%);
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
    border: 4px solid #d2d4d4;
    border-radius: 18px;
    cursor: pointer;
    transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.scan-parts-option:hover:not(:disabled) {
    z-index: 1;
    border-color: #1594f6;
    box-shadow: 0 7px 18px rgba(24, 58, 79, 0.22);
    transform: translateY(-2px);
}

.scan-parts-option:active:not(:disabled) {
    transform: translateY(1px);
}

.scan-parts-option:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.scan-parts-option img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 137px;
    object-fit: contain;
}

.scan-parts-option-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(38, 50, 56, 0.15);
    border-top-color: #60727b;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.scan-parts-status {
    width: min(82vw, 458px);
    min-height: 22px;
    margin: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 180ms ease 380ms, transform 180ms ease 380ms;
}

.scan-parts-overlay.is-open .scan-parts-status {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 480px) {
    .scan-parts-stage {
        padding: 64px 12px 28px;
    }

    .scan-parts-stack {
        width: min(88vw, 458px);
        width: min(88vw, calc(72.028dvh - 121.01px), 458px);
    }

    .scan-parts-grid {
        padding: 11px;
        grid-auto-rows: minmax(116px, 1fr);
        gap: 8px;
    }

    .scan-parts-option {
        min-height: 116px;
        border-width: 3px;
        border-radius: 14px;
    }

    .scan-parts-option img {
        min-height: 110px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scan-parts-scrim,
    .scan-parts-camera-card,
    .scan-parts-selection-card,
    .scan-parts-status,
    .scan-parts-option {
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }
}

@media (max-width: 840px) {
    .sidebar {
        width: 270px;
    }

    .sidebar-scroll {
        padding: 10px;
    }

    .panel {
        padding: 12px;
    }

}

@media (max-width: 620px) {
    .sidebar {
        width: 224px;
    }

    .brand-row {
        padding-inline: 10px;
    }

    .brand span,
    .editor-badge,
    .button kbd {
        display: none;
    }

    .voxel-tool-control {
        left: 16px;
        bottom: 16px;
    }

    .viewport-menu-control {
        top: 16px;
        right: 16px;
    }

    .viewport-close {
        top: 16px;
        left: 16px;
    }

    .viewport-menu {
        width: min(250px, calc(100vw - 32px));
    }

    .viewport-menu-item {
        min-height: 56px;
        font-size: 17px;
    }

    .viewport-menu-item img {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .part-actions {
        right: 16px;
        gap: 10px;
    }

    .part-action {
        width: 54px;
        height: 54px;
        padding: 6px;
    }

    .part-action img {
        width: 42px;
        height: 42px;
    }

    .voxel-tool-palette {
        gap: 1px;
        padding-inline: 4px;
    }

    .voxel-tool-option {
        width: 40px;
        height: 44px;
    }

    .voxel-tool-option img {
        width: 36px;
        height: 36px;
    }

    .color-palette-control {
        right: 16px;
        bottom: 16px;
        gap: 9px;
    }

    .viewport-undo {
        min-width: 82px;
        padding-inline: 18px;
    }

    .color-palette-swatches {
        grid-template-columns: repeat(8, 24px);
        grid-auto-rows: 24px;
    }

    .color-palette-swatch {
        width: 24px;
        height: 24px;
    }
}
