/* ============================================================
   Bootstrap primary colour override — #00ace6
   ============================================================ */
:root {
    --bs-primary:           #00ace6;
    --bs-primary-rgb:       0, 172, 230;
    --bs-link-color:            #00ace6;
    --bs-link-color-rgb:        0, 172, 230;
    --bs-link-hover-color:      #0099cc;
    --bs-link-hover-color-rgb:  0, 153, 204;
    /* Shared text color for destructive controls (outline-warning buttons and
       the inline "Remove" links). Tuned darker than Bootstrap's light amber so
       it stays legible on white. */
    --warn-text:        #ee9011;
    --warn-text-hover:  #c2410c;
}

.btn:disabled { opacity: 0.5; }

.btn-primary {
    --bs-btn-bg:               #00ace6;
    --bs-btn-border-color:     #00ace6;
    --bs-btn-hover-bg:         #0099cc;
    --bs-btn-hover-border-color: #0099cc;
    --bs-btn-active-bg:        #0088b3;
    --bs-btn-active-border-color: #0088b3;
    --bs-btn-focus-shadow-rgb: 0, 172, 230;
    --bs-btn-disabled-bg:      #00ace6;
    --bs-btn-disabled-border-color: #00ace6;
}

.btn-outline-primary {
    --bs-btn-color:            #00ace6;
    --bs-btn-border-color:     #00ace6;
    --bs-btn-hover-bg:         #00ace6;
    --bs-btn-hover-border-color: #00ace6;
    --bs-btn-active-bg:        #00ace6;
    --bs-btn-active-border-color: #00ace6;
    --bs-btn-focus-shadow-rgb: 0, 172, 230;
}

.text-primary   { color: #00ace6 !important; }
.bg-primary     { background-color: #00ace6 !important; }
.border-primary { border-color: #00ace6 !important; }
.form-control:focus { border-color: #00ace6; box-shadow: 0 0 0 0.25rem rgba(0, 172, 230, 0.25); }
.form-label       { margin-bottom: 0.25rem; font-size: 0.875rem; font-weight: 600; }
.form-group       { margin-bottom: 1rem; }
.form-hint        { font-size: 12px; color: #64748b; margin-top: 4px; margin-bottom: 0; }
.form-check-input:checked { background-color: #00ace6; border-color: #00ace6; }
.form-check-input:focus { box-shadow: 0 0 0 0.25rem rgba(0, 172, 230, 0.25); }

/* ============================================================
   Layout variables
   ============================================================ */
:root {
    --sidebar-w:          240px;
    --sidebar-bg:         #3d4f63;
    --sidebar-hover:      #4a5f76;
    --sidebar-active-bg:  #d52b1e;
    --sidebar-border:     #4a5f76;
    --ca-red:             #d52b1e;
    --ca-red-dark:        #b52318;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    min-height: 100vh;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1040;
    transition: transform 0.25s ease;
}

.sidebar-logo {
    padding: 20px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid var(--sidebar-border);
    display: block;
}

.sidebar-logo span { color: #f87171; }
.sidebar-logo-img { height: 18px; width: auto; display: block; }

.sidebar-site-label {
    padding: 6px 20px 10px;
    font-size: 13px;
    color: rgba(255,255,255,.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* No width cap: the label stretches to the sidebar rail (flex-stretched), so its
       content box is exactly the rail minus padding. A max-width here (border-box)
       would only truncate early and leave dead space on the right. */
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section-label {
    padding: 14px 20px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #8fa3b8;
}

.sidebar .nav-link {
    padding: 9px 20px;
    color: #c8d8e8;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
}

/* display:flex above beats the [hidden] attribute's UA display:none, so a nav link
   rendered hidden (Blog Posts, shown/hidden by the Edit page's blog toggle) needs this
   to actually stay out of the sidebar. */
.sidebar .nav-link[hidden] { display: none; }
.sidebar .nav-link:hover  { background: var(--sidebar-hover); color: #fff; }
.sidebar .nav-link.active { background: var(--sidebar-active-bg); color: #fff; }
.sidebar .nav-link .icon  { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.8; }

.sidebar-admin-return { margin: 0; }
.sidebar .nav-link-admin-return {
    width: 100%;
    background: none;
    border: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    color: #fbbf24;
}
.sidebar .nav-link-admin-return:hover { background: rgba(251,191,36,.15); color: #fcd34d; }
.sidebar .nav-link-admin-return .icon { opacity: 1; }

/* ============================================================
   Main layout
   ============================================================ */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 28px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-title { font-size: 16px; font-weight: 600; color: #1e293b; min-width: 100px; }

.page-content { padding: 28px; flex: 1; }

.dashboard-footer {
    padding: 0 28px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #e2e8f0;
    background: #f1f5f9;
    font-size: 13px;
    color: #94a3b8;
}

/* ============================================================
   Profile avatar
   ============================================================ */
.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    color: var(--ca-red);
    font-size: 13px;
    font-weight: 700;
    border: 1px solid #c3ccd7;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.profile-avatar:hover { background: #f1f5f9; border-color: #a8b3c1; }

/* ============================================================
   Topbar next-step guide
   ============================================================ */
.topbar-guide {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 16px;
}
.topbar-guide-icon { font-size: 15px; flex-shrink: 0; }
.topbar-guide-text {
    font-size: 13px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topbar-guide-btn {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}
/* Red is reserved for a real billing emergency (level=danger: plan lapsed /
   trial expired). Every other level's primary action uses the site's normal
   brand-blue CTA color, so a routine "Go Live?" or "Try AI Design" nudge
   doesn't read as urgent as an unpaid account. */
.topbar-guide-btn-primary { background: var(--bs-primary); color: #fff; }
.topbar-guide-btn-primary:hover { background: var(--bs-link-hover-color); color: #fff; }
.topbar-guide-danger .topbar-guide-btn-primary { background: var(--ca-red); }
.topbar-guide-danger .topbar-guide-btn-primary:hover { background: var(--ca-red-dark); }
.topbar-guide-btn-ghost { background: transparent; color: #64748b; border-color: #cbd5e1; }
.topbar-guide-btn-ghost:hover { background: #f1f5f9; color: #334155; }

.topbar-guide-danger  .topbar-guide-icon { color: #dc2626; }
.topbar-guide-danger  .topbar-guide-text { color: #b91c1c; font-weight: 600; }
.topbar-guide-warning .topbar-guide-icon { color: #d97706; }
.topbar-guide-info    .topbar-guide-icon { color: #2563eb; }
.topbar-guide-success .topbar-guide-icon { color: #16a34a; }

/* Drop the text first, then the secondary button, as the bar gets cramped.
   The primary action always stays: on phones the guide button is the only
   route to Publish (the pending-changes modal), so it must never disappear. */
@media (max-width: 900px) { .topbar-guide-text { display: none; } }
@media (max-width: 768px) {
    .topbar-guide { padding: 0 8px; justify-content: flex-end; }
    .topbar-guide-btn-ghost { display: none; }
    .topbar-guide-icon { display: none; }
    .topbar-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ============================================================
   Sections list
   ============================================================ */
.section-row {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.section-row.disabled .drag-handle,
.section-row.disabled .section-row-label,
.section-row.disabled .section-row-meta { opacity: 0.4; }
.section-row.dragging       { opacity: 0.4; background: #f1f5f9; }
.section-row.editing-dimmed { background: #f8fafc; opacity: 0.45; pointer-events: none; }
.section-row.editing-active { border-color: #00ace6; box-shadow: 0 0 0 3px rgba(0,172,230,0.15); opacity: 1; }
.section-row.editing-active .section-row-actions .toggle-switch,
.section-row.editing-active .section-row-actions .section-edit-btn { opacity: 0.5; }

/* Section row actions */
.section-row-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* Toggle switch */
.toggle-switch               { position: relative; display: inline-block; width: 32px; height: 18px; cursor: pointer; flex-shrink: 0; }
.toggle-switch input         { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider               { position: absolute; inset: 0; background: #cbd5e1; border-radius: 18px; transition: background 0.2s; }
.toggle-slider::before       { content: ''; position: absolute; width: 12px; height: 12px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.toggle-switch input:checked + .toggle-slider              { background: var(--bs-primary); }
.toggle-switch input:checked + .toggle-slider::before      { transform: translateX(14px); }
/* A toggle the plan doesn't allow (the blog page on a trial): looks inert, not broken. */
.toggle-switch--locked                                     { cursor: not-allowed; }
.toggle-switch--locked .toggle-slider                      { opacity: 0.45; }
.section-row-label          { font-size: 14px; font-weight: 500; }
.section-row-meta           { font-size: 13px; color: #64748b; margin-top: 2px; }
.drag-handle                { display: flex; align-items: center; cursor: grab; padding: 0 4px; }
.section-row-icon           { display: flex; align-items: center; padding: 0 4px; }

/* ============================================================
   Repeatable items
   ============================================================ */
.repeat-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.repeat-item-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.repeat-item-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: auto;
}

/* Per-item reorder control (injected into every repeat-item header via JS).
   Horizontally centred in the header, between the label and the Remove button. */
.move-repeat-item-up {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    line-height: 1;
    color: #94a3b8;
    background: none;
    border: none;
    padding: 2px 8px;
    cursor: pointer;
}
.move-repeat-item-up:hover { color: #00ace6; }

/* The first block in a list has nowhere to move up to. */
.repeat-items-container > .repeat-item:first-child > .repeat-item-header > .move-repeat-item-up,
.menu-items-list > .repeat-item:first-child > .repeat-item-header > .move-repeat-item-up,
#menu-categories > .menu-category-row:first-child > .repeat-item-header > .move-repeat-item-up {
    visibility: hidden;
}

.remove-repeat-item {
    font-size: 11px;
    color: var(--warn-text);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 1;
}
.remove-repeat-item:hover { color: var(--warn-text-hover); }

.add-repeat-item {
    font-size: 14px;
    color: #00ace6;
    background: none;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    margin-top: 4px;
    transition: border-color 0.15s, color 0.15s;
}
.add-repeat-item:hover { border-color: #00ace6; }

/* Inline bold: a data-inline-bold field is edited in a contenteditable box beside its
   (now hidden) input, so bold reads as bold and the <b> marker never reaches the screen.
   The box carries .form-control as well, so the border, padding and focus ring are the
   input's own and cannot drift from the fields above and below it. */
.inline-bold-editor {
    /* An input's height comes from its content box; a div's has to be asked for. This is
       Bootstrap's own line-height + vertical padding + borders, so the two match exactly. */
    min-height: calc(1.5em + 0.75rem + 2px);
    height: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    cursor: text;
}
/* A div has no placeholder attribute. Driven by a class rather than :empty, which a
   browser's filler <br> in an emptied box would defeat. */
.inline-bold-editor.is-empty::before {
    content: attr(data-placeholder);
    color: var(--bs-secondary-color, #6c757d);
    pointer-events: none;
}

/* Inline bold: a "B" injected into the label of any data-inline-bold field. */
.inline-bold-btn {
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
    color: #64748b;
    background: none;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 3px 7px;
    margin-left: 8px;
    cursor: pointer;
    vertical-align: middle;
    transition: border-color 0.15s, color 0.15s;
}
.inline-bold-btn:hover { border-color: #00ace6; color: #00ace6; }
/* Set while the caret sits in bold text, so the B reads as the toggle it is. */
.inline-bold-btn.is-active {
    border-color: #00ace6;
    color: #00ace6;
    background: rgba(0, 172, 230, 0.10);
}

/* ============================================================
   Contact form field builder
   ============================================================ */
.cf-fields-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cf-field-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
}
.cf-field-row.dragging { opacity: 0.4; background: #f1f5f9; }
.cf-drag-handle { display: flex; align-items: center; cursor: grab; color: #94a3b8; font-size: 14px; }
.cf-field-info  { flex-grow: 1; min-width: 0; }
.cf-field-name  { font-size: 14px; font-weight: 500; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-field-meta  { font-size: 12px; color: #64748b; margin-top: 1px; }
.cf-field-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.cf-remove-btn {
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    color: #f59e0b;
    line-height: 1;
    border-radius: 6px;
}
.cf-remove-btn:hover { color: #b45309; background: #fffbeb; }

/* Outline-warning button text: Bootstrap's default amber (#ffc107) is too light
   to read on white. Darken only the resting text via the btn color variable;
   the border (--bs-btn-border-color) and the filled hover state are untouched. */
.btn-outline-warning { --bs-btn-color: var(--warn-text); }

/* ============================================================
   Site URL block
   ============================================================ */
/* Fixed width, so the buttons beside it sit in the same place on every site
   whatever the length of the host. The address itself is truncated in PHP (see
   dashboard/edit.blade.php) so the marker is ".."; the clip here is the backstop
   for a host that still overruns, e.g. at a larger browser font size. */
.site-url-block {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 210px;
    flex: 0 0 210px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
}
.site-url-block > a {
    /* A step down from body size: at 16px a full-length host does not fit the
       fixed box, and this matches the btn-sm controls sitting beside it. */
    font-size: 14px;
    /* Fill the box whatever the text length, so the fitting script measures the
       space available rather than the width of the text already in it. */
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ============================================================
   Mobile sidebar
   ============================================================ */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #1e293b;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1039;
}

/* ============================================================
   Dashboard stat cards
   ============================================================ */
.stat-card-label  { font-size: 11px; font-weight: 600; color: #64748b; letter-spacing: 0.5px; }
.stat-card-value  { font-size: 28px; font-weight: 700; color: #1e293b; line-height: 1.2; }
.stat-card-denom  { font-size: 16px; font-weight: 400; color: #94a3b8; }

/* ============================================================
   Auth pages
   ============================================================ */
.auth-logo { font-size: 24px; font-weight: 700; color: #1e293b; }
.auth-logo span { color: var(--ca-red); }
.auth-logo-img { height: 26px; width: auto; display: block; margin: 0 auto; }
/* Centered header block (logo + tagline) above the left-aligned form */
.auth-logo + p { text-align: center; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.2); }
    .sidebar-overlay.open { display: block; }
    .main-wrapper { margin-left: 0; }
    .topbar { padding: 0 16px; }
    .sidebar-toggle { display: flex; }
    .page-content { padding: 16px; }

}

::placeholder { color: #ccc !important; opacity: 1; }

/* ============================================================
   Lucide icon picker
   ============================================================ */
#lucide-picker-modal { display: none; position: fixed; inset: 0; z-index: 10000; }
#lucide-picker-modal.is-open { display: block; }
.lp-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.lp-dialog {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: #fff; border-radius: 10px; box-shadow: 0 8px 40px rgba(0,0,0,.18);
    width: 540px; max-width: calc(100vw - 32px); display: flex; flex-direction: column;
    max-height: calc(100vh - 64px);
}
.lp-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; border-bottom: 1px solid #e2e8f0;
}
.lp-search {
    flex: 1; border: 1px solid #cbd5e1; border-radius: 6px;
    padding: 7px 12px; font-size: 14px; outline: none;
}
.lp-search:focus { border-color: #6366f1; }
.lp-close {
    background: none; border: none; font-size: 22px; line-height: 1;
    color: #94a3b8; cursor: pointer; padding: 0 4px;
}
.lp-close:hover { color: #1e293b; }
.lp-grid {
    display: grid; grid-template-columns: repeat(8, 1fr);
    gap: 4px; padding: 14px 16px; overflow-y: auto; flex: 1;
}
.lp-icon {
    display: flex; align-items: center; justify-content: center;
    padding: 10px; border-radius: 6px; border: 1px solid transparent;
    background: none; cursor: pointer; color: #475569; transition: all .12s;
}
.lp-icon:hover { background: #f1f5f9; color: #1e293b; border-color: #cbd5e1; }
.lp-icon.is-selected { background: #ede9fe; color: #6366f1; border-color: #a5b4fc; }
.lp-footer {
    padding: 10px 16px; border-top: 1px solid #e2e8f0; display: flex; justify-content: flex-end;
}
.lp-clear { background: none; border: none; font-size: 13px; color: #94a3b8; cursor: pointer; padding: 4px 8px; }
.lp-clear:hover { color: #ef4444; }

/* Layout preview (Header/Footer modal) */
.layout-preview-label { font-size: 12px; color: #64748b; margin-bottom: 6px; }
.layout-preview-frame { border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden; background: #f8fafc; min-height: 60px; }
.layout-preview-placeholder { font-size: 13px; color: #94a3b8; display:flex; align-items:center; justify-content:center; min-height:60px; }

/* Icon picker field widget */
.icon-picker-wrap { display: flex; align-items: center; gap: 10px; }
.icon-picker-preview {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border: 1px solid #e2e8f0; border-radius: 6px; color: #475569; flex-shrink: 0;
}
.icon-picker-btn {
    font-size: 13px; padding: 6px 12px;
}

/* Modal header */
.modal-title { font-size: 17px !important; font-weight: 600; }
.modal-header { padding: 14px 18px; border-bottom: 1px solid #e2e8f0; }
.modal-body   { padding: 22px 22px; }
.modal-footer { padding: 14px 20px; }

/* Header row inside a form-section: eyebrow title on the left,
   optional action buttons on the right (used for the top "Save" pair
   that aligns with the first form-section). */
.form-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.form-section-header .form-section-eyebrow { margin-bottom: 0; }

.form-top-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ============================================================
   Form groups & sections (used in modals and section editor)
   ============================================================ */

/* Logical group of related fields within a card or modal.
   No top padding on the first one — spacing between adjacent sections
   comes from the sibling combinator below. This works even when a
   non-section element (e.g. a CSRF hidden input) precedes the first
   form-section, which would defeat :first-child. */
.form-section { padding-top: 0; padding-bottom: 22px; }
.form-section + .form-section {
    padding-top: 22px;
    border-top: 1px solid #eef1f5;
}
.form-section:last-child { padding-bottom: 0; }

/* Small uppercase "eyebrow" title for a form section */
.form-section-eyebrow {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-section-eyebrow .form-section-hint {
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
    text-transform: none;
    letter-spacing: 0;
}

/* Card title styling for editor cards */
.card-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
}

/* Card body: a touch more breathing room than Bootstrap default */
.card > .card-body { padding: 1.25rem 1.35rem; }

/* Last form-group inside a section has no extra bottom margin */
.form-section > .form-group:last-child,
.form-section > *:last-child > .form-group:last-child { margin-bottom: 0; }

/* Section row: subtle hover */
.section-row { transition: border-color 0.15s, box-shadow 0.15s; }
.section-row:hover:not(.disabled):not(.dragging):not(.editing-dimmed) {
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* "Plus" add button next to a card title (Home Sections card) */
.card-title-add-btn {
    margin-left: auto;
    padding-right: calc(0.5rem + 5px);
}

/* Action bar inside the section editor (Save / Back row) */
.section-edit-actionbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Standalone divider for in-card section breaks (used inside section field forms) */
.form-section-divider {
    height: 1px;
    background: #eef1f5;
    margin: 22px -4px 14px;
}

/* Form-section helper: two-column grid */
.form-section-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 575px) {
    .form-section-grid-2 { grid-template-columns: 1fr; }
}

/* Cancel-confirm popover — section editor "Cancel" with unsaved changes.
   The caret and the quick fade-slide entrance anchor it to the button, so it
   reads as the button opening a menu rather than a control appearing from
   nowhere. */
.cancel-confirm-pop {
    position: absolute;
    z-index: 1060;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.14);
    padding: 4px;
    animation: cancel-pop-in 0.12s ease-out;
}
.cancel-confirm-pop::before {
    content: "";
    position: absolute;
    top: -5px;
    right: 18px;
    width: 8px;
    height: 8px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
}
@keyframes cancel-pop-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .cancel-confirm-pop { animation: none; }
}
.cancel-confirm-item {
    display: block;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #b45309;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.cancel-confirm-item:hover { background: #fffbeb; }

/* Preview loading overlay — used by Edit Site and AI Design preview panels */
.preview-loading-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}
.preview-loading-overlay.show { display: flex; }
.preview-loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(100, 116, 139, 0.25);
    border-top-color: #475569;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    animation: preview-loading-spin .7s linear infinite;
}
@keyframes preview-loading-spin { to { transform: rotate(360deg); } }
