:root {
    --bg: #0c0c0d;
    --panel: rgba(255, 255, 255, 0.06);
    --panel-strong: rgba(255, 255, 255, 0.09);
    --border: rgba(255, 255, 255, 0.12);
    --text: #ffffff;
    --muted: rgba(255, 255, 255, 0.72);
    --accent: #d90429;
    --accent-strong: #ef233c;
    --shadow: 0 24px 50px rgba(0, 0, 0, 0.36);
    --serif: "Playfair Display", "Times New Roman", serif;
    --sans: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--text);
    background: linear-gradient(180deg, #151517 0%, var(--bg) 100%);
}

a { color: inherit; text-decoration: none; }

main { padding-bottom: 48px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 800;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.btn.wide { width: 100%; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: #fff; }
.btn-secondary { border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.04); color: #fff; }

.customizer-shell {
    min-height: calc(100vh - 122px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 18px;
    align-items: stretch;
}

.customizer-left {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: stretch;
    position: relative;
}

.seat-picker-panel {
    display: none;
    min-width: 0;
    padding: 16px;
    max-height: calc(100vh - 122px);
    overflow: auto;
    background: rgba(18, 18, 20, 0.96);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 18px;
    width: auto;
    z-index: 20;
}

.customizer-shell.is-seat-step .seat-picker-panel {
    display: block;
}

.seat-picker-inner {
    display: grid;
    gap: 16px;
}

.seat-picker-panel h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.customizer-stage,
.control-panel,
.reopened-favorite {
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 18px;
}

.customizer-stage {
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(320px, 1fr);
    overflow: hidden;
}

.stage-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #d8ffee;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    font-weight: 800;
}

.stage-toolbar h1,
.control-panel h2 {
    margin: 0;
    font-family: var(--serif);
    letter-spacing: 0;
}

.stage-toolbar h1 {
    font-size: clamp(1.7rem, 3.2vw, 3rem);
    line-height: 1;
}

.step-tabs {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.step-tab {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-weight: 900;
    cursor: pointer;
}

.step-tab.active {
    background: var(--accent);
    border-color: rgba(217, 4, 41, 0.8);
}

.viewer-shell {
    position: relative;
    min-height: clamp(320px, 56vh, 460px);
    background: #111;
}

.model-viewer {
    width: 100%;
    height: 100%;
    min-height: clamp(320px, 56vh, 460px);
    overflow: hidden;
    background: radial-gradient(circle at 50% 20%, rgba(217, 4, 41, 0.10), transparent 42%), #111;
}

.viewer-status,
.preview-badge {
    position: absolute;
    left: 18px;
    z-index: 4;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
}

.viewer-status {
    bottom: 18px;
    max-width: min(560px, calc(100% - 36px));
    padding: 10px 14px;
    color: var(--muted);
    line-height: 1.5;
    font-size: 0.9rem;
}

.preview-badge {
    top: 18px;
    padding: 9px 13px;
    font-size: 0.82rem;
    font-weight: 900;
}

.control-panel {
    min-width: 0;
    padding: 14px;
    align-self: center;
    max-height: calc(100vh - 122px);
    overflow-y: auto;
    overflow-x: hidden;
}

@media (max-height: 860px) and (min-width: 1181px) {
    .customizer-shell {
        min-height: calc(100vh - 104px);
    }

    .customizer-stage {
        grid-template-rows: auto minmax(290px, 1fr);
    }

    .stage-toolbar {
        padding: 12px 14px;
    }

    .stage-toolbar h1 {
        font-size: clamp(1.4rem, 2.4vw, 2.2rem);
    }

    .viewer-shell,
    .model-viewer {
        min-height: clamp(280px, 48vh, 380px);
    }

    .control-panel {
        padding: 12px;
    }

    .panel-section[data-step-panel="motor"].active {
        gap: 10px;
    }

    .panel-section[data-step-panel="motor"] h2 {
        font-size: 1.7rem;
    }

    .panel-section[data-step-panel="motor"] .panel-copy {
        font-size: 0.88rem;
        line-height: 1.35;
    }

    .panel-section[data-step-panel="motor"] #motorChoices {
        gap: 6px;
    }

    #motorChoices .choice-card {
        min-height: 54px;
        padding: 10px 12px;
    }

    #motorChoices .choice-card strong {
        font-size: 0.92rem;
    }

    .panel-section[data-step-panel="motor"] .btn.wide {
        min-height: 40px;
    }
}

.panel-section {
    display: none;
}

.panel-section.active {
    display: grid;
    gap: 16px;
}

.panel-section[data-step-panel="motor"].active {
    gap: 12px;
}

.panel-section[data-step-panel="motor"] .panel-copy {
    line-height: 1.45;
    font-size: 0.93rem;
}

.panel-section[data-step-panel="motor"] #motorChoices {
    gap: 8px;
}

.panel-section[data-step-panel="motor"] .field-group {
    gap: 6px;
}

.panel-section[data-step-panel="motor"] .field-group label {
    font-size: 0.86rem;
}

.panel-section[data-step-panel="motor"] .field-group input[type="color"] {
    min-height: 40px;
}

.panel-section[data-step-panel="motor"] .color-swatches {
    gap: 8px;
}

.panel-section[data-step-panel="motor"] .color-swatches button {
    width: auto;
    min-height: 38px;
    height: auto;
    padding: 6px 10px 6px 7px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    color: inherit;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.72rem;
    line-height: 1.15;
    text-align: left;
}

.panel-section[data-step-panel="motor"] .color-swatches button .swatch-dot {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 50%;
    background: var(--swatch);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.panel-section[data-step-panel="motor"] .color-swatches button[hidden] {
    display: none !important;
}

.panel-section[data-step-panel="motor"] .btn.wide {
    min-height: 42px;
}

.control-panel h2 {
    font-size: 2rem;
}

.control-panel h3 {
    margin: 0;
    font-size: 1rem;
}

.panel-copy,
.action-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.custom-ai-entry {
    width: 100%;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid rgba(227, 23, 65, 0.35);
    border-radius: 14px;
    background: rgba(227, 23, 65, 0.11);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(103, 7, 31, 0.16);
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.custom-ai-entry i {
    font-size: 1.2rem;
    color: #ff6d89;
}

.custom-ai-entry:hover,
.custom-ai-entry:focus-visible {
    border-color: rgba(255, 91, 124, 0.62);
    background: rgba(227, 23, 65, 0.18);
    outline: none;
    transform: translateY(-1px);
}

.choice-list,
.seat-type-grid,
.field-grid,
.summary-list {
    display: grid;
    gap: 10px;
}

.choice-card,
.texture-card,
.summary-item {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.choice-card,
.choice-card {
    display: grid;
    gap: 5px;
    min-height: 76px;
    padding: 14px;
    text-align: left;
    cursor: pointer;
    transform: translateZ(0);
}

.choice-card.active,
.texture-card.active {
    border-color: rgba(217, 4, 41, 0.8);
    box-shadow: 0 0 0 1px rgba(217, 4, 41, 0.35);
}

.choice-card:not(:disabled):hover,
.choice-card:not(:disabled):focus-visible,
.texture-card:hover,
.texture-card:focus-visible,
.seat-part-buttons button:not(:disabled):hover,
.seat-part-buttons button:not(:disabled):focus-visible,
.color-swatches button:hover,
.color-swatches button:focus-visible,
[data-stitch-color]:not(:disabled):hover,
[data-stitch-color]:not(:disabled):focus-visible,
[data-color]:hover,
[data-color]:focus-visible {
    transform: translateY(-2px) scale(1.015);
    border-color: rgba(239, 35, 60, 0.55);
    box-shadow: 0 10px 26px rgba(239, 35, 60, 0.14);
}

.choice-card span,
.choice-card span {
    color: var(--muted);
    font-size: 0.83rem;
}

/* Motor cards are title-only, so tighten spacing and center label cleanly. */
#motorChoices .choice-card {
    display: flex;
    align-items: center;
    min-height: 62px;
    padding: 12px 14px;
}

#motorChoices .choice-card strong {
    display: block;
    width: 100%;
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.25;
    letter-spacing: 0.01em;
}

.seat-part-status,
.seat-summary-text {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.seat-summary-bar,
.design-panel {
    display: grid;
    gap: 10px;
    padding: 0 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#stitchDesignPanel[hidden],
#stitchColorSection[hidden],
.seat-part-buttons button[hidden] {
    display: none !important;
}

.seat-summary-bar {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.design-panel {
    gap: 14px;
}

.design-panel:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.customize-tool-section {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.035);
}

.seat-workbench {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
}

.seat-workspace {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.seat-workspace-header {
    display: grid;
    gap: 6px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.seat-workspace-header h3 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.seat-workspace-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.seat-workspace .customize-tool-section {
    margin: 0;
}

.seat-workspace .customize-tool-section h4 {
    margin: 0;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
}

.seat-summary-actions,
.seat-part-buttons,
.stitch-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mini-btn,
.seat-part-buttons button,
.stitch-controls button {
    min-height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    padding: 8px 12px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.seat-part-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.seat-part-buttons button {
    display: grid;
    align-content: center;
    gap: 4px;
    min-height: 62px;
    border-radius: 12px;
    text-align: left;
}

.seat-part-buttons button span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.mini-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.seat-part-buttons button.active,
.stitch-controls button.active {
    background: rgba(217, 4, 41, 0.22);
    border-color: rgba(217, 4, 41, 0.72);
}

.field-group,
.field-grid label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 800;
}

.field-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-group input,
.field-grid select,
.field-grid input {
    width: 100%;
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.22);
    color: #fff;
    padding: 0 12px;
    font: inherit;
}

.field-group input[type="color"] {
    padding: 4px;
}

.color-swatches {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-swatches button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.18);
    background: var(--swatch);
    cursor: pointer;
}

.toggle-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.toggle-row label {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-weight: 800;
}

.texture-rail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-height: min(52vh, 420px);
    overflow: auto;
    padding-right: 0;
}

.texture-card {
    display: grid;
    gap: 7px;
    padding: 8px;
    cursor: pointer;
    text-align: left;
    border-radius: 12px;
}

.texture-card.texture-hidden {
    display: none;
}

.texture-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.texture-card span {
    min-height: 2.4em;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.2;
}

.empty-texture {
    grid-column: 1 / -1;
    padding: 18px;
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    color: var(--muted);
}

.custom-price-card {
    position: sticky;
    bottom: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(217, 4, 41, 0.28);
    background: linear-gradient(135deg, rgba(42, 16, 20, 0.96), rgba(22, 22, 24, 0.96));
    backdrop-filter: blur(14px);
}

.custom-price-card span {
    color: var(--muted);
    font-weight: 900;
    text-transform: capitalize;
}

.custom-price-card strong {
    font-size: 2rem;
    white-space: nowrap;
}

.custom-price-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: 0.9rem;
}

/* The final-review panel is narrow beside the 3D viewer. Keep the label and
   total together, then give the explanatory copy a full, readable row. */
.custom-price-card.final {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "label amount"
        "note note";
    align-items: center;
    gap: 8px 12px;
}

.custom-price-card.final span {
    grid-area: label;
    min-width: 0;
    white-space: nowrap;
}

.custom-price-card.final strong {
    grid-area: amount;
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.custom-price-card.final p {
    grid-area: note;
    max-width: none;
    font-size: 0.82rem;
    line-height: 1.35;
}

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

.panel-section,
.summary-list,
.summary-item,
.custom-price-card,
.panel-actions {
    min-width: 0;
    max-width: 100%;
}

.summary-item strong {
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: right;
}

.panel-actions .btn {
    flex: 1 1 130px;
    min-width: 0;
    padding-inline: 14px;
}

.favorite-save-panel {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.045);
}

.favorite-save-panel h3,
.favorite-save-panel p {
    margin: 0;
}

.favorite-save-panel p {
    color: var(--muted);
    line-height: 1.45;
    font-size: 0.9rem;
}

.favorite-save-field {
    display: grid;
    gap: 6px;
}

.favorite-save-field span {
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.favorite-save-field input,
.favorite-save-field textarea {
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(8, 8, 10, 0.38);
    color: var(--text);
}

.favorite-save-field textarea {
    min-height: 78px;
    resize: vertical;
}

.favorite-save-field input:focus,
.favorite-save-field textarea:focus {
    outline: 2px solid rgba(239, 35, 60, 0.35);
    outline-offset: 2px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
}

.summary-item span:first-child {
    color: var(--muted);
}

.reopened-favorite {
    margin-top: 18px;
    padding: 18px;
}

.reopened-favorite h2,
.reopened-favorite p {
    margin: 0 0 6px;
}

.reopened-favorite span {
    color: var(--muted);
}

@media (max-width: 1180px) {
    .customizer-shell {
        grid-template-columns: 1fr;
        align-items: stretch;
        transform: none;
    }

    .control-panel {
        align-self: stretch;
        max-height: none;
    }

    .seat-picker-panel {
        display: none;
    }

    .customizer-shell.is-seat-step .seat-picker-panel {
        display: block;
        max-height: none;
    }
}

@media (max-width: 720px) {
    .stage-toolbar {
        flex-direction: column;
    }

    .model-viewer,
    .viewer-shell {
        min-height: 390px;
    }

    .field-grid.compact {
        grid-template-columns: 1fr;
    }

    .texture-rail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 300px;
    }

    .seat-summary-bar {
        grid-template-columns: 1fr;
    }

    .seat-workbench {
        grid-template-columns: 1fr;
    }

    .seat-part-buttons,
    .custom-price-card {
        grid-template-columns: 1fr;
    }

    .custom-price-card {
        display: grid;
        align-items: start;
    }

    .panel-actions .btn {
        width: 100%;
    }
}

/* Premium studio layout: keep the existing controls and 3D behavior, but connect them visually. */
body > .page-shell {
    width: min(1500px, calc(100% - 32px));
    padding-top: 24px;
}

.customizer-shell {
    grid-template-columns: minmax(0, 1fr) minmax(350px, 390px);
    gap: 0;
    min-height: min(760px, calc(100vh - 132px));
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: rgba(11, 11, 13, 0.78);
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
}

.customizer-stage,
.control-panel {
    border: 0;
    box-shadow: none;
}

.customizer-stage {
    min-height: min(760px, calc(100vh - 132px));
    grid-template-rows: auto minmax(500px, 1fr);
    border-radius: 29px 0 0 29px;
    background: linear-gradient(145deg, rgba(34, 34, 38, 0.92), rgba(13, 13, 15, 0.98));
}

.stage-toolbar {
    min-height: 142px;
    padding: 28px 30px 24px;
    align-items: center;
    border-bottom-color: rgba(255, 255, 255, 0.10);
    background:
        radial-gradient(circle at 15% 0%, rgba(217, 4, 41, 0.16), transparent 46%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent);
}

.stage-toolbar h1 {
    max-width: 760px;
    font-size: clamp(2.4rem, 4vw, 4.4rem);
    letter-spacing: -0.035em;
}

.eyebrow {
    padding: 7px 11px;
    border-radius: 999px;
    color: #effff8;
    background: rgba(217, 4, 41, 0.14);
    border: 1px solid rgba(239, 35, 60, 0.24);
}

.step-tabs {
    position: relative;
    gap: 22px;
    padding: 4px 2px;
}

.step-tabs::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 22px;
    right: 22px;
    height: 1px;
    background: rgba(255, 255, 255, 0.16);
}

.step-tab {
    position: relative;
    z-index: 1;
    width: 42px;
    height: 42px;
    background: #242428;
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.step-tab:hover,
.step-tab:focus-visible {
    transform: translateY(-2px);
}

.step-tab:focus-visible,
.choice-card:focus-visible,
.color-swatches button:focus-visible,
.btn:focus-visible,
.mini-btn:focus-visible,
.seat-part-buttons button:focus-visible,
.texture-card:focus-visible,
.stitch-controls button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent-strong) 72%, white);
    outline-offset: 3px;
}

.viewer-shell,
.model-viewer {
    min-height: 590px;
}

.viewer-shell {
    isolation: isolate;
    overflow: hidden;
    background: #101012;
}

.viewer-shell::before {
    content: "";
    position: absolute;
    z-index: 2;
    left: 16%;
    right: 16%;
    bottom: 15%;
    height: 16%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(217, 4, 41, 0.18), rgba(0, 0, 0, 0.24) 44%, transparent 72%);
    filter: blur(10px);
    pointer-events: none;
}

.viewer-shell::after {
    content: "";
    position: absolute;
    z-index: 3;
    inset: 0;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0.025), transparent 34%, transparent 70%, rgba(217, 4, 41, 0.035));
    pointer-events: none;
}

.viewer-status,
.preview-badge {
    color: rgba(255, 255, 255, 0.84);
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(7, 7, 9, 0.72);
}

.control-panel {
    position: sticky;
    top: 104px;
    align-self: start;
    min-height: min(760px, calc(100vh - 132px));
    max-height: calc(100vh - 116px);
    padding: 26px 24px;
    border-left: 1px solid var(--border);
    border-radius: 0 29px 29px 0;
    background:
        radial-gradient(circle at 100% 0%, rgba(217, 4, 41, 0.11), transparent 34%),
        rgba(25, 25, 28, 0.96);
}

.control-panel h2 {
    font-size: clamp(2rem, 2.8vw, 2.7rem);
    line-height: 1.05;
}

.panel-section[data-step-panel="motor"].active {
    gap: 18px;
}

.panel-section[data-step-panel="motor"] #motorChoices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#motorChoices .choice-card {
    position: relative;
    min-height: 68px;
    padding: 14px 38px 14px 14px;
    border-radius: 15px;
}

#motorChoices .choice-card::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--muted);
    transform: translateY(-50%);
}

#motorChoices .choice-card.active::after {
    border-color: #fff;
    background: var(--accent-strong);
    box-shadow: 0 0 0 4px rgba(239, 35, 60, 0.18);
}

.panel-section[data-step-panel="motor"] .field-group {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding-top: 4px;
}

.panel-section[data-step-panel="motor"] .field-group input[type="color"] {
    width: 58px;
    min-height: 38px;
    padding: 3px;
}

/* The native color input needs an obvious invitation to interact, rather than
   looking like an unexplained color chip. */
.panel-section[data-step-panel="motor"] .fairing-color-field {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    align-items: stretch;
    padding-top: 8px;
}

.fairing-color-field .field-label {
    font-size: 0.86rem;
    font-weight: 700;
}

.fairing-color-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.055);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.fairing-color-trigger:hover,
.fairing-color-trigger:focus-within {
    border-color: var(--accent-strong);
    background: rgba(239, 35, 60, 0.08);
    box-shadow: 0 0 0 3px rgba(239, 35, 60, 0.14);
}

.panel-section[data-step-panel="motor"] .fairing-color-trigger input[type="color"] {
    width: 44px;
    height: 38px;
    min-height: 38px;
    padding: 2px;
    border-radius: 8px;
    cursor: pointer;
    flex: 0 0 44px;
}

.fairing-color-trigger__copy {
    display: grid;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.fairing-color-trigger__copy strong {
    font-size: 0.82rem;
}

.fairing-color-trigger__copy small {
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.25;
}

.fairing-color-trigger output {
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.72rem;
    font-weight: 700;
}

.color-swatches button {
    position: relative;
    width: 38px;
    height: 38px;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.color-swatches button:hover,
.color-swatches button:focus-visible {
    transform: translateY(-2px) scale(1.04);
}

.color-swatches button.active {
    box-shadow: 0 0 0 3px #161619, 0 0 0 5px var(--accent-strong);
}

.color-swatches button.active::after {
    content: "\2713";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 900;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.panel-section[data-step-panel="motor"] .btn.wide {
    min-height: 50px;
    box-shadow: 0 18px 34px rgba(217, 4, 41, 0.24);
}

.customizer-shell.is-seat-step .customizer-left {
    grid-template-columns: minmax(310px, 370px) minmax(0, 1fr);
    gap: 0;
}

.customizer-shell.is-seat-step .seat-picker-panel {
    max-height: calc(100vh - 116px);
    border-width: 0 1px 0 0;
    border-radius: 29px 0 0 29px;
}

.customizer-shell.is-seat-step .customizer-stage {
    border-radius: 0;
}

html[data-theme="light"] {
    --bg: #fff8f7;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: rgba(255, 255, 255, 0.98);
    --border: rgba(96, 39, 47, 0.18);
    --text: #311915;
    --muted: #694f53;
    --shadow: 0 24px 50px rgba(82, 32, 38, 0.12);
}

html[data-theme="light"] body {
    color: var(--text);
    background:
        radial-gradient(circle at 12% 0%, rgba(217, 4, 41, 0.13), transparent 28%),
        linear-gradient(180deg, #fffaf9, var(--bg));
}

html[data-theme="light"] .customizer-shell {
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 34px 90px rgba(82, 32, 38, 0.15);
}

html[data-theme="light"] .customizer-stage {
    background: linear-gradient(145deg, #fff, #f9eded);
}

html[data-theme="light"] .favorite-save-panel {
    border-color: rgba(217, 4, 41, 0.14);
    background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .favorite-save-field input,
html[data-theme="light"] .favorite-save-field textarea {
    border-color: rgba(49, 25, 21, 0.12);
    background: rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .stage-toolbar {
    border-bottom-color: var(--border);
    background:
        radial-gradient(circle at 15% 0%, rgba(217, 4, 41, 0.11), transparent 46%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 249, 248, 0.82));
}

html[data-theme="light"] .eyebrow {
    color: #7f2635;
    background: rgba(217, 4, 41, 0.08);
}

html[data-theme="light"] .step-tabs::before {
    background: rgba(96, 39, 47, 0.22);
}

html[data-theme="light"] .step-tab {
    color: var(--text);
    background: #fff;
    border-color: var(--border);
}

html[data-theme="light"] .step-tab.active {
    color: #fff;
    background: var(--accent);
}

html[data-theme="light"] .control-panel,
html[data-theme="light"] .seat-picker-panel {
    color: var(--text);
    background:
        radial-gradient(circle at 100% 0%, rgba(217, 4, 41, 0.08), transparent 34%),
        rgba(255, 255, 255, 0.96);
}

html[data-theme="light"] .custom-ai-entry {
    border-color: rgba(217, 4, 41, 0.24);
    background: rgba(217, 4, 41, 0.07);
    color: var(--text);
    box-shadow: 0 14px 28px rgba(82, 32, 38, 0.08);
}

html[data-theme="light"] .custom-ai-entry:hover,
html[data-theme="light"] .custom-ai-entry:focus-visible {
    border-color: rgba(217, 4, 41, 0.42);
    background: rgba(217, 4, 41, 0.11);
}

html[data-theme="light"] .choice-card,
html[data-theme="light"] .texture-card,
html[data-theme="light"] .summary-item,
html[data-theme="light"] .seat-summary-bar,
html[data-theme="light"] .customize-tool-section,
html[data-theme="light"] .seat-workspace,
html[data-theme="light"] .mini-btn,
html[data-theme="light"] .seat-part-buttons button,
html[data-theme="light"] .stitch-controls button,
html[data-theme="light"] .btn-secondary {
    color: var(--text);
    background: rgba(96, 39, 47, 0.045);
    border-color: var(--border);
}

html[data-theme="light"] .field-group input,
html[data-theme="light"] .field-grid select,
html[data-theme="light"] .field-grid input {
    color: var(--text);
    background: #fff;
    border-color: var(--border);
}

html[data-theme="light"] .color-swatches button {
    border-color: rgba(96, 39, 47, 0.30);
}

html[data-theme="light"] .seat-summary-bar,
html[data-theme="light"] .seat-workspace-header,
html[data-theme="light"] .design-panel {
    border-color: var(--border);
}

html[data-theme="light"] .custom-price-card {
    color: #fff;
    background: linear-gradient(135deg, #571522, #22191b);
}

html[data-theme="light"] .custom-price-card span,
html[data-theme="light"] .custom-price-card p {
    color: rgba(255, 255, 255, 0.76);
}

@media (max-width: 1180px) {
    body > .page-shell {
        width: min(100% - 24px, 980px);
    }

    .customizer-shell {
        grid-template-columns: 1fr;
        border-radius: 26px;
    }

    .customizer-stage {
        min-height: 0;
        border-radius: 25px 25px 0 0;
    }

    .control-panel {
        position: static;
        min-height: 0;
        max-height: none;
        border-top: 1px solid var(--border);
        border-left: 0;
        border-radius: 0 0 25px 25px;
    }

    .customizer-shell.is-seat-step .customizer-left {
        grid-template-columns: 1fr;
    }

    .customizer-shell.is-seat-step .seat-picker-panel {
        border-width: 0 0 1px;
        border-radius: 25px 25px 0 0;
        max-height: none;
    }

    .customizer-shell.is-seat-step .customizer-stage {
        border-radius: 0;
    }

    .viewer-shell,
    .model-viewer {
        min-height: 540px;
    }
}

@media (max-width: 720px) {
    body > .page-shell {
        width: calc(100% - 16px);
        max-width: 680px;
        padding-top: 14px;
    }

    .customizer-shell,
    .customizer-left,
    .customizer-stage,
    .stage-toolbar,
    .viewer-shell,
    .control-panel {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .customizer-shell {
        border-radius: 22px;
    }

    .customizer-stage {
        grid-template-rows: auto;
    }

    .stage-toolbar {
        min-height: 0;
        padding: 22px 18px;
        align-items: stretch;
    }

    .viewer-shell {
        order: 3;
    }

    .control-panel {
        order: 2;
        border-radius: 0;
    }

    .stage-toolbar h1 {
        font-size: clamp(2rem, 12vw, 3.2rem);
    }

    .step-tabs {
        width: 100%;
        max-width: 100%;
        justify-content: space-between;
    }

    .viewer-shell,
    .model-viewer {
        min-height: 410px;
    }

    .control-panel { padding: 22px 18px; }

    .panel-section[data-step-panel="motor"] #motorChoices {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .step-tab,
    .color-swatches button,
    .choice-card,
    .btn {
        transition: none;
    }
}
