/* ============================================================
   Configurator — Premium Studio Workspace
   ============================================================ */

.configurator-body {
    background: var(--paper);
}

/* ============================================================
   Progress Steps
   ============================================================ */

.progress-container {
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 70px 0 var(--space-3);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    max-width: 720px;
    margin: 0 auto;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    position: relative;
    flex-shrink: 0;
}

.step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--paper);
    color: var(--ink-mute);
    border: 1.5px solid var(--rule);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.step-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--ink-mute);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: var(--transition);
    white-space: nowrap;
}

.progress-step.active .step-circle {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.progress-step.active .step-label {
    color: var(--ink);
}

.progress-step.completed .step-circle {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--paper);
}

.progress-step.completed .step-circle::after {
    content: '✓';
}

.progress-step.completed .step-circle {
    font-size: 0;
}

.progress-step.completed .step-circle::after {
    font-size: 0.85rem;
}

.progress-step.completed .step-label {
    color: var(--ink-soft);
}

.progress-line {
    flex: 1;
    max-width: 60px;
    height: 1px;
    background: var(--rule);
    margin-bottom: 18px;
}

/* ============================================================
   Main wrapper
   ============================================================ */

.configurator-main {
    padding: var(--space-4) 0 var(--space-9);
    min-height: calc(100vh - 200px);
}

.step-content {
    display: none;
    animation: fadeIn 0.5s var(--ease-out) both;
}

.step-content.active {
    display: block;
}

.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    padding-top: var(--space-7);
    margin-top: var(--space-7);
    border-top: 1px solid var(--rule-soft);
    flex-wrap: wrap;
}

/* ============================================================
   STEP 1 — Upload
   ============================================================ */

.step1-layout {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: var(--space-9);
    align-items: center;
    min-height: 60vh;
}

.step1-intro .eyebrow {
    margin-bottom: var(--space-4);
}

.step1-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 4.5vw, 4rem);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-5);
    color: var(--ink);
}

.step1-title em {
    font-style: italic;
    color: var(--accent);
    font-weight: 400;
}

.step1-lead {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--ink-soft);
    margin-bottom: var(--space-6);
    font-weight: 300;
    max-width: 460px;
}

.step1-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.step1-list li {
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
}

.step1-list-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-tint);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.step1-list strong {
    color: var(--ink);
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.step1-list > li > div {
    font-size: 0.95rem;
    color: var(--ink-soft);
    line-height: 1.5;
}

/* Upload zone */
.step1-upload {
    position: relative;
}

.upload-zone {
    background: var(--paper);
    border: 1.5px dashed var(--rule);
    border-radius: var(--r-xl);
    padding: var(--space-3);
    transition: var(--transition);
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-tint);
    transform: scale(1.01);
}

.upload-zone-inner {
    position: relative;
    background: var(--paper-soft);
    border-radius: var(--r-lg);
    padding: var(--space-9) var(--space-7);
    text-align: center;
    overflow: hidden;
}

/* Decorative grid in upload */
.upload-frame-decor {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--rule-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--rule-soft) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.6;
    pointer-events: none;
}

.upload-frame-decor::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 40%, var(--paper-soft) 80%);
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--paper);
    border: 1px solid var(--rule);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-5);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.upload-zone:hover .upload-icon-wrap {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.05);
    transition: var(--transition);
}

.upload-title {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: var(--space-3);
    letter-spacing: -0.01em;
}

.upload-or {
    color: var(--ink-mute);
    font-size: 0.85rem;
    margin-bottom: var(--space-3);
    position: relative;
}

.upload-hint {
    margin-top: var(--space-5);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink-mute);
    letter-spacing: 0.02em;
}

.upload-trust {
    text-align: center;
    margin-top: var(--space-4);
    font-size: 0.82rem;
    color: var(--ink-mute);
}

.upload-trust-icon {
    color: var(--accent);
    font-weight: 700;
    margin-right: var(--space-1);
}

/* ============================================================
   STEP 2 — Design / Studio Layout
   ============================================================ */

.studio-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--space-6);
    align-items: start;
}

/* ---- Stage (preview area) ---- */
.studio-stage {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    padding: var(--space-6);
}

.stage-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--rule-soft);
}

.stage-title {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.015em;
    margin-top: var(--space-2);
}

.stage-toggles {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
}

.toggle-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.5rem 0.85rem;
    background: var(--paper-soft);
    border: 1px solid var(--rule);
    border-radius: var(--r-pill);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.toggle-pill input {
    accent-color: var(--ink);
    cursor: pointer;
    width: 14px;
    height: 14px;
}

.toggle-pill:has(input:checked) {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

/* Comparison panels */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.comparison-panel {
    display: flex;
    flex-direction: column;
}

.panel-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ink-mute);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: var(--space-3);
}

.panel-label-accent {
    color: var(--accent);
}

.image-container {
    background: var(--paper-soft);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.image-container img,
.image-container canvas {
    max-width: 100%;
    max-height: 100%;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    display: block;
}

/* Spec strip */
.preview-info {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 0;
    background: var(--paper-soft);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    overflow: hidden;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-4);
    border-right: 1px solid var(--rule);
}

.info-item:last-child {
    border-right: none;
}

.info-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ink-mute);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.info-value {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink);
}

/* ============================================================
   STEP 2 — Control Panel (sidebar)
   ============================================================ */

.studio-controls {
    position: sticky;
    top: 130px;
}

.controls-card {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.controls-header {
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--rule-soft);
}

.controls-header .eyebrow {
    margin-bottom: var(--space-1);
    font-size: 0.65rem;
}

.controls-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.control-group-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--rule-soft);
}

.control-group-block:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.control-group-title {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ink-mute);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: var(--space-1);
    font-family: var(--font-body);
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.control-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.control-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
}

.help-text {
    font-size: 0.75rem;
    color: var(--ink-mute);
    cursor: help;
    border: 1px solid var(--rule);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
}

/* Mode toggle */
.mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--paper-soft);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    padding: 3px;
    gap: 2px;
}

.mode-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: calc(var(--r-md) - 3px);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink-soft);
    transition: var(--transition);
    user-select: none;
}

.mode-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mode-option:has(input:checked) {
    background: var(--ink);
    color: var(--paper);
    box-shadow: var(--shadow-sm);
}

/* Select */
.config-select {
    width: 100%;
    padding: 0.55rem 2rem 0.55rem 0.75rem;
    background: var(--paper) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234A4742' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    color: var(--ink);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    font-size: 0.875rem;
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.config-select:hover {
    border-color: var(--ink);
}

.config-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-tint);
}

/* Manual plates inputs */
.manual-plates-inputs {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.manual-plates-inputs input[type="number"] {
    width: 70px;
    padding: 0.55rem 0.65rem;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    font-size: 0.95rem;
    font-family: var(--font-mono);
    font-weight: 500;
    text-align: center;
    -moz-appearance: textfield;
    transition: var(--transition);
}

.manual-plates-inputs input[type="number"]::-webkit-outer-spin-button,
.manual-plates-inputs input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.manual-plates-inputs input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-tint);
}

.manual-plates-inputs > span {
    color: var(--ink-mute);
    font-size: 1rem;
    font-family: var(--font-display);
    font-weight: 400;
}

.plates-info {
    font-family: var(--font-mono);
    font-size: 0.78rem !important;
    color: var(--ink-mute) !important;
    margin-left: var(--space-1);
}

/* Range slider */
.config-range {
    width: 100%;
    height: 4px;
    background: var(--rule);
    border-radius: var(--r-pill);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.config-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--ink);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.config-range::-webkit-slider-thumb:hover {
    background: var(--accent);
    transform: scale(1.1);
}

.config-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--ink);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.range-axis {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--ink-mute);
    margin-top: 2px;
}

.range-value-inline {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--ink);
    font-size: 0.95rem;
}

/* Checkboxes */
.config-checkbox-group {
    margin-bottom: 0;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--paper-soft);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: var(--transition);
    margin: 0;
}

.check-row:hover {
    border-color: var(--ink);
    background: var(--paper);
}

.check-row input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    accent-color: var(--ink);
    cursor: pointer;
}

.check-label {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.3;
}

.check-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink);
}

.check-desc {
    font-size: 0.72rem;
    color: var(--ink-mute);
}

.check-row-accent {
    background: var(--accent-tint);
    border-color: var(--accent-soft);
}

.check-row-accent:hover {
    border-color: var(--accent);
}

.check-row-accent .check-title {
    color: var(--accent-deep);
}

/* Baseplate toggle with images */
.baseplate-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.baseplate-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: var(--paper-soft);
    border: 2px solid var(--rule-soft);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: var(--transition);
}

.baseplate-option:hover {
    border-color: var(--ink);
    background: var(--paper);
}

.baseplate-option.active {
    border-color: var(--accent);
    background: var(--accent-tint);
}

.baseplate-image-wrap {
    width: 100%;
    height: 80px;
    overflow: hidden;
    border-radius: var(--r-sm);
    position: relative;
}

.baseplate-image-wrap img {
    width: 200%;
    height: 200%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
    transform: translate(-25%, -25%);
}

.baseplate-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ink);
    text-align: center;
}

.baseplate-option.active .baseplate-label {
    color: var(--accent-deep);
}

/* Regenerate button */
.btn-block {
    display: flex;
    width: 100%;
}

.btn-regenerate {
    margin-top: var(--space-2);
}

/* ============================================================
   Info banner (re: palette slider)
   ============================================================ */

.info-banner {
    display: flex;
    gap: var(--space-4);
    background: var(--warning-tint);
    border: 1px solid #E2C58F;
    border-left: 3px solid var(--warning);
    border-radius: var(--r-md);
    padding: var(--space-4) var(--space-5);
    margin-top: var(--space-5);
    position: relative;
}

.info-banner-icon {
    color: var(--warning);
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.info-banner-content {
    flex: 1;
    font-size: 0.88rem;
    color: var(--ink-soft);
    line-height: 1.5;
}

.info-banner-content strong {
    color: var(--ink);
    display: block;
    margin-bottom: var(--space-1);
    font-weight: 600;
    font-size: 0.95rem;
}

.info-banner-content p {
    margin-bottom: var(--space-2);
    color: var(--ink-soft);
    font-size: 0.88rem;
}

.info-banner-content ul {
    padding-left: var(--space-4);
    color: var(--ink-soft);
    font-size: 0.85rem;
}

.info-banner-content ul li {
    margin-bottom: 4px;
}

.info-banner-content strong:not(:first-child) {
    display: inline;
}

.info-banner-close {
    background: transparent;
    border: none;
    color: var(--ink-mute);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    align-self: flex-start;
}

.info-banner-close:hover {
    color: var(--ink);
}

/* ============================================================
   Color replacement
   ============================================================ */

.color-replacement-section {
    margin-top: var(--space-6);
    border-top: 1px solid var(--rule-soft);
    padding-top: var(--space-5);
}

.collapsible-header {
    cursor: pointer;
    user-select: none;
}

.collapsible-header h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.collapse-arrow {
    color: var(--ink-mute);
    font-size: 0.85rem;
    transition: transform 0.3s var(--ease-out);
}

.collapsible-header.collapsed .collapse-arrow {
    transform: rotate(-90deg);
}

.color-replacement-content {
    margin-top: var(--space-3);
    overflow: hidden;
    max-height: 1000px;
    transition: max-height 0.4s var(--ease-out);
}

.collapsible-header.collapsed + .color-replacement-content {
    max-height: 0;
}

.color-replacement-hint {
    font-size: 0.85rem;
    color: var(--ink-mute);
    margin-bottom: var(--space-3);
}

.replacement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-3);
}

/* JS renders: .replacement-item { .replacement-color, span, .replacement-arrow, .replacement-select } */
.replacement-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--paper-soft);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    font-size: 0.82rem;
    transition: var(--transition);
}

.replacement-item:hover {
    border-color: var(--ink);
    background: var(--paper);
}

.replacement-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid var(--rule);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}

.replacement-item > span:first-of-type {
    flex: 1;
    color: var(--ink);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.replacement-arrow {
    color: var(--ink-mute);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.replacement-select {
    padding: 4px 22px 4px 8px;
    background: var(--paper) url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%234A4742' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 6px center;
    color: var(--ink);
    border: 1px solid var(--rule);
    border-radius: var(--r-sm);
    font-size: 0.75rem;
    font-family: var(--font-body);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    max-width: 90px;
}

.replacement-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* ============================================================
   STEP 3 — Actual Size Preview
   ============================================================ */

.preview-page {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--space-4) var(--space-6);
}

.preview-header {
    text-align: center;
    margin-bottom: var(--space-7);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.preview-header .eyebrow {
    justify-content: center;
    margin-bottom: var(--space-3);
}

.preview-header h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    letter-spacing: -0.025em;
    margin-bottom: var(--space-3);
}

.preview-header h2 em {
    font-style: italic;
    color: var(--accent);
    font-weight: 400;
}

.preview-subtitle {
    font-size: 1.05rem;
    color: var(--ink-soft);
    max-width: 560px;
    margin: 0 auto;
    font-weight: 300;
}

/* Zoom controls */
.zoom-controls {
    max-width: 720px;
    margin: 0 auto var(--space-5);
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-lg);
}

.zoom-control-row {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

.zoom-btn {
    padding: var(--space-2) var(--space-4);
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.zoom-btn:hover {
    border-color: var(--accent);
    background: var(--accent-tint);
}

.zoom-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.zoom-btn-reset {
    padding: var(--space-2) var(--space-4);
    background: var(--paper-soft);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    color: var(--ink-mute);
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: auto;
    transition: var(--transition);
}

.zoom-btn-reset:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.zoom-slider-container {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.zoom-label {
    font-size: 0.9rem;
    color: var(--ink-mute);
    font-weight: 500;
}

.zoom-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--rule);
    outline: none;
    -webkit-appearance: none;
}

.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.zoom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.zoom-indicator {
    font-size: 0.9rem;
    color: var(--ink);
    font-weight: 500;
    min-width: 140px;
    text-align: right;
}

/* Preview viewport (fixed size, no scroll) */
.preview-viewport {
    background: var(--paper-soft);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    margin: 0 auto var(--space-6);
    max-width: 100%;
    height: 70vh;
    position: relative;
    overflow: hidden;
    cursor: grab;
}

.preview-viewport:active {
    cursor: grabbing;
}

.preview-canvas-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
}

#actualSizeCanvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.preview-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    max-width: 720px;
    margin: 0 auto var(--space-6);
    padding: var(--space-5);
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--rule-soft);
}

.preview-info-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    text-align: center;
}

.preview-info-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-mute);
    font-weight: 500;
}

.preview-info-value {
    font-size: 1.1rem;
    color: var(--ink);
    font-weight: 500;
}

/* ============================================================
   STEP 4 — Add-ons
   ============================================================ */

.addons-page {
    max-width: 820px;
    margin: 0 auto;
}

.addons-header {
    text-align: center;
    margin-bottom: var(--space-7);
}

.addons-header .eyebrow {
    justify-content: center;
    margin-bottom: var(--space-3);
}

.addons-header h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    letter-spacing: -0.025em;
    margin-bottom: var(--space-3);
}

.addons-header h2 em {
    font-style: italic;
    color: var(--accent);
    font-weight: 400;
}

.addons-subtitle {
    font-size: 1.05rem;
    color: var(--ink-soft);
    max-width: 560px;
    margin: 0 auto;
    font-weight: 300;
}

.addons-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.addon-card {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    padding: var(--space-5) var(--space-6);
    transition: var(--transition);
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: var(--space-6);
    align-items: center;
}

.addon-card:hover {
    border-color: var(--ink);
    box-shadow: var(--shadow-md);
}

.addon-card-main {
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
}

.addon-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    background: var(--paper-soft);
    border: 1px solid var(--rule);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--accent);
    flex-shrink: 0;
}

.addon-card-text h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: var(--space-1);
    letter-spacing: -0.01em;
}

.addon-card-text p {
    font-size: 0.88rem;
    color: var(--ink-soft);
    line-height: 1.5;
}

.addon-card-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.addon-card-single {
    justify-content: center;
}

.addon-option,
.addon-checkbox {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 0.7rem 1rem;
    background: var(--paper-soft);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.addon-option input,
.addon-checkbox input {
    flex-shrink: 0;
    accent-color: var(--ink);
    cursor: pointer;
    margin-right: var(--space-2);
}

.addon-option:hover,
.addon-checkbox:hover {
    border-color: var(--ink);
    background: var(--paper);
}

.addon-option:has(input:checked),
.addon-checkbox:has(input:checked) {
    border-color: var(--ink);
    background: var(--paper);
    box-shadow: var(--shadow-xs);
}

.addon-option-label {
    flex: 1;
    color: var(--ink);
    font-weight: 500;
}

.addon-option-price {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ink-mute);
    white-space: nowrap;
}

.addon-option:has(input:checked) .addon-option-price,
.addon-checkbox:has(input:checked) .addon-option-price {
    color: var(--accent);
}

/* ============================================================
   STEP 5 — Order Summary (receipt style)
   ============================================================ */

.order-summary {
    max-width: 1100px;
    margin: 0 auto;
}

.order-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.order-header .eyebrow {
    justify-content: center;
    margin-bottom: var(--space-3);
}

.order-header h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    letter-spacing: -0.025em;
    margin-bottom: var(--space-3);
}

.order-header h2 em {
    font-style: italic;
    color: var(--accent);
    font-weight: 400;
}

.order-subtitle {
    font-size: 1.05rem;
    color: var(--ink-soft);
    max-width: 560px;
    margin: 0 auto;
    font-weight: 300;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    align-items: start;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    padding: var(--space-7);
    box-shadow: var(--shadow-md);
}

.summary-preview {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    position: relative;
}

.summary-preview-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink-mute);
    letter-spacing: 0.06em;
}

.summary-canvas-frame {
    background: var(--paper-soft);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    padding: var(--space-4);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.summary-canvas-frame canvas {
    max-width: 100%;
    max-height: 100%;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.summary-caption {
    font-size: 0.75rem;
    color: var(--ink-mute);
    font-style: italic;
    text-align: center;
}

.summary-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.summary-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.summary-section h3 {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ink-mute);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: var(--space-3);
    font-family: var(--font-body);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--rule-soft);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-3);
    font-size: 0.92rem;
    padding: var(--space-1) 0;
}

.detail-row span:first-child {
    color: var(--ink-soft);
}

.detail-row span:last-child {
    color: var(--ink);
    font-weight: 500;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-align: right;
}

#summaryAddons {
    font-size: 0.9rem;
}

#summaryAddons .addon-summary-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-1) 0;
    color: var(--ink-soft);
}

#summaryAddons .addon-summary-row span:last-child {
    font-family: var(--font-mono);
    color: var(--ink);
    font-size: 0.85rem;
}

#summaryAddons:empty::before {
    content: 'None selected.';
    color: var(--ink-mute);
    font-style: italic;
    font-size: 0.88rem;
}

/* Price section */
.price-section {
    margin-top: var(--space-3);
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.price-row span:last-child {
    font-family: var(--font-mono);
    color: var(--ink);
    font-weight: 500;
}

.price-row.total {
    margin-top: var(--space-3);
    padding-top: var(--space-4);
    border-top: 1px solid var(--ink);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--ink);
}

.price-row.total span:last-child {
    font-family: var(--font-display);
    color: var(--ink);
    font-size: 1.75rem;
    font-weight: 500;
}

.price-note {
    font-size: 0.8rem;
    color: var(--ink-mute);
    margin-top: var(--space-2);
    font-style: italic;
}

.checkout-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.checkout-actions .btn-large {
    padding: 1.15rem 2rem;
    font-size: 1.05rem;
}

.checkout-actions .btn-ghost {
    text-align: center;
    border: 1px solid transparent;
    padding: var(--space-3);
    border-radius: var(--r-md);
    transition: var(--transition);
}

.checkout-actions .btn-ghost:hover {
    border-color: var(--rule);
    background: var(--paper-soft);
}

.checkout-trust {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding-top: var(--space-4);
    margin-top: var(--space-2);
    border-top: 1px solid var(--rule-soft);
    font-size: 0.75rem;
    color: var(--ink-mute);
    font-family: var(--font-body);
    flex-wrap: wrap;
}

.checkout-trust span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ============================================================
   Floating Cost Badge (persistent price)
   ============================================================ */

.floating-cost-badge {
    position: fixed;
    bottom: var(--space-5);
    right: var(--space-5);
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xl);
    z-index: 90;
    min-width: 240px;
    max-width: 340px;
    overflow: hidden;
    transition: var(--transition);
    animation: fadeIn 0.5s var(--ease-out);
    border: 1px solid rgba(250, 248, 244, 0.1);
}

.floating-cost-header {
    padding: var(--space-4) var(--space-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    cursor: pointer;
    user-select: none;
}

.cost-icon {
    display: none; /* hide emoji */
}

.cost-summary {
    flex: 1;
}

.cost-title {
    font-size: 0.68rem;
    color: rgba(250, 248, 244, 0.55);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 2px;
    font-weight: 600;
}

.cost-amount {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 500;
    color: var(--paper);
    letter-spacing: -0.01em;
}

.toggle-arrow {
    color: rgba(250, 248, 244, 0.4);
    font-size: 0.85rem;
    transition: transform 0.3s var(--ease-out);
}

.floating-cost-badge.collapsed .toggle-arrow {
    transform: rotate(-180deg);
}

.floating-cost-details {
    padding: 0 var(--space-5) var(--space-4);
    border-top: 1px solid rgba(250, 248, 244, 0.1);
    overflow: hidden;
    max-height: 400px;
    transition: max-height 0.3s var(--ease-out), padding 0.3s var(--ease-out);
}

.floating-cost-badge.collapsed .floating-cost-details {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-color: transparent;
}

.cost-breakdown-compact {
    padding-top: var(--space-4);
    font-size: 0.85rem;
    color: rgba(250, 248, 244, 0.75);
}

.cost-breakdown-compact .breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-1) 0;
    font-size: 0.82rem;
    color: rgba(250, 248, 244, 0.7);
}

.cost-breakdown-compact .breakdown-item span:last-child {
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
}

.cost-breakdown-compact .breakdown-item.savings {
    color: #95D095;
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px dashed rgba(250, 248, 244, 0.15);
    font-size: 0.78rem;
}

.cost-breakdown-compact .breakdown-item.savings span:last-child {
    color: #95D095;
}

/* ============================================================
   Loading overlay
   ============================================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(250, 248, 244, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-4);
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 2px solid var(--rule);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-overlay p {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--ink);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.01em;
}

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

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1100px) {
    .studio-layout {
        grid-template-columns: 1fr;
    }

    .studio-controls {
        position: static;
    }

    .step1-layout {
        grid-template-columns: 1fr;
        gap: var(--space-7);
    }
}

@media (max-width: 768px) {
    .progress-container {
        padding-top: 88px;
        padding-bottom: var(--space-4);
    }

    .step-label {
        display: none;
    }

    .progress-line {
        max-width: 32px;
        margin-bottom: 0;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .preview-info {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-item {
        border-right: 1px solid var(--rule);
        border-bottom: 1px solid var(--rule);
    }

    .info-item:nth-child(even) {
        border-right: none;
    }

    .info-item:nth-last-child(-n+2) {
        border-bottom: none;
    }

    .addon-card {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .summary-grid {
        grid-template-columns: 1fr;
        padding: var(--space-5);
    }

    .stage-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .floating-cost-badge {
        right: var(--space-3);
        left: var(--space-3);
        bottom: var(--space-3);
        max-width: none;
    }

    .step-actions {
        flex-direction: column-reverse;
    }

    .step-actions .btn-large {
        width: 100%;
    }
}

/* ============================================================
   Actual Size Preview Modal
   ============================================================ */

.actual-size-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 20, 25, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    overflow: auto;
    padding: var(--space-5);
}

.actual-size-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.actual-size-modal-content {
    background: var(--paper);
    border-radius: var(--r-lg);
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.actual-size-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: var(--space-5);
    border-bottom: 1px solid var(--rule);
}

.actual-size-header h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 var(--space-1) 0;
}

.actual-size-desc {
    font-size: 0.875rem;
    color: var(--ink-mute);
    margin: 0;
}

.actual-size-body {
    padding: var(--space-5);
    overflow: auto;
    flex: 1;
}

.actual-size-info {
    display: flex;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    background: var(--paper-soft);
    border-radius: var(--r-md);
    border: 1px solid var(--rule);
}

.actual-size-stat {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.actual-size-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ink-mute);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.actual-size-value {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--ink);
    font-weight: 500;
}

.actual-size-canvas-container {
    background: var(--paper-soft);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    padding: var(--space-4);
    overflow: auto;
    max-height: 60vh;
}

.actual-size-canvas-container canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

@media (max-width: 768px) {
    .actual-size-modal {
        padding: var(--space-3);
    }

    .actual-size-info {
        flex-direction: column;
        gap: var(--space-3);
    }
}
