.builder-shell {
    height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
}

.builder-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.builder-layout {
    display: grid;
    grid-template-columns: 330px 1fr;
    min-height: 0;
    flex: 1;
}

.builder-sidebar {
    border-right: 1px solid #e5e7eb;
    background: #fff;
    overflow: auto;
}

.sidebar-header {
    display: flex;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-tab {
    flex: 1;
    border: 0;
    background: #fff;
    padding: 12px;
    font-weight: 600;
}

    .sidebar-tab.active {
        background: #f3f4f6;
    }

.sidebar-panel {
    display: none;
    padding: 16px;
}

    .sidebar-panel.active {
        display: block;
    }

.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 12px;
}

.widget-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.widget-tool {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

    .widget-tool:hover {
        background: #f9fafb;
    }

.builder-canvas-wrap {
    background: #f3f4f6;
    overflow: auto;
    padding: 20px;
}

.builder-canvas {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
}

.canvas-empty {
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    padding: 40px;
    text-align: center;
    color: #64748b;
}

.canvas-widget {
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    margin-bottom: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

    .canvas-widget.selected {
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37,99,235,.12);
    }

.canvas-widget-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid #eef2f7;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
}

.canvas-widget-actions {
    display: flex;
    gap: 6px;
}

    .canvas-widget-actions button {
        border: 1px solid #cbd5e1;
        background: #fff;
        border-radius: 8px;
        padding: 3px 8px;
    }

.canvas-widget-body {
    padding: 14px;
}

.dropzone {
    min-height: 90px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 12px;
    background: #f8fafc;
}

    .dropzone.active-dropzone {
        border-color: #2563eb;
        background: #eff6ff;
    }

.dropzone-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 8px;
}

.empty-box {
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    color: #64748b;
    background: #f8fafc;
}

.editable-html {
    min-height: 48px;
}

.heading-preview {
    margin: 0;
}

.media-thumb-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.media-thumb-item {
    position: relative;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

    .media-thumb-item img {
        width: 100%;
        height: 100px;
        object-fit: cover;
        display: block;
    }

    .media-thumb-item a {
        display: block;
        font-size: 12px;
        padding: 6px 8px;
        text-decoration: none;
        color: #0f172a;
    }

.grid-preview {
    display: grid;
    gap: 12px;
}

.btn-preview {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

    .btn-preview.btn-outline {
        border: 1px solid #0d6efd;
        color: #0d6efd;
        background: #fff;
        padding: .5rem .9rem;
        border-radius: .375rem;
        text-decoration: none;
    }

    .btn-preview.btn-solid {
        background: #0d6efd;
        color: #fff;
        padding: .5rem .9rem;
        border-radius: .375rem;
        text-decoration: none;
    }

.prop-group-title {
    font-size: 13px;
    font-weight: 700;
    margin: 18px 0 10px;
    color: #475569;
}

.empty-selection {
    padding: 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
}

#mediaPickerModal .modal-dialog {
    max-width: 950px;
}
