#sl-site-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    padding: 1rem;
}
#sl-site-editor-modal.open {
    display: flex;
}
#sl-site-editor-modal .sl-site-editor-modal-card {
    width: min(100%, 760px);
    max-height: 90vh;
    overflow: auto;
    border: 1px solid rgba(0, 245, 255, 0.3);
    background: rgba(10, 10, 15, 0.96);
    border-radius: 0.8rem;
    padding: 1rem;
    color-scheme: dark;
}
#sl-site-editor-modal .sl-site-editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}
#sl-site-editor-modal label {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.22rem;
}
#sl-site-editor-modal input,
#sl-site-editor-modal textarea {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.75);
    color: #f8fafc;
    border-radius: 0.5rem;
    padding: 0.48rem 0.62rem;
    font-size: 0.8rem;
}
#sl-site-editor-modal .sl-site-editor-color-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
#sl-site-editor-modal .sl-site-editor-color-row input[name] {
    flex: 1 1 auto;
    min-width: 0;
}
#sl-site-editor-modal .sl-site-editor-color-picker {
    width: 2.4rem;
    min-width: 2.4rem;
    height: 2.2rem;
    padding: 0.18rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.85);
    cursor: pointer;
    color-scheme: dark;
}
#sl-site-editor-modal .sl-site-editor-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}
#sl-site-editor-modal .sl-site-editor-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 0.35rem;
}
#sl-site-editor-modal .sl-site-editor-color-picker::-moz-color-swatch {
    border: none;
    border-radius: 0.35rem;
}
#sl-site-editor-modal .sl-site-editor-alpha-row {
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
#sl-site-editor-modal .sl-site-editor-alpha-label {
    font-size: 0.68rem;
    color: #94a3b8;
    min-width: 2.3rem;
}
#sl-site-editor-modal .sl-site-editor-alpha-slider {
    flex: 1 1 auto;
    padding: 0;
}
#sl-site-editor-modal .sl-site-editor-alpha-presets {
    margin-top: 0.35rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
#sl-site-editor-modal .sl-site-editor-alpha-preset-btn {
    border: 1px solid rgba(125, 211, 252, 0.35);
    background: rgba(15, 23, 42, 0.55);
    color: #cbd5e1;
    border-radius: 9999px;
    padding: 0.18rem 0.52rem;
    font-size: 0.66rem;
    line-height: 1.2;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
#sl-site-editor-modal .sl-site-editor-alpha-preset-btn:hover {
    border-color: rgba(0, 245, 255, 0.7);
    color: #a5f3fc;
    background: rgba(8, 47, 73, 0.45);
}
#sl-site-editor-modal .sl-site-editor-alpha-preset-btn.is-active {
    border-color: rgba(0, 245, 255, 0.95);
    color: #00f5ff;
    background: rgba(0, 245, 255, 0.16);
}
#sl-site-editor-modal textarea {
    min-height: 90px;
    resize: vertical;
}
#sl-site-editor-modal #sl-card-description {
    min-height: clamp(150px, 24vh, 240px);
}
#sl-site-editor-modal .sl-site-editor-clamp-card {
    border: 1px solid rgba(0, 245, 255, 0.25);
    border-radius: 0.65rem;
    padding: 0.6rem 0.72rem;
    background: rgba(2, 6, 23, 0.45);
}
#sl-site-editor-modal .sl-site-editor-clamp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.42rem;
}
#sl-site-editor-modal .sl-site-editor-clamp-preview {
    font-size: 0.68rem;
    color: #67e8f9;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: nowrap;
}
#sl-site-editor-modal .sl-site-editor-clamp-note {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}
#sl-site-editor-modal .sl-site-editor-field-note {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-top: 0.35rem;
    line-height: 1.35;
}
#sl-site-editor-modal .sl-site-editor-inline-color-tools {
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}
#sl-site-editor-modal .sl-site-editor-inline-text-color-picker {
    width: 2.4rem;
    min-width: 2.4rem;
    height: 2.2rem;
    padding: 0.18rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.85);
    cursor: pointer;
    color-scheme: dark;
}
#sl-site-editor-modal .sl-site-editor-inline-color-apply-btn {
    border: 1px solid rgba(0, 245, 255, 0.45);
    background: rgba(0, 245, 255, 0.1);
    color: #67e8f9;
    border-radius: 0.5rem;
    padding: 0.42rem 0.62rem;
    font-size: 0.72rem;
    white-space: nowrap;
}
#sl-site-editor-modal .sl-site-editor-inline-color-apply-btn:hover {
    border-color: rgba(0, 245, 255, 0.8);
    color: #a5f3fc;
    background: rgba(6, 182, 212, 0.2);
}
#sl-site-editor-modal .sl-site-editor-inline-color-remove-btn {
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(51, 65, 85, 0.35);
    color: #cbd5e1;
    border-radius: 0.5rem;
    padding: 0.42rem 0.62rem;
    font-size: 0.72rem;
    white-space: nowrap;
}
#sl-site-editor-modal .sl-site-editor-inline-color-save-btn {
    border: 1px solid rgba(163, 230, 53, 0.45);
    background: rgba(163, 230, 53, 0.08);
    color: #d9f99d;
    border-radius: 0.5rem;
    padding: 0.42rem 0.6rem;
    font-size: 0.72rem;
    white-space: nowrap;
}
#sl-site-editor-modal .sl-site-editor-inline-color-save-btn:hover {
    border-color: rgba(163, 230, 53, 0.85);
    color: #ecfccb;
    background: rgba(163, 230, 53, 0.18);
}
#sl-site-editor-modal .sl-site-editor-inline-color-swatches {
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
#sl-site-editor-modal .sl-site-editor-inline-color-swatch {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.4rem;
    border: 2px solid rgba(148, 163, 184, 0.45);
    cursor: pointer;
    padding: 0;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
#sl-site-editor-modal .sl-site-editor-inline-color-swatch:hover {
    transform: scale(1.12);
    border-color: rgba(226, 232, 240, 0.85);
}
#sl-site-editor-modal .sl-site-editor-inline-color-swatch.is-active {
    border-color: #00f5ff;
    box-shadow: 0 0 6px rgba(0, 245, 255, 0.65);
}
#sl-site-editor-modal .sl-site-editor-inline-color-swatch-empty {
    font-size: 0.66rem;
    color: #64748b;
}
#sl-site-editor-modal .sl-site-editor-inline-color-remove-btn:hover {
    border-color: rgba(248, 113, 113, 0.75);
    color: #fecaca;
    background: rgba(127, 29, 29, 0.35);
}
#sl-site-editor-modal .sl-site-editor-clamp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.55rem;
}
#sl-site-editor-modal .sl-site-editor-slider-wrap {
    display: grid;
    gap: 0.2rem;
}
#sl-site-editor-modal .sl-site-editor-slider-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.45rem;
}
#sl-site-editor-modal .sl-site-editor-slider-value {
    font-size: 0.68rem;
    color: #a5f3fc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
#sl-site-editor-modal input[type="range"] {
    padding: 0;
    accent-color: #00f5ff;
    background: transparent;
}
#sl-site-editor-modal .sl-site-editor-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.9rem;
}
#sl-site-editor-modal .sl-site-editor-modal-actions button {
    border-radius: 0.5rem;
    padding: 0.52rem 0.8rem;
    font-size: 0.8rem;
}
#sl-site-editor-modal .sl-site-editor-asset-row {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}
#sl-site-editor-modal .sl-site-editor-asset-row button {
    border: 1px solid rgba(0, 245, 255, 0.45);
    background: rgba(0, 245, 255, 0.1);
    color: #67e8f9;
    border-radius: 0.5rem;
    padding: 0.48rem 0.62rem;
    font-size: 0.75rem;
    white-space: nowrap;
}
#sl-site-editor-modal .sl-site-editor-asset-browser {
    border: 1px solid rgba(0, 245, 255, 0.25);
    border-radius: 0.7rem;
    padding: 0.7rem;
    background: rgba(15, 23, 42, 0.45);
}
#sl-site-editor-modal .sl-site-editor-asset-browser.hidden {
    display: none;
}
#sl-site-editor-modal .sl-site-editor-asset-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-bottom: 0.65rem;
}
#sl-site-editor-modal .sl-site-editor-asset-toolbar input {
    min-width: 180px;
    flex: 1 1 220px;
}
#sl-site-editor-modal .sl-site-editor-asset-folder-select {
    min-width: 180px;
    flex: 1 1 220px;
    background: #0f172a;
    color: #e5e7eb;
    border: 1px solid rgba(71, 85, 105, 0.8);
    border-radius: 0.5rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.82rem;
}
#sl-site-editor-modal .sl-site-editor-asset-toolbar button {
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(51, 65, 85, 0.35);
    color: #e2e8f0;
    border-radius: 0.45rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.75rem;
}
#sl-site-editor-modal .sl-site-editor-asset-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.55rem;
    max-height: 300px;
    overflow: auto;
}
#sl-site-editor-modal .sl-site-editor-asset-item {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(2, 6, 23, 0.65);
    border-radius: 0.55rem;
    padding: 0.4rem;
    color: #d1d5db;
    text-align: left;
    font-size: 0.7rem;
}
#sl-site-editor-modal .sl-site-editor-asset-item:hover {
    border-color: rgba(0, 245, 255, 0.65);
}
#sl-site-editor-modal .sl-site-editor-asset-thumb {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: 0.4rem;
    margin-bottom: 0.35rem;
    background: rgba(15, 23, 42, 0.8);
}
#sl-site-editor-modal .sl-site-editor-asset-empty {
    grid-column: 1 / -1;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 0.55rem;
    padding: 0.75rem;
    color: #94a3b8;
    text-align: center;
    font-size: 0.76rem;
}

/* Dialog layout is separate from public card styles. */
#sl-site-editor-modal .sl-site-editor-modal-card {
    width: min(100%, 1080px);
    max-height: min(92dvh, 1000px);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: #0a0a0f;
}
#sl-site-editor-modal #sl-card-editor-heading {
    padding: 1rem 1.2rem;
    margin: 0;
    border-bottom: 1px solid #263341;
}
#sl-site-editor-form { display: flex; flex-direction: column; min-height: 0; }
#sl-site-editor-modal .sl-editor-body {
    overflow: auto;
    min-height: 0;
    padding: 1rem 1.2rem;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 1.4rem;
    align-items: start;
}
#sl-site-editor-modal .sl-editor-sections { min-width: 0; }
#sl-site-editor-modal .sl-editor-section { border-bottom: 1px solid #263341; }
#sl-site-editor-modal summary { cursor: pointer; color: #dce6ed; padding: 0.8rem 0; font-size: 0.85rem; }
#sl-site-editor-modal .sl-editor-section-value { float: right; color: #94a3b8; font-size: 0.75rem; }
#sl-site-editor-modal .sl-editor-fields { display: grid; gap: 0.9rem; padding: 0.25rem 0 1rem; }
#sl-site-editor-modal .sl-editor-fields > div { min-width: 0; }
#sl-site-editor-modal .sl-editor-content-fields { grid-template-columns: minmax(0, 1fr) 80px; }
#sl-site-editor-modal .sl-editor-content-fields > div:last-child { grid-column: 1 / -1; }
#sl-site-editor-modal #sl-card-description { min-height: 160px; }
#sl-site-editor-modal .sl-editor-preview { position: sticky; top: 0; min-width: 0; }
#sl-site-editor-modal .sl-editor-preview > summary { padding-top: 0.8rem; color: #94a3b8; }
#sl-site-editor-modal #sl-card-preview { overflow-wrap: anywhere; }
#sl-site-editor-modal #sl-card-preview .sl-site-editor-card { width: 100%; min-width: 0; margin: 0; }
#sl-site-editor-modal #sl-card-preview .sl-site-editor-banner-content { padding: 1rem; }
#sl-site-editor-modal .sl-editor-embed-placeholder { padding: 1.5rem 1rem; color: #94a3b8; background: #111827; font-size: 0.8rem; }
#sl-site-editor-modal .sl-editor-text-colors > summary { padding: 0.4rem 0 0; font-size: 0.74rem; color: #67e8f9; }
#sl-site-editor-modal .sl-site-editor-inline-color-swatch-empty { display: none; }
#sl-site-editor-modal .sl-site-editor-modal-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.2rem;
    margin: 0;
    border-top: 1px solid #263341;
    background: #0d111a;
    flex-shrink: 0;
}
#sl-site-editor-modal .sl-site-editor-modal-actions label { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0; color: #dce6ed; }
#sl-site-editor-modal input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: #00f5ff; }
#sl-site-editor-modal .sl-editor-save-hint { flex: 1 1 120px; font-size: 0.72rem; color: #94a3b8; }
#sl-site-editor-modal select { width: 100%; background: #111827; color: #e2e8f0; border: 1px solid #475569; border-radius: 0.5rem; padding: 0.5rem; font-size: 0.8rem; }
#sl-site-editor-modal .sl-editor-link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 0.5rem; align-items: end; }
#sl-site-editor-modal .sl-editor-link-row button,
#sl-site-editor-modal [data-add-link] { padding: 0.45rem; color: #67e8f9; font-size: 0.75rem; justify-self: start; }
#sl-site-editor-modal .sl-site-editor-asset-row input { min-width: 0; }
#sl-site-editor-modal [hidden] { display: none !important; }
#sl-site-editor-modal :focus-visible { outline: 2px solid #00f5ff; outline-offset: 3px; }
@media (max-width: 760px) {
    #sl-site-editor-modal { padding: 0.5rem; }
    #sl-site-editor-modal .sl-editor-body { grid-template-columns: minmax(0, 1fr); padding: 0.75rem; gap: 0.75rem; }
    #sl-site-editor-modal .sl-editor-preview { position: static; }
    #sl-site-editor-modal .sl-editor-save-hint { flex-basis: 100%; order: 1; }
    #sl-site-editor-modal .sl-site-editor-modal-actions { padding: 0.75rem; }
    #sl-site-editor-modal .sl-site-editor-modal-actions label { margin-right: auto; }
    #sl-site-editor-modal .sl-editor-link-row { grid-template-columns: minmax(0, 1fr); }
    #sl-site-editor-modal .sl-site-editor-clamp-header { align-items: start; flex-direction: column; }
    #sl-site-editor-modal .sl-site-editor-clamp-grid { grid-template-columns: minmax(0, 1fr); }
    #sl-site-editor-modal .sl-editor-content-fields { grid-template-columns: minmax(0, 1fr) 64px; }
}
