#controls {
            width: 100%;
        }

        .accordion-controls {
            display: grid;
            gap: 10px;
            margin-bottom: 12px;
        }

        .suggested-presets {
            margin-bottom: 12px;
            padding: 10px;
            border: 1px solid rgba(111, 78, 55, 0.16);
            border-radius: 12px;
            background: linear-gradient(150deg, #fffdf8 0%, #fbf5eb 100%);
        }

        .suggested-presets-title {
            margin: 0 0 8px;
            font-size: 0.82rem;
            font-weight: 600;
            letter-spacing: 0.03em;
            text-transform: uppercase;
            color: #6b5f50;
        }

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

        .suggested-preset-button {
            margin: 0;
            min-height: 36px;
            padding: 7px 10px;
            border-radius: 999px;
            border: 1px solid rgba(111, 78, 55, 0.2);
            background: rgba(255, 255, 255, 0.82);
            color: #4d4133;
            font-size: 0.78rem;
            font-weight: 600;
            letter-spacing: 0.01em;
            transition: transform 0.16s var(--motion-soft), border-color 0.16s var(--motion-soft), box-shadow 0.16s var(--motion-soft), background-color 0.16s var(--motion-soft);
        }

        .suggested-preset-button:hover {
            border-color: #c3ae90;
            background: #fff;
            box-shadow: 0 5px 12px rgba(40, 28, 18, 0.08);
            transform: translateY(-1px);
        }

        .suggested-preset-button:active {
            transform: translateY(0);
            box-shadow: 0 2px 8px rgba(40, 28, 18, 0.08);
        }

        .control-group {
            border: 1px solid var(--line);
            border-radius: 14px;
            margin: 0;
            background: #fffdfa;
            overflow: hidden;
            transition: border-color 0.2s var(--motion-soft), background-color 0.2s var(--motion-soft);
        }

        body.guide-lock .control-group {
            pointer-events: none;
            opacity: 0.4;
        }

        body.guide-lock .control-group.guide-active-group {
            pointer-events: auto;
            opacity: 1;
        }

        .control-group.guide-active-group {
            position: relative;
            z-index: 72;
            border-color: #d8c6ad;
            box-shadow: 0 10px 20px rgba(36, 27, 18, 0.14);
        }

        .control-group.is-open {
            border-color: #d3c2aa;
            background: #fffefc;
        }

        .control-group-header {
            margin: 0;
            width: 100%;
            min-height: 56px;
            padding: 11px 12px;
            border: none;
            border-radius: 14px;
            background: transparent;
            color: var(--text-main);
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto auto;
            align-items: center;
            gap: 8px;
            text-align: left;
            cursor: pointer;
            margin-bottom: 0;
            transition: background-color 0.2s var(--motion-soft), color 0.2s var(--motion-soft);
        }

        .control-group-header:hover {
            background: #faf4ea;
        }

        .control-group.is-open .control-group-header {
            border-bottom-left-radius: 0;
            border-bottom-right-radius: 0;
        }

        .control-group-title {
            font-size: 0.92rem;
            font-weight: 600;
            letter-spacing: 0.02em;
        }

        .control-group-value {
            font-size: 0.86rem;
            color: #5e5345;
            font-weight: 500;
            max-width: 120px;
            text-align: right;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .control-group-chevron {
            color: #7f7464;
            font-size: 0.9rem;
            line-height: 1;
            transition: transform 0.18s ease;
        }

        .control-group.is-open .control-group-chevron {
            transform: rotate(180deg);
        }

        .control-group-panel {
            max-height: 0;
            opacity: 0;
            overflow: hidden;
            padding: 0 12px;
            border-top: 0 solid rgba(47, 43, 36, 0.1);
            transition:
                max-height 280ms var(--motion-soft),
                opacity 180ms ease,
                padding-top 280ms var(--motion-soft),
                padding-bottom 280ms var(--motion-soft),
                border-top-width 180ms ease;
        }

        .control-group.is-open .control-group-panel {
            max-height: 520px;
            opacity: 1;
            padding-top: 10px;
            padding-bottom: 12px;
            border-top-width: 1px;
        }

        .control-select-source {
            display: none;
        }

        .inline-swatch-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
            gap: 10px 8px;
        }

        .inline-swatch-grid.is-chip-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
        }

        .inline-chip-button {
            margin: 0;
            min-height: 40px;
            padding: 8px 10px;
            border: 1px solid #dccfbc;
            border-radius: 999px;
            background: #fffdf9;
            color: #4a4035;
            font-weight: 500;
            font-size: 0.86rem !important;
            transition: border-color 0.18s var(--motion-soft), background-color 0.18s var(--motion-soft), box-shadow 0.18s var(--motion-soft), transform 0.14s var(--motion-soft);
        }

        .inline-chip-button:hover {
            border-color: #cbb99f;
            background: #f9f2e8;
        }

        .inline-chip-button.is-selected {
            border-color: #6f4e37;
            background: #efe4d8;
            color: #3b2f25;
            box-shadow: inset 0 0 0 1px rgba(111, 78, 55, 0.12);
        }

        .inline-chip-button.guide-target {
            border-color: rgba(255, 255, 255, 0.95);
            color: #2f251b;
            box-shadow:
                0 0 0 3px rgba(255, 255, 255, 0.86),
                0 0 0 11px rgba(255, 255, 255, 0.2),
                0 10px 22px rgba(12, 10, 8, 0.32);
            animation: guide-calfskin-pulse 1.35s var(--motion-soft) infinite;
        }

        @keyframes guide-calfskin-pulse {
            0%,
            100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.06);
            }
        }

        .inline-chip-button:active {
            transform: scale(0.985);
        }

        .inline-swatch-button {
            margin: 0;
            border: 1px solid transparent;
            border-radius: 12px;
            background: transparent;
            color: var(--text-main);
            min-height: 72px;
            padding: 6px 4px;
            display: inline-flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 7px;
            transition: border-color 0.2s var(--motion-soft), background-color 0.2s var(--motion-soft), box-shadow 0.2s var(--motion-soft), transform 0.14s var(--motion-soft);
        }

        .inline-swatch-dot {
            width: 46px;
            height: 46px;
            border-radius: 999px;
            border: 2px solid rgba(47, 43, 36, 0.14);
            box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.62);
            transition: border-color 0.2s var(--motion-soft), box-shadow 0.2s var(--motion-soft), transform 0.2s var(--motion-soft);
        }

        .inline-swatch-text {
            font-size: 0.72rem;
            line-height: 1.2;
            color: #655a4b;
            text-align: center;
            word-break: break-word;
        }

        .inline-swatch-button:hover {
            border-color: rgba(111, 78, 55, 0.24);
            background: rgba(250, 245, 236, 0.75);
        }

        .inline-swatch-button:active {
            transform: scale(0.96);
        }

        .inline-swatch-button.is-selected {
            border-color: rgba(111, 78, 55, 0.42);
            background: rgba(243, 233, 220, 0.7);
        }

        .inline-swatch-button.is-selected .inline-swatch-dot {
            border-color: #6f4e37;
            box-shadow:
                0 0 0 3px rgba(111, 78, 55, 0.2),
                inset 0 1px 1px rgba(255, 255, 255, 0.75);
            transform: scale(1.02);
        }

        select, button, input, textarea {
            width: 100%;
            padding: 10px 12px;
            margin-bottom: 12px;
            font-size: 16px !important;
            font-family: inherit;
            border-radius: 10px;
            border: 1px solid #d3c7b7;
            background: #fff;
            color: var(--text-main);
        }
        @supports (-webkit-touch-callout: none) {
            input,
            select,
            textarea,
            button {
                font-size: 16px !important;
            }
        }

        select:focus,
        button:focus,
        .fancybox-trigger:focus {
            outline: 2px solid #d8c6af;
            outline-offset: 1px;
        }

        button {
            border: none;
            background: var(--accent);
            color: #fff;
            font-weight: 600;
            margin-bottom: 8px;
            cursor: pointer;
            transition: background-color 0.2s var(--motion-soft), box-shadow 0.2s var(--motion-soft), border-color 0.2s var(--motion-soft), color 0.2s var(--motion-soft), transform 0.14s var(--motion-soft);
        }

        button:hover {
            background: var(--accent-hover);
        }

        button:active {
            transform: translateY(1px) scale(0.995);
        }

        #randomize-button {
            height: 48px;
            border-radius: 12px;
            font-weight: 600;
            background: linear-gradient(180deg, #745039 0%, #654632 100%);
            box-shadow: 0 7px 16px rgba(62, 42, 29, 0.2);
        }

        #randomize-button:hover {
            background: linear-gradient(180deg, #6a4a36 0%, #5c402f 100%);
            box-shadow: 0 9px 18px rgba(62, 42, 29, 0.22);
        }

        #randomize-button:active {
            box-shadow: 0 5px 10px rgba(62, 42, 29, 0.18);
        }

        .zoom-row > #randomize-button {
            flex: 1.08 1 0;
        }

        .zoom-row > #zoom-button {
            flex: 0.92 1 0;
        }

        .helper-note {
            margin: 0 0 14px;
            color: var(--text-soft);
            font-size: 0.92rem;
            line-height: 1.5;
        }

        .summary-card {
            border: 1px solid var(--line);
            border-radius: 14px;
            background: linear-gradient(165deg, #fffdf8 0%, #fcf6ec 100%);
            padding: 15px;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
        }

        .summary-card h2 {
            margin: 0 0 12px;
            font-size: 1rem;
            letter-spacing: 0.01em;
        }

        .summary-list {
            list-style: none;
            margin: 0;
            padding: 0;
            display: grid;
            gap: 8px;
        }

        .summary-list li {
            display: flex;
            justify-content: space-between;
            gap: 10px;
            font-size: 0.94rem;
            min-width: 0;
            padding-bottom: 6px;
            border-bottom: 1px dashed rgba(47, 43, 36, 0.12);
        }

        .summary-list li:last-child {
            padding-bottom: 0;
            border-bottom: none;
        }

        .summary-list span {
            color: var(--text-soft);
            font-size: 0.8rem;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        .summary-list strong {
            font-weight: 600;
            text-align: right;
            overflow-wrap: anywhere;
            color: #392f24;
        }

        .handoff-actions {
            margin-top: 14px;
            border-top: 1px solid rgba(47, 43, 36, 0.14);
            padding-top: 13px;
        }

        .handoff-action-grid {
            display: grid;
            gap: 9px;
        }

        .handoff-action-button {
            margin: 0;
            border: 1px solid #d3c7b7;
            background: #fffdfa;
            color: var(--text-main);
            font-weight: 500;
            border-radius: 11px;
            min-height: 42px;
            transition: border-color 0.18s var(--motion-soft), background-color 0.18s var(--motion-soft), box-shadow 0.18s var(--motion-soft), transform 0.14s var(--motion-soft);
        }

        .handoff-action-button:hover {
            border-color: #c9b79e;
            background: #f8f1e6;
            box-shadow: 0 6px 14px rgba(40, 28, 18, 0.08);
        }

        .handoff-action-button:active {
            box-shadow: 0 3px 8px rgba(40, 28, 18, 0.08);
        }

        .handoff-feedback {
            margin: 8px 2px 0;
            color: #7a705f;
            font-size: 0.8rem;
            line-height: 1.35;
        }

        .handoff-feedback.is-error {
            color: #9c2f2f;
        }


        .palette-backdrop {
            position: fixed;
            inset: 0;
            display: flex;
            align-items: flex-end;
            justify-content: center;
            padding: 16px;
            background: rgba(34, 26, 18, 0.18);
            backdrop-filter: blur(2px);
            z-index: 80;
        }

        .palette-backdrop.is-guide-focus {
            background: rgba(12, 10, 8, 0.72);
            backdrop-filter: blur(4px);
        }

        .palette-backdrop.is-hidden {
            display: none;
        }

        .color-palette {
            width: min(440px, 100%);
            background: var(--paper-strong);
            border: 1px solid var(--line-soft);
            border-radius: 18px;
            box-shadow: var(--shadow-float);
            padding: 14px 14px 12px;
        }

        .color-palette.is-guide-focus {
            border-color: rgba(255, 255, 255, 0.36);
            box-shadow:
                0 24px 52px rgba(0, 0, 0, 0.36),
                0 0 0 1px rgba(255, 255, 255, 0.1);
        }

        .color-palette-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 12px;
        }

        .color-palette-head strong {
            font-size: 1rem;
            font-weight: 600;
            letter-spacing: 0.01em;
        }

        .palette-close-button {
            width: auto;
            margin: 0;
            padding: 6px 12px;
            border: 1px solid #d8ccbb;
            border-radius: 999px;
            background: #fffcf7;
            color: #594a39;
            font-size: 0.86rem;
            font-weight: 500;
            cursor: pointer;
            transition: border-color 0.18s var(--motion-soft), background-color 0.18s var(--motion-soft), box-shadow 0.18s var(--motion-soft), transform 0.14s var(--motion-soft);
        }

        .palette-close-button:hover {
            border-color: #cbb99f;
            background: #f8f1e6;
            box-shadow: 0 4px 10px rgba(40, 28, 18, 0.08);
        }

        .palette-close-button:active {
            transform: scale(0.99);
        }

        .palette-guide-note {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin: 0 0 10px;
            padding: 8px 10px;
            border-radius: 10px;
            border: 1px solid rgba(111, 78, 55, 0.22);
            background: #fcf6ec;
            color: #544736;
            font-size: 0.82rem;
            line-height: 1.35;
        }

        .palette-guide-note.is-hidden {
            display: none;
        }

        .palette-guide-skip {
            width: auto;
            margin: 0;
            min-height: 30px;
            padding: 4px 10px;
            border-radius: 999px;
            border: 1px solid #d8ccbb;
            background: #fffcf7;
            color: #594a39;
            font-size: 0.76rem !important;
            font-weight: 500;
        }

        .palette-options {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
            gap: 12px 10px;
        }

        .palette-options.is-guide-focus {
            position: relative;
        }

        .palette-options.is-guide-focus .palette-option {
            opacity: 0.18;
            transition: opacity 0.2s var(--motion-soft);
            pointer-events: none;
        }

        .palette-options.is-guide-focus .palette-option.is-guide-target-option {
            opacity: 1;
            pointer-events: auto;
        }

        .palette-swatch {
            width: 56px;
            height: 56px;
            border-radius: 999px;
            border: 2px solid rgba(47, 43, 36, 0.16);
            margin: 0 auto;
            padding: 0;
            background: #f0ece5;
            cursor: pointer;
            display: block;
            box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6);
            transition: border-color 0.18s var(--motion-soft), box-shadow 0.18s var(--motion-soft), transform 0.14s var(--motion-soft);
        }

        .palette-swatch:hover,
        .palette-swatch:focus-visible {
            border-color: rgba(111, 78, 55, 0.56);
            box-shadow:
                0 0 0 2px rgba(111, 78, 55, 0.12),
                inset 0 1px 1px rgba(255, 255, 255, 0.7);
            outline: none;
        }

        .palette-swatch.is-selected {
            border-color: #6f4e37;
            box-shadow:
                0 0 0 3px rgba(111, 78, 55, 0.22),
                inset 0 1px 1px rgba(255, 255, 255, 0.72);
        }

        .palette-swatch.is-guide-target {
            border-color: rgba(255, 255, 255, 0.96);
            box-shadow:
                0 0 0 4px rgba(255, 255, 255, 0.86),
                0 0 0 14px rgba(255, 255, 255, 0.18),
                0 14px 28px rgba(0, 0, 0, 0.34),
                inset 0 1px 1px rgba(255, 255, 255, 0.8);
            animation: palette-swatch-guide-pulse 1.35s var(--motion-soft) infinite;
        }

        @keyframes palette-swatch-guide-pulse {
            0%,
            100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.12);
            }
        }

        .palette-swatch:active {
            transform: scale(0.97);
        }

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

        .palette-option {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 7px;
            min-width: 0;
        }

        .palette-option-label {
            font-size: 0.76rem;
            line-height: 1.2;
            color: var(--text-soft);
            text-align: center;
            word-break: break-word;
            letter-spacing: 0.01em;
        }

        @media (max-width: 900px) {
            .workspace {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .page-shell {
                padding: 8px 8px 16px;
            }

            .preview-card,
            .controls-card {
                border-radius: 12px;
                padding: 12px 10px;
            }

            .hero-subtitle {
                font-size: 0.88rem;
                margin: 6px 0 0;
                line-height: 1.4;
                white-space: normal;
                overflow-wrap: anywhere;
            }

            .workspace {
                gap: 8px;
            }

            .preview-head p {
                margin: 4px 0 8px;
                font-size: 0.84rem;
                line-height: 1.4;
            }

            .preview-head h2,
            .controls-card h2 {
                font-size: 1.1rem;
            }

            #product-container {
                border-radius: 10px;
                margin-bottom: 8px;
            }

            .product-layer {
                transition: opacity 600ms var(--motion-soft);
            }

            .product-layer.is-source-transitioning {
                opacity: 0.82;
                filter: none;
            }

            .zoom-row {
                flex-direction: column;
                justify-content: center;
                align-items: stretch;
                gap: 8px;
                margin-top: 4px;
            }

            .fancybox-trigger {
                width: 100%;
                min-height: 42px;
            }

            .zoom-row > button,
            .zoom-row > .fancybox-trigger {
                width: 100%;
            }

            select,
            button,
            input,
            textarea {
                font-size: 16px !important;
                padding: 9px 10px;
                margin-bottom: 8px;
            }

            .accordion-controls {
                gap: 8px;
                margin-bottom: 10px;
            }

            .suggested-presets {
                margin-bottom: 10px;
                padding: 8px;
                border-radius: 10px;
            }

            .suggested-presets-grid {
                grid-template-columns: 1fr;
                gap: 6px;
            }

            .suggested-preset-button {
                min-height: 38px;
            }

            .control-group {
                border-radius: 12px;
            }

            .control-group-header {
                min-height: 50px;
                padding: 9px 10px;
                border-radius: 12px;
            }

            .control-group-title {
                font-size: 0.88rem;
            }

            .control-group-value {
                max-width: 108px;
                font-size: 0.8rem;
            }

            .control-group-panel {
                padding: 0 10px;
            }

            .inline-swatch-grid {
                grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
                gap: 8px 6px;
            }

            .inline-swatch-grid.is-chip-grid {
                grid-template-columns: 1fr;
                gap: 6px;
            }

            .inline-chip-button {
                min-height: 38px;
                font-size: 0.84rem !important;
            }

            .inline-swatch-button {
                min-height: 68px;
                gap: 6px;
            }

            .inline-swatch-dot {
                width: 42px;
                height: 42px;
            }

            .inline-swatch-text {
                font-size: 0.68rem;
            }

            .helper-note {
                margin-bottom: 8px;
                font-size: 0.84rem;
                line-height: 1.4;
            }

            .summary-card {
                margin-top: 4px;
                padding: 10px;
                border-radius: 10px;
            }

            .summary-list span {
                font-size: 0.75rem;
            }

            .summary-card h2 {
                margin-bottom: 8px;
                font-size: 0.9rem;
            }

            .summary-list li {
                font-size: 0.84rem;
                gap: 8px;
            }

            .first-time-guide {
                bottom: 10px;
                width: calc(100% - 16px);
            }

            .guide-preview-target {
                width: 110px;
                height: 110px;
                top: 53%;
            }

            .guide-preview-target-dot {
                width: 22px;
                height: 22px;
            }

            .first-time-guide-card {
                border-radius: 12px;
                padding: 10px 11px;
            }

            .first-time-guide-message {
                margin: 5px 0 9px;
                font-size: 0.82rem;
            }

            .first-time-guide-actions {
                gap: 6px;
            }

            .palette-guide-note {
                margin-bottom: 8px;
                padding: 7px 8px;
                font-size: 0.78rem;
                flex-wrap: wrap;
            }

            .palette-backdrop {
                padding: 10px;
                background: rgba(34, 26, 18, 0.16);
            }

            .color-palette {
                border-radius: 12px;
                padding: 10px;
            }

            .preview-loading-state.is-runtime {
                padding: 10px;
            }

            .preview-loading-indicator {
                padding: 6px 10px;
            }

            .palette-options {
                grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
                gap: 8px;
            }

            .palette-swatch {
                width: 56px;
                height: 56px;
            }

            .palette-option-label {
                font-size: 0.72rem;
            }
        }
