:root {
    --start-theme-admin-bar-height: 0px;
    --start-theme-editor-bar-height: 0px;
    --start-theme-chrome-offset: 0px;
    --start-theme-preview-width: 1440px;
    --start-theme-editor-motion: 180ms cubic-bezier(.22, 1, .36, 1);
}

html.start-visual-editor-has-admin-bar,
html.start-theme-contract-has-admin-bar {
    --start-theme-admin-bar-height: 50px;
    --start-theme-chrome-offset: 50px;
}

/* Structural marker only. The editor surface lives inside the native Admin Bar. */
.start-theme-editor-slot,
[data-start-theme-editor-slot] {
    position: relative;
    z-index: auto;
    display: block;
    width: 100%;
    height: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    pointer-events: none;
    background: transparent;
}

/*
 * Responsive owner: the real site canvas is the single named size container.
 * In production it naturally has viewport width. In Visual Editor it receives
 * the selected Desktop/Tablet/Mobile width. No iframe and no cloned CSS rules.
 */
.start-theme-canvas,
[data-start-theme-canvas] {
    position: relative;
    container-name: start-theme-canvas;
    container-type: inline-size;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
}

[data-start-theme-sticky="header"] {
    --start-theme-sticky-top: var(--start-theme-chrome-offset, 0px);
}

html.start-theme-contract-invalid.start-visual-editor-mode #admin_bar {
    outline: 2px solid #dc2626;
    outline-offset: -2px;
}

html.start-visual-editor-mode [data-start-theme-canvas] {
    width: min(var(--start-theme-preview-width, 1440px), calc(100vw - 32px));
    max-width: var(--start-theme-preview-width, 1440px);
    min-width: 0;
    margin-inline: auto;
    min-height: calc(100dvh - var(--start-theme-chrome-offset, 50px));
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .10), 0 18px 48px rgba(15, 23, 42, .14);
    transition: width var(--start-theme-editor-motion), max-width var(--start-theme-editor-motion), box-shadow var(--start-theme-editor-motion);
}

html.start-visual-editor-mode[data-start-visual-viewport="desktop"] [data-start-theme-canvas] {
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .04), 0 10px 28px rgba(15, 23, 42, .05);
}

@media (prefers-reduced-motion: reduce) {
    html.start-visual-editor-mode [data-start-theme-canvas] {
        transition: none;
    }
}
