/* Main Split Layout */
.main-split {
    display: flex;
    gap: 1.25rem;
    height: calc(100vh - 6.25rem);
    padding: 0 1.25rem;
}

.right-panel {
    width: 31rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.right-panel-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 90px;
}

.left-panel {
    flex: 2;
    min-width: 0;
    overflow-y: auto;
}

/* Header */
.header {
    background: var(--studio-panel);
    backdrop-filter: blur(12px);
    padding: 1.25rem 1.875rem;
    border-bottom: 1px solid var(--studio-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    z-index: 100;
}

.header h1 {
    font-size: 1.5rem;
    color: var(--studio-text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-dot {
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 15px var(--primary);
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    /* Stack panels vertically on mobile */
    .main-split {
        flex-direction: column;
        height: auto;
        padding: 0 10px;
    }

    .right-panel,
    .left-panel {
        flex: none;
        width: 100%;
    }

    .toolbar {
        margin-bottom: 20px;
    }

    .toolbar-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .tool-btn {
        flex: 1;
        min-width: 120px;
        flex-direction: column;
        justify-content: center;
    }

    .tool-btn .icon {
        font-size: 2rem;
    }

    .modal-content {
        width: 95%;
    }
}

/* ============================================================ 
   CENTRALIZED POSITIONING ENGINE (The "Pivot" System)
   Used by Editor, CMS, and Live Preview.
   ============================================================ */
.pos-managed-el {
    position: absolute !important;
    left: calc(50% + var(--el-x, 0%)) !important;
    top: calc(50% + var(--el-y, 0%)) !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Force SVGs to be responsive by default (CSS-First approach) */
.svg-template-element {
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.svg-template-element svg {
    width: 100% !important;
    height: 100% !important;
    display: block;
    max-width: 100%;
    object-fit: contain;
}

