.r-block {
}

.menu-tree-item { 
    transition: all 0.2s ease; 
    border-left: 4px solid transparent !important; 
}
.menu-tree-item[data-level="0"] { border-left-color: var(--bs-primary) !important; font-weight: bold; }
.menu-tree-item[data-level="1"] { border-left-color: var(--bs-info) !important; background-color: var(--bs-secondary-bg) !important; }
.menu-tree-item[data-level="2"] { border-left-color: var(--bs-warning) !important; background-color: var(--bs-tertiary-bg) !important; }
.menu-tree-item[data-level="3"] { border-left-color: var(--bs-success) !important; background-color: var(--bs-secondary-bg) !important; }
.menu-tree-item[data-level="4"] { border-left-color: var(--bs-danger) !important; background-color: var(--bs-tertiary-bg) !important; }

.menu-drop-top { border-top: 3px solid var(--bs-primary) !important; }
.menu-drop-bottom { border-bottom: 3px solid var(--bs-primary) !important; }
.menu-drop-child { border: 3px dashed var(--bs-success) !important; background-color: rgba(25, 135, 84, 0.1) !important; transform: scale(0.98); }

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bs-body-bg: #f9fafb;
    --bs-tertiary-bg: #ffffff;
    --bs-secondary-bg: #f3f4f6;
    --bs-border-color: #e5e7eb;
    --bs-body-color: #374151;
    --studio-accent: #4f46e5;
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --studio-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --navbar-color: #1f2937;
    --sidebar-width: 280px;

    /* Sizing tokens */
    --studio-nav-btn-h: 40px;
    --studio-nav-btn-font: 14px;
    --studio-icon-btn: 40px;
    --studio-radius-sm: 8px;
    --studio-radius-md: 12px;
    --studio-radius-lg: 16px;

    /* Typography scale (min 10px for accessibility) */
    --studio-font-2xs: 10px;
    --studio-font-xs: 11px;
    --studio-font-sm: 12px;
    --studio-font-md: 13px;
    --studio-font-base: 14px;

    /* Switch / accent colors */
    --studio-switch-active: #5da8a1;
    --studio-switch-active-rgb: 93, 168, 161;
    --studio-switch-off: var(--bs-border-color);
}

[data-bs-theme="dark"] {
    --bs-body-bg: #111827;
    --bs-tertiary-bg: #1f2937;
    --bs-secondary-bg: #374151;
    --bs-border-color: #374151;
    --bs-body-color: #e5e7eb;
    --navbar-bg: rgba(31, 41, 55, 0.95);
    --navbar-color: #f9fafb;
}

body { 
    min-height: 100vh; 
    height: auto;
    display: flex; 
    flex-direction: column; 
    overflow-x: hidden; 
    background-color: var(--bs-body-bg); 
    color: var(--bs-body-color); 
    transition: background-color 0.3s, color 0.3s; 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    letter-spacing: -0.01em;
}

body.builder-layout {
    height: 100vh !important;
    overflow: hidden !important;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.navbar { 
    flex-shrink: 0; 
    z-index: 1050; 
    background-color: var(--navbar-bg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--navbar-color) !important;
    border-bottom: 1px solid var(--bs-border-color) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
} 
.navbar .navbar-brand { color: var(--navbar-color) !important; }
.navbar .btn { font-family: 'Plus Jakarta Sans', sans-serif; }
.navbar .btn-outline-dark { color: var(--navbar-color) !important; border-color: var(--bs-border-color) !important; }
.navbar .btn-outline-dark:hover { background-color: var(--bs-secondary-bg) !important; }
.navbar .vr { background-color: var(--navbar-color) !important; }

.dropdown-menu {
    z-index: 1060 !important;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid var(--bs-border-color);
}

.main-wrapper { 
    display: flex; 
    flex-grow: 1; 
    overflow: hidden; 
    height: 0;
}

.sidebar { 
    width: var(--sidebar-width); 
    background-color: var(--bs-tertiary-bg) !important; 
    padding: 1rem 1rem;
    flex-shrink: 0; 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; 
    flex-direction: column; 
    border-right: 1px solid var(--bs-border-color) !important; 
    z-index: 100;
    box-shadow: 1px 0 10px rgba(0,0,0,0.01);
} 

.properties-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bs-tertiary-bg) !important;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    flex-direction: column;
    border-left: 1px solid var(--bs-border-color) !important;
    overflow: hidden;
    padding: 0;
    z-index: 100;
    box-shadow: -1px 0 10px rgba(0,0,0,0.01);
}

/* Sidebar Tab Bar */
.sidebar-tab-bar {
    display: flex;
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    flex-shrink: 0;
}
.sidebar-tab {
    flex: 1;
    padding: 8px 0;
    border: none;
    background: none;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bs-secondary-color);
    cursor: pointer;
    transition: color 0.15s, box-shadow 0.15s;
    border-bottom: 2px solid transparent;
}
.sidebar-tab:hover {
    color: var(--bs-body-color);
}
.sidebar-tab.active {
    color: var(--bs-primary);
    border-bottom-color: var(--bs-primary);
}

/* Sidebar AI Chat Panel */
.sidebar-ai-panel {
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

/* Context Header */
.sidebar-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    flex-shrink: 0;
}
.sidebar-ai-context-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bs-body-color);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.sidebar-ai-clear {
    border: none;
    background: none;
    color: var(--bs-secondary-color);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.sidebar-ai-clear:hover {
    color: var(--bs-body-color);
    background: var(--bs-tertiary-bg);
}

/* Messages */
.sidebar-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bs-body-bg);
}

/* Empty State */
.sidebar-ai-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 24px 16px;
    text-align: center;
    gap: 12px;
}
.sidebar-ai-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bs-primary), #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
}
.sidebar-ai-empty p {
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
    margin: 0;
    line-height: 1.5;
}
.sidebar-ai-empty-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}
.sidebar-ai-empty-chip {
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.sidebar-ai-empty-chip:hover {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.05);
    color: var(--bs-primary);
}

/* Typing Indicator */
.sidebar-ai-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    align-self: flex-start;
}
.sidebar-ai-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bs-secondary-color);
    animation: aiTypingBounce 1.4s infinite ease-in-out both;
}
.sidebar-ai-typing-dot:nth-child(1) { animation-delay: 0s; }
.sidebar-ai-typing-dot:nth-child(2) { animation-delay: 0.16s; }
.sidebar-ai-typing-dot:nth-child(3) { animation-delay: 0.32s; }
@keyframes aiTypingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input Area */
.sidebar-ai-input {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-top: 1px solid var(--bs-border-color);
    background: var(--bs-tertiary-bg);
    flex-shrink: 0;
}
.sidebar-ai-input input {
    flex: 1;
    border: 1px solid var(--bs-border-color);
    border-radius: 18px;
    padding: 7px 14px;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s, opacity 0.2s;
    min-width: 0;
}
.sidebar-ai-input input:focus {
    border-color: var(--bs-primary);
}
.sidebar-ai-input input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.sidebar-ai-input button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
}
.sidebar-ai-input button:disabled {
    opacity: 0.4;
}

#sidebar-tab-content { 
    overflow-y: auto; 
    overflow-x: hidden; 
    flex-grow: 1; 
    padding-right: 8px; 
    min-height: 0; 
    scrollbar-width: thin;
    scrollbar-color: var(--bs-border-color) transparent;
}

#sidebar-tab-content::-webkit-scrollbar {
    width: 4px;
}
#sidebar-tab-content::-webkit-scrollbar-track {
    background: transparent;
}
#sidebar-tab-content::-webkit-scrollbar-thumb {
    background-color: var(--bs-border-color);
    border-radius: 20px;
}

#sidebar-tab-content .component-tile {
    width: calc(33.33% - 0.5rem);
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    padding: 1.25rem 0.25rem;
    text-align: center;
    cursor: grab;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    user-select: none;
    position: relative;
    background: var(--bs-tertiary-bg);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--bs-body-color);
}
#sidebar-tab-content .component-tile:hover {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-primary);
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.08);
    transform: translateY(-2px);
}
#sidebar-tab-content .component-tile:active {
    cursor: grabbing;
    transform: scale(0.95);
}
#sidebar-tab-content .component-tile:hover .tile-icon {
    color: var(--bs-primary);
    opacity: 1;
}
#sidebar-tab-content .component-tile:hover .tile-label {
    color: var(--bs-primary);
}

.tile-icon { 
    font-size: 1.4rem; 
    color: var(--bs-body-color);
    opacity: 0.6;
    transition: all 0.2s ease;
}

.tile-label { 
    font-size: 0.68rem; 
    font-weight: 600;
    color: var(--bs-body-color);
    text-transform: capitalize;
    letter-spacing: -0.01em;
}

#sidebar-tab-content h6 {
    font-size: var(--studio-font-2xs);
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--bs-secondary-color);
    margin-top: 1.75rem;
    margin-bottom: 1rem;
    padding: 0 4px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

#sidebar-tab-content h6::after {
    content: "";
    flex-grow: 1;
    height: 1px;
    background: var(--bs-border-color);
    opacity: 0.5;
}

/* Sidebar Collapse */
.sidebar-collapse-btn {
    position: relative;
    z-index: 101;
    width: 20px;
    flex-shrink: 0;
    border: none;
    background: var(--bs-tertiary-bg);
    border-top: 1px solid var(--bs-border-color);
    border-bottom: 1px solid var(--bs-border-color);
    color: var(--bs-secondary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 10px;
    transition: background 0.2s, color 0.2s;
}
.sidebar-collapse-btn:hover {
    background: var(--bs-secondary-bg);
    color: var(--bs-primary);
}
.sidebar-collapse-left {
    border-right: 1px solid var(--bs-border-color);
}
.sidebar-collapse-right {
    border-left: 1px solid var(--bs-border-color);
}
.sidebar.collapsed,
.properties-sidebar.collapsed {
    width: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    border: none !important;
    flex-shrink: 0;
}
body.preview-mode .sidebar-collapse-btn {
    display: none !important;
}

.canvas-container {
    flex-grow: 1; 
    background-color: var(--bs-secondary-bg) !important; 
    padding: 1rem 1rem;
    overflow-y: auto; 
    display: flex;
    flex-direction: column; 
    align-items: center; 
    position: relative; 
    height: 100%; 
}
#builder-canvas {
    background-color: #ffffff !important; /* Always white website background */
    border: 1px solid rgba(0,0,0,0.05) !important;
    box-shadow: 0 15px 45px rgba(0,0,0,0.08) !important;
    width: 100%;
    height: 100%;
    flex-shrink: 0;
}
#builder-canvas.device-desktop { max-width: 100%; } #builder-canvas.device-tablet { max-width: 768px; } #builder-canvas.device-mobile { max-width: 375px; }

#canvas-resizer {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 100px;
    cursor: col-resize;
    z-index: 1000;
    background: var(--bs-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, width 0.2s;
}
#canvas-resizer:hover, #canvas-resizer.is-dragging {
    opacity: 1;
    width: 10px;
}
.canvas-container:hover #canvas-resizer {
    opacity: 0.5;
}
#canvas-resizer::after {
    content: '';
    width: 2px;
    height: 30px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
}
#canvas-width-label {
    position: absolute;
    top: -40px;
    right: 0;
    background: var(--bs-dark);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    display: none;
    pointer-events: none;
}
#builder-canvas:hover #canvas-width-label, #canvas-resizer.is-dragging + #canvas-width-label {
    display: block;
}
body.preview-mode .navbar, 
body.preview-mode .sidebar, 
body.preview-mode .properties-sidebar,
body.preview-mode #canvas-resizer,
body.preview-mode #canvas-width-label,
body.preview-mode #breadcrumb-navigator { 
    display: none !important; 
}
body.preview-mode .main-wrapper {
    height: calc(100vh - 50px);
    margin-top: 50px;
}
body.preview-mode .canvas-container {
    padding: 0 !important;
    background-color: var(--bs-body-bg) !important;
}
body.preview-mode #builder-canvas {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
}
body.preview-mode .builder-column { border-color: transparent; background-color: transparent; } 
body.preview-mode [data-id] { border-color: transparent !important; background-color: transparent !important; padding: 0; cursor: default; } 
body.preview-mode [contenteditable="true"] { pointer-events: none; } 
body.preview-mode .video-overlay, body.preview-mode .map-overlay { display: none !important; }

/* Preview page tabs (onboarding preview) */
#preview-page-tabs { max-width: 50vw; scrollbar-width: none; }
#preview-page-tabs::-webkit-scrollbar { display: none; }
.preview-page-tab.active { background: rgba(255,255,255,0.2) !important; border-color: rgba(255,255,255,0.5) !important; }

.active-swatch {
    outline: 2px solid var(--bs-primary);
    outline-offset: 1px;
    z-index: 2;
}
.border-dashed {
    border-style: dashed !important;
}
.color-swatch-item {
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.color-swatch-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stock-img-btn, .icon-grid-item { cursor: pointer; transition: transform 0.2s; border-radius: 4px; } .stock-img-btn { width: 100%; height: 120px; object-fit: cover; } .stock-img-btn:hover { transform: scale(1.05); } .icon-grid-item { font-size: 1.5rem; padding: 10px; text-align: center; border: 1px solid transparent; } .icon-grid-item:hover { transform: scale(1.2); border-color: var(--bs-border-color); background: var(--bs-tertiary-bg); }

#templates-grid {
    min-height: 70vh;
    align-content: flex-start;
}

.template-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.template-card:hover {
    transform: translateY(-10px);
    border-color: var(--bs-primary) !important;
}
.tpl-preview-box {
    background: var(--bs-secondary-bg);
    height: 160px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.25rem;
    border: 1px solid var(--bs-border-color);
}
.tpl-preview-skeleton {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
}
.skel-nav { height: 12px; width: 100%; background: var(--bs-tertiary-bg); border-radius: 4px; }
.skel-hero { height: 60px; width: 100%; background: var(--bs-primary); opacity: 0.2; border-radius: 4px; }
.skel-block { height: 25px; width: 80%; background: var(--bs-tertiary-bg); border-radius: 4px; align-self: center; }
.skel-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; height: 30px; }
.skel-footer { height: 15px; width: 100%; background: var(--bs-tertiary-bg); border-radius: 4px; margin-top: auto; }

/* Category Pills */
.cat-filter { font-weight: bold; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Command Palette Styles */
.cp-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    color: var(--bs-body-color);
}
.cp-item:hover, .cp-item.active {
    background: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
}
.cp-item-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-body-bg);
    border-radius: 6px;
    margin-right: 12px;
    font-size: 1.2rem;
}
.cp-item-label { font-weight: 600; font-size: 0.95rem; }
.cp-item-type { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--bs-secondary-color); margin-left: auto; }
.cp-section-header { font-size: 0.7rem; font-weight: 800; color: var(--bs-primary); text-transform: uppercase; letter-spacing: 1px; padding: 12px 16px 4px; }

/* Floating Preview Styles */
#component-preview-popup {
    position: fixed;
    z-index: 10000;
    width: 350px;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    pointer-events: none;
    display: none;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}
#component-preview-popup.show {
    display: block;
    transform: scale(1);
    opacity: 1;
}
.preview-header {
    background: var(--bs-secondary-bg);
    padding: 8px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--bs-primary);
    border-bottom: 1px solid var(--bs-border-color);
}
.preview-content {
    padding: 20px;
    transform: scale(0.6);
    transform-origin: top left;
    width: 166.67%; /* 100% / 0.6 — compensate for scale not affecting layout box */
    pointer-events: none;
}
.preview-content * { pointer-events: none !important; }

/* Theme Swatches in Sidebar */
.theme-swatch {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.1);
    transition: transform 0.1s;
}
.theme-swatch:hover { transform: scale(1.2); z-index: 2; }
.dropdown-submenu { position: relative; } .dropdown-submenu > .dropdown-menu { top: 0; left: 100%; margin-top: -6px; margin-left: -1px; } .dropdown-submenu:hover > .dropdown-menu { display: block; } .menu-tree-list { list-style: none; padding-left: 0; margin: 0; } .menu-tree-list ul { padding-left: 1.5rem; margin-top: 0.5rem; border-left: 2px dashed var(--bs-border-color); } .menu-row { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: 6px; padding: 8px; transition: all 0.2s; display: flex; align-items: center; gap: 8px; } .menu-row.is-dragging-menu { opacity: 0.5; border: 1px dashed var(--bs-primary); } .menu-drop-before { border-top: 4px solid var(--bs-primary) !important; } .menu-drop-after { border-bottom: 4px solid var(--bs-primary) !important; } .menu-drop-inside { background-color: rgba(var(--bs-primary-rgb), 0.1) !important; transform: translateX(10px); } .menu-settings-panel { background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-top: none; padding: 12px; display: none; margin-bottom: 8px; } .menu-settings-panel.show { display: block; }
#component-search {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    transition: all 0.2s;
}
#component-search:focus {
    background-color: transparent !important;
}
.search-wrapper .input-group:focus-within {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.15) !important;
}
#sidebar-tabs {
    background-color: var(--bs-tertiary-bg);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 1.5rem; 
    border: 1px solid var(--bs-border-color);
}
#sidebar-tabs .nav-item {
    flex: 1;
}
#sidebar-tabs .nav-link {
    border-radius: 8px;
    border: none;
    color: var(--bs-secondary-color);
    font-size: var(--studio-font-2xs);
    padding: 8px 4px;
    transition: all 0.2s ease;
    background: transparent;
}
#sidebar-tabs .nav-link:hover {
    color: var(--bs-body-color);
    background: rgba(255,255,255,0.05);
}
#sidebar-tabs .nav-link.active {
    background-color: var(--bs-body-bg);
    color: var(--bs-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
#sidebar-tabs .nav-link i {
    font-size: 0.9rem;
}
#dom-layers-container { font-size: 0.85rem; }
.layer-item { 
    display: flex; 
    align-items: center; 
    padding: 6px 8px; 
    border: 1px solid transparent; 
    border-radius: 4px; 
    margin-bottom: 2px; 
    cursor: pointer; 
    transition: background-color 0.2s; 
    color: var(--bs-body-color); 
    position: relative;
}
.layer-item:hover { background-color: var(--bs-secondary-bg); border-color: var(--bs-border-color); }
.layer-item.active { background-color: var(--bs-primary) !important; color: #fff !important; border-color: var(--bs-primary); font-weight: bold; box-shadow: 0 2px 6px rgba(79,70,229,0.2); }
.layer-item.active i, .layer-item.active span { color: #fff !important; opacity: 1 !important; }
.layer-item-icon { color: var(--bs-secondary-color); margin-right: 8px; opacity: 0.7; }

/* Nesting depth indicators */
.layer-item::before {
    content: "";
    position: absolute;
    left: var(--depth-px, 0px);
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--bs-border-color);
    opacity: 0.3;
}
.layer-children-group {
    padding-left: 10px;
    border-left: 1px dashed var(--bs-border-color);
    margin-left: 14px;
}
.layer-node {
    position: relative;
}

.pages-manager-container {
    min-height: 200px;
    background: var(--bs-tertiary-bg);
    padding: 15px;
    border-radius: 12px;
    border: 1px dashed var(--bs-border-color);
}

.image-overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}
[data-id] img {
    position: relative;
    z-index: 0;
}
@keyframes ai-glow { 0% { box-shadow: 0 0 5px rgba(255, 193, 7, 0.5); } 50% { box-shadow: 0 0 15px rgba(255, 193, 7, 0.8); } 100% { box-shadow: 0 0 5px rgba(255, 193, 7, 0.5); } }
 .ai-processing { animation: ai-glow 1.5s infinite; pointer-events: none; opacity: 0.8; }
::-webkit-scrollbar { width: 8px; height: 8px; } 
::-webkit-scrollbar-track { background: transparent; } 
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; } 
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); background-clip: content-box; }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); background-clip: content-box; }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); background-clip: content-box; }

/* Gallery Editor Styles */
#gallery-items-container .gallery-edit-item {
    cursor: default;
}
#gallery-items-container .card {
    transition: transform 0.2s, box-shadow 0.2s;
}
#gallery-items-container .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
}
.cursor-move {
    cursor: move;
}
.gallery-edit-item.opacity-50 {
    opacity: 0.5;
}

.pricing-toggle-wrapper {
    user-select: none;
}

/* Quote Component Styles */
.quote-style-card {
    background: var(--bs-body-bg);
    padding: 2.5rem !important;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05) !important;
    border: none !important;
}
.quote-style-bordered {
    background: transparent;
    padding: 2.5rem !important;
    border-radius: 1rem;
    border: 2px solid var(--bs-border-color) !important;
    box-shadow: none !important;
}
.quote-style-minimal {
    background: transparent;
    padding: 1.5rem 0 !important;
    border-radius: 0;
    border: none !important;
    box-shadow: none !important;
}
.quote-item-container .italic {
    font-style: italic;
}

/* Team Component Styles */
.team-style-classic {
    background: transparent;
}
.team-style-card {
    background: var(--bs-body-bg);
    padding: 2rem !important;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.team-style-minimal {
    padding: 1rem !important;
}
.team-member-container.rounded-circle .team-photo {
    border-radius: 50% !important;
}
.team-member-container.rounded-0 .team-photo {
    border-radius: 0 !important;
}

/* Team Hover Overlay Styles */
.team-style-overlay .team-overlay-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(var(--bs-primary-rgb), 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}
.team-style-overlay:hover .team-overlay-content {
    opacity: 1;
}
.team-style-overlay .team-social-links .btn {
    color: white;
    border-color: rgba(255,255,255,0.5);
}
.team-style-overlay .team-social-links .btn:hover {
    background: white;
    color: var(--bs-primary);
}

/* Interactive Hover Zoom */
.team-photo-wrapper {
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tabs Sizing & Animations */
.tabs-sm .nav-link { padding: 0.25rem 0.5rem; font-size: 0.875rem; }
.tabs-lg .nav-link { padding: 1rem 1.5rem; font-size: 1.25rem; }

.tabs-vertical .nav-link {
    text-align: left;
    margin-bottom: 5px;
}

.nav-tabs {
    padding: 0 !important;
    margin: 0 !important;
}

/* Grid Resizer Styles */
.resizer-ghost-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bs-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
}


/* Breadcrumb Navigator Styles */
#breadcrumb-navigator {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    padding: 4px;
    border-radius: 12px;
    font-size: var(--studio-font-xs);
    display: none;
    align-items: center;
    gap: 2px;
    z-index: 1050;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    user-select: none;
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.03);
    max-width: 90%;
}
#breadcrumb-navigator.show {
    opacity: 1;
}
.bc-item {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: var(--bs-secondary-color);
    padding: 5px 10px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-size: var(--studio-font-xs);
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.bc-item i {
    font-size: 12px;
    opacity: 0.6;
}
.bc-item:hover {
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.08);
}
.bc-item:hover i {
    opacity: 1;
}
.bc-item.active {
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.1);
    cursor: default;
    font-weight: 700;
}
.bc-item.active i {
    opacity: 1;
}
.bc-sep {
    color: var(--bs-body-color);
    opacity: 0.15;
    font-size: 10px;
    flex-shrink: 0;
}
.bc-depth {
    font-size: var(--studio-font-2xs);
    font-weight: 700;
    color: var(--bs-secondary-color);
    background: var(--bs-secondary-bg);
    border-radius: 4px;
    padding: 0 4px;
    line-height: 16px;
    opacity: 0.6;
}

/* Inspector Toolbar */
.inspector-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    flex-shrink: 0;
    z-index: 10;
}
.inspector-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.inspector-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--bs-secondary-color);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}
.inspector-action-btn:hover {
    background: var(--bs-secondary-bg);
    color: var(--bs-primary);
}
.inspector-action-btn:disabled {
    opacity: 0.3;
    cursor: default;
}
.inspector-action-btn:disabled:hover {
    background: transparent;
    color: var(--bs-secondary-color);
}
.inspector-action-btn--danger:hover {
    color: var(--bs-danger);
    background: rgba(var(--bs-danger-rgb), 0.08);
}
.inspector-action-sep {
    width: 1px;
    height: 16px;
    background: var(--bs-border-color);
    margin: 0 2px;
}

/* Property Sidebar Tabs */
.properties-sidebar .prop-tabs {
    padding: 6px;
    border-radius: 12px;
}
.properties-sidebar .prop-tabs .nav-link {
    border: none;
    font-size: var(--studio-font-2xs);
    text-transform: capitalize;
    letter-spacing: 0;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 600;
    opacity: 0.7;
}
.properties-sidebar .prop-tabs .nav-link.active {
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    opacity: 1;
}
.properties-sidebar .prop-tabs .nav-link:hover:not(.active) {
    opacity: 1;
}

/* Property Wrapper & Labels */
.properties-sidebar .prop-wrapper label {
    font-size: var(--studio-font-xs);
    font-weight: 600;
    color: var(--bs-secondary-color);
    margin-bottom: 8px;
    letter-spacing: 0;
}
.properties-sidebar .prop-input,
.properties-sidebar .class-add-input {
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-secondary-bg);
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    color: var(--bs-body-color);
    transition: all 0.2s ease;
}
.properties-sidebar .prop-input:focus,
.properties-sidebar .class-add-input:focus {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.05);
    outline: none;
}

.properties-sidebar .prop-group-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--bs-body-color);
    padding: 1rem 0;
    border-bottom: 1px solid var(--bs-border-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.properties-sidebar .prop-group-header i { color: var(--bs-primary); font-size: 1rem; }

.properties-sidebar .prop-input.form-control-color {
    padding: 2px;
}

/* Professional Navbar Styling */
.navbar .btn-outline-light.border-0 {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    opacity: 0.85;
}
.navbar .btn-outline-light.border-0:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    opacity: 1;
    transform: translateY(-1px);
}
.navbar .btn-outline-light.border-0:active {
    transform: translateY(0);
}
.navbar .navbar-brand {
    transition: transform 0.3s ease;
}
.navbar .navbar-brand:hover {
    transform: scale(1.02);
}
.navbar .vr {
    align-self: center;
}
.navbar .dropdown-menu {
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2) !important;
}
.navbar .dropdown-item {
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.6rem 1rem;
}
.navbar .dropdown-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
    color: var(--bs-primary) !important;
    padding-left: 1.25rem;
}
.navbar .rounded-pill {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

/* --- God Tier Site Structure Manager --- */
.page-row {
    color: var(--bs-body-color);
    position: relative;
    user-select: none;
    cursor: pointer;
}
.page-row:hover {
    background-color: var(--bs-secondary-bg);
}
.page-row.active-page {
    background-color: var(--bs-primary-bg-subtle) !important;
    color: var(--bs-primary) !important;
}
.page-row.active-page .page-name {
    font-weight: 800 !important;
}

/* Tree Guide Lines */
.tree-line {
    border-left: 1px dashed var(--bs-border-color);
    position: absolute;
    height: 100%;
    top: -10px;
    left: -12px;
}
.tree-line-hor {
    border-top: 1px dashed var(--bs-border-color);
    position: absolute;
    width: 10px;
    top: 50%;
    left: -12px;
}

/* Drag & Drop Indicators */
.page-drop-before {
    box-shadow: 0 -2px 0 0 var(--bs-primary) !important;
}
.page-drop-after {
    box-shadow: 0 2px 0 0 var(--bs-primary) !important;
}
.page-drop-inside {
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
    outline: 1px dashed var(--bs-primary) !important;
    border-radius: 8px;
}

.is-dragging-page {
    opacity: 0.4;
    transform: scale(0.98);
}

/* Inline Actions */
.page-row .page-hover-actions {
    transition: opacity 0.2s;
}
.page-row:hover .page-hover-actions {
    opacity: 1 !important;
}

.btn-xs {
    padding: 1px 5px;
    font-size: 0.75rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

/* AI Copilot Positioning & Layering */
.z-9999 { z-index: 9999 !important; }

/* Chat Messages */
.ai-chat-msg {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.83rem;
    line-height: 1.5;
    max-width: 90%;
    animation: aiFadeIn 0.3s ease;
}
@keyframes aiFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ai-chat-msg-ai {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    align-self: flex-start;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.ai-chat-msg-user {
    background: var(--bs-primary);
    color: #fff;
    align-self: flex-end;
}

/* Chat Chips */
.ai-chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
    animation: aiFadeIn 0.3s ease;
}
.ai-chat-chip {
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid var(--bs-primary);
    background: var(--bs-tertiary-bg);
    color: var(--bs-primary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.ai-chat-chip:hover {
    background: var(--bs-primary);
    color: #fff;
}

/* Progress Messages */
.ai-chat-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #6c757d;
    padding: 4px 0;
    animation: aiFadeIn 0.3s ease;
}
.ai-chat-progress .bi-check-circle-fill {
    color: var(--accent-success, #10b981);
    font-size: 0.82rem;
}

/* --- Suggestive Toggles (Checkboxes & Switches) --- */
.form-check-input {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.form-check-input:checked {
    background-color: var(--studio-switch-active) !important;
    border-color: var(--studio-switch-active) !important;
}

.form-switch .form-check-input {
    width: 2.2em;
    height: 1.1em;
    background-color: var(--studio-switch-off);
    border-color: var(--studio-switch-off);
}

.form-switch .form-check-input:checked {
    filter: drop-shadow(0 0 4px rgba(var(--studio-switch-active-rgb), 0.4));
}

.form-check.form-switch {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

/* Suggestive Container feedback when active */
.form-check.form-switch:has(.form-check-input:checked) {
    background-color: rgba(var(--studio-switch-active-rgb), 0.05) !important;
    border-color: rgba(var(--studio-switch-active-rgb), 0.2) !important;
}

.form-check.form-switch:has(.form-check-input:checked) label {
    color: #059669 !important; /* Darker emerald for text contrast */
}

/* Hover feedback */
.form-check-input:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.1);
}

/* Focus state */
.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(var(--studio-switch-active-rgb), 0.15);
    border-color: var(--studio-switch-active);
}

/* ─── Builder Utility Classes ─── */
.builder-nav-btn { font-size: var(--studio-nav-btn-font); height: var(--studio-nav-btn-h); }
.builder-icon-btn { width: var(--studio-icon-btn); height: var(--studio-icon-btn); padding: 0; }
.builder-icon-btn-lg { width: 42px; height: 42px; padding: 0; }
.builder-dropdown { min-width: 300px; border-radius: var(--studio-radius-md); overflow: hidden; background: var(--bs-tertiary-bg); margin-top: 0.5rem; }
.builder-dropdown-item { font-size: var(--studio-font-sm); }
.builder-micro-label { font-size: var(--studio-font-2xs); text-transform: uppercase; letter-spacing: 0.5px; }

/* Compact subheader overrides */
.builder-main-nav .builder-nav-btn { font-size: 12px; height: 34px; }
.builder-main-nav .builder-icon-btn { width: 34px; height: 34px; }
.builder-main-nav .builder-icon-btn-lg { width: 34px; height: 34px; }

/* Dev Mode Toggle */
#btn-dev-mode { border: 1px solid var(--bs-border-color); background: transparent; color: var(--bs-body-color); }
#btn-dev-mode.active { background: var(--bs-info); color: #fff; border-color: var(--bs-info); }
.dev-mode-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bs-secondary); flex-shrink: 0; }
.dev-mode-dot.live { background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: dev-pulse 1.5s infinite; }
@keyframes dev-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 50% { box-shadow: 0 0 0 5px rgba(34,197,94,0); } }

/* Save State Indicator */
.save-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 16px;
    border-radius: 50%;
    transition: color 0.4s, background-color 0.4s, box-shadow 0.4s, transform 0.3s;
}
.save-indicator[data-state="idle"] {
    color: #adb5bd;
    background: rgba(173, 181, 189, 0.08);
    box-shadow: none;
}
.save-indicator[data-state="saved"] {
    color: #fff;
    background: #198754;
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.2), 0 2px 8px rgba(25, 135, 84, 0.3);
    animation: save-pop 0.4s ease-out;
}
.save-indicator[data-state="saving"] {
    color: var(--studio-accent, #6366f1);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.save-indicator[data-state="error"] {
    color: #fff;
    background: #dc3545;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.2), 0 2px 8px rgba(220, 53, 69, 0.3);
    animation: save-shake 0.4s ease-out;
}
@keyframes save-spin {
    to { transform: rotate(360deg); }
}
@keyframes save-pop {
    0%   { transform: scale(0.5); opacity: 0.4; }
    60%  { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes save-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-3px); }
    40%      { transform: translateX(3px); }
    60%      { transform: translateX(-2px); }
    80%      { transform: translateX(2px); }
}
.save-indicator[data-state="saving"] i {
    animation: save-spin 0.8s linear infinite;
}

/* Undo Toast */
.undo-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 100001;
    background: #1a1d23;
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    font-family: system-ui, -apple-system, sans-serif;
}
.undo-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.undo-toast-btn {
    background: var(--studio-accent);
    color: #fff;
    border: none;
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.undo-toast-btn:hover { filter: brightness(1.15); }
.undo-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--studio-accent);
    border-radius: 0 0 10px 10px;
    transition: width linear;
}

/* Offline Banner */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100002;
    background: #fbbf24;
    color: #78350f;
    text-align: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}
.offline-banner.visible {
    transform: translateY(0);
}
.sidebar-tab-label { font-size: var(--studio-font-xs); }

/* Integration Groups & Cards */
.int-group-header { transition: background .15s; }
.int-group-header:hover { background: var(--bs-tertiary-bg) !important; }
.int-card { transition: border-color 0.15s; border-color: var(--bs-border-color) !important; }
.int-card-active { border-left: 3px solid #22c55e !important; }
.int-card-header { transition: background .1s; }
.int-card-header:hover { background: var(--bs-secondary-bg); }
.int-card .int-value { transition: border-color 0.15s; }
.int-card .int-value:focus { background: var(--bs-body-bg) !important; box-shadow: none; }
.int-card .int-status { transition: opacity 0.2s; }
.int-card .int-dot { transition: background 0.3s; }
.int-card .form-check-input { width: 2.2em; height: 1.15em; cursor: pointer; }
.int-card .form-check-input:checked { background-color: #22c55e; border-color: #22c55e; }

/* Property Panel Utility Classes */
.prop-micro-label { font-size: var(--studio-font-2xs); text-transform: uppercase; }
.prop-color-swatch { width: 24px; height: 24px; }
.prop-color-input { width: 32px; height: 32px; border-radius: var(--studio-radius-sm); }
.prop-hex-input { font-size: var(--studio-font-xs); height: 32px; padding-left: 8px; }
.prop-theme-swatch { width: 20px; height: 20px; }
.prop-bs-swatch { min-height: 45px; position: relative; }
.prop-bs-swatch-label { font-size: var(--studio-font-2xs); font-weight: bold; text-align: center; line-height: 1; }

/* ─── Section Preview Thumbnails ─── */
.section-preview-thumb {
    width: 60px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 6px;
    background: var(--bs-secondary-bg, #f3f4f6);
    border: 1px solid var(--bs-border-color, #e5e7eb);
    position: relative;
    overflow: hidden;
}
.section-preview-thumb::before,
.section-preview-thumb::after {
    content: '';
    position: absolute;
    border-radius: 2px;
}

/* hero-center: centered horizontal bars */
.section-preview-thumb[data-pattern="hero-center"]::before {
    width: 30px; height: 4px;
    top: 12px; left: 50%; transform: translateX(-50%);
    background: var(--bs-primary, #4f46e5);
}
.section-preview-thumb[data-pattern="hero-center"]::after {
    width: 20px; height: 4px;
    top: 20px; left: 50%; transform: translateX(-50%);
    background: var(--bs-primary, #4f46e5); opacity: 0.4;
}

/* hero-split: two vertical blocks */
.section-preview-thumb[data-pattern="hero-split"]::before {
    width: 26px; height: 28px;
    top: 6px; left: 4px;
    background: var(--bs-primary, #4f46e5); opacity: 0.3;
}
.section-preview-thumb[data-pattern="hero-split"]::after {
    width: 22px; height: 28px;
    top: 6px; right: 4px;
    background: var(--bs-primary, #4f46e5); opacity: 0.6;
}

/* cards-3: three columns */
.section-preview-thumb[data-pattern="cards-3"]::before {
    width: 14px; height: 24px;
    top: 8px; left: 4px;
    background: var(--bs-primary, #4f46e5); opacity: 0.3;
    box-shadow: 19px 0 0 0 rgba(79,70,229,0.3), 38px 0 0 0 rgba(79,70,229,0.3);
}

/* cards-4: 2x2 grid */
.section-preview-thumb[data-pattern="cards-4"]::before {
    width: 24px; height: 14px;
    top: 4px; left: 4px;
    background: var(--bs-primary, #4f46e5); opacity: 0.3;
    box-shadow: 28px 0 0 0 rgba(79,70,229,0.3);
}
.section-preview-thumb[data-pattern="cards-4"]::after {
    width: 24px; height: 14px;
    bottom: 4px; left: 4px;
    background: var(--bs-primary, #4f46e5); opacity: 0.25;
    box-shadow: 28px 0 0 0 rgba(79,70,229,0.25);
}

/* split: two unequal columns */
.section-preview-thumb[data-pattern="split"]::before {
    width: 32px; height: 28px;
    top: 6px; left: 4px;
    background: var(--bs-primary, #4f46e5); opacity: 0.25;
}
.section-preview-thumb[data-pattern="split"]::after {
    width: 18px; height: 28px;
    top: 6px; right: 4px;
    background: var(--bs-primary, #4f46e5); opacity: 0.5;
}

/* icon-grid: small circles grid */
.section-preview-thumb[data-pattern="icon-grid"]::before {
    width: 8px; height: 8px;
    top: 8px; left: 8px;
    border-radius: 50%;
    background: var(--bs-primary, #4f46e5); opacity: 0.4;
    box-shadow: 14px 0 0 0 rgba(79,70,229,0.4), 28px 0 0 0 rgba(79,70,229,0.4);
}
.section-preview-thumb[data-pattern="icon-grid"]::after {
    width: 8px; height: 8px;
    bottom: 8px; left: 8px;
    border-radius: 50%;
    background: var(--bs-primary, #4f46e5); opacity: 0.3;
    box-shadow: 14px 0 0 0 rgba(79,70,229,0.3), 28px 0 0 0 rgba(79,70,229,0.3);
}

/* centered: centered bar + button */
.section-preview-thumb[data-pattern="centered"]::before {
    width: 30px; height: 4px;
    top: 12px; left: 50%; transform: translateX(-50%);
    background: var(--bs-primary, #4f46e5); opacity: 0.5;
}
.section-preview-thumb[data-pattern="centered"]::after {
    width: 18px; height: 6px;
    top: 22px; left: 50%; transform: translateX(-50%);
    background: var(--bs-primary, #4f46e5); opacity: 0.7;
    border-radius: 3px;
}

/* form-split: column + dashed form column */
.section-preview-thumb[data-pattern="form-split"]::before {
    width: 24px; height: 28px;
    top: 6px; left: 4px;
    background: var(--bs-primary, #4f46e5); opacity: 0.25;
}
.section-preview-thumb[data-pattern="form-split"]::after {
    width: 24px; height: 28px;
    top: 6px; right: 4px;
    border: 1.5px dashed var(--bs-primary, #4f46e5);
    opacity: 0.5;
    background: transparent;
}

/* gallery: 2x2 image blocks */
.section-preview-thumb[data-pattern="gallery"]::before {
    width: 24px; height: 14px;
    top: 4px; left: 4px;
    background: var(--bs-primary, #4f46e5); opacity: 0.35;
    box-shadow: 28px 0 0 0 rgba(79,70,229,0.35);
}
.section-preview-thumb[data-pattern="gallery"]::after {
    width: 24px; height: 14px;
    bottom: 4px; left: 4px;
    background: var(--bs-primary, #4f46e5); opacity: 0.25;
    box-shadow: 28px 0 0 0 rgba(79,70,229,0.25);
}

/* list: stacked horizontal bars */
.section-preview-thumb[data-pattern="list"]::before {
    width: 44px; height: 4px;
    top: 8px; left: 8px;
    background: var(--bs-primary, #4f46e5); opacity: 0.4;
    box-shadow: 0 8px 0 0 rgba(79,70,229,0.3), 0 16px 0 0 rgba(79,70,229,0.2);
}

/* stats: vertical bar chart */
.section-preview-thumb[data-pattern="stats"]::before {
    width: 8px; height: 20px;
    bottom: 6px; left: 10px;
    background: var(--bs-primary, #4f46e5); opacity: 0.5;
    box-shadow: 14px 6px 0 0 rgba(79,70,229,0.4), 28px 3px 0 0 rgba(79,70,229,0.3);
}

/* single: single centered block */
.section-preview-thumb[data-pattern="single"]::before {
    width: 36px; height: 24px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bs-primary, #4f46e5); opacity: 0.3;
}

/* ─── Section Card Tiles (inline preview) ─── */
.section-tile-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    overflow: hidden;
    cursor: grab;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bs-tertiary-bg);
    user-select: none;
    content-visibility: auto;
    contain-intrinsic-size: auto 134px;
}
.section-tile-card:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 4px 16px rgba(79,70,229,0.12);
    transform: translateY(-2px);
}
.section-tile-card:active {
    cursor: grabbing;
    transform: scale(0.98);
}
.section-tile-preview {
    width: 100%;
    height: 100px;
    overflow: hidden;
    position: relative;
    background: #ffffff;
    pointer-events: none;
}
.section-tile-preview-inner {
    width: 1140px;
    transform: scale(0.217);
    transform-origin: top left;
    pointer-events: none;
}
.section-tile-preview-inner:empty {
    width: 100%;
    height: 100%;
    transform: none;
    background: linear-gradient(90deg, var(--bs-secondary-bg, #f3f4f6) 25%, var(--bs-border-color, #e5e7eb) 50%, var(--bs-secondary-bg, #f3f4f6) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}
@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.section-tile-info {
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: 1px solid var(--bs-border-color);
}
.section-tile-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--bs-body-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Section Hover Preview Panel ─── */
.section-preview-panel {
    position: fixed;
    z-index: 200;
    width: 480px;
    border-radius: 12px;
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-8px) scale(0.97);
    transition: opacity 0.2s ease, transform 0.2s ease;
    background: #ffffff;
}
.section-preview-panel.visible {
    opacity: 1;
    transform: translateX(0) scale(1);
}
.section-preview-panel-header {
    padding: 8px 14px;
    background: var(--bs-secondary-bg, #f3f4f6);
    border-bottom: 1px solid var(--bs-border-color);
    font-size: 11px;
    font-weight: 700;
    color: var(--bs-body-color);
    display: flex;
    align-items: center;
    gap: 6px;
}
.section-preview-panel-header i {
    color: var(--bs-primary);
    font-size: 13px;
}
.section-preview-iframe-wrap {
    height: 300px;
    overflow: hidden;
}
.section-preview-iframe {
    border: none;
    width: 1140px;
    height: 800px;
    transform: scale(0.421); /* 480 / 1140 */
    transform-origin: top left;
    pointer-events: none;
}

/* ─── Settings Page ─── */
.settings-page { min-height: 70vh; }

.settings-sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    color: var(--bs-body-color);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.settings-sidebar .nav-link:hover {
    background: var(--bs-secondary-bg);
    color: var(--bs-primary);
}
.settings-sidebar .nav-link.active {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    font-weight: 600;
}
.settings-sidebar .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.settings-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bs-primary), #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Theme Selector Cards */
.theme-option {
    cursor: pointer;
}
.theme-option-card {
    border: 2px solid var(--bs-border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    width: 140px;
}
.theme-option-card:hover {
    border-color: var(--bs-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.15);
}
.theme-option-card.active {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.2);
}
.theme-option-label {
    padding: 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bs-body-color);
}

/* Theme Preview Mini Mockups */
.theme-preview {
    height: 80px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.theme-preview .tp-bar {
    height: 8px;
    border-radius: 3px;
}
.theme-preview .tp-body {
    flex: 1;
    display: flex;
    gap: 4px;
}
.theme-preview .tp-sidebar {
    width: 30%;
    border-radius: 3px;
}
.theme-preview .tp-content {
    flex: 1;
    border-radius: 3px;
}

.theme-preview-light {
    background: #f3f4f6;
}
.theme-preview-light .tp-bar { background: #fff; border: 1px solid #e5e7eb; }
.theme-preview-light .tp-sidebar { background: #fff; border: 1px solid #e5e7eb; }
.theme-preview-light .tp-content { background: #fff; border: 1px solid #e5e7eb; }

.theme-preview-dark {
    background: #1f2937;
}
.theme-preview-dark .tp-bar { background: #374151; }
.theme-preview-dark .tp-sidebar { background: #374151; }
.theme-preview-dark .tp-content { background: #374151; }

.theme-preview-system {
    background: linear-gradient(135deg, #f3f4f6 50%, #1f2937 50%);
}
.theme-preview-system .tp-bar { background: linear-gradient(90deg, #fff 50%, #374151 50%); border: 1px solid #e5e7eb; }
.theme-preview-system .tp-sidebar { background: linear-gradient(180deg, #fff 50%, #374151 50%); }
.theme-preview-system .tp-content { background: linear-gradient(180deg, #fff 50%, #374151 50%); }

@media (max-width: 767.98px) {
    .settings-sidebar {
        flex-direction: row !important;
        overflow-x: auto;
        gap: 0.25rem !important;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--bs-border-color);
        margin-bottom: 1rem;
    }
    .settings-sidebar .nav-link span { font-size: 0.78rem; }
    .settings-sidebar .nav-link i { margin-right: 0.35rem !important; }
    .settings-avatar { width: 48px; height: 48px; font-size: 1.2rem; }
}

/* --- Auth Pages --- */
body.auth-page { background: linear-gradient(135deg, #0d0f1a 0%, #1a1f3a 50%, #0d1117 100%); min-height: 100vh; }
.auth-card { border-radius: 20px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.04); backdrop-filter: blur(20px); }
.auth-card input.form-control { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #fff; }
.auth-card input.form-control:focus { background: rgba(255,255,255,.1); border-color: #6366f1; box-shadow: 0 0 0 .2rem rgba(99,102,241,.25); color: #fff; }
.auth-card input.form-control::placeholder { color: rgba(255,255,255,.35); }
.logo-text { font-weight: 900; letter-spacing: -.5px; }
/* 2FA input overrides */
.auth-card input.form-control.two-factor-input { text-align: center; font-size: 1.5rem; letter-spacing: .5rem; }
.auth-card input.form-control.two-factor-input::placeholder { letter-spacing: normal; font-size: 1rem; }

/* --- Builder UI --- */
.user-avatar-bubble {
    width: 32px;
    height: 32px;
    background: var(--bs-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
}
.device-selector-segment {
    display: flex;
    background: var(--bs-secondary-bg);
    padding: 2px;
    border-radius: 10px;
    gap: 2px;
    border: 1px solid var(--bs-border-color);
}
.device-selector-segment button {
    border: none;
    background: transparent;
    color: var(--bs-secondary-color);
    padding: 4px 10px;
    border-radius: 7px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.device-selector-segment button:hover {
    color: var(--bs-body-color);
    background: rgba(0,0,0,0.03);
}
.device-selector-segment button.active {
    background: var(--bs-body-bg);
    color: var(--bs-primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
[data-bs-theme="dark"] .device-selector-segment button.active {
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* --- Business Wizard --- */
.wizard-step { animation: wizardFadeIn 0.3s ease; }
@keyframes wizardFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fw-900 { font-weight: 900; }

/* --- Grid Layout Picker (sidebar popover) --- */
.grid-layout-picker { position: fixed; z-index: 10000; width: 260px; animation: gridPickerIn 0.15s ease; }
@keyframes gridPickerIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* --- Grid Preset Cards (shared: picker + panel) --- */
.grid-preset-card { flex: 0 0 calc(50% - 0.25rem); transition: all 0.15s ease; cursor: pointer; }
.grid-preset-card:hover { border-color: var(--bs-primary) !important; transform: translateY(-1px); }

/* --- Grid Column Items (property panel) --- */
.grid-column-item .col-span-slider { height: 4px; accent-color: var(--bs-primary); }
.grid-column-item .col-span-slider::-webkit-slider-thumb { width: 14px; height: 14px; }
.grid-column-item .col-delete-btn:hover { background: rgba(var(--bs-danger-rgb), 0.1); border-radius: 4px; }
.grid-presets-grid .grid-preset-card { flex: 0 0 calc(50% - 0.25rem); }

/* --- Accordion Manager (property panel) --- */
.acc-mgr-item { transition: all 0.15s ease; }
.acc-mgr-item:hover { border-color: var(--bs-primary) !important; }
.acc-mgr-item .acc-delete-btn:hover { opacity: 0.8; }
.acc-mgr-item .acc-focus-btn:hover { color: var(--bs-primary) !important; }
.acc-mgr-item .acc-expand-btn:hover { color: var(--bs-primary) !important; }
.acc-mgr-item.acc-drop-above { border-top: 2px solid var(--bs-primary) !important; }
.acc-mgr-item.acc-drop-below { border-bottom: 2px solid var(--bs-primary) !important; }

/* Impersonation banner */
.impersonation-banner {
    background: #ffc107;
    color: #212529;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    z-index: 1100;
    position: relative;
}
.impersonation-banner a {
    color: #212529;
    text-decoration: underline;
}