.system-website-template-page .system-website-template-message,
.system-website-template-dialog .system-website-template-message {
    border: 1px solid transparent;
    border-radius: var(--evosoft-admin-radius);
    font-size: 14px;
    margin-bottom: 12px;
    padding: 10px 12px;
}

.system-website-template-page .system-website-template-message--error,
.system-website-template-dialog .system-website-template-message--error {
    background: var(--evosoft-admin-danger-soft);
    border-color: #fecaca;
    color: var(--evosoft-admin-danger);
}

.system-website-template-publish-dialog .system-website-template-message--error {
    background: var(--evosoft-admin-danger-soft);
    border-color: #fecaca;
    color: var(--evosoft-admin-danger);
}

.system-website-template-publish-dialog .system-website-template-message--warning {
    background: var(--evosoft-admin-warning-soft);
    border-color: #fde68a;
    color: var(--evosoft-admin-warning);
}

.system-website-template-publish-dialog ul {
    margin: 6px 0 0;
    padding-left: 20px;
}

.system-website-template-publish__summary {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.system-website-template-publish__summary span {
    color: var(--evosoft-admin-text-secondary);
}

.system-website-template-preflight-check {
    align-items: center;
    border-bottom: 1px solid var(--evosoft-admin-border);
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
}

.system-website-template-preflight-check.is-success strong,
.system-website-template-readiness--success {
    color: var(--evosoft-admin-success);
}

.system-website-template-preflight-check.is-error strong,
.system-website-template-readiness--error {
    color: var(--evosoft-admin-danger);
}

.system-website-template-readiness--muted {
    color: var(--evosoft-admin-text-secondary);
}

.system-website-template-dialog .system-website-template-form .admin-form-grid {
    align-items: start;
}

.system-website-template-manifest__empty,
.system-website-template-manifest__rule {
    background: var(--evosoft-admin-surface-subtle);
    border: 1px solid var(--evosoft-admin-border);
    border-radius: var(--evosoft-admin-radius);
    color: var(--evosoft-admin-text-secondary);
    padding: 12px 14px;
}

.system-website-template-manifest__list {
    display: grid;
    gap: 8px;
}

.system-website-template-manifest__item {
    align-items: center;
    border: 1px solid var(--evosoft-admin-border);
    border-radius: var(--evosoft-admin-radius);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    padding: 12px 14px;
}

.system-website-template-manifest__item > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.system-website-template-manifest__item small {
    color: var(--evosoft-admin-text-secondary);
}

.system-website-template-manifest__errors {
    background: var(--evosoft-admin-danger-soft);
    border: 1px solid #fecaca;
    border-radius: var(--evosoft-admin-radius);
    color: var(--evosoft-admin-danger);
    margin: 0;
    padding: 10px 12px 10px 32px;
}

.system-website-template-manifest__rule {
    margin-top: 12px;
}

@media (max-width: 640px) {
    .system-website-template-manifest__item {
        align-items: start;
        grid-template-columns: 1fr;
    }
}

/* Template-scoped appearance authoring; ordinary controls keep the shared geometry. */
.system-style-editor { display: grid; gap: 16px; min-width: 0; }
.system-style-list { display: grid; gap: 8px; }
.system-style-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px; border: 1px solid var(--evosoft-admin-border); border-radius: 4px; }
.system-style-row > div:first-child { display: grid; gap: 4px; }
.system-style-editor small, .system-style-fields > p, .system-style-editor > p { color: var(--evosoft-admin-text-secondary); font-size: 13px; }
.system-style-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.system-style-authoring { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr); gap: 16px; }
.system-style-fields, .system-style-sample-panel { display: grid; align-content: start; gap: 16px; min-width: 0; }
.system-style-sample-canvas { background: var(--evosoft-admin-surface-muted); padding: 12px; border: 1px solid var(--evosoft-admin-border); border-radius: 4px; }
.system-style-sample { width: 100%; box-sizing: border-box; padding: 24px; margin: 0 auto; background: var(--sample-bg); color: var(--sample-text); font-family: var(--sample-body), sans-serif; }
.system-style-sample-brand { font-weight: 600; color: var(--sample-link); }
.system-style-sample h3 { margin: 24px 0 12px; font-size: 26px; font-family: var(--sample-heading), sans-serif; }
.system-style-sample p { color: var(--sample-text-muted); line-height: 1.6; }
.system-style-sample-cta { display: inline-block; padding: 10px 16px; background: var(--sample-primary); color: var(--sample-on-primary); border-radius: 4px; }
.system-style-sample-card { padding: 16px; margin-top: 24px; border: 1px solid var(--sample-border); background: var(--sample-surface); border-radius: 4px; }
.system-style-sample-link { color: var(--sample-link); }
@media (max-width: 800px) { .system-style-authoring { grid-template-columns: minmax(0, 1fr); } }

.system-website-template-dialog .system-website-template-manifest { display: grid; gap: 16px; }
.system-website-template-dialog .system-style-history { border-top: 1px solid var(--evosoft-admin-border); padding-top: 16px; }
.system-website-template-dialog .system-style-history summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.system-website-template-dialog .system-style-history summary span { margin-left: 8px; color: var(--evosoft-admin-text-secondary); font-size: 13px; font-weight: 400; }
.system-website-template-dialog .system-style-history .system-website-template-manifest__item + .system-website-template-manifest__item { margin-top: 8px; }
.system-website-template-dialog .system-style-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) {
    .system-website-template-dialog .system-style-list { grid-template-columns: minmax(0, 1fr); }
}
.e-dialog.system-website-template-dialog form.system-template-metadata { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: var(--evosoft-admin-section-gap); align-items: stretch; }
.e-dialog.system-website-template-dialog form.system-template-metadata > section { min-width: 0; }

.system-style-editor .system-style-color-field { display: flex; align-items: center; gap: 12px; min-height: var(--evosoft-admin-control-height); }
.system-style-editor .system-style-color-field code { color: var(--evosoft-admin-text-secondary); font-size: 13px; }

.system-style-theme-card { border: 1px solid var(--evosoft-admin-border); border-radius: 4px; padding: 16px; background: #fff; min-width: 0; display: grid; gap: 16px; align-content: start; }
.system-style-theme-card .system-style-row { border: 0; padding: 0; }
.system-style-palette { display: grid; gap: 12px; min-width: 0; }
.system-style-palette-mode { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; align-items: center; }
.system-style-palette-label { font-size: 12px; font-weight: 600; color: var(--evosoft-admin-text-secondary); }
.system-style-swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.system-style-swatch { display: grid; gap: 4px; min-width: 0; }
.system-style-swatch > span { display: block; height: 22px; border-radius: 4px; border: 1px solid var(--evosoft-admin-border); }
.system-style-palette-details summary { cursor: pointer; font-size: 13px; color: var(--evosoft-admin-primary); }
.system-style-palette-table-scroll { max-height: 260px; overflow: auto; margin-top: 8px; scrollbar-width: thin; }
.system-style-palette table { width: 100%; border-collapse: collapse; font-size: 12px; }
.system-style-palette th, .system-style-palette td { padding: 8px 4px; border-bottom: 1px solid var(--evosoft-admin-border); text-align: left; }
.system-style-palette th { font-weight: 500; }
.system-style-palette td { white-space: nowrap; }
.system-style-palette td > span { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: middle; border: 1px solid var(--evosoft-admin-border); border-radius: 3px; }
.system-style-palette td code { color: var(--evosoft-admin-text); font-size: 11px; }
.system-style-authoring-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 16px; border-top: 1px solid var(--evosoft-admin-border); }
.system-style-authoring-heading > span { font-size: 13px; color: var(--evosoft-admin-text-secondary); }
.system-style-generated-palette { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--evosoft-admin-border); border-radius: 4px; background: #fff; }
.system-style-history .system-style-list { margin: 12px 0 16px; }


.system-style-swatch:focus-visible { outline: 2px solid var(--evosoft-admin-primary); outline-offset: 2px; border-radius: 4px; }

.system-style-theme-card { gap: 8px; padding: 12px; }
.system-style-theme-card .system-style-row > .system-style-theme-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.system-style-theme-swatch { display: flex; width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid var(--evosoft-admin-border); border-radius: 6px; overflow: hidden; }
.system-style-theme-swatch i { flex: 1; }
.system-style-theme-copy { display: grid; gap: 4px; min-width: 0; }
.system-style-theme-copy strong { font-size: 14px; font-weight: 600; }
.system-style-theme-copy small { color: var(--evosoft-admin-text-secondary); font-size: 12px; }
.system-style-card-details > summary { color: var(--evosoft-admin-text-secondary); font-size: 12px; cursor: pointer; }
.system-style-card-details[open] > summary { margin-bottom: 12px; }

/* Focused editor: settings, preview toolbar and optional palette inspection. */
.system-style-authoring .system-style-fields { padding: 16px; border: 1px solid var(--evosoft-admin-border); border-radius: 4px; background: var(--evosoft-admin-surface-muted); }
.system-style-color-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.system-style-color-grid .system-style-color-field { gap: 8px; flex-wrap: wrap; }
.system-style-authoring .system-style-fields > p { margin: 0; line-height: 1.6; }
.system-style-save-actions { padding-top: 12px; border-top: 1px solid var(--evosoft-admin-border); }
.system-style-preview-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.system-style-preview-controls { display: flex; flex-wrap: wrap; gap: 12px; }
.system-style-toggle-group { display: flex; gap: 4px; }
body:has(.admin-layout) .e-dialog .system-style-toggle.e-btn.e-outline.is-selected { background: var(--evosoft-admin-primary-soft); border-color: var(--evosoft-admin-primary); color: var(--evosoft-admin-primary); }
.system-style-authoring .system-style-generated-palette { display: block; padding: 12px 16px; }
.system-style-generated-palette > summary { font-size: 13px; color: var(--evosoft-admin-text-secondary); cursor: pointer; }
.system-style-generated-palette[open] > summary { margin-bottom: 12px; }
@media (max-width: 400px) { .system-style-color-grid { grid-template-columns: minmax(0, 1fr); } }

.system-style-release-group { display: grid; gap: 16px; padding: 16px; border: 1px solid var(--evosoft-admin-border); border-radius: 8px; background: var(--evosoft-admin-surface-muted); min-width: 0; }
.system-style-release-group > .system-style-release-heading { padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--evosoft-admin-border); border-radius: 0; background: transparent; }
.system-style-history > .system-style-release-group + .system-style-release-group { margin-top: 16px; }
.system-style-history .system-style-release-group > .system-style-list { margin: 0; }
.system-style-release-group .system-style-list { align-items: start; }
.system-style-release-group .system-style-card-details[open] { padding-top: 8px; border-top: 1px solid var(--evosoft-admin-border); }
@media (max-width: 600px) { .system-style-release-group { padding: 12px; } }
.system-style-advanced-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.system-style-advanced-toolbar > span { color: var(--evosoft-admin-text-secondary); font-size: 13px; }
.system-style-generated-palette .system-style-palette-table-scroll { max-height: 420px; }
.system-style-generated-palette td :is(.e-colorpicker-wrapper, .e-colorpicker-container) { margin-right: 8px; vertical-align: middle; }

/* Keep the swatch and dropdown inside one continuous control boundary. */
.system-style-editor :is(.e-colorpicker-wrapper, .e-colorpicker-container) {
    border: 1px solid var(--evosoft-admin-border);
    border-radius: 4px;
    background: #fff;
}
.system-style-editor :is(.e-colorpicker-wrapper, .e-colorpicker-container) .e-btn {
    border: 0 !important;
    box-shadow: none;
}
.system-style-editor :is(.e-colorpicker-wrapper, .e-colorpicker-container):focus-within {
    outline: 2px solid var(--evosoft-admin-primary, #0078d4);
    outline-offset: 2px;
}
.system-style-editor :is(.e-colorpicker-wrapper, .e-colorpicker-container) .e-selected-color {
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .12);
}

.system-style-card-actions { align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; }
.system-style-theme-card .system-style-row { align-items: flex-start; }
.system-style-theme-card .system-style-theme-copy strong { overflow-wrap: anywhere; }
.system-style-theme-card .system-style-theme-identity { flex: 1 1 160px; }
.system-style-theme-card:has(.system-style-card-actions) { gap: 12px; }
@media (max-width: 600px) {
    .system-style-card-actions { width: calc(100% - 52px); justify-content: flex-start; margin-left: 52px; }
}

/* Reviewed source import and release comparison, within the shared dialog shell. */
.system-website-template-dialog .system-template-source-list,
.system-website-template-dialog .system-template-structure {
    display: grid;
    gap: var(--evosoft-admin-section-gap);
}
.system-website-template-dialog .system-template-comparison {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--evosoft-admin-section-gap);
}
.system-website-template-dialog .system-template-comparison > section { min-width: 0; }
.system-website-template-dialog .system-template-comparison h3 { font-size: 16px; margin: 0 0 12px; }
.system-website-template-dialog .system-template-structure details {
    border-left: 2px solid var(--evosoft-admin-border);
    padding-left: 12px;
}
.system-website-template-dialog .system-template-structure details > div { margin-top: 12px; }
.system-website-template-dialog .system-template-structure p,
.system-website-template-dialog .system-template-source-list p { margin: 6px 0; color: var(--evosoft-admin-text-secondary); }
.system-website-template-dialog .system-template-style-comparison,
.system-website-template-dialog .system-template-advanced { margin-top: 14px; }
.system-website-template-dialog .system-template-advanced { color: var(--evosoft-admin-text-secondary); }
.system-website-template-dialog :is(.system-template-advanced, .system-template-structure, .system-template-style-comparison) summary { cursor: pointer; }
.system-website-template-dialog .system-template-advanced pre { max-height: 240px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.system-website-template-dialog .system-template-advanced p { overflow-wrap: anywhere; }
.system-website-template-dialog .system-template-changes { margin: 0; padding-left: 20px; }
@media (max-width: 768px) {
    .system-website-template-dialog .system-template-comparison { grid-template-columns: minmax(0, 1fr); }
}

/* One working version per tab, with secondary history and technical information. */
.system-website-template-dialog .system-template-dialog-heading,
.system-website-template-dialog .system-template-section-toolbar,
.system-website-template-dialog .system-template-working-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.system-website-template-dialog .system-template-dialog-heading {
    flex-wrap: nowrap;
    min-width: 0;
}
.system-website-template-dialog .system-template-dialog-heading .admin-dialog-title {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}
.system-website-template-dialog .system-template-check-update {
    flex: 0 0 auto;
}
.system-website-template-dialog > .e-dlg-content > :is(.system-website-template-message, p[role="status"]) {
    flex: 0 0 auto;
    margin: var(--evosoft-admin-form-gap) var(--evosoft-admin-dialog-padding-x) 0;
}
.system-website-template-dialog .system-template-working-heading { margin-bottom: 12px; }
.system-website-template-dialog .system-template-history {
    margin-top: var(--evosoft-admin-section-gap);
    padding-top: var(--evosoft-admin-section-gap);
    border-top: 1px solid var(--evosoft-admin-border);
}
.system-website-template-dialog .system-template-history > summary,
.system-website-template-dialog .system-template-history-entry > summary { cursor: pointer; font-weight: 500; }
.system-website-template-dialog .system-template-history-entry { margin-top: 14px; }
.system-website-template-dialog .system-template-history-entry[open] > summary,
.system-website-template-dialog .system-template-advanced[open] > summary { margin-bottom: 12px; }
.system-website-template-dialog .system-template-note { color: var(--evosoft-admin-text-secondary); margin: 0; }
.system-website-template-dialog .system-template-structure-content { display: grid; gap: 14px; min-width: 0; }
.system-website-template-dialog .system-template-advanced > .admin-form-grid { margin-top: 12px; }
.system-website-template-dialog .system-template-section-toolbar .admin-edit-section-heading { flex: 1 1 240px; }
.system-website-template-dialog .system-template-history .system-style-list { margin-top: 12px; }
.system-website-template-dialog .system-template-history[open] > summary {
    margin-bottom: var(--evosoft-admin-section-gap);
}
.system-website-template-dialog .system-template-metadata-details > .system-template-note {
    margin-bottom: var(--evosoft-admin-section-gap);
    font-size: 13px;
    line-height: 1.5;
}
.system-website-template-dialog .system-template-metadata-details > summary {
    font-weight: 600;
}
.system-website-template-dialog .system-template-metadata-details {
    padding: var(--evosoft-admin-section-padding);
}
@media (max-width: 600px) {
    .system-website-template-dialog .system-template-check-label { display: none; }
    .system-website-template-dialog .system-template-check-update .e-btn-icon { margin: 0; }
    body:has(.admin-layout) .e-dialog.system-website-template-dialog .admin-image-editor--stacked {
        grid-template-columns: minmax(0, 1fr);
    }
    body:has(.admin-layout) .e-dialog.system-website-template-dialog .admin-edit-section-heading--with-status {
        align-items: start;
        flex-direction: column;
    }
}

.system-zip-import-dialog .system-showcase-preview-viewport {
    overflow: auto;
    border: 1px solid var(--evosoft-admin-border);
    background: var(--evosoft-admin-surface-muted);
}
.system-zip-import-dialog .system-showcase-preview-viewport iframe {
    display: block;
    border: 0;
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
}
.system-zip-import-dialog .system-website-template-message--error {
    color: var(--evosoft-admin-danger);
}
.system-zip-import-dialog .system-zip-preview-page { flex: 1 1 280px; max-width: 560px; min-width: 0; }

/* Browse the library in its template/page context; shared controls own geometry. */
.system-component-browser {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.system-component-browser__navigation {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--evosoft-admin-border);
    border-radius: var(--evosoft-admin-radius);
    background: var(--evosoft-admin-surface-muted);
}
.system-component-browser__content { min-width: 0; }
.system-component-browser__hint,
.system-component-browser__heading span,
.system-component-browser__path,
.system-component-context small {
    color: var(--evosoft-admin-text-secondary);
    font-size: 13px;
}
.system-component-browser__hint { margin: 12px 0 0; }
.system-component-browser__pages {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
    max-height: 65vh;
    overflow-y: auto;
}
.system-component-browser__page {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    border: 0;
    border-radius: var(--evosoft-admin-radius);
    padding: 10px;
    background: transparent;
    color: var(--evosoft-admin-text);
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.system-component-browser__page > span:first-child { min-width: 0; }
.system-component-browser__page small {
    display: block;
    color: var(--evosoft-admin-text-secondary);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.system-component-browser__page:hover { background: var(--evosoft-admin-neutral-soft); }
.system-component-browser__page.is-active {
    background: var(--evosoft-admin-info-soft);
    color: var(--evosoft-admin-primary);
}
.system-component-browser__page:focus-visible { outline: 2px solid var(--evosoft-admin-primary); outline-offset: -2px; }
.system-component-browser__page:disabled { opacity: .6; cursor: wait; }
.system-component-browser__count { color: var(--evosoft-admin-text-secondary); font-size: 12px; flex-shrink: 0; }
.system-component-browser__heading { margin-bottom: 14px; }
.system-component-browser__heading strong { display: block; font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.system-component-browser__heading span { display: block; }
.system-component-browser__name { white-space: normal; overflow-wrap: anywhere; }
.system-component-browser__path { display: block; overflow: hidden; text-overflow: ellipsis; }
.system-component-context { margin-bottom: 12px; color: var(--evosoft-admin-text-secondary); font-size: 13px; }
.system-component-context:empty { display: none; }
.system-component-context p { margin: 6px 0 0; }
@media (max-width: 1024px) {
    .system-component-browser { grid-template-columns: 200px minmax(0, 1fr); gap: 12px; }
    .system-component-browser__navigation { padding: 12px; }
}
@media (max-width: 768px) {
    .system-component-browser { grid-template-columns: minmax(0, 1fr); }
    .system-component-browser__pages { max-height: 240px; }
}

/* Website identity stays visible in every working tab, independently of draft metadata. */
.system-website-template-dialog .system-template-identity {
    display: flex; align-items: center; gap: 16px;
    padding: var(--evosoft-admin-section-padding);
    margin-bottom: var(--evosoft-admin-section-gap);
    border: 1px solid var(--evosoft-admin-border); border-left: 3px solid var(--evosoft-admin-primary);
    border-radius: var(--evosoft-admin-radius); background: #fff; min-width: 0;
}
.system-website-template-dialog .system-template-identity__image {
    width: 76px; height: 50px; flex: 0 0 76px; display: grid; place-items: center;
    background: var(--evosoft-admin-surface-muted); border-radius: var(--evosoft-admin-radius); overflow: hidden;
    color: var(--evosoft-admin-text-secondary);
}
.system-website-template-dialog .system-template-identity__image img { width: 100%; height: 100%; object-fit: cover; }
.system-website-template-dialog .system-template-identity__copy { display: grid; gap: 4px; min-width: 0; flex: 1; }
.system-website-template-dialog .system-template-identity__copy strong { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.system-website-template-dialog .system-template-identity__copy span { font-size: 12px; color: var(--evosoft-admin-text-secondary); }
body:has(.admin-layout) .e-dialog.system-website-template-dialog .system-template-metadata .admin-image-editor--stacked { grid-template-columns: minmax(0, 1fr); }
body:has(.admin-layout) .e-dialog.system-website-template-dialog .system-template-metadata .admin-image-preview { width: 100%; height: auto; aspect-ratio: 16 / 9; }
body:has(.admin-layout) .e-dialog.system-website-template-dialog .system-template-metadata .admin-image-preview img { width: 100%; height: 100%; object-fit: contain; }
.system-website-template-dialog .system-template-readiness { margin-top: var(--evosoft-admin-section-gap); display: grid; gap: var(--evosoft-admin-form-gap); }
.system-website-template-dialog .system-template-section-toolbar > span { font-size: 13px; color: var(--evosoft-admin-text-secondary); }
.system-website-template-dialog .system-template-save-state { margin-right: auto; font-size: 12px; color: var(--evosoft-admin-text-secondary); }
.system-website-template-dialog .system-template-metadata textarea { min-height: 118px; }
/* The preview canvas is an explicit iframe scroll owner, like product/article previews. */
body:has(.admin-layout) .e-dialog.system-website-preview-dialog > .e-dlg-content { display: flex; overflow: hidden; padding-bottom: var(--evosoft-admin-dialog-padding-y); }
.system-website-preview-dialog .system-website-preview-page { display: grid; gap: var(--evosoft-admin-label-gap); flex: 1 1 280px; max-width: 480px; min-width: 0; }
.system-website-preview-dialog .system-website-preview-page label { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.system-website-preview-dialog .system-website-preview-stage--tablet .admin-preview-viewport { width: 768px; }
.system-website-preview-dialog .system-website-preview-error { padding: 10px 12px; border: 1px solid var(--evosoft-admin-border); border-radius: var(--evosoft-admin-radius); color: var(--evosoft-admin-danger); background: var(--evosoft-admin-danger-soft); }
.system-website-preview-dialog .admin-preview-loading { padding: 16px; text-align: center; }
@media (max-width: 768px) {
    .e-dialog.system-website-template-dialog form.system-template-metadata { grid-template-columns: minmax(0, 1fr); }
    .system-website-template-dialog .system-template-identity { flex-wrap: wrap; gap: 10px; }
    .system-website-template-dialog .system-template-identity__copy { flex-basis: calc(100% - 90px); }
    .system-website-template-dialog .system-template-identity > .admin-status { margin-left: auto; }
    .system-website-template-dialog .system-template-save-state { display: none; }
    .system-website-preview-dialog .system-website-preview-page { max-width: none; flex-basis: 100%; }
    .system-website-preview-dialog .admin-preview-tools { width: 100%; }
    .system-website-preview-dialog .admin-preview-switch { flex: 1; }
    .system-website-preview-dialog .admin-preview-switch .e-btn { flex: 1; }
}

.system-imported-layout-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:16px 0;}
.system-imported-layout fieldset{border:0;padding:0;margin:0;min-width:0;}
.system-imported-layout-actions{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px;}
.system-imported-layout-preview{padding:16px;background:var(--admin-bg-subtle,#f7f9fc);overflow:auto;}
.system-imported-layout-preview iframe{display:block;height:520px;max-width:100%;margin:auto;background:white;border:1px solid var(--admin-border,#dce4ef);border-radius:6px;}
@media(max-width:767px){.system-imported-layout-fields{grid-template-columns:1fr;}.system-imported-layout-preview{padding:8px;}}
