:root {
    --x-font-display: "Inter", sans-serif;

    --primary-1: #2b1426;
    --primary-2: #9b1f89;
    --primary-3: #ffe1f9;
    --primary-4: #fff7fd;
}
.bg-primary-1,
.bg-theme-1 {
    background-color: var(--primary-1);
}
.bg-primary-2,
.bg-theme-2 {
    background-color: var(--primary-2);
}
.bg-primary-3,
.bg-theme-3 {
    background-color: var(--primary-3);
}
.bg-primary-4,
.bg-theme-4 {
    background-color: var(--primary-4);
}

.text-primary-1,
.text-theme-1 {
    color: var(--primary-1);
}
.text-primary-2,
.text-theme-2 {
    color: var(--primary-2);
}
.text-primary-3,
.text-theme-3 {
    color: var(--primary-3);
}
.text-primary-4,
.text-theme-4 {
    color: var(--primary-4);
}

.weight-100 {
    font-weight: 100;
}
.weight-200 {
    font-weight: 200;
}
.weight-300 {
    font-weight: 300;
}
.weight-400 {
    font-weight: 400;
}
.weight-500 {
    font-weight: 500;
}
.weight-600 {
    font-weight: 600;
}
.weight-700 {
    font-weight: 700;
}
.weight-800 {
    font-weight: 800;
}
.weight-900 {
    font-weight: 900;
}

html {
    background-color: var(--primary-1);
}

body,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--x-font-display);
}

nav#primary_nav.is-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

#primary_nav .dropdown-menu {
    z-index: 1040;
}

@media (min-width: 992px) {
    #primary_nav .nav-item.dropdown:hover > .dropdown-menu,
    #primary_nav .nav-item.dropdown > .dropdown-menu.show {
        display: block;
    }
}

nav#primary_nav.navbar-static {
    position: static;
}

/* Page builder chrome navbar (separate from app navbar — customize in editor/navbar.blade.php) */
nav#editor_nav.is-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

#editor_nav .dropdown-menu {
    z-index: 1040;
}

@media (min-width: 992px) {
    #editor_nav .nav-item.dropdown:hover > .dropdown-menu,
    #editor_nav .nav-item.dropdown > .dropdown-menu.show {
        display: block;
    }
}

nav#editor_nav.navbar-static {
    position: static;
}

.editor-navbar__context {
    opacity: 0.9;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-navbar__page-title {
    font-weight: 600;
}

.page-builder-shell {
    --page-editor-nav-height: 3.5rem;
    --page-editor-toolbar-height: 3.25rem;
    --page-editor-sticky-offset: var(--page-editor-toolbar-height);
    min-height: 100vh;
}

.page-builder-body {
    display: block;
}

h1.primary_headline {
    font-size: 6em;
}

.btn-xl {
    font-size: 1.6em;
    padding: 0.5em 1.5em;
}

.h-100-fixed {
    height: 100vh;
    overflow-y: auto;
    position: fixed;
}

.sidebar_nav a.nav-link {
    font-weight: 300;
    color: #fff;
    transition: all 0.2s ease-in-out;
    opacity: 0.7;
}
.sidebar_nav a.nav-link:hover,
.sidebar_nav a.nav-link.active {
    transition: all 0.2s ease-in-out;
    opacity: 1;
}
.sidebar_nav a.nav-link.active {
    background: transparent;
}
.sidebar_nav a.nav-link {
    padding: 7px 3px;
}

.sidebar2_nav a.nav-link.active {
    background: rgb(0 0 0 / 3%);
    color: #000;
}
.sidebar2_nav a.nav-link {
    padding: 10px 15px;
}
.sidebar2_nav a.nav-link:hover {
    background-color: #fff;
    color: #000;
}
.sidebar2_nav li {
    margin-bottom: 10px;
}

.sidebar2_nav-toggle {
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: inherit;
}

.sidebar2_nav-toggle:focus {
    outline: none;
    box-shadow: none;
}

.sidebar2_nav-toggle[aria-expanded="true"] .sidebar2_chevron {
    transform: rotate(180deg);
}

.sidebar2_chevron {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
    opacity: 0.6;
}

.sidebar2_nav-sub {
    padding-left: 0.25rem;
}

.sidebar2_nav-sub .nav-link {
    padding: 8px 15px 8px 2.25rem;
    font-size: 0.9rem;
}
.primary_content_wrapper {
    min-height: 80vh;
}

.list-group.list-group-dark .list-group-item-action {
    border-radius: 1em;
}

.list-group.list-group-dark .list-group-item-action:not(.active):hover,
.list-group.list-group-dark .list-group-item-action:not(.active):focus {
    background: rgb(0 0 0 / 48%);
    color: #fff;
}

/* Onboarding stepper */
.onboarding-stepper__track {
    height: 4px;
    background: rgb(43 20 38 / 12%);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.onboarding-stepper__progress {
    height: 100%;
    background: var(--primary-2);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.onboarding-stepper__steps {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.onboarding-stepper__step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
    color: rgb(43 20 38 / 45%);
    font-size: 0.8rem;
}

.onboarding-stepper__step.is-active,
.onboarding-stepper__step.is-complete {
    color: var(--primary-1);
}

.onboarding-stepper__dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid rgb(43 20 38 / 20%);
    font-weight: 600;
    font-size: 0.85rem;
    background: #fff;
    transition: all 0.2s ease;
}

.onboarding-stepper__step.is-active .onboarding-stepper__dot {
    border-color: var(--primary-2);
    background: var(--primary-2);
    color: #fff;
}

.onboarding-stepper__step.is-complete .onboarding-stepper__dot {
    border-color: var(--primary-2);
    color: var(--primary-2);
}

.onboarding-panel[hidden] {
    display: none !important;
}

.onboarding-review__row {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 0.5rem 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgb(43 20 38 / 8%);
}

.onboarding-review__row:last-child {
    border-bottom: 0;
}

.onboarding-review dt {
    font-weight: 500;
    color: var(--primary-1);
    margin: 0;
}

.onboarding-review dd {
    margin: 0;
}

@media (max-width: 575.98px) {
    .onboarding-review__row {
        grid-template-columns: 1fr;
    }
}

.template-card {
    transition:
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.template-card:has(input:checked) {
    box-shadow: 0 0 0 1px var(--bs-dark);
}

.template-card:not(:has(input:disabled)):hover {
    box-shadow: 0 4px 20px rgb(17 24 39 / 8%);
}

.drag-handle {
    cursor: grab;
    user-select: none;
}

.sortable-ghost {
    opacity: 0.45;
}

[x-cloak] {
    display: none !important;
}

/* Global toast alerts */
.zedlify-toast-stack {
    position: fixed;
    top: 5.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1080;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: min(92vw, 420px);
    pointer-events: none;
}

.zedlify-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgb(15 23 42 / 18%);
    font-size: 0.875rem;
    line-height: 1.4;
    animation: zedlify-toast-in 0.28s ease;
    transition:
        opacity 0.28s ease,
        transform 0.28s ease;
}

.zedlify-toast.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
}

.zedlify-toast--success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.zedlify-toast--danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.zedlify-toast--warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.zedlify-toast--info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.zedlify-toast__message {
    flex: 1;
}

.zedlify-toast__close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    margin: -0.1rem 0 0;
    cursor: pointer;
    opacity: 0.65;
    color: inherit;
}

.zedlify-toast__close:hover {
    opacity: 1;
}

@keyframes zedlify-toast-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.current-template-banner__thumb {
    object-fit: cover;
}

.template-picker-card--selected .template-card {
    box-shadow: 0 0 0 2px var(--bs-dark);
}

.font-preview-select {
    font-size: 1.05rem;
}

.page-builder-layout .builder-sidebar {
    top: 1rem;
    z-index: 10;
}

.builder-palette-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 48px;
}

.palette-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px dashed #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    cursor: grab;
    user-select: none;
    touch-action: none;
    font-size: 0.875rem;
    text-align: left;
}

.palette-item__label {
    flex: 1;
    min-width: 0;
}

.palette-item__grip {
    flex-shrink: 0;
    opacity: 0.55;
    pointer-events: none;
}

.palette-item:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.palette-item:active,
.palette-item.sortable-chosen {
    cursor: grabbing;
}

.builder-canvas {
    min-height: 200px;
    padding: 0.5rem;
    border: 2px dashed #cbd5e1;
    border-radius: 0.5rem;
    background: #f8fafc;
}

.builder-drop-hint {
    padding: 2.5rem 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
    pointer-events: none;
}

.builder-canvas.sortable-drag-active {
    border-color: #1f2937;
    background: #f1f5f9;
}

.sortable-chosen {
    opacity: 0.85;
}

.palette-item:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

/* Page editor layout — window scroll; toolbar sticks after navbar scrolls away */
.page-editor-form {
    display: block;
}

.page-editor-chrome-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: #fff;
}

.page-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    flex-wrap: wrap;
}

.page-editor-toolbar__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status_switcher {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    background: rgb(255 255 255 / 60%);
}

.status_switcher .form-check-input {
    /* width: 2.25rem; */
    /* height: 1.125rem; */
    margin-top: 0;
    cursor: pointer;
}

.status_switcher__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    user-select: none;
    min-width: 4.5rem;
    margin-left: -10px;
}

.page-editor-workspace {
    display: grid;
    grid-template-columns: 220px 1fr 320px;
    align-items: start;
}

.page-editor-sidebar {
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: sticky;
    top: var(--page-editor-sticky-offset, 3.25rem);
    z-index: 1010;
    align-self: start;
    max-height: calc(100vh - var(--page-editor-sticky-offset, 3.25rem));
}

.page-editor-sidebar__header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.page-editor-sidebar__list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.page-editor-sidebar__footer {
    padding: 0.75rem;
    border-top: 1px solid #f3f3f3;
}

.page-editor-canvas {
    background: #f3f3f3;
    padding: 1.5rem;
    min-height: calc(100vh - var(--page-editor-sticky-offset, 3.25rem));
}

.builder-preview-root {
    min-height: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgb(15 23 42 / 12%);
    overflow: hidden;
}

.builder-preview-root .zl-wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px;
}

.builder-preview-root .zl-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 0 20px;
    flex-wrap: wrap;
}

.builder-preview-root .zl-brand {
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.builder-preview-sections {
    min-height: 200px;
}

.builder-preview-sections.sortable-drag-active {
    outline: 2px dashed #2563eb;
    outline-offset: 4px;
    border-radius: 8px;
}

.builder-drop-hint {
    padding: 3rem 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background: rgb(255 255 255 / 50%);
}

.preview-section-shell {
    position: relative;
    margin-bottom: 2px;
    cursor: pointer;
    outline: 2px solid transparent;
    outline-offset: 0;
    transition:
        outline-color 0.15s ease,
        outline-width 0.15s ease;
}

.preview-section-shell:hover:not(.is-selected) {
    outline-color: rgb(37 99 235 / 28%);
}

.preview-section-shell.is-selected {
    outline: 2px solid #2563eb;
    outline-offset: 0;
    z-index: 2;
}

.preview-section-shell.sortable-chosen {
    outline-color: rgb(37 99 235 / 45%);
    cursor: grabbing;
}

.page-editor-inspector {
    border: none;
    border-left: 1px solid #e2e8f0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: sticky;
    top: var(--page-editor-sticky-offset, 3.25rem);
    z-index: 1010;
    align-self: start;
    max-height: calc(100vh - var(--page-editor-sticky-offset, 3.25rem));
}

.page-editor-inspector__body {
    flex: 1;
    overflow-y: auto;
    padding: 0.65rem 0.75rem;
}

.page-editor-tabs .nav-link {
    font-size: 0.8125rem;
    padding: 0.65rem 0.5rem;
    border-radius: 0;
    color: #64748b;
}

.page-editor-tabs .nav-link.active {
    color: #111827;
    font-weight: 600;
}

.page-editor-inspector--compact .page-editor-tabs .nav-link {
    font-size: 0.6875rem;
    padding: 0.35rem 0.25rem;
    letter-spacing: 0.01em;
}

.page-editor-inspector--compact .card-header {
    padding: 0;
}

.page-editor-inspector--compact .form-label {
    font-size: 0.6875rem;
    margin-bottom: 0.2rem;
    font-weight: 500;
}

.page-editor-inspector--compact .form-control,
.page-editor-inspector--compact .form-select {
    font-size: 0.75rem;
    padding: 0.3rem 0.45rem;
    min-height: calc(1.5em + 0.5rem);
}

.page-editor-inspector--compact .form-control-sm {
    font-size: 0.6875rem;
    padding: 0.2rem 0.4rem;
}

.page-editor-inspector--compact .btn-sm {
    font-size: 0.6875rem;
    padding: 0.2rem 0.45rem;
}

.page-editor-inspector--compact textarea.form-control {
    min-height: 4.5rem;
}

.page-editor-inspector--compact .border.rounded.p-3 {
    padding: 0.5rem !important;
}

.page-editor-autosave-badge {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 1050;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgb(15 23 42 / 18%);
    pointer-events: none;
    max-width: min(90vw, 360px);
}

.page-editor-autosave-badge--pending {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.page-editor-autosave-badge--saving {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.page-editor-autosave-badge--saved {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.page-editor-autosave-badge--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.nav-link:focus-visible {
    box-shadow: none;
}

@media (max-width: 1199.98px) {
    .page-editor-workspace {
        grid-template-columns: 200px 1fr 280px;
    }
}

@media (max-width: 991.98px) {
    .page-editor-workspace {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .page-editor-sidebar {
        position: static;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        max-height: 200px;
    }

    .page-editor-sidebar__list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .page-editor-inspector {
        position: static;
        border-left: none;
        border-top: 1px solid #e2e8f0;
        max-height: 360px;
    }
}

@media (max-width: 900px) {
    .preview-features-grid {
        grid-template-columns: 1fr !important;
    }
}
