/*
 * Editor shell owns viewport geometry. Tool-specific styles remain in the
 * editor view; header and quick-toolbar visuals live in their own stylesheets.
 * Keep the 768px mobile / 1200px docked-panel breakpoints in sync.
 */

:root {
    --toolbar-h: 72px;
    --editor-footer-size: 76px;
    --editor-shell-gap: 12px;
    --editor-rail-size: 68px;
    --editor-drawer-size: clamp(500px, 23vw, 560px);
    --editor-ink: #172033;
    --editor-muted: #738097;
    --editor-line: #dfe6f0;
    --editor-blue: #0051bb;
    --editor-blue-soft: #eef3ff;
}

body.editor-page {
    background: #edf1f7;
    color: var(--editor-ink);
}

.editor-page #canvasArea {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.editor-page #canvasWrap {
    overscroll-behavior: contain;
}

.editor-page #canvasArea>#productDisplayModeToggle {
    position: absolute !important;
    top: 50% !important;
    left: 14px !important;
    z-index: 130;
    grid-template-columns: 1fr;
    margin: 0 !important;
    transform: translateY(-50%) !important;
}


/* Shrink-to-fit swatches; no fixed column count in a resizable drawer. */

.editor-page #canvasArea>#product3DInteractionToggle {
    display: none !important;
    position: absolute !important;
    inset: 12px 14px auto auto !important;
    width: auto !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 3px !important;
    z-index: 130;
}

.editor-page #canvasArea.is-3d-mode>#product3DInteractionToggle {
    display: flex !important;
}

.editor-page #product3DInteractionToggle>button {
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 12px !important;
    white-space: nowrap;
}

.editor-page #canvasArea.is-3d-mode>#objectToolbar {
    position: absolute !important;
    top: 12px !important;
    bottom: auto !important;
    left: calc(50% - 14px) !important;
    right: auto !important;
    width: max-content !important;
    max-width: calc(100% - 360px) !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 3px 6px !important;
    transform: translateX(-50%) !important;
    box-sizing: border-box;
}

.editor-page #canvasArea.is-3d-mode #objectToolbar> :is(#genericObjectTools, #textContextTools) {
    min-width: 0;
    max-width: 100%;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scrollbar-width: none;
}

.editor-page #canvasArea.is-3d-mode #objectToolbar :is(#genericObjectTools, #textContextTools)> :is(button, .floating-color-control, .floating-font-select) {
    flex-shrink: 0;
    height: 34px !important;
    min-height: 34px !important;
}

@media (max-width: 1000px) {
    .editor-page #canvasArea>#product3DInteractionToggle {
        inset: 10px 10px auto auto !important;
        height: 38px !important;
        padding: 2px !important;
    }
    .editor-page #product3DInteractionToggle>button {
        width: 32px !important;
        height: 32px !important;
        min-height: 32px !important;
        padding: 6px !important;
    }
    .editor-page #product3DInteractionToggle>button span {
        display: none;
    }
    .editor-page #canvasArea.is-3d-mode>#objectToolbar {
        top: 10px !important;
        left: 146px !important;
        right: 58px !important;
        width: auto !important;
        max-width: none !important;
        height: 38px !important;
        min-height: 38px !important;
        transform: none !important;
    }
    .editor-page #canvasArea.is-3d-mode #objectToolbar :is(#genericObjectTools, #textContextTools)> :is(button, .floating-color-control, .floating-font-select) {
        height: 30px !important;
        min-height: 30px !important;
    }
}

.editor-page #floatingColorPopover,
.editor-page #floatingColorPopover .floating-color-palette-panel {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.editor-page #floatingColorSwatches {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(28px, 1fr)) !important;
    grid-auto-flow: row !important;
    gap: 7px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 3px !important;
}

.editor-page #floatingColorSwatches>button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 34px !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 1;
    border-radius: 9px !important;
    padding: 0 !important;
}

.editor-page #textGradientGrid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.editor-page #textGradientGrid .text-gradient-card {
    height: 76px;
    padding: 10px;
    border-radius: 12px;
    background: #fff;
    gap: 7px;
}

.editor-page #textGradientGrid .text-gradient-card span::before {
    font-size: 22px;
    filter: none;
    letter-spacing: -.5px;
}

.editor-page #textGradientGrid .text-gradient-card small {
    display: block;
    color: #738097;
    font-size: 10px !important;
}

.editor-page #textGradientGrid .text-gradient-card.active {
    background: #eff4ff;
    border-color: #3b63dc;
    box-shadow: inset 0 0 0 1px #3b63dc;
}

.editor-page #textGradientColorControls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.editor-page #gradientStopColorPopover {
    max-width: calc(100vw - 24px) !important;
}

.editor-page #layersList [data-layer-id] {
    cursor: grab;
}

.editor-page #layersList [data-layer-id].is-dragging {
    opacity: .4;
    cursor: grabbing;
}

.editor-page #layersList .layer-drag-grip {
    flex: 0 0 14px;
    color: #9aa8bd;
    font-size: 17px;
}

.editor-page #layersList .layer-row-meta {
    min-width: 0;
}

.editor-page #layersList .layer-thumb {
    flex-shrink: 0;
}

.editor-page #layersList .drop-before {
    box-shadow: 0 -3px 0 #365ee4 !important;
}

.editor-page #layersList .drop-after {
    box-shadow: 0 3px 0 #365ee4 !important;
}

.editor-page #toast {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + 8px) !important;
    right: auto !important;
    bottom: auto !important;
    left: 50% !important;
    z-index: 10000 !important;
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(420px, calc(100vw - 32px));
    padding: 8px 12px !important;
    border: 1px solid #d8e2f4;
    border-left: 4px solid #315bd3;
    border-radius: 14px !important;
    background: #fff !important;
    color: #25324a !important;
    box-shadow: 0 12px 36px #17255424 !important;
    white-space: normal !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -10px) !important;
    transition: opacity .18s, transform .18s, visibility .18s;
}

.editor-page #toast.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) !important;
}

.editor-page #toast[data-type="error"] {
    border-left-color: #dc4545;
}

.editor-page #toast[data-type="success"] {
    border-left-color: #159365;
}

.editor-page #toast[data-type="warning"] {
    border-left-color: #d28a13;
}

.editor-page #toastIcon {
    flex: 0 0 auto;
    color: #315bd3;
    font-size: 22px;
}

.editor-page #toast[data-type="error"] #toastIcon {
    color: #dc4545;
}

.editor-page #toast[data-type="success"] #toastIcon {
    color: #159365;
}

.editor-page #toastMsg {
    flex: 1;
    font-size: 12px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.editor-page #toast .editor-toast-close {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #f3f6fa;
    color: #68758c;
    cursor: pointer;
}

.editor-page .topbar.editor-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    height: var(--toolbar-h) !important;
    min-height: var(--toolbar-h) !important;
    gap: 16px !important;
    box-shadow: none !important;
}

.editor-header .topbar-left {
    flex: 0 1 auto !important;
    min-width: 0 !important;
}

.editor-header .topbar-right {
    position: relative !important;
    inset: auto !important;
    flex: 0 0 auto !important;
    min-width: max-content !important;
    margin-left: auto !important;
}

.editor-header .topbar-design-actions,
.editor-header .topbar-account-actions {
    flex: 0 0 auto !important;
}

.editor-header .topbar-right :is(.btn-save, .btn-preview, .btn-confirm-order, .nav-icon-btn) {
    position: relative !important;
    inset: auto !important;
    margin: 0 !important;
    transform: none !important;
}

.editor-page .editor-workspace-context {
    display: flex !important;
    position: static !important;
    transform: none !important;
    flex: 1 1 auto;
    border: 0;
    background: transparent;
}

.editor-page .editor-body {
    background: #edf1f7 !important;
    background-image: none !important;
}

.editor-page .editor-body>.canvas-area {
    border: 1px solid var(--editor-line) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: none !important;
    transition: none !important;
}


/* The artwork viewport fills the stage; controls float above it, not in gutters. */

.editor-page .editor-body>.canvas-area>.canvas-wrap {
    position: absolute !important;
    inset: 76px 94px 126px 18px !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: auto !important;
    align-items: center !important;
    justify-content: center !important;
}

.editor-page .editor-body>#canvasArea:not(.is-3d-mode)>#canvasWrap {
    inset: 0 !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    scrollbar-width: none;
}

.editor-page #canvasArea:not(.is-3d-mode)>#canvasWrap::-webkit-scrollbar {
    display: none;
}

.editor-page .canvas-wrap .canvas-container {
    flex-shrink: 0;
    margin: auto !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    filter: none;
}

.editor-page .canvas-wrap::after {
    display: none;
}

.editor-page .canvas-area>.canvas-stage-controls {
    bottom: 12px !important;
    width: min(780px, calc(100% - 24px)) !important;
    max-width: calc(100% - 24px) !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

.editor-page .canvas-stage-controls>.editor-quick-toolbar {
    flex: 0 0 auto;
    height: 54px;
    min-height: 54px;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--editor-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
}
.editor-page .canvas-stage-controls>.editor-quick-toolbar>.editor-history-btn {
    flex: 0 0 36px;
    width: 36px;
    height: 40px;
    border-radius: 8px;
}
.editor-page .canvas-stage-controls .quick-toolbar-divider { height: 24px; margin: 0 4px; }
/* Keep undo and redo available above the 3D help control. */
.editor-page #canvasArea.is-3d-mode>.canvas-stage-controls {
    display: flex !important;
    width: max-content !important;
    bottom: 72px !important;
}
.editor-page #canvasArea.is-3d-mode>.canvas-stage-controls>.zoom-controls { display: none !important; }

.editor-page .canvas-stage-controls>.zoom-controls {
    flex: 1 1 0;
    width: auto !important;
    min-width: 0 !important;
    border: 1px solid var(--editor-line) !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: none !important;
}

.editor-page .canvas-view-switcher {
    border: 1px solid var(--editor-line) !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 4px 16px #263b650a !important;
}

.editor-page .canvas-view-switcher .view-side-btn.active {
    color: var(--editor-blue) !important;
    background: var(--editor-blue-soft) !important;
    border-color: #adc0ef !important;
    box-shadow: none !important;
}


/* Product sides have their own dimensions, independent of global CTA buttons. */

.editor-page #canvasArea>#productViewSwitcher {
    position: absolute !important;
    top: 50% !important;
    right: 12px !important;
    bottom: auto !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    z-index: 85;
    display: flex !important;
    flex-direction: column !important;
    width: 88px !important;
    min-width: 0 !important;
    max-width: 88px !important;
    max-height: max(84px, calc(100% - 200px)) !important;
    gap: 6px !important;
    padding: 6px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    border: 1px solid #d5deec !important;
    border-radius: 18px !important;
    background: #f6f8fcf5 !important;
    box-shadow: 0 8px 26px #243b6412 !important;
}

.editor-page #canvasArea>#productViewSwitcher[hidden],
.editor-page #canvasArea.is-3d-mode>#productViewSwitcher {
    display: none !important;
}

.editor-page #productViewSwitcher .view-switcher-title {
    display: none !important;
}

.editor-page #productViewSwitcher .view-side-btn {
    position: relative;
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 74px !important;
    min-height: 74px !important;
    padding: 7px 4px !important;
    margin: 0 !important;
    gap: 0px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    border: 1px solid #e1e7f0 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #637089 !important;
    box-shadow: none !important;
    transform: none !important;
}

.editor-page #productViewSwitcher .view-side-btn img {
    display: block !important;
    flex: 0 0 46px;
    width: 48px !important;
    height: 46px !important;
    padding: 0 !important;
    margin: 0 !important;
    object-fit: contain;
}

.editor-page #productViewSwitcher .view-side-btn img[hidden],
.editor-page #productViewSwitcher .view-side-btn.unavailable {
    display: none !important;
}

.editor-page #productViewSwitcher .view-side-btn>span {
    font-size: 11px !important;
    line-height: 16px !important;
    font-weight: 600 !important;
    color: #222;
}

.editor-page #productViewSwitcher .view-side-btn.active {
    color: #0051bb !important;
    background: #eaf0ff !important;
    box-shadow: inset 0 0 0 1px #6283e4 !important;
}

.editor-page #productViewSwitcher .view-side-btn:hover:not(:disabled):not(.active) {
    background: #f0f4fc !important;
    border-color: #b7c8e7 !important;
}

.editor-page #productViewSwitcher .view-side-btn:focus-visible {
    outline: 2px solid #315bd3;
    outline-offset: -3px;
}

.editor-page #productViewSwitcher[aria-busy="true"] .view-side-btn {
    opacity: .6;
    cursor: progress;
}

@media (max-width: 768px) {
    .editor-page #canvasArea>#productViewSwitcher {
        right: 8px !important;
        width: 60px !important;
        max-width: 60px !important;
        padding: 4px !important;
        gap: 4px !important;
        max-height: max(64px, calc(100% - 210px)) !important;
        border-radius: 14px !important;
    }
    .editor-page #productViewSwitcher .view-side-btn {
        height: 62px !important;
        min-height: 62px !important;
        padding: 4px 2px !important;
        gap: 2px !important;
    }
    .editor-page #productViewSwitcher .view-side-btn img {
        width: 34px !important;
        height: 34px !important;
        flex-basis: 34px;
    }
    .editor-page #productViewSwitcher .view-side-btn>span {
        font-size: 9px !important;
        line-height: 14px !important;
    }
}

.editor-page .editor-body>.side-panel {
    border: 1px solid var(--editor-line) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: 0 8px 24px #263b6508 !important;
}


/* Each drawer uses its own settings card as the single visible surface. */

.editor-page .editor-body>#sidePanel:is(.contextual-panel-active, .image-contextual-panel-active),
.editor-page .editor-body>#sidePanel.product-panel-active:has(#tab-product.active:not(.product-selector-open)),
.editor-page .editor-body>#sidePanel:is(.text-panel-active, .image-panel-active, .clipart-panel-active, .ai-panel-active, .layer-panel-active):not(.contextual-panel-active):not(.image-contextual-panel-active) {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.editor-page #sidePanel:is(.contextual-panel-active, .image-contextual-panel-active)>.side-panel-body,
.editor-page #sidePanel.product-panel-active:has(#tab-product.active:not(.product-selector-open))>.side-panel-body,
.editor-page #sidePanel:is(.text-panel-active, .image-panel-active, .clipart-panel-active, .ai-panel-active, .layer-panel-active):not(.contextual-panel-active):not(.image-contextual-panel-active)>.side-panel-body {
    padding: 0 !important;
    background: transparent !important;
    scrollbar-gutter: auto;
}

.editor-page #sidePanel:is(.contextual-panel-active, .image-contextual-panel-active)>.side-panel-body,
.editor-page #sidePanel:is(.text-panel-active, .image-panel-active, .clipart-panel-active, .ai-panel-active, .layer-panel-active):not(.contextual-panel-active):not(.image-contextual-panel-active)>.side-panel-body {
    display: flex !important;
    flex-direction: column;
    min-height: 0 !important;
    overflow: hidden !important;
}

.editor-page #sidePanel:is(.contextual-panel-active, .image-contextual-panel-active)>.side-panel-body>.tab-pane.active,
.editor-page #sidePanel:is(.text-panel-active, .image-panel-active, .clipart-panel-active, .ai-panel-active, .layer-panel-active):not(.contextual-panel-active):not(.image-contextual-panel-active) :is(#tab-text, #tab-image, #tab-clipart, #tab-ai, #tab-layers).active {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    height: 100% !important;
    min-height: 0 !important;
    gap: 0;
    box-shadow: none !important;
}

.editor-page #sidePanel:is(.text-panel-active, .image-panel-active, .clipart-panel-active, .ai-panel-active, .layer-panel-active):not(.contextual-panel-active):not(.image-contextual-panel-active) :is(#tab-text, #tab-image, #tab-clipart, #tab-ai, #tab-layers).active> :is(.text-settings-card, .image-settings-card, .clipart-settings-card, .ai-settings-card, #layersPanelMount) {
    flex: 1 1 auto;
    width: 100%;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}


/* Toolbar inspectors fill the drawer, with long controls scrolling inside the card. */

.editor-page #sidePanel.contextual-panel-active #tab-text.font-drawer-mode>.text-settings-card,
.editor-page #sidePanel.image-contextual-panel-active #tab-image.active>#imageInspectorMount {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    box-sizing: border-box;
    width: 100%;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.editor-page #sidePanel.contextual-panel-active #tab-text.active>.side-inspector:not([hidden]),
.editor-page #sidePanel.contextual-panel-active #tab-text.font-drawer-mode .font-drawer-panel,
.editor-page #sidePanel.image-contextual-panel-active #imageInspectorMount>.side-inspector:not([hidden]) {
    flex: 1 1 auto;
    box-sizing: border-box;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c2ccdc transparent;
    border-radius: 18px !important;
    box-shadow: none !important;
}

.editor-page #sidePanel.contextual-panel-active #tab-text.font-drawer-mode .font-drawer-panel {
    overflow: hidden !important;
}

.editor-page #sidePanel.contextual-panel-active .font-drawer-panel> :is(.toolbar-inspector-head, .font-picker-sticky) {
    flex-shrink: 0;
}

.editor-page #sidePanel.layer-panel-active #layersPanelMount>.right-panel.embedded-layer-panel {
    box-shadow: none !important;
}

@media (min-width: 769px) {
    .editor-page #sidePanel.product-panel-active #tab-product.active:not(.product-selector-open) {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .editor-page #sidePanel.product-panel-active #tab-product.active:not(.product-selector-open)>.product-settings-card {
        flex: 1 1 auto;
        height: 100% !important;
        min-height: 0 !important;
        margin: 0;
        border-radius: 18px;
        box-shadow: none;
    }
}

.editor-page .side-panel-floating-header {
    border-radius: 18px 18px 0 0 !important;
    background: #fff !important;
}

.editor-page .side-panel-body {
    scrollbar-color: #c2ccdc transparent;
}

.editor-page .editor-body .tool-btn {
    border-radius: 12px !important;
    box-shadow: none !important;
}

.editor-page .editor-body .tool-btn.active {
    color: var(--editor-blue) !important;
    background: var(--editor-blue-soft) !important;
    border-color: #c3d0f1 !important;
}

.editor-page .editor-body .tool-btn:hover {
    background: #f1f5fc !important;
    transform: none !important;
}

.editor-page :is(button, a, input, select):focus-visible {
    outline: 2px solid #6385e1;
    outline-offset: 3px;
}

@media (min-width: 769px) {
    .editor-page .editor-body {
        height: calc(100dvh - var(--toolbar-h) - var(--editor-footer-size)) !important;
    }
    .editor-page .editor-body>.left-panel {
        top: var(--editor-shell-gap) !important;
        bottom: var(--editor-shell-gap) !important;
        height: auto !important;
        max-height: none !important;
        transform: none !important;
        justify-content: flex-start !important;
        overflow-y: auto;
        padding: 8px 6px !important;
        border: 1px solid var(--editor-line) !important;
        border-radius: 16px !important;
        background: #fff !important;
        box-shadow: none !important;
    }
    .editor-page .left-panel .tool-btn {
        width: 54px !important;
        min-height: 48px !important;
    }
    .editor-page .left-panel .tool-btn-label {
        font-size: 9px !important;
        line-height: 1.35;
    }
    .editor-page #canvasArea .object-toolbar:not(.text-mode):not(.image-mode),
    .editor-page #canvasArea .object-toolbar.text-mode,
    .editor-page #canvasArea .image-edit-dock {
        position: absolute !important;
        top: 12px !important;
        bottom: auto !important;
        left: 50% !important;
        right: auto !important;
        width: max-content !important;
        max-width: calc(100% - 176px) !important;
        margin: 0 !important;
        transform: translateX(-50%) !important;
    }
    .editor-page .canvas-area>.canvas-view-switcher {
        position: absolute !important;
        right: 10px !important;
        width: 74px !important;
        padding: 5px !important;
    }
    .editor-page .canvas-view-switcher .view-side-btn {
        min-height: 62px !important;
    }
    .editor-page .editor-bottom-actionbar {
        height: var(--editor-footer-size) !important;
        border-top: 1px solid var(--editor-line) !important;
        background: #fff !important;
        box-shadow: none !important;
        padding: 10px 16px !important;
    }
    .editor-page .editor-bottom-product {
        border-radius: 12px !important;
        box-shadow: none !important;
    }
    .editor-page .editor-bottom-product.active {
        background: var(--editor-blue-soft) !important;
        border-color: #bdcdf2 !important;
    }
    .editor-page .editor-bottom-confirm {
        border-radius: 12px !important;
        background: var(--editor-blue) !important;
        color: #fff !important;
        box-shadow: none !important;
    }
}

@media (min-width: 1200px) {
    .editor-page .editor-body {
        display: grid !important;
        grid-template-columns: var(--editor-rail-size) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        gap: var(--editor-shell-gap);
        padding: var(--editor-shell-gap) !important;
    }
    .editor-page .editor-body.side-panel-open {
        grid-template-columns: var(--editor-rail-size) var(--editor-drawer-size) minmax(0, 1fr);
    }
    .editor-page .editor-body> :is(.left-panel, #sidePanel, .canvas-area) {
        position: relative !important;
        inset: auto !important;
        grid-row: 1;
        width: auto !important;
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        transform: none !important;
    }
    .editor-page .editor-body>.left-panel {
        grid-column: 1;
    }
    .editor-page .editor-body>#sidePanel {
        grid-column: 2;
    }
    .editor-page .editor-body>#sidePanel.font-panel-active.contextual-panel-active {
        inset: auto !important;
        height: 100% !important;
    }
    .editor-page .editor-body>.canvas-area {
        grid-column: -2;
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .editor-page .editor-workspace-context {
        display: none !important;
    }
    .editor-page .editor-body>#sidePanel {
        width: min(360px, calc(100vw - 116px)) !important;
    }
    .editor-page .editor-body.side-panel-open>.canvas-area {
        left: calc(var(--editor-rail-size) + var(--editor-shell-gap) * 2) !important;
    }
    .editor-page .editor-body>.side-panel {
        box-shadow: 12px 0 36px #263b6520 !important;
    }
}

@media (max-width: 768px) {
     :root {
        --toolbar-h: 64px;
        --editor-shell-gap: 8px;
    }
    .editor-page .editor-workspace-context,
    .editor-page .topbar-account-actions {
        display: none !important;
    }
    .editor-page .editor-body {
        height: calc(100dvh - var(--toolbar-h)) !important;
    }
    .editor-page .editor-body>.canvas-area>.canvas-wrap {
        inset: 72px 12px 122px !important;
    }
    .editor-page .editor-body>.left-panel {
        border: 1px solid var(--editor-line) !important;
        border-radius: 16px !important;
        background: #fff !important;
        box-shadow: 0 4px 20px #263b6510 !important;
    }
    .editor-page .editor-body>.side-panel {
        box-shadow: 0 -12px 36px #263b6520 !important;
    }
}


/* Compact product tabs with distinct selection and readable pricing. */

@media (min-width: 769px) {
    .editor-page .editor-bottom-actionbar {
        gap: 12px !important;
        border-top: 1px solid #e1e7f0 !important;
        box-shadow: 0 -4px 20px #263b6506 !important;
    }
    .editor-page .editor-bottom-product {
        min-width: 190px !important;
        max-width: 250px !important;
        flex: 0 0 clamp(190px, 20vw, 250px) !important;
        gap: 10px !important;
        padding: 5px 34px 5px 5px !important;
        border: 1px solid #e1e7f0 !important;
        border-radius: 13px !important;
        background: #fff !important;
        overflow: hidden;
    }
    .editor-page .editor-bottom-product.active {
        background: #f8faff !important;
        border-color: #9cb3ed !important;
    }
    .editor-page .editor-bottom-product:hover {
        border-color: #9cb3ed !important;
    }
    .editor-page .editor-bottom-product img {
        width: 46px !important;
        height: 46px !important;
        flex-basis: 46px !important;
        padding: 2px !important;
        border-radius: 9px !important;
        background: #fff !important;
        border-color: #e7ecf5 !important;
    }
    .editor-page .editor-bottom-product-copy {
        gap: 0px !important;
    }
    .editor-page .editor-bottom-product-copy strong {
        line-height: 1.35 !important;
    }
    .editor-page .editor-bottom-product-copy span {
        font-size: 12px !important;
        font-weight: 500 !important;
        font-variant-numeric: tabular-nums;
    }
    .editor-page .editor-bottom-product-remove {
        width: 26px;
        height: 26px;
    }
    .editor-page .editor-bottom-product:focus-visible {
        outline: 2px solid #3158cd;
        outline-offset: 2px;
    }
}

.editor-page #cartDrawer .cart-footer .cart-checkout {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 48px !important;
    padding: 12px 16px !important;
    border: 1px solid #2548b2 !important;
    border-radius: 12px !important;
    background: #0051bb !important;
    color: #fff !important;
    box-shadow: inset 0 1px 0 #ffffff20, 0 4px 10px #0051bb20 !important;
    text-decoration: none !important;
    transition: background .16s ease, box-shadow .16s ease;
}

.editor-page #cartDrawer .cart-footer .cart-checkout>span {
    color: inherit !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    min-width: 0;
}

.editor-page #cartDrawer .cart-footer .cart-checkout>svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px !important;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.editor-page #cartDrawer .cart-footer .cart-checkout:hover {
    background: #2344a6 !important;
    box-shadow: inset 0 1px 0 #ffffff20, 0 5px 14px #0051bb30 !important;
}

.editor-page #cartDrawer .cart-footer .cart-checkout:active {
    background: #1e3a8a !important;
    box-shadow: none !important;
}

.editor-page #cartDrawer .cart-footer .cart-checkout:focus-visible {
    outline: 3px solid #b4c6ff !important;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .editor-page #cartDrawer .cart-footer .cart-checkout {
        transition: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .editor-page .editor-body *,
    .editor-page .topbar * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

.editor-page .print-area-tooltip {
    position: fixed;
    z-index: 150;
    display: grid;
    gap: 4px;
    max-width: calc(100vw - 16px);
    padding: 10px 12px;
    border: 1px solid #bce6ca;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(15, 23, 42, .12);
    color: #172033;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.5;
    pointer-events: none;
}

.editor-page .print-area-tooltip[hidden] {
    display: none !important;
}

.editor-page .print-area-tooltip>strong {
    color: #15803d;
    font-size: 11px;
    font-weight: 600;
}

.editor-page .print-area-tooltip>span {
    font-size: 12px;
    font-weight: 600;
}
