/* Embed chrome: админский skin поверх bundle редактора */

/* Мост bundle-токенов → admin DS (единая палитра с шапкой и табами) */
body.admin-editor-active #adminSvgEditorMount.sle-mounted {
    --bg-black: var(--sle-bg-app);
    --bg-white12: var(--sle-bg-panel);
    --bg-black32: var(--sle-bg-panel);
    --bg-black70: var(--sle-bg-panel-strong);
    --stroke-white12: var(--sle-stroke);
    --accent-white48: var(--admin-text-muted);
    --accent-white: var(--admin-text);
    background: var(--sle-bg-app, var(--admin-bg)) !important;
    color: var(--admin-text);
    -webkit-font-smoothing: antialiased;
}

/* Светлая тема: иконки-бандла белые → инвертируем в тёмные */
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted button img,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-history-bar button img,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .tool-btn img,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-bool-btn img {
    filter: invert(1) brightness(0.25);
    opacity: 0.9;
}

html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted button:disabled img {
    opacity: 0.35;
    filter: invert(1) brightness(0.35);
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .app {
    background: var(--sle-bg-app, var(--admin-bg)) !important;
    grid-template-columns: 240px minmax(0, 1fr) 300px !important;
    grid-template-rows: minmax(0, 1fr) !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-layers,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .canvas-area,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-stickers {
    grid-row: 1;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .top-bar {
    display: none !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-layers,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-stickers {
    background: var(--admin-editor-panel) !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-layers {
    border-right: 1px solid var(--admin-border-subtle);
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-stickers {
    border-left: 1px solid var(--admin-border-subtle);
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .canvas-area {
    background: var(--admin-editor-canvas) !important;
    position: relative !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted p,
body.admin-editor-active #adminSvgEditorMount.sle-mounted span,
body.admin-editor-active #adminSvgEditorMount.sle-mounted label,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .hint,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-bool-hint,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-toolbar-hint {
    color: var(--admin-text-secondary);
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted code {
    color: var(--admin-text);
    background: var(--admin-surface-glass);
    padding: 0 4px;
    border-radius: 4px;
}

/* История — левая панель, над «Инструменты» */
body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-history-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--admin-border-subtle);
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-history-bar button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border-radius: var(--admin-radius-sm, 8px);
    border: 1px solid var(--admin-border);
    background: var(--admin-surface-glass-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-history-bar button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-history-bar button img {
    width: 20px;
    height: 20px;
}

body.admin-editor-active #adminSvgEditorMount .sle-canvas-zoom-bar,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-params-bg-host {
    display: none;
}

/* Фон — док в левом нижнем углу холста */
body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-canvas-bg-dock {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--admin-radius-sm, 8px);
    background: var(--admin-editor-popover);
    border: 1px solid var(--admin-border);
    box-shadow: var(--admin-shadow-sm);
    pointer-events: auto;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-canvas-bg-dock .sle-canvas-card-wrap {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-canvas-bg-dock .xf-export-card-label {
    margin: 0 !important;
    white-space: nowrap;
    text-transform: none;
    letter-spacing: normal;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--admin-text-secondary) !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-canvas-bg-dock #sle-xfCardTypeSelect {
    display: block !important;
    width: auto;
    min-width: 136px;
    max-width: 200px;
    min-height: 34px;
    height: 34px;
    padding: 0 30px 0 10px;
    border-radius: var(--admin-radius-sm, 8px);
    border: 1px solid var(--admin-border);
    background-color: var(--admin-surface-glass-subtle);
    color: var(--admin-text);
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' fill-opacity='0.65' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* Импорт в левой панели — когда нет слоёв */
body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-layers-import-host {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 140px;
    margin-top: 4px;
    gap: 0;
    overflow: hidden;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-layers-import-host[hidden] {
    display: none !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-layers-import-host .drop-zone {
    flex: 1 1 auto;
    min-height: 140px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 16px 12px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    border-radius: var(--admin-radius-sm, 8px) !important;
    border: 1px dashed var(--admin-border) !important;
    background: var(--admin-surface-glass-subtle) !important;
    color: var(--admin-text-secondary) !important;
    text-align: center;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted #sle-saveLayoutBtn,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-save-btn.btn-primary {
    border-radius: var(--admin-radius-sm, 8px) !important;
    font-weight: 650 !important;
    box-shadow: none !important;
    border: none !important;
    background: var(--admin-primary, #2563eb) !important;
    color: var(--admin-text) !important;
}

/* Заголовки панелей — единый стиль (убиваем bundle 34px в stickers) */
body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-stickers .panel-title,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-panel-main-title,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-import-head {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    line-height: 1.35 !important;
    color: var(--admin-text-muted) !important;
    white-space: normal !important;
    margin: 0 0 8px !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-import-head {
    margin-top: 4px !important;
}

/* Правая колонка: вертикальный блок параметров */
body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-stickers {
    min-width: 280px !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-stickers.sle-params-only > :not(.sle-params-save-foot) {
    flex-shrink: 0;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-params-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1 1 auto;
    min-height: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    overflow-y: auto;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-params-save-foot {
    flex: 0 0 auto;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--admin-border-subtle);
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted #sle-saveLayoutBtn.sle-save-btn--panel,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-save-btn--panel.btn-primary {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    height: auto !important;
    padding: 0 18px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .layout-pkg-meta-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 16px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .layout-pkg-name-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 0 !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .layout-pkg-cards-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 8px !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-stickers .xf-export-card-wrap {
    display: none !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .layout-pkg-name-wrap label,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .layout-pkg-cards-title {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--admin-text-muted);
    white-space: normal;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-field-hint {
    margin: -2px 0 8px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--admin-text-faint);
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted #sle-layoutPkgNameInput {
    width: 100% !important;
    min-height: 40px;
    height: auto !important;
    padding: 0 12px;
    border-radius: var(--admin-radius-sm, 8px);
    border: 1px solid var(--admin-border);
    background: var(--admin-chip-fill);
    color: var(--admin-text);
    font-size: 14px;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-legacy-hidden {
    display: none !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-card-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-card-picker--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-card-picker--canvas {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 6px 8px;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-sm, 8px);
    background: var(--admin-hover-fill);
    color: var(--admin-text);
    text-align: left;
    cursor: pointer;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card--tile {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-height: 0;
    padding: 8px 6px 10px;
    text-align: center;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card--chip {
    flex: 0 0 auto;
    width: auto;
    min-height: 0;
    min-width: 0;
    padding: 5px;
    gap: 0;
    justify-content: center;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card:hover {
    border-color: var(--admin-border-strong);
    background: var(--admin-chip-fill);
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card--on {
    border-color: var(--admin-primary, #2563eb);
    background: var(--admin-info-muted);
    box-shadow: 0 0 0 1px var(--admin-primary-border);
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card__check {
    display: none;
    position: absolute;
    top: 5px;
    right: 5px;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--admin-primary, #2563eb);
    color: var(--admin-text);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card--on .sle-type-card__check::before {
    content: '✓';
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card--on .sle-type-card__check {
    display: flex;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card--chip.sle-type-card--on {
    box-shadow: 0 0 0 2px var(--admin-primary, #2563eb);
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card--chip .sle-type-card__check {
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    font-size: 9px;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-card-thumb-wrap {
    flex-shrink: 0;
    width: 30px;
    height: 48px;
    border-radius: 6px;
    border: 1px solid var(--admin-border);
    background: var(--admin-preview-well);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-card-thumb {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card--tile .sle-card-thumb-wrap {
    width: 34px;
    height: 54px;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card--chip .sle-card-thumb-wrap {
    width: 30px;
    height: 48px;
    border: none;
    background: transparent;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card--tile .sle-type-card__text {
    width: 100%;
    align-items: center;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card--tile .sle-type-card__title {
    font-size: 11px;
    line-height: 1.2;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card__title {
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
    color: var(--admin-text);
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-type-card__meta {
    font-size: 11px;
    color: var(--admin-text-muted);
    line-height: 1.2;
}

/* Булевы инструменты */
body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-tools-row {
    gap: 8px;
    flex-wrap: nowrap;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-tool-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    flex-shrink: 0 !important;
    border-radius: var(--admin-radius-sm, 8px);
    border: 1px solid var(--admin-border-subtle);
    background: var(--admin-chip-fill);
    color: var(--admin-text);
    opacity: 1 !important;
    overflow: visible !important;
    padding: 0 !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-tool-btn:disabled {
    opacity: 0.5 !important;
    color: var(--admin-text-muted);
    cursor: not-allowed;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-tool-btn .sle-tool-svg {
    width: 22px !important;
    height: 22px !important;
    display: block !important;
    overflow: visible !important;
    flex-shrink: 0 !important;
    pointer-events: none;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-tool-btn .sle-tool-svg path {
    vector-effect: non-scaling-stroke;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-tool-btn img {
    opacity: 1 !important;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-hint-icon {
    display: none !important;
}

/* Заголовки панелей + ? */
body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-panel-title-row .panel-title {
    margin: 0;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-hint-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--admin-border);
    background: var(--admin-chip-fill-strong);
    color: var(--admin-text-secondary);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-hint-icon.is-active {
    background: var(--admin-border);
    border-color: var(--admin-border-strong);
    color: var(--admin-text);
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-bool-hint,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-toolbar-hint,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-stickers .hint {
    display: none;
    margin: 6px 0 0;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.45;
    border-radius: 8px;
    background: var(--admin-hover-fill);
    border: 1px solid var(--admin-chip-fill-strong);
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-bool-hint.sle-hint-open,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-toolbar-hint.sle-hint-open,
body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-stickers.sle-import-hints-open .hint {
    display: block;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-layers-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 160px;
    padding: 16px;
    text-align: center;
    color: var(--admin-text-muted);
    font-size: 13px;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-layers-empty strong {
    color: var(--admin-text);
    font-size: 15px;
}

body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-empty-goto-import {
    min-height: 40px;
    padding: 0 14px;
    border-radius: var(--admin-radius-sm, 8px);
    border: 1px solid var(--admin-primary-border);
    background: var(--admin-info-muted);
    color: var(--admin-text);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

body.admin-editor-active #adminTabEditor .admin-page-head__actions .sle-new-layout-btn--active {
    border-color: var(--admin-primary-border);
    background: var(--admin-info-muted);
    color: var(--admin-text);
}

#sveModalBackdrop .sve-modal__section--save-as-new {
    padding-top: 0;
    margin-top: -4px;
    border: 0;
    background: transparent;
}

body.admin-editor-active #adminSvgEditorMount .sle-mobile-tabs,
body.admin-editor-active #adminSvgEditorMount .sle-mobile-save-bar {
    display: none;
}

body.admin-editor-active #adminSvgEditorMount .sle-mobile-pick-file,
body.admin-editor-active #adminSvgEditorMount .sle-mobile-open-library {
    display: none !important;
}

@media (max-width: 900px) {
    body.admin-editor-active .admin-brand__subtitle {
        display: none;
    }

    body.admin-editor-active .admin-main-inner--full {
        padding-bottom: 0;
    }

    body.admin-editor-active #adminSvgEditorMount {
        padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
    }

    body.admin-editor-active #adminSvgEditorMount .sle-mobile-tabs {
        display: flex;
        flex: 0 0 auto;
        gap: 6px;
        padding: 8px 10px;
        background: var(--admin-surface);
        border-bottom: 1px solid var(--admin-border);
        position: relative;
        z-index: 20;
    }

    body.admin-editor-active #adminSvgEditorMount .sle-mobile-tabs button {
        flex: 1;
        min-height: 40px;
        border: 1px solid var(--admin-surface-glass);
        border-radius: var(--admin-radius-sm, 8px);
        background: transparent;
        color: var(--admin-text-secondary);
        font-size: 13px;
        font-weight: 650;
        cursor: pointer;
    }

    body.admin-editor-active #adminSvgEditorMount .sle-mobile-tabs button.is-active {
        background: var(--admin-info-muted);
        border-color: var(--admin-primary-border);
        color: var(--admin-text);
    }

    body.admin-editor-active #adminSvgEditorMount .sle-mobile-save-bar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10040;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        background: var(--admin-surface);
        border-top: 1px solid var(--admin-border);
    }

    body.admin-editor-active #adminSvgEditorMount .sle-mobile-save-btn {
        width: 100%;
        min-height: 48px;
    }

    body.admin-editor-active #adminSvgEditorMount.sle-mounted {
        display: flex;
        flex-direction: column;
    }

    body.admin-editor-active #adminSvgEditorMount.sle-mounted .app {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: minmax(0, 1fr) !important;
        flex: 1 1 auto;
        min-height: 0 !important;
        height: auto !important;
        overflow: hidden;
        position: relative;
    }

    body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-params-save-foot {
        display: none !important;
    }

    body.admin-editor-active #adminTabEditor .admin-page-head {
        max-width: none;
        padding: 6px 10px;
        margin-bottom: 0;
    }

    /* Only one panel visible — hide others hard */
    body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-layers,
    body.admin-editor-active #adminSvgEditorMount.sle-mounted .canvas-area,
    body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-stickers {
        grid-column: 1 !important;
        grid-row: 1 !important;
        display: none !important;
        position: relative;
        z-index: 1;
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: none;
        overflow: auto;
        box-sizing: border-box;
    }

    body.admin-editor-active #adminSvgEditorMount[data-sle-mobile-panel='canvas'] .canvas-area {
        display: flex !important;
        flex-direction: column;
        padding: 8px;
        overflow: hidden;
    }

    body.admin-editor-active #adminSvgEditorMount[data-sle-mobile-panel='layers'] .panel-layers {
        display: flex !important;
        flex-direction: column;
        padding: 10px 12px 16px;
    }

    body.admin-editor-active #adminSvgEditorMount[data-sle-mobile-panel='params'] .panel-stickers {
        display: flex !important;
        flex-direction: column;
        padding: 10px 12px 16px;
    }

    body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-tools-row {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: visible;
    }

    body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-tool-btn {
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 52px;
        height: 44px !important;
        box-sizing: border-box;
    }

    body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-tool-btn img,
    body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-tool-btn .sle-tool-svg {
        width: 20px !important;
        height: 20px !important;
    }

    body.admin-editor-active #adminSvgEditorMount.sle-mounted #sle-dropZone.sle-import--touch-ready {
        min-height: 88px;
        padding: 18px 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 14px;
        line-height: 1.35;
        color: var(--admin-text-secondary);
    }

    body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-layers .hint,
    body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-layers-import-host > .hint {
        display: none !important;
    }

    body.admin-editor-active #adminSvgEditorMount .sle-canvas-empty-mobile {
        position: absolute;
        inset: 8px;
        z-index: 6;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 14px;
        padding: 20px 16px;
        text-align: center;
        border-radius: 12px;
        background: rgba(15, 23, 42, 0.92);
        color: var(--admin-text);
    }

    body.admin-editor-active #adminSvgEditorMount .sle-canvas-empty-mobile[hidden] {
        display: none !important;
    }

    body.admin-editor-active #adminSvgEditorMount .sle-canvas-empty-mobile__actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: min(100%, 280px);
    }

    body.admin-editor-active #adminSvgEditorMount .sle-canvas-empty-mobile__actions .btn {
        min-height: 48px;
        width: 100%;
    }

    body.admin-editor-active #adminSvgEditorMount .canvas-area {
        position: relative;
    }

    body.admin-editor-active #adminSvgEditorMount .sle-mobile-pick-file,
    body.admin-editor-active #adminSvgEditorMount .sle-mobile-open-library {
        display: flex !important;
        min-height: 48px;
        width: 100%;
        margin-top: 10px;
    }

    body.admin-editor-active #adminSvgEditorMount .sle-import-drag-overlay--mobile-off {
        display: none !important;
        pointer-events: none !important;
    }

    body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-canvas-bg-dock {
        display: none !important;
    }

    body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-params-bg-host {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 12px;
        padding: 10px 12px;
        border-radius: var(--admin-radius-sm, 8px);
        border: 1px solid var(--admin-border);
        background: var(--admin-surface-glass-subtle);
    }

    body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-params-bg-host .xf-export-card-label {
        font-size: 12px;
        font-weight: 600;
        color: var(--admin-text-secondary);
    }

    body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-params-bg-host #sle-xfCardTypeSelect {
        width: 100%;
        max-width: none;
        min-height: 44px;
    }

    /* Zoom only when canvas has content — keep small, don't cover empty CTA */
    body.admin-editor-active #adminSvgEditorMount .sle-canvas-zoom-bar {
        display: none;
        gap: 6px;
        position: absolute;
        top: 8px;
        right: 8px;
        z-index: 8;
    }

    body.admin-editor-active #adminSvgEditorMount[data-sle-mobile-panel='canvas']:not(.sle-has-empty-canvas) .sle-canvas-zoom-bar {
        display: flex;
    }

    body.admin-editor-active #adminSvgEditorMount .sle-canvas-zoom-bar button {
        min-width: 40px;
        min-height: 40px;
        border-radius: var(--admin-radius-sm, 8px);
        border: 1px solid var(--admin-border);
        background: var(--admin-editor-popover);
        color: var(--admin-text);
        font-size: 18px;
        font-weight: 700;
        cursor: pointer;
    }

    /* Canvas card should fit the available panel */
    body.admin-editor-active #adminSvgEditorMount[data-sle-mobile-panel='canvas'] #sle-canvasWrapper {
        max-width: 100%;
        max-height: 100%;
    }
}

/* === LIGHT THEME: editor follows shell (no dark island) === */

html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted {
    --accent-white: var(--admin-text);
    --accent-white48: #6c7a91;
    --bg-black: var(--sle-bg-app);
    --bg-white12: var(--sle-bg-panel);
    --bg-black32: var(--sle-bg-panel-strong);
    --bg-black70: var(--sle-bg-panel-strong);
    --stroke-white12: var(--sle-stroke);
}

html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .canvas-area,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .canvas-wrapper,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted #sle-canvasWrapper {
    background: var(--admin-editor-canvas) !important;
}

/* Бандл местами хардкодит color:#fff / white — переводим на текст темы */
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-layers,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .panel-stickers,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-toolbar,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .layer-row,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .layer-name,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .sticker-item,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .hint,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted label,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-params-title,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-section-title,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .xf-export-card-label,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .layer-ctx-label,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .layer-ctx-shortcut {
    color: var(--admin-text) !important;
}

html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .layer-ctx-shortcut,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .hint,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .layers-bool-hint {
    color: var(--admin-text-muted) !important;
}

/* Primary CTA — белый текст на синем */
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .btn-primary,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-save-btn.btn-primary,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted button.sle-save-btn {
    color: #fff !important;
}

html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-canvas-bg-dock {
    background: var(--admin-surface) !important;
    border-color: var(--admin-border) !important;
    color: var(--admin-text) !important;
}

html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-canvas-bg-dock .xf-export-card-label,
html[data-admin-theme="light"] body.admin-editor-active #adminSvgEditorMount.sle-mounted .sle-canvas-bg-dock #sle-xfCardTypeSelect {
    color: var(--admin-text) !important;
}
