@use "../variables" as v;

/* ── Step bar ───────────────────────────────────────────────── */
.cw-stepbar {
    flex-shrink: 0;
    height: 52px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    z-index: 50;

    @media (max-width: 768px) {
        flex-direction: column;
        height: auto;
        padding: 10px 16px;
        gap: 8px;
        align-items: stretch;
    }
}

.cw-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    transition: background 150ms;
}

.cw-back-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.cw-steps {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;

    @media (max-width: 768px) {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

.cw-step {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: color 150ms, background 150ms;
    white-space: nowrap;

    .cw-step-label {
        @media (max-width: 640px) {
            display: none;
        }
    }
}

.cw-step:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.cw-step.is-active {
    color: var(--active-text);
    font-weight: 600;
    background: var(--active-bg);
}

.cw-step.is-done {
    color: var(--success);
}

.cw-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    background: currentColor;
    color: #fff;
    flex-shrink: 0;
}

.cw-step.is-active .cw-step-num {
    background: var(--active-text);
    color: var(--bg-surface);
}

.cw-step.is-done .cw-step-num {
    background: var(--success);
    color: #fff;
}

.cw-step:not(.is-active):not(.is-done) .cw-step-num {
    background: var(--border-color);
    color: var(--text-muted);
}

.cw-stepbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;

    @media (max-width: 768px) {
        justify-content: flex-end;
    }
}

.cw-campaign-title {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-saved-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--success);
}

.cw-saving-indicator {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Step panels ────────────────────────────────────────────── */
.cw-step-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    background: var(--bg-page);
}

.cw-step-panel--scroll {
    overflow-y: auto;
}

/* ── Compose: modular layout ────────────────────────────────── */
.cw-composer-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    width: 100%;

    @media (max-width: 1024px) {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }
}

.cw-canvas-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-page);

    @media (max-width: 1024px) {
        height: auto;
        overflow: visible;
    }
}

/* ── Canvas Toolbar ─────────────────────────────────────────── */
.cw-canvas-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    height: 46px;
    flex-shrink: 0;
}

.cw-canvas-actions-left {
    display: flex;
    align-items: center;

    gap: 8px;
}

.cw-canvas-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cw-device-toggle {
    display: inline-flex;
    align-items: center;
    background: var(--bg-hover);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.cw-divider-v {
    width: 1px;
    height: 18px;
    background: var(--border-color);
    margin: 0 4px;
}

.cw-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-surface);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 150ms ease;

    &:hover:not(:disabled) {
        background: var(--bg-hover);
        border-color: var(--text-muted);
    }

    &:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
}

.cw-device-btn {
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border-radius: 6px;
    transition: all 150ms;
    color: var(--text-muted);

    &:hover:not(.is-active) {
        color: var(--text-primary);
        background: var(--bg-hover);
    }

    &.is-active {
        color: var(--info);
        background: var(--bg-surface) !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border: 1px solid var(--info) !important;
    }
}

.cw-clear-btn {
    color: #ef4444;
    border-color: #fecaca;
    background: #fef2f2;

    &:hover:not(:disabled) {
        background: #fee2e2;
        border-color: #fca5a5;
    }
}

/* ── Compose: toolbar ───────────────────────────────────────── */
.cw-editor-toolbar {
    position: relative;
    flex-shrink: 0;
    height: 46px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    gap: 8px;
}

.cw-toolbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cw-toolbar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cw-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cw-toolbar-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    padding: 0 4px;
}

.cw-tool-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: background 150ms, border-color 150ms;
}

.cw-tool-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.cw-tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Compose: editor body ───────────────────────────────────── */
.cw-editor-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

/* ── Left Panel ─────────────────────────────────────────────── */
.cw-left-panel {
    width: 300px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    /* NO overflow:hidden - it clips the SortableJS drag ghost */
    min-height: 0;

    @media (max-width: 1024px) {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 380px;
        overflow-y: auto;
    }
}

/* Tabs (Blocks / Sections / Saved) */
.cw-lp-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
}

.cw-lp-tab {
    flex: 1;
    padding: 12px 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.cw-lp-tab.is-active {
    color: var(--active-text);
    border-bottom-color: var(--active-text);
    font-weight: 600;
}

.cw-lp-tab.is-disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

/* Panel content area (scrollable) */
.cw-lp-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 12px;
}

/* Block card grid - flexbox only, CSS Grid breaks SortableJS dragging */
.cw-block-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cw-block-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px 10px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    cursor: grab;
    user-select: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    position: relative;
    width: calc(33.333% - 6px);
    box-sizing: border-box;
}

.cw-block-card:hover {
    border-color: #10b981;
    background: #f0fdf4;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.10);
}

.cw-block-card:active {
    cursor: grabbing;
}

.cw-block-card-dots {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #d1d5db;
    letter-spacing: 1px;
    line-height: 1;
}

.cw-block-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    margin-top: 8px;
}

.cw-block-card-label {
    font-size: 11px;
    font-weight: 500;
    color: #374151;
    text-align: center;
    line-height: 1.2;
}

/* ── Sections panel ─────────────────────────────────────────────── */
.cw-sec-panel {
    padding: 0;
}

.cw-sec-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 12px 8px;
    border-bottom: 1px solid #f3f4f6;
}

.cw-sec-cat-btn {
    padding: 3px 10px;
    font-size: 11px;
    border-radius: 20px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.cw-sec-cat-btn:hover {
    border-color: v.$primary;
    color: #6366f1;
}

.cw-sec-cat-btn.is-active {
    background: v.$primary;
    border-color: v.$primary;
    color: #fff;
    font-weight: 600;
}

.cw-sec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
}

.cw-sec-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    background: #fff;
}

.cw-sec-card:hover {
    border-color: v.$primary;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

.cw-sec-thumb {
    display: block;
    width: 100%;
    background: #f8f9fa;
    line-height: 0;
}

.cw-sec-thumb svg {
    width: 100%;
    height: auto;
    display: block;
}

.cw-sec-card-lbl {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    padding: 6px 4px;
    background: #fff;
    border-top: 1px solid #f3f4f6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Empty state in sections tab */
.cw-lp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    gap: 12px;
    color: #d1d5db;
    text-align: center;
}

.cw-lp-empty p {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

/* Settings state header */
.cw-lp-settings-hdr {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--bg-surface);
}

.cw-lp-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--active-text);
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.cw-lp-back-btn:hover {
    text-decoration: underline;
}

.cw-lp-block-type {
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    text-align: center;
}

.cw-lp-del-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #ef4444;
    display: flex;
    align-items: center;
    border-radius: 4px;
}

.cw-lp-del-btn:hover {
    background: var(--bg-hover);
}

/* Settings body */
.cw-lp-settings-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Reduce scrollbar (scroll wheel) width & make it elegant */
.cw-lp-settings-body::-webkit-scrollbar,
.cw-lp-content::-webkit-scrollbar {
    width: 4px;
}

.cw-lp-settings-body::-webkit-scrollbar-track,
.cw-lp-content::-webkit-scrollbar-track {
    background: transparent;
}

.cw-lp-settings-body::-webkit-scrollbar-thumb,
.cw-lp-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.cw-lp-settings-body::-webkit-scrollbar-thumb:hover,
.cw-lp-content::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

.cw-lp-section {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.cw-lp-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* ── Canvas ─────────────────────────────────────────────────── */
.cw-canvas-wrap {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-page);
    padding: 36px 56px 36px;
    display: flex;
    justify-content: center;
    align-items: flex-start;

    @media (max-width: 768px) {
        padding: 16px 12px;
    }
}

.cw-email-frame {
    width: 100%;
    max-width: 600px;
    background: var(--bg-surface);
    min-height: 200px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    transition: max-width 0.25s ease;
}

.cw-email-frame.is-mobile {
    max-width: 400px;
}

.cw-canvas-inner-draggable {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
}

.cw-canvas-draggable {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 480px;
}

// .cw-device-btn.is-active {
//     background: #ffffff !important;
//     box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
//     border: 1px solid #008489 !important;
// }

.cw-size-tab-btn.is-active {
    background: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cw-columns-preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cw-col-preset-card {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px;
    background: #ffffff;
    cursor: grab;
    transition: all 150ms;
}

.cw-col-preset-card:hover {
    border-color: #8b5cf6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cw-col-preset-card.is-active-preset {
    border-color: #8b5cf6 !important;
    background: #f5f3ff !important;
    box-shadow: 0 1px 3px rgba(139, 92, 246, 0.1);
}

.cw-col-preset-preview {
    display: flex;
    gap: 2px;
    width: 48px;
    height: 14px;
    border: 1px solid #9ca3af;
    border-radius: 3px;
    padding: 1px;
    background: #f9fafb;
    align-items: stretch;
}

.cw-col-preset-bar {
    background: #d1d5db;
    border-radius: 1px;
}

.cw-col-preset-lbl {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
}

.cw-drop-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: #9ca3af;
    gap: 10px;
    border: 2px dashed #d1d5db;
    margin: 20px;
    border-radius: 8px;
}

.cw-drop-hint p {
    font-size: 13px;
    margin: 0;
}

.cw-canvas-draggable {
    min-height: 40px;
}

/* ── Email blocks ───────────────────────────────────────────── */
.eb-wrapper {
    position: relative;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 150ms;
}

.eb-wrapper:hover {
    border-color: #c084fc;
}

.eb-wrapper.is-selected {
    border-color: #8b5cf6 !important;
}

.eb-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: #9ca3af;
    transition: opacity 150ms;
}

.eb-block-tag {
    position: absolute;
    top: -20px;
    left: -2px;
    height: 20px;
    background: #8b5cf6;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    padding: 0 8px;
    border-radius: 4px 4px 0 0;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
    pointer-events: auto;
}

.eb-block-tag .eb-handle {
    color: #ffffff;
    display: inline-flex;
    opacity: 0.85;
}

.eb-block-tag .eb-handle:hover {
    opacity: 1;
}

.eb-actions-panel {
    position: absolute;
    right: -45px;
    top: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 11;
    padding: 2px;
}

.eb-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4b5563;
    border-radius: 6px;
    transition: background 150ms, color 150ms;
}

.eb-action-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.eb-action-btn.eb-handle {
    cursor: grab;
}

.eb-action-btn.eb-handle:active {
    cursor: grabbing;
}

/* ── Smooth Drag & Drop Sync Styles ── */
.is-dragging .eb-wrapper:hover {
    border-color: transparent !important;
}

.is-dragging .eb-wrapper.is-selected {
    border-color: transparent !important;
}

/* Fallback element moving with the mouse cursor */
.cw-drag-fallback {
    border: 2px solid #8b5cf6 !important;
    background: #ffffff !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    transform: none !important;
    /* Keep flat at 0 degree rotation */
    opacity: 0.95 !important;
}

.cw-drag-fallback .eb-block-tag,
.cw-drag-fallback .eb-actions-panel {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Placeholder ghost left behind in the list (Horizontal Purple Indicator Line with Dots) */
.eb-ghost {
    height: 4px !important;
    background: #8b5cf6 !important;
    margin: 16px 0 !important;
    padding: 0 !important;
    border: none !important;
    position: relative !important;
    opacity: 1 !important;
    overflow: visible !important;
    min-height: 4px !important;
}

.eb-ghost>* {
    opacity: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    display: none !important;
}

.eb-ghost::before {
    content: '' !important;
    position: absolute !important;
    top: -3px !important;
    left: 0 !important;
    width: 10px !important;
    height: 10px !important;
    background: #8b5cf6 !important;
    border-radius: 50% !important;
    z-index: 100 !important;
}

.eb-ghost::after {
    content: '' !important;
    position: absolute !important;
    top: -3px !important;
    right: 0 !important;
    width: 10px !important;
    height: 10px !important;
    background: #8b5cf6 !important;
    border-radius: 50% !important;
    z-index: 100 !important;
}

.eb-text {
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    min-height: 20px;
}

.eb-text:focus {
    outline: none;
}

.eb-heading {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    outline: none;
    min-height: 28px;
}

.eb-heading:focus {
    outline: none;
}

.eb-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-hover);
    height: 120px;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    border: 2px dashed var(--border-color);
}

.eb-button {
    display: inline-block;
    font-weight: 600;
    border-radius: 6px;
    padding: 10px 24px;
    cursor: default;
}

.eb-columns {
    display: grid;
    gap: 8px;
    width: 100%;
}

.eb-col-slot {
    position: relative;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    min-height: 60px;
    background: var(--bg-page);
    overflow: visible;
}

.eb-col-draggable {
    min-height: 60px;
    padding: 4px;
}

.eb-col-drop-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #9ca3af;
    font-size: 11px;
    pointer-events: none;
}

.eb-wrapper--nested {
    margin: 4px 0;
    border-radius: 6px;
}

.eb-wrapper--nested .eb-content {
    padding: 4px;
}

.eb-social {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.eb-social-link {
    display: inline-block;
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 12px;
    color: #374151;
    text-decoration: none;
    text-transform: capitalize;
}

.eb-html-placeholder {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    background: #f9fafb;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.eb-html-placeholder span {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
}

.eb-html-code {
    font-size: 11px;
    color: #6b7280;
    font-family: monospace;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eb-placeholder-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 4px;
    color: #9ca3af;
    font-size: 12px;
}

:deep(.eb-ghost) {
    background: #e8f0fe;
    border: 2px dashed #4285f4;
    opacity: 0.6;
}

.eb-footer {
    border-top: 1px solid #e5e7eb;
    padding: 16px 24px;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.8;
    background: #f9fafb;
}

.eb-footer a {
    color: #4285f4;
    text-decoration: none;
}

.eb-footer p {
    margin: 0;
}

/* ── Settings shared form controls ──────────────────────────── */

/* Row: label on left, control on right */
.cw-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.cw-settings-lbl {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 80px;
}

/* Number input with unit tag */
.cw-unit-input {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-surface);
}

.cw-unit-input .cw-field-input {
    border: none;
    border-radius: 0;
    height: 28px;
    padding: 0 6px;
    text-align: right;
    font-size: 12px;
}

.cw-unit-tag {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 6px;
    background: var(--bg-page);
    border-left: 1px solid var(--border-color);
    height: 28px;
    display: flex;
    align-items: center;
}

/* Icon button row (alignment, etc.) */
.cw-icon-btns {
    display: flex;
    gap: 3px;
}

.cw-icon-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.cw-icon-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-color);
    color: v.$primary;
}

.cw-icon-btn.is-active {
    background: var(--bg-hover);
    border-color: v.$primary;
    color: v.$primary;
}

/* 4-side padding/margin grid */
.cw-spacing-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.cw-group-sides-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6b7280;
    cursor: pointer;
}

.cw-4side-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.cw-side-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.cw-side-input .cw-field-input {
    padding: 0 4px;
    text-align: center;
    font-size: 12px;
}

.cw-side-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group-sm {
    margin-bottom: 8px;
}

.cw-field-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
}

.cw-field-input {
    width: 100%;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 12px;
    color: var(--text-primary);
    background: var(--bg-surface);
    box-sizing: border-box;
}

.cw-field-input:focus {
    outline: none;
    border-color: var(--active-text);
}

/* ── Code editor ── */
.cw-lp-section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.cw-expand-btn {
    background: none;
    border: none;
    color: #6366f1;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.cw-expand-btn:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.cw-code-editor {
    display: flex;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.6;
}

.cw-code-editor--full {
    flex: 1;
    border-radius: 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

.cw-code-lines {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 10px 8px;
    background: #f1f5f9;
    border-right: 1px solid #e5e7eb;
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.6;
    user-select: none;
    min-width: 32px;
    overflow: hidden;
}

.cw-code-lines span {
    display: block;
}

.cw-code-textarea {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.6;
    color: #1e293b;
    resize: none;
    min-height: 220px;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

.cw-code-editor--full .cw-code-textarea {
    min-height: unset;
    height: 100%;
}

.cw-align-btns {
    display: flex;
    gap: 4px;
}

.cw-align-btn {
    flex: 1;
    height: 26px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
}

.cw-align-btn.is-active {
    background: #e8f0fe;
    border-color: #4285f4;
    color: #4285f4;
}

.cw-color-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cw-color-input {
    width: 28px;
    height: 28px;
    padding: 1px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
}

.cw-color-value {
    font-size: 11px;
    color: #6b7280;
    font-family: monospace;
}

.cw-spacing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* ── Step 2/3/4 shared ──────────────────────────────────────── */
.cw-content-area {
    max-width: 850px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 24px;
}

.cw-form-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.cw-section-heading {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px;
}

.cw-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.cw-toggle-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.cw-toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.cw-toggle-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    display: inline-flex;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-track {
    width: 36px;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: background 200ms;
    position: relative;
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 200ms;
}

.toggle-switch input:checked~.toggle-track {
    background: var(--active-text);
}

.toggle-switch input:checked~.toggle-track::after {
    transform: translateX(16px);
}

.cw-ab-group {
    margin-top: 4px;
}

.cw-utm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;

    @media (max-width: 640px) {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Recipients - tabs */
.cw-recipients-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.cw-recipients-tab {
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.cw-recipients-tab.is-active {
    color: var(--active-text);
    border-bottom-color: var(--active-text);
    font-weight: 600;
    background: none;
}

/* Recipients - included/excluded cards */
.cw-incl-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 18px;
    overflow: hidden;
}

.cw-incl-card-hdr {
    padding: 16px 20px 10px;
    border-bottom: 1px solid var(--border-color);
}

.cw-incl-card-hdr h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--active-text);
}

.cw-incl-card-hdr p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.cw-incl-table {
    width: 100%;
    border-collapse: collapse;

    @media (max-width: 768px) {
        &, thead, tbody, th, td, tr {
            display: block;
        }
        thead {
            display: none;
        }
    }
}

.cw-incl-table thead th {
    background: var(--bg-page);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 8px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.cw-incl-row td {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;

    @media (max-width: 768px) {
        padding: 6px 0;
        border-bottom: none;
        width: 100% !important;
        box-sizing: border-box;
    }
}

.cw-incl-row {
    @media (max-width: 768px) {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 10px;
        margin-bottom: 12px;
        background: var(--bg-surface);
    }
}

.cw-incl-row:last-child td {
    border-bottom: none;
}

.cw-incl-row td:last-child {
    @media (max-width: 768px) {
        display: flex;
        justify-content: flex-end;
    }
}

.cw-incl-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-surface);
    outline: none;
    cursor: pointer;
}

.cw-incl-select:focus {
    border-color: var(--active-text);
    box-shadow: 0 0 0 2px var(--active-bg);
}

.cw-incl-actions {
    display: flex;
    gap: 6px;
}

.cw-incl-act {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.12s;
}

.cw-incl-act:hover {
    background: var(--bg-hover);
}

.cw-incl-act:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cw-excl-empty-cell {
    padding: 14px 16px;
    text-align: left;
}

.cw-excl-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.cw-excl-add-btn:hover {
    border-color: var(--active-text);
    color: var(--active-text);
    background: var(--active-bg);
}

.cw-incl-hint {
    padding: 8px 16px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-page);
    border-top: 1px solid var(--border-color);
}

/* Step navigation */
.cw-step-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 4px;
}

.cw-nav-back {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.cw-nav-back:hover {
    text-decoration: underline;
}

.cw-nav-continue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.cw-nav-continue:hover {
    background: #15803d;
}

/* Step actions (legacy - kept for compose step) */
.cw-step-actions {
    display: flex;
    justify-content: space-between;
    padding: 16px 0 0;
    margin-top: 4px;
}

/* ─── Review & Send ──────────────────────────────────────── */
.cw-content-card {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: visible;
}

.cw-review-section {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);

    @media (max-width: 576px) {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
}

.cw-review-section:last-child {
    border-bottom: none;
}

.cw-review-lbl {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.cw-review-val {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.cw-review-subval {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.cw-review-edit {
    flex-shrink: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s;

    @media (max-width: 576px) {
        align-self: flex-start;
    }
}

.cw-review-edit:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Email preview in review */
.cw-email-preview-card {
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    cursor: pointer;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.cw-email-preview-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    transform: translateY(-1px);
}

.cw-email-preview-expand-badge {
    background: #111827;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.cw-email-preview-card:hover .cw-email-preview-expand-badge {
    background: #4f46e5;
    transform: scale(1.05);
}

.ep-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
}

.ep-footer a {
    color: #2563eb;
}

/* Test email button */
.cw-test-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    margin-top: 8px;
}

.cw-test-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Schedule section */
.cw-schedule-section {
    padding: 24px;
    background: var(--bg-page);
    border-top: 1px solid var(--border-color);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.cw-schedule-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.cw-schedule-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.cw-schedule-divider {
    height: 1px;
    background: var(--border-color);
    margin-bottom: 16px;
}

.cw-schedule-q {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.cw-radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    cursor: pointer;
}

.cw-radio-item input[type="radio"] {
    accent-color: #2563eb;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.cw-radio-active {
    color: #2563eb;
    font-weight: 600;
}

/* Schedule body: two-column layout */
.cw-schedule-body {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.cw-schedule-left {
    flex: 0 0 auto;
    min-width: 280px;
}

.cw-schedule-right {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .cw-schedule-body {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }

    .cw-schedule-left {
        min-width: unset;
        width: 100%;
    }

    .cw-schedule-right {
        width: 100%;
    }
}

.cw-schedule-field-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.cw-dt-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    color: #374151;
    outline: none;
    box-sizing: border-box;
}

.cw-dt-input:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.12);
}

.cw-dt-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.cw-dt-range-row .cw-dt-input,
.cw-dt-range-row .cw-dt-picker {
    flex: 1;
    min-width: 0;
}

.cw-dt-sep {
    font-size: 14px;
    color: #6b7280;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .cw-dt-range-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .cw-dt-sep {
        display: none;
    }
    .cw-send-btn {
        justify-content: center;
        width: 100%;
        font-size: 11px !important;
    }
    .cw-draft-btn{
        justify-content: center;
        width: 80%;
        font-size: 11px !important;
    }
}

.cw-schedule-hint {
    font-size: 11px;
    color: #6b7280;
    margin-top: 6px;
}

.cw-server-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 8px;
}

.cw-server-time code {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
}

/* Action buttons row */
.cw-schedule-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.cw-draft-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    height: 38px;
}

.cw-draft-btn:hover {
    background: #f9fafb;
}

.cw-draft-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.cw-send-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 26px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin: 0px;
    height: 38px;
}

.cw-send-btn:hover {
    background: #15803d;
}

.cw-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Broadcast feedback */
.cw-broadcast-success {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 16px;
}

.cw-broadcast-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    margin-top: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.cw-spin {
    animation: spin 0.8s linear infinite;
}

/* Review preview legacy helpers */
.cw-rv-placeholder {
    color: #9ca3af;
    font-size: 12px;
    padding: 6px 0;
    font-style: italic;
}

.link-btn {
    background: none;
    border: none;
    color: var(--active-text);
    cursor: pointer;
    font-size: inherit;
    padding: 0;
}

/* ── Subject & Settings Step ─────────────────────────────── */
.ss-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 18px;
}

.ss-field-group {
    margin-bottom: 14px;
}

.ss-field-group:last-child {
    margin-bottom: 0;
}

.ss-mt {
    margin-top: 18px;
}

.ss-field-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.ss-required {
    color: var(--text-secondary);
    font-weight: 400;
}

.ss-field-hint {
    font-size: 11px;
    color: var(--danger);
    margin: 4px 0 0;
}

.ss-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-surface);
    overflow: hidden;
}

.ss-input {
    flex: 1;
    height: 38px;
    padding: 0 12px;
    border: none;
    outline: none;
    font-size: 13px;
    color: var(--text-primary);
    background: transparent;
    min-width: 0;
}

.ss-input::placeholder {
    color: var(--text-muted);
}

.ss-plain-input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-surface);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    box-sizing: border-box;
}

.ss-plain-input::placeholder {
    color: var(--text-muted);
}

.ss-plain-input:focus {
    border-color: var(--active-text);
}

.ss-merge-btn {
    flex-shrink: 0;
    height: 38px;
    padding: 0 10px;
    border: none;
    border-left: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 15px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.12s;
}

.ss-merge-btn:hover {
    background: var(--bg-hover);
}

/* -- A/B warning -- */
.ss-ab-warning {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 6px 0 0;
}

/* -- A/B checkbox row -- */
.ss-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 10px;
}

.ss-checkbox {
    width: 15px;
    height: 15px;
    accent-color: var(--active-text);
    cursor: pointer;
    flex-shrink: 0;
}

.ss-checkbox-label {
    font-size: 13px;
    color: var(--active-text);
    font-weight: 500;
}

/* -- A/B hint text -- */
.ss-ab-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 10px;
}

/* -- A/B table -- */
.ss-ab-table-wrap {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.ss-ab-table {
    width: 100%;
    border-collapse: collapse;
}

.ss-ab-table thead tr {
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-page);
}

.ss-ab-table th {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: left;
}

.ss-ab-table td {
    padding: 10px 14px;
    vertical-align: middle;
}

.ss-ab-table tbody tr:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

/* -- Priority stepper -- */
.ss-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-surface);
}

.ss-stepper-btn {
    width: 32px;
    height: 36px;
    border: none;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
}

.ss-stepper-btn:hover {
    background: var(--bg-hover);
}

.ss-stepper-input {
    width: 52px;
    height: 36px;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    outline: none;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-surface);
    -moz-appearance: textfield;
}

.ss-stepper-input::-webkit-inner-spin-button,
.ss-stepper-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* -- A/B delete button -- */
.ss-delete-btn {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: none;
    background: var(--danger-light);
    color: var(--danger);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s;
}

.ss-delete-btn:hover {
    background: var(--danger-border);
}

/* -- Add More button -- */
.ss-ab-footer {
    display: flex;
    justify-content: flex-end;
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
}

.ss-add-more-btn {
    background: var(--gray-600);
    color: var(--bg-surface);
    border: none;
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s;
}

.ss-add-more-btn:hover {
    background: var(--gray-500);
}

/* -- Sender profile card header -- */
.ss-card-hdr {
    margin-bottom: 14px;
}

.ss-card-hdr-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ss-card-hdr-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* -- No profiles warning -- */
.ss-no-profiles {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--warning-light);
    border: 1px solid var(--warning-border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--warning);
}

.ss-link {
    color: var(--active-text);
    text-decoration: underline;
}

/* -- Profile list -- */
.ss-profile-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ss-profile-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--bg-surface);
    font-family: inherit;
    text-align: left;
}

.ss-profile-option:hover {
    border-color: var(--active-text);
    background: var(--bg-hover);
}

.ss-profile-option.is-selected {
    border-color: var(--active-text);
    background: var(--active-bg);
}

/* -- Sender search -- */
.ss-sender-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface);
    margin-bottom: 2px;
}

.ss-sender-search svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.ss-sender-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
}

.ss-sender-search input::placeholder {
    color: var(--text-muted);
}

.ss-sender-empty {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 10px 0 2px;
    margin: 0;
}

.ss-radio {
    display: none;
}

.ss-profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5c72d4 0%, #9fabe6 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.ss-profile-info {
    flex: 1;
}

.ss-profile-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.ss-profile-email {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 1px;
}

.ss-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
    background: var(--success-light);
    border-radius: 10px;
    padding: 2px 8px;
}

.ss-reply-override {
    margin-top: 14px;
}

/* -- UTM grid -- */
.ss-utm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 14px;

    @media (max-width: 640px) {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* -- Send test email -- */
.ss-test-btn {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
    padding: 8px 16px;
    cursor: pointer;
    margin-top: 14px;
    transition: background 0.12s, border-color 0.12s;
}

.ss-test-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* Preview modal */
.cw-preview-body {
    background: var(--bg-page);
    padding: 0;
}

.cw-preview-email {
    width: 100%;
}

/* ── Social links settings ── */
.cw-social-link-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}

.cw-social-link-row:last-of-type {
    border-bottom: none;
}

.cw-social-drag {
    cursor: grab;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.cw-social-link-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cw-social-link-icon svg {
    width: 13px;
    height: 13px;
}

.cw-social-link-name {
    flex: 1;
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    text-transform: capitalize;
}

.cw-social-link-del {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.cw-social-link-del:hover {
    color: var(--danger);
}

.cw-social-link-url {
    width: 100%;
    padding-left: 18px;
}

.cw-add-icons-btn {
    width: 100%;
    margin-top: 10px;
    padding: 7px 0;
    border: 1.5px solid var(--border-color);
    border-radius: 7px;
    background: var(--bg-surface);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.12s;
}

.cw-add-icons-btn:hover {
    background: var(--bg-hover);
}

/* ── Social icon picker modal ── */
.cw-social-picker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 380px;
    overflow-y: auto;
}

.cw-social-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
    background: var(--bg-surface);
}

.cw-social-picker-item:hover {
    border-color: var(--active-text);
    background: var(--bg-hover);
}

.cw-social-picker-item.is-selected {
    border-color: var(--active-text);
    background: var(--active-bg);
}

.cw-sp-check {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cw-sp-icon {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cw-sp-icon svg {
    width: 14px;
    height: 14px;
}

.cw-sp-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ── Canvas social icons ── */
.eb-social-icon-wrap {
    text-decoration: none;
}

/* ── Divider style buttons ── */
.cw-divider-styles {
    display: flex;
    gap: 4px;
}

.cw-divider-style-btn {
    flex: 1;
    padding: 5px 4px;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-surface);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    letter-spacing: 1px;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
    white-space: nowrap;
}

.cw-divider-style-btn:hover {
    border-color: var(--active-text);
    background: var(--active-bg);
    color: var(--active-text);
}

.cw-divider-style-btn.is-active {
    border-color: var(--active-text);
    background: var(--active-bg);
    color: var(--active-text);
}

/* ── Button link settings ── */
.cw-field-select {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 12px;
    color: var(--text-primary);
    background: var(--bg-surface);
    outline: none;
    cursor: pointer;
    min-width: 0;
}

.cw-field-select:focus {
    border-color: var(--active-text);
}

.cw-remove-link-btn {
    background: none;
    border: none;
    color: #6366f1;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.cw-remove-link-btn:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* ── Video source tab toggle ── */
.cw-video-src-tabs {
    display: flex;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.cw-video-src-tab {
    flex: 1;
    padding: 5px 0;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-hover-strong);
    border: none;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.cw-video-src-tab.is-active {
    background: var(--active-text);
    color: var(--bg-surface);
}

/* ── Image block settings ── */
.cw-img-preview {
    position: relative;
    width: 100%;
    height: 140px;
    border-radius: 8px;
    border: 2px dashed var(--border-color);
    overflow: hidden;
    cursor: pointer;
    background: repeating-conic-gradient(var(--bg-hover) 0% 25%, var(--bg-surface) 0% 50%) 0 0 / 12px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s;
    margin-bottom: 8px;
}

.cw-img-preview:hover {
    border-color: var(--active-text);
}

.cw-img-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.cw-img-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.cw-img-preview-empty span {
    font-size: 11px;
}

.cw-img-uploading {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--active-text);
    font-weight: 500;
}

.cw-img-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
}

.cw-img-action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.12s;
}

.cw-img-action-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.cw-img-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cw-img-remove-btn {
    color: var(--danger);
}

.cw-img-remove-btn:hover:not(:disabled) {
    background: var(--danger-light);
    border-color: var(--danger-border);
}

@keyframes cw-spin {
    to {
        transform: rotate(360deg);
    }
}

.cw-spin {
    animation: cw-spin 0.7s linear infinite;
}

/* Custom premium checked boxes */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--bg-surface);
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 14px;
    height: 14px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    display: inline-grid;
    place-content: center;
    cursor: pointer;
    outline: none !important;
    box-shadow: none !important;
    transition: all 120ms ease;
    vertical-align: middle;
}

input[type="checkbox"]::before {
    content: "";
    width: 8px;
    height: 8px;
    transform: scale(0);
    transition: 100ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--bg-surface);
    background-color: CanvasText;
    clip-path: polygon(14% 44%, 0 58%, 38% 96%, 100% 21%, 86% 7%, 38% 68%);
}

input[type="checkbox"]:checked {
    background-color: var(--active-text);
    border-color: var(--active-text);
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

input[type="checkbox"]:focus,
input[type="checkbox"]:focus-visible,
input[type="checkbox"]:active {
    outline: none !important;
    box-shadow: none !important;
    border-color: var(--active-text);
}