/* Mobile prototype: the existing editor controls are reused, not duplicated. */
.designer-product-options, .designer-artwork-options { display: contents; }
.designer-artwork-options > .designer-step:first-child { margin-top: 28px; }
.cloth-footer { display: none; }
.mobile-editor-header, .mobile-editor-dock, .mobile-editor-sheet, .mobile-editor-tools,
.mobile-editor-return, .mobile-editor-history, .mobile-editor-view-tools, .mobile-editor-reflection, .mobile-editor-product { display: none; }

@media (max-width: 760px) {
    body.constructor-editing { overflow: hidden; }
    body.constructor-editing .header,
    body.constructor-editing footer,
    body.constructor-editing .mobile-contacts { display: none; }
    #designer.mobile-editor {
        --editor-height: 100dvh;
        --sheet-height: min(390px, calc(var(--editor-height) * .43));
        position: fixed; z-index: 100; inset: 0 0 auto; height: var(--editor-height);
        padding: 0; display: flex; flex-direction: column; overflow: hidden;
        background: var(--bg); isolation: isolate;
    }
    .mobile-editor .designer-intro {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip-path: inset(50%); white-space: nowrap;
    }
    .mobile-editor-header {
        display: flex; align-items: center; justify-content: space-between; gap: 6px;
        flex: 0 0 auto; padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px;
        border-bottom: 1px solid var(--line); color: var(--paper);
    }
    .mobile-editor-header > a { display: flex; align-items: center; gap: 7px; min-height: 44px; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
    .mobile-editor-header strong { font-size: 15px; letter-spacing: -.5px; white-space: nowrap; }
    .mobile-editor-header .mobile-editor-done {
        min-height: 44px; padding: 10px 15px; background: var(--lime); color: var(--bg);
        border: 0; font-size: 14px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
    }
    .mobile-editor-header #cloth-toggle { flex: 1; min-width: 0; max-width: 200px; min-height: 44px; padding: 10px; border: 1px solid #55594c; background: none; color: var(--paper); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-editor-header #cloth-toggle[aria-pressed=true] { color: var(--lime); border-color: var(--lime); }
    .mobile-editor-header svg, .mobile-editor-nav svg { width: 23px; height: 23px; flex-shrink: 0; }
    .mobile-editor .designer-app {
        display: flex; flex: 1 1 auto; min-height: 0; border: 0; margin: 0;
    }
    .mobile-editor[data-mobile-panel] .designer-app { margin-bottom: var(--sheet-offset, var(--sheet-height)); }
    .mobile-editor .designer-library,
    .mobile-editor .designer-properties,
    .mobile-editor .designer-toolbar,
    .mobile-editor .cloth-tools,
    .mobile-editor .designer-touch-tools,
    .mobile-editor .designer-brush-options,
    .mobile-editor .designer-desktop-hint,
    .mobile-editor .designer-scale-note,
    .mobile-editor .designer-disclaimer { display: none; }
    #designer.mobile-editor .designer-touch-tools { display: none; }
    #designer.mobile-editor .designer-workspace > .designer-brush-options { display: none !important; }
    .mobile-editor .designer-workspace { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; position: relative; }
    .mobile-editor-product { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; min-height: 44px; margin: 10px 12px 0; padding: 10px 14px; border: 1px solid #bac0ad; border-radius: 6px; background: #eeeee7; color: #22241f; font-size: 14px; text-align: left; }
    .mobile-editor-product > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-editor-product[aria-expanded=true] { border-color: #536347; background: #d2f660; }
    .mobile-editor .designer-stage-bar { padding: 8px 12px; gap: 10px; flex-shrink: 0; }
    .mobile-editor .designer-sides { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .mobile-editor .designer-sides button { min-height: 44px; flex-shrink: 0; padding: 10px 15px; font-size: 14px; }
    .mobile-editor .designer-guides { font-size: 11px; flex-shrink: 0; min-height: 44px; }
    .mobile-editor .designer-canvas-wrap {
        flex: 1 1 auto; min-height: 0; padding: 0; display: grid; place-items: center;
        container-type: size; background: #e8e7df;
    }
    .mobile-editor .designer-viewport {
        width: 100%; height: 100%; aspect-ratio: auto; background: #e8e7df;
    }
    .mobile-editor .designer-canvas-surface { width: var(--canvas-base-width, 100%); height: var(--canvas-base-height, 100%); }
    .mobile-editor .designer-stage-footer { padding: 8px 12px; font-size: 10px; flex-shrink: 0; border-top: 0; }
    .mobile-editor .designer-stage-footer > span:nth-of-type(2) { display: none; }
    .mobile-editor-history { display: flex; gap: 6px; margin-left: auto; }
    .mobile-editor-history button {
        width: 44px; height: 44px; border: 1px solid #bac0ad; border-radius: 50%;
        background: #eeeee7; color: #22241f; font-size: 21px;
    }
    .mobile-editor-history button:disabled { opacity: .35; }
    .mobile-editor .designer-stage-footer { align-items: center; flex-wrap: wrap; gap: 5px; }
    .mobile-editor .designer-stage-footer > span:first-child { display: none; }
    .mobile-editor-view-tools { display: flex; align-items: center; gap: 5px; }
    .mobile-editor-view-tools button { width: 44px; height: 44px; padding: 0; border: 1px solid #bac0ad; border-radius: 50%; background: #eeeee7; color: #22241f; font-size: 21px; }
    .mobile-editor-view-tools output { min-width: 38px; font-size: 11px; text-align: center; }
    .mobile-editor-view-tools button:disabled { opacity: .35; }
    .mobile-editor-dock { display: block; flex: 0 0 auto; background: var(--bg); border-top: 1px solid var(--line); }
    .mobile-editor .designer-status {
        position: static; z-index: auto; box-shadow: none;
        display: block; padding: 9px 14px 0; margin: 0; border: 0; background: transparent;
        color: var(--muted); font-size: 11px; line-height: 1.4;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .mobile-editor .designer-status[data-state=error] { color: #ffc6c6; white-space: normal; }
    .mobile-editor-nav { display: flex; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #697451 transparent; overscroll-behavior-x: contain; touch-action: pan-x; padding: 5px 8px calc(6px + env(safe-area-inset-bottom, 0px)); gap: 4px; }
    .mobile-editor-nav button {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
        flex: 0 0 76px; min-height: 60px; padding: 7px 2px; border: 1px solid transparent; border-radius: 8px;
        background: none; color: var(--paper); font-size: 11px; line-height: 1.2;
    }
    .mobile-editor-nav button[aria-expanded=true], .mobile-editor-nav button[aria-pressed=true] { background: #d2f660; color: #22241f; }
    .mobile-editor-nav button:disabled { opacity: .4; }
    .mobile-editor-nav button[hidden] { display: none; }
    .mobile-editor-sheet {
        position: absolute; z-index: 4; left: 0; right: 0; bottom: var(--dock-height, 96px);
        height: var(--sheet-height); min-height: 0; display: flex; flex-direction: column;
        background: var(--bg); color: var(--paper); border: 1px solid #53594a;
        border-radius: 18px 18px 0 0; box-shadow: 0 -8px 25px #0002; overflow: hidden;
    }
    .mobile-editor-sheet[hidden] { display: none; }
    .mobile-editor-sheet:is([data-panel=brush], [data-panel=reflect], [data-panel=tools]) { height: auto; max-height: var(--sheet-height); }
    .mobile-editor-sheet-body > .mobile-editor-reflection { display: block; }
    .mobile-editor-reflection .designer-tool-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .mobile-editor-reflection button { min-height: 56px; padding: 12px; border: 1px solid #697451; border-radius: 6px; color: var(--paper); background: #2c2f29; font-size: 14px; }
    .mobile-editor-sheet-header::before { content: ''; position: absolute; top: 7px; left: calc(50% - 16px); width: 32px; height: 3px; background: #747969; border-radius: 5px; }
    .mobile-editor-sheet-header { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 2px; flex-shrink: 0; border-bottom: 1px solid var(--line); touch-action: none; }
    .mobile-editor-sheet-header h2 { font-size: 18px; letter-spacing: -.4px; text-transform: none; }
    .mobile-editor-sheet-header button { min-width: 44px; min-height: 44px; border: 0; background: none; color: var(--muted); font-size: 13px; }
    .mobile-editor-sheet-body { min-height: 0; overflow-y: auto; padding: 16px; overscroll-behavior: contain; scrollbar-width: thin; }
    .mobile-editor-sheet-body > .designer-product-options,
    .mobile-editor-sheet-body > .designer-artwork-options,
    .mobile-editor-sheet-body > .designer-properties,
    .mobile-editor-sheet-body > .designer-save,
    .mobile-editor-sheet-body > .mobile-editor-tools { display: block; padding: 0; border: 0; margin: 0; }
    .mobile-editor-sheet .designer-step { display: none; }
    .mobile-editor-sheet .designer-label { font: 12px/1.5 Arial, sans-serif; letter-spacing: 0; margin: 16px 0 8px; }
    .mobile-editor-sheet .designer-label:first-child { margin-top: 0; }
    .mobile-editor-sheet .designer-hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
    .mobile-editor-sheet .designer-garments { max-height: none; overflow: visible; gap: 8px; }
    .mobile-editor-sheet .designer-garments button { min-height: 76px; padding: 12px; border-radius: 8px; }
    .mobile-editor-sheet .designer-garments small { font-size: 11px; }
    .mobile-editor-sheet .designer-panel input:not([type=file]):not([type=range]),
    .mobile-editor-sheet.designer-panel input:not([type=file]):not([type=range]),
    .mobile-editor-sheet input:not([type=file]):not([type=range]),
    .mobile-editor-sheet textarea, .mobile-editor-sheet select { font-size: 16px; min-height: 44px; border-radius: 6px; }
    .mobile-editor-sheet .designer-color-palette { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
    .mobile-editor-sheet .designer-color-palette button { min-height: 44px; border-radius: 6px; }
    .mobile-editor-sheet .designer-color-palette svg { height: 40px; }
    .mobile-editor-sheet .designer-small-actions button,
    .mobile-editor-sheet .designer-layer-order button { min-height: 44px; font-size: 13px; }
    .mobile-editor-details { border-top: 1px solid var(--line); margin-top: 14px; }
    .mobile-editor-details summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-size: 13px; cursor: pointer; list-style: none; }
    .mobile-editor-details summary::after { content: '+'; color: var(--lime); font-size: 20px; }
    .mobile-editor-details[open] summary::after { content: '−'; }
    .mobile-editor-sheet fieldset > legend, .mobile-editor-sheet #text-edit-hint { display: none; }
    .mobile-editor-sheet .design-layers button { min-height: 44px; }
    .mobile-editor-sheet .designer-save { display: none; }
    .mobile-editor-sheet[data-panel=save] .designer-save { display: block; }
    .mobile-editor-sheet .designer-save > .button { margin-top: 0; }
    .mobile-editor-sheet .print-catalog .designer-presets { max-height: none; overflow: visible; }
    .mobile-editor-sheet .print-expand { display: none; }
    .mobile-editor .designer-artwork-options #add-text { display: none; }
    .mobile-editor-sheet .designer-presets button { border-radius: 8px; }
    .mobile-editor-sheet .designer-presets span { font-size: 12px; }
    .mobile-editor-sheet .designer-toolbar { display: flex !important; padding: 0; border: 0; color: var(--paper); }
    .mobile-editor-sheet .designer-toolbar button { min-height: 44px; color: var(--paper); border-color: #55594c; }
    .mobile-editor-sheet .designer-toolbar button[aria-pressed=true] { color: #22241f; background: var(--lime); }
    .mobile-editor-sheet .designer-tools-heading { display: none; }
    .mobile-editor-sheet .designer-zoom-tools { margin-left: 0; }
    .mobile-editor-sheet .cloth-tools { display: flex; padding: 0 0 14px; margin-bottom: 14px; border-color: var(--line); }
    .mobile-editor-sheet[data-panel=tools] .cloth-tools { padding: 0; margin: 0; border: 0; }
    .mobile-editor-sheet .cloth-tools button { color: var(--paper); border-color: #55594c; min-height: 44px; }
    .mobile-editor-sheet .cloth-tools button[aria-pressed=true] { color: var(--lime); background: #33392a; }
    .mobile-editor-sheet .cloth-tools p { color: var(--muted); }
    .mobile-editor-sheet .designer-brush-options { color: var(--paper); padding: 14px 0; border: 0; }
    .mobile-editor-sheet .designer-brush-options input[type=color] { width: 48px; height: 44px; min-height: 44px; padding: 4px; }
    .mobile-editor-sheet .designer-brush-options input[type=range] { accent-color: var(--lime); }
    .mobile-editor-sheet .designer-brush-options button { min-height: 44px; border-color: #55594c; border-radius: 6px; }
    .mobile-editor[data-canvas-tool=brush] .mobile-editor-sheet .designer-brush-options { display: flex; }
    .mobile-editor-sheet .designer-brush-options p { color: var(--muted); }
    .mobile-editor-return { display: block; margin: 0 5% 20px; padding: 15px; border: 1px solid var(--lime); color: var(--lime); background: none; font-size: 16px; }
    body.constructor-editing .mobile-editor-return { display: none; }
    .mobile-editor :is(button, a, input, select, textarea):focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
    .mobile-editor .designer-workspace button:focus-visible { outline-color: #536347; }
    .mobile-editor.mobile-editor-keyboard { --sheet-height: calc(var(--editor-height) * .5); }
    .mobile-editor-keyboard .mobile-editor-header,
    .mobile-editor-keyboard .mobile-editor-product,
    .mobile-editor-keyboard .mobile-editor-nav,
    .mobile-editor-keyboard .designer-stage-footer { display: none; }
    .mobile-editor-keyboard .designer-stage-bar { padding-block: 2px; }
    .mobile-editor-keyboard .designer-sides button { min-height: 36px; padding-block: 6px; }
    .mobile-editor-keyboard .designer-guides { min-height: 36px; }
    @media (max-width: 360px) {
        .mobile-editor-header > a { min-width: 32px; }
        .mobile-editor-header > a span { display: none; }
    }
    @media (prefers-reduced-motion: reduce) { .mobile-editor .designer-app { transition: none; } }
}
