/* space-create-dialog.css — Space creation wizard */
/* Prefix: ch-space-create- (legacy single-page) and ch-wiz- (new 2-step wizard) */

/* ════════════════════════════════════════════════════
   Folder create dialog
   ════════════════════════════════════════════════════ */
/* Reuses the .ch-wiz-* internals from the space wizard, but tightens the
   padding so a 3-field dialog doesn't feel bloated.
   Industry-standard compact modal padding is ~16–20px, not 24px+. */
/* Sized to match ClickUp's "Create Folder" reference layout — larger and
   more breathable than a typical compact prompt. */
.ch-folder-create-dialog {
    width: 480px;
    max-width: 92vw;
    max-height: 85vh;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: ch-folder-create-in 0.14s ease-out;
}

/* Header — no border below; subtitle sits ~6px under the title */
.ch-folder-create-dialog .ch-wiz-header {
    padding: 24px 24px 8px;
    border-bottom: none;
}
.ch-folder-create-dialog .ch-wiz-title { font-size: 18px; font-weight: 600; }
.ch-folder-create-dialog .ch-wiz-close { width: 26px; height: 26px; }
.ch-folder-create-dialog .ch-wiz-subtitle {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
}

/* Body — generous breathing room between sections */
.ch-folder-create-dialog .ch-wiz-body {
    padding: 16px 24px 0;
    gap: 16px;
}
.ch-folder-create-dialog .ch-wiz-field-label {
    margin-bottom: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}
.ch-folder-create-dialog .ch-wiz-input {
    padding: 9px 12px;
    font-size: 13px;
    border-radius: 8px;
}
.ch-folder-create-dialog .ch-wiz-desc {
    min-height: 44px;
    height: 44px;
    resize: none;
}

/* Make-private row sits in its own band with a separator above */
.ch-folder-create-dialog .ch-wiz-row {
    padding: 16px 0;
    margin-top: 8px;
    border-top: 1px solid var(--border, #2e2e2e);
}
.ch-folder-create-dialog .ch-wiz-row-label { font-size: 14px; font-weight: 600; }
.ch-folder-create-dialog .ch-wiz-row-hint { font-size: 12px; line-height: 1.4; margin-top: 2px; }

/* Footer — separator above, button styling matches ClickUp's proportions */
.ch-folder-create-dialog .ch-wiz-footer {
    padding: 14px 24px 18px;
    border-top: 1px solid var(--border, #2e2e2e);
    gap: 8px;
}
.ch-folder-create-dialog .ch-wiz-secondary-btn { padding: 7px 16px; font-size: 13px; border-radius: 8px; }
.ch-folder-create-dialog .ch-wiz-primary-btn { padding: 7px 18px; font-size: 13px; border-radius: 8px; }
@keyframes ch-folder-create-in {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ch-space-create-dialog {
    width: 560px;
    max-width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    padding: 0;
    animation: ch-space-create-in 0.15s ease-out;
}

/* ════════════════════════════════════════════════════
   2-step wizard layout (ch-wiz-)
   ════════════════════════════════════════════════════ */
.ch-space-create-wizard {
    width: 520px;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
.ch-wiz-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border, #2e2e2e);
}
.ch-wiz-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ch-wiz-back-arrow {
    background: none;
    border: none;
    color: var(--text-secondary, #aaa);
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    line-height: 1;
}
.ch-wiz-back-arrow:hover { background: var(--bg-hover, #2a2a2a); color: var(--text-primary, #e5e5e5); }
.ch-wiz-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #e5e5e5);
    flex: 1;
}
.ch-wiz-close {
    background: var(--bg-hover, #2a2a2a);
    border: none;
    color: var(--text-secondary, #aaa);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ch-wiz-close:hover { color: var(--text-primary, #e5e5e5); background: var(--bg-active, #383838); }
.ch-wiz-subtitle {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted, #888);
    line-height: 1.45;
}

/* ── Body ── */
.ch-wiz-body {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.ch-wiz-field-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #e5e5e5);
    margin-bottom: -4px;
}
.ch-wiz-field-label-suffix {
    font-weight: 400;
    color: var(--text-muted, #888);
}

/* ── Identity row (icon + name) ── */
.ch-wiz-identity {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ch-wiz-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.12s;
}
.ch-wiz-icon:hover { transform: scale(1.05); }

/* ── Inputs ── */
.ch-wiz-input {
    width: 100%;
    background: var(--bg-input, #1c1c1c);
    border: 1px solid var(--border, #2e2e2e);
    border-radius: 8px;
    color: var(--text-primary, #e5e5e5);
    font-size: 14px;
    font-family: inherit;
    padding: 8px 12px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.12s;
}
.ch-wiz-input:focus { border-color: var(--accent, #00B4EA); }
.ch-wiz-input::placeholder { color: var(--text-muted, #666); }
.ch-wiz-name { flex: 1; }
.ch-wiz-desc { resize: vertical; min-height: 60px; }

/* ── Generic row (label + control) ── */
.ch-wiz-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
}
.ch-wiz-row-label-col { display: flex; flex-direction: column; gap: 2px; }
.ch-wiz-row-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #e5e5e5);
}
.ch-wiz-row-hint {
    font-size: 12px;
    color: var(--text-muted, #888);
}

/* ── Pill toggle (Local/Cloud) ── */
.ch-wiz-pill {
    display: inline-flex;
    border: 1px solid var(--border, #2e2e2e);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-input, #1c1c1c);
}
.ch-wiz-pill-btn {
    background: none;
    border: none;
    color: var(--text-muted, #888);
    font-size: 13px;
    font-family: inherit;
    padding: 6px 16px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.ch-wiz-pill-btn:hover { color: var(--text-primary, #e5e5e5); }
.ch-wiz-pill-btn--active {
    background: color-mix(in srgb, var(--accent, #00B4EA) 18%, transparent);
    color: var(--accent, #00B4EA);
    font-weight: 500;
}

/* ── Select (dropdown) ── */
.ch-wiz-select {
    background: var(--bg-input, #1c1c1c);
    border: 1px solid var(--border, #2e2e2e);
    border-radius: 6px;
    color: var(--text-primary, #e5e5e5);
    font-size: 13px;
    padding: 6px 10px;
    outline: none;
    cursor: pointer;
}
.ch-wiz-select:hover, .ch-wiz-select:focus { border-color: var(--accent, #00B4EA); }

/* ── Switch (iOS-style toggle) ── */
.ch-wiz-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.ch-wiz-switch input { opacity: 0; width: 0; height: 0; }
.ch-wiz-switch-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border, #3a3a3a);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.18s;
}
.ch-wiz-switch-slider::before {
    content: '';
    position: absolute;
    height: 16px; width: 16px;
    top: 2px; left: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.18s;
}
.ch-wiz-switch input:checked + .ch-wiz-switch-slider { background: var(--accent, #00B4EA); }
.ch-wiz-switch input:checked + .ch-wiz-switch-slider::before { transform: translateX(16px); }
.ch-wiz-switch--locked { opacity: 0.85; cursor: not-allowed; }

/* ── Footer ── */
.ch-wiz-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border, #2e2e2e);
}
.ch-wiz-secondary-btn {
    background: none;
    border: 1px solid var(--border, #2e2e2e);
    color: var(--text-secondary, #ccc);
    padding: 7px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}
.ch-wiz-secondary-btn:hover { background: var(--bg-hover, #2a2a2a); color: var(--text-primary, #e5e5e5); }
.ch-wiz-secondary-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ch-wiz-primary-btn {
    background: var(--accent, #00B4EA);
    border: none;
    color: #fff;
    padding: 7px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: opacity 0.12s, background 0.12s;
}
.ch-wiz-primary-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--accent, #00B4EA) 88%, #fff); }
.ch-wiz-primary-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Step 2: Template grid (2x2) ── */
.ch-wiz-template-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 6px;
}
.ch-wiz-template-card {
    border: 1px solid var(--border, #2e2e2e);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    background: var(--bg-input, #1c1c1c);
    transition: border-color 0.12s, background 0.12s;
}
.ch-wiz-template-card:hover { background: var(--bg-hover, #242424); }
.ch-wiz-template-card--selected {
    border-color: var(--accent, #00B4EA);
    background: color-mix(in srgb, var(--accent, #00B4EA) 8%, transparent);
}
.ch-wiz-template-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #e5e5e5);
    margin-bottom: 3px;
}
.ch-wiz-template-desc {
    font-size: 12px;
    color: var(--text-muted, #888);
    line-height: 1.35;
}

/* ── "Customize defaults for X" section ── */
.ch-wiz-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #e5e5e5);
    margin-top: 10px;
    margin-bottom: -4px;
}
.ch-wiz-customize-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ch-wiz-customize-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border, #2e2e2e);
    border-radius: 10px;
    cursor: pointer;
    background: var(--bg-input, #1c1c1c);
    transition: background 0.12s, border-color 0.12s;
}
.ch-wiz-customize-card:hover {
    background: var(--bg-hover, #242424);
    border-color: var(--border-strong, #3a3a3a);
}
.ch-wiz-customize-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--bg-hover, #2a2a2a);
    color: var(--text-secondary, #bbb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.ch-wiz-customize-text { flex: 1; min-width: 0; }
.ch-wiz-customize-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #e5e5e5);
}
.ch-wiz-customize-sub {
    font-size: 12px;
    color: var(--text-muted, #888);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ch-wiz-customize-chevron {
    color: var(--text-muted, #666);
    font-size: 18px;
    flex-shrink: 0;
}

/* ── Views editor ── */
.ch-wiz-views-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border, #2e2e2e);
    border-radius: 10px;
    overflow: hidden;
}
.ch-wiz-view-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border, #2e2e2e);
}
.ch-wiz-view-row:last-child { border-bottom: none; }
.ch-wiz-view-left { display: flex; align-items: center; gap: 10px; }
.ch-wiz-view-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    flex-shrink: 0;
}
.ch-wiz-view-label {
    font-size: 13px;
    color: var(--text-primary, #e5e5e5);
}
.ch-wiz-view-required {
    font-size: 12px;
    color: var(--text-muted, #888);
}
.ch-wiz-view-right { display: flex; align-items: center; gap: 10px; }
.ch-wiz-view-default-tag {
    font-size: 11px;
    color: var(--accent, #00B4EA);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ── Statuses editor ── */
.ch-space-create-dialog:has(.ch-wiz-statuses-body) {
    width: 640px;
    height: min(525px, 85vh);
    overflow: hidden;
    padding: 0;
}
.ch-wiz-statuses-body {
    display: flex;
    flex-direction: row;
    padding: 0;
    gap: 0;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}
.ch-wiz-statuses-left { width: 252px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; border-right: 1px solid var(--border, #2e2e2e); padding: 16px 24px; }
.ch-wiz-statuses-select { width: 100%; padding: 8px 10px; }

.ch-tpl-picker { display: flex; flex-direction: column; gap: 4px; }
.ch-tpl-picker-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; cursor: pointer; }
.ch-tpl-picker-chevron { font-size: 11px; opacity: .7; margin-left: 4px; flex-shrink: 0; }

.ch-tpl-picker-popup { position: fixed; z-index: 10001; background: var(--bg-elevated, #1e1e1e); border: 1px solid var(--border, #2e2e2e); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.45); display: flex; flex-direction: column; max-height: 300px; overflow: hidden; }
.ch-tpl-picker-search-wrap { padding: 8px 8px 4px; flex-shrink: 0; }
.ch-tpl-picker-search { width: 100%; box-sizing: border-box; background: var(--bg-input, #141414); border: 1px solid var(--border, #2e2e2e); border-radius: 5px; color: var(--text, #e8e8e8); font-size: 12px; padding: 5px 8px; outline: none; }
.ch-tpl-picker-search:focus { border-color: var(--accent, #00B4EA); }
.ch-tpl-picker-list { overflow-y: auto; flex: 1; padding: 2px 4px; }
.ch-tpl-picker-item { display: flex; align-items: center; gap: 6px; padding: 6px 6px; border-radius: 5px; cursor: pointer; user-select: none; font-size: 13px; color: var(--text, #e8e8e8); }
.ch-tpl-picker-item:hover { background: var(--hover, rgba(255,255,255,.06)); }
.ch-tpl-picker-item--selected { color: var(--accent, #00B4EA); }
.ch-tpl-picker-item-check { width: 14px; font-size: 12px; flex-shrink: 0; color: var(--accent, #00B4EA); }
.ch-tpl-picker-item-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-tpl-picker-item-more { display: none; background: none; border: none; cursor: pointer; padding: 1px 4px; border-radius: 4px; font-size: 15px; color: var(--text-muted, #888); line-height: 1; flex-shrink: 0; }
.ch-tpl-picker-item:hover .ch-tpl-picker-item-more { display: block; }
.ch-tpl-picker-item-more:hover { background: var(--hover, rgba(255,255,255,.1)); color: var(--text, #e8e8e8); }
.ch-tpl-picker-rename-input { flex: 1; font-size: 13px; background: var(--bg-input, #141414); border: 1px solid var(--accent, #00B4EA); border-radius: 4px; color: var(--text, #e8e8e8); padding: 3px 6px; outline: none; min-width: 0; }
.ch-tpl-picker-footer { padding: 4px 4px 6px; border-top: 1px solid var(--border, #2e2e2e); flex-shrink: 0; }
.ch-tpl-picker-new-btn { background: none; border: none; cursor: pointer; padding: 6px 8px; border-radius: 5px; font-size: 12px; color: var(--text-muted, #888); text-align: left; width: 100%; }
.ch-tpl-picker-new-btn:hover { background: var(--hover, rgba(255,255,255,.06)); color: var(--text, #e8e8e8); }
.ch-tpl-picker-new-input { width: 100%; box-sizing: border-box; background: var(--bg-input, #141414); border: 1px solid var(--accent, #00B4EA); border-radius: 5px; color: var(--text, #e8e8e8); font-size: 12px; padding: 6px 8px; outline: none; }
.ch-tpl-picker-error { font-size: 11px; color: var(--danger, #ef4444); padding: 2px 8px 0; }

.ch-tpl-item-menu { position: fixed; z-index: 10002; background: var(--bg-elevated, #1e1e1e); border: 1px solid var(--border, #2e2e2e); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.4); padding: 4px; min-width: 120px; }
.ch-tpl-item-menu-confirm { padding: 6px 10px 2px; }
.ch-tpl-item-menu-confirm-label { font-size: 12px; color: var(--text-muted, #888); }
.ch-tpl-item-menu-item { padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 13px; color: var(--text, #e8e8e8); }
.ch-tpl-item-menu-item:hover { background: var(--hover, rgba(255,255,255,.06)); }
.ch-tpl-item-menu-item--danger { color: var(--danger, #f87171); }
.ch-tpl-item-menu-item--danger:hover { background: rgba(248,113,113,.1); }


.ch-wiz-statuses-right { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px 24px; overflow-y: auto; }

.ch-wiz-status-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ch-wiz-status-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px;
}
.ch-wiz-status-group-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #bbb);
}
.ch-wiz-status-group-info {
    color: var(--text-muted, #666);
    font-size: 12px;
    cursor: help;
}
.ch-wiz-status-group-add {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted, #888);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    border-radius: 4px;
}
.ch-wiz-status-group-add:hover { background: var(--bg-hover, #2a2a2a); color: var(--text-primary, #e5e5e5); }

.ch-wiz-status-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ch-wiz-status-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border, #2e2e2e);
    border-radius: 8px;
    background: var(--bg-input, #1c1c1c);
}
.ch-wiz-status-handle {
    color: var(--text-muted, #555);
    font-size: 14px;
    cursor: grab;
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
    letter-spacing: -3px;
    padding-right: 3px;
}
.ch-wiz-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ch-wiz-status-name {
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary, #e5e5e5);
    letter-spacing: 0.5px;
    cursor: text;
    outline: none;
    min-width: 40px;
}
.ch-wiz-status-name--editing {
    background: var(--bg-hover, #2a2a2a);
    padding: 0 4px;
    border-radius: 3px;
}
.ch-wiz-status-menu {
    background: none;
    border: none;
    color: var(--text-muted, #888);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}
.ch-wiz-status-menu:hover { background: var(--bg-hover, #2a2a2a); color: var(--text-primary, #e5e5e5); }

.ch-wiz-status-add-row {
    background: none;
    border: 1px dashed var(--border, #2e2e2e);
    color: var(--text-muted, #888);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.ch-wiz-status-add-row:hover {
    border-color: var(--accent, #00B4EA);
    color: var(--text-primary, #e5e5e5);
    background: var(--bg-hover, #242424);
}

/* Chip context menu (Rename / Delete) */
.ch-wiz-status-chip-menu {
    background: var(--bg-surface, #2F2F2F);
    border: 1px solid var(--border, #404040);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    padding: 4px 0;
    min-width: 140px;
}
.ch-wiz-status-chip-menu-item {
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-primary, #e5e5e5);
    cursor: pointer;
    transition: background 0.1s;
}
.ch-wiz-status-chip-menu-item:hover { background: var(--bg-hover, #383838); }
.ch-wiz-status-chip-menu-item--danger { color: #e55; }
.ch-wiz-status-chip-menu-item--danger:hover { background: rgba(220, 50, 50, 0.15); }

/* Footer with help link + actions on the right */
.ch-wiz-statuses-footer { justify-content: space-between; }
.ch-wiz-help-link {
    color: var(--text-muted, #888);
    font-size: 12px;
    text-decoration: underline;
}
.ch-wiz-help-link:hover { color: var(--text-secondary, #bbb); }
.ch-wiz-footer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ch-space-create-dialog--open {
    opacity: 1;
    transform: translateY(0);
}

@keyframes ch-space-create-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Section ── */
.ch-space-create-section {
    padding: 20px 24px 12px;
}

.ch-space-create-section + .ch-space-create-section {
    border-top: 1px solid var(--border, #2e2e2e);
    padding-top: 16px;
}

.ch-space-create-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #666);
    margin-bottom: 12px;
}

/* ── Identity row ── */
.ch-space-create-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.ch-space-create-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.12s, box-shadow 0.12s;
}

.ch-space-create-icon:hover {
    transform: scale(1.08);
    box-shadow: 0 0 0 3px var(--bg-surface, #242424), 0 0 0 5px var(--accent, #00B4EA);
}

.ch-space-create-name {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border, #2e2e2e);
    color: var(--text-primary, #e5e5e5);
    font-size: 18px;
    font-weight: 500;
    padding: 8px 0;
    outline: none;
    box-sizing: border-box;
}

.ch-space-create-name:focus {
    border-bottom-color: var(--accent, #00B4EA);
}

.ch-space-create-name::placeholder {
    color: var(--text-muted, #666);
    font-weight: 400;
}

/* ── Description ── */
.ch-space-create-desc-wrap {
    margin-top: 4px;
    padding-left: 52px; /* align with name input (40px icon + 12px gap) */
}

.ch-space-create-desc-toggle {
    font-size: 13px;
    color: var(--text-muted, #666);
    text-decoration: none;
    cursor: pointer;
}

.ch-space-create-desc-toggle:hover {
    color: var(--accent, #00B4EA);
}

.ch-space-create-desc {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border, #2e2e2e);
    border-radius: 6px;
    color: var(--text-primary, #e5e5e5);
    font-size: 13px;
    font-family: inherit;
    padding: 8px 10px;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
}

.ch-space-create-desc:focus {
    border-color: var(--accent, #00B4EA);
}

.ch-space-create-desc::placeholder {
    color: var(--text-muted, #666);
}

/* ── Project kind toggle (Local / Cloud pill) ── */
.ch-space-create-kind-row {
    padding-left: 52px; /* align with name input */
    margin-top: 12px;
}

.ch-space-create-kind-pill {
    display: inline-flex;
    border: 1px solid var(--border, #2e2e2e);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-surface, #242424);
}

.ch-space-create-kind-btn {
    background: none;
    border: none;
    color: var(--text-muted, #888);
    font-size: 13px;
    font-family: inherit;
    padding: 6px 18px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.ch-space-create-kind-btn:hover {
    color: var(--text-primary, #e5e5e5);
    background: var(--bg-hover, #2a2a2a);
}

.ch-space-create-kind-btn--active {
    background: color-mix(in srgb, var(--accent, #00B4EA) 15%, transparent);
    color: var(--accent, #00B4EA);
    font-weight: 500;
}

/* ── Cloud permissions ── */
.ch-space-create-cloud {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    padding-left: 52px;
}

.ch-space-create-select {
    background: var(--bg-surface, #242424);
    border: 1px solid var(--border, #2e2e2e);
    border-radius: 6px;
    color: var(--text-primary, #e5e5e5);
    font-size: 13px;
    padding: 6px 10px;
    outline: none;
    cursor: pointer;
}

.ch-space-create-select:hover,
.ch-space-create-select:focus {
    border-color: var(--accent, #00B4EA);
}

.ch-space-create-toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary, #aaa);
    cursor: pointer;
    user-select: none;
}

.ch-space-create-toggle {
    accent-color: var(--accent, #00B4EA);
}

/* ── Template grid ── */
.ch-space-create-templates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ch-space-create-tpl-card {
    border: 1px solid var(--border, #2e2e2e);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}

.ch-space-create-tpl-card:hover {
    background: var(--bg-hover, #2a2a2a);
}

.ch-space-create-tpl-card--selected {
    border-color: var(--accent, #00B4EA);
    background: rgba(0, 180, 234, 0.06);
}

.ch-space-create-tpl-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #e5e5e5);
    margin-bottom: 2px;
}

.ch-space-create-tpl-desc {
    font-size: 11px;
    color: var(--text-muted, #666);
    margin-bottom: 6px;
}

.ch-space-create-tpl-views {
    font-size: 10px;
    color: var(--text-secondary, #aaa);
    margin-bottom: 6px;
}

/* ── Status chain (dots + arrows) ── */
.ch-space-create-tpl-chain {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
}

.ch-space-create-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ch-space-create-status-arrow {
    font-size: 9px;
    color: var(--text-muted, #666);
}

.ch-space-create-status-name {
    font-size: 11px;
    color: var(--text-secondary, #aaa);
    margin-right: 2px;
}

/* ── Customize defaults ── */
.ch-space-create-customize-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-muted, #666);
    font-size: 12px;
    cursor: pointer;
    padding: 8px 0;
    margin-top: 4px;
}

.ch-space-create-customize-btn::before {
    content: '\25B6';
    font-size: 8px;
    transition: transform 0.15s;
}

.ch-space-create-customize-btn--open::before {
    transform: rotate(90deg);
}

.ch-space-create-customize-btn:hover {
    color: var(--accent, #00B4EA);
}

.ch-space-create-custom-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #666);
    margin-bottom: 6px;
}

/* Pill-style toggle chips instead of native checkboxes */
.ch-space-create-custom-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 4px;
}

.ch-space-create-check-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    font-size: 12px;
    color: var(--text-secondary, #aaa);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid var(--border, #2e2e2e);
    background: var(--bg-surface, #242424);
    transition: all 0.12s ease;
}

.ch-space-create-check-label:hover {
    border-color: var(--text-muted, #555);
    color: var(--text-primary, #e5e5e5);
}

/* Hide the native checkbox */
.ch-space-create-check-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Checked = filled pill */
.ch-space-create-check--on {
    background: color-mix(in srgb, var(--accent, #00B4EA) 15%, transparent);
    border-color: var(--accent, #00B4EA);
    color: var(--accent, #00B4EA);
}

.ch-space-create-custom-row {
    padding: 10px 0;
    border-top: 1px solid var(--border, #2e2e2e);
    margin: 0 4px;
}

/* ── Color picker popover ── */
.ch-space-create-color-pop {
    display: grid;
    grid-template-columns: repeat(5, 28px);
    gap: 4px;
    padding: 8px;
    background: var(--bg-surface, #2F2F2F);
    border: 1px solid var(--border, #404040);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.ch-space-create-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.1s;
}

.ch-space-create-swatch:hover {
    transform: scale(1.15);
}

.ch-space-create-swatch--active {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--accent, #00B4EA);
}

/* ── Footer ── */
.ch-space-create-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 24px 16px;
    border-top: 1px solid var(--border, #2e2e2e);
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .ch-space-create-dialog {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    .ch-space-create-templates {
        grid-template-columns: 1fr;
    }
    .ch-space-create-section {
        padding: 16px;
    }
    .ch-space-create-footer {
        padding: 12px 16px;
    }
    .ch-space-create-cloud {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding-left: 0;
    }
    .ch-space-create-desc-wrap {
        padding-left: 0;
    }
}

/* ── Import-from-file zone (step 2 pseudo-template) ── */
.ch-wiz-import-zone {
    margin-top: 12px;
}
.ch-wiz-import-dropzone {
    border: 2px dashed var(--border, #404040);
    border-radius: 10px;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    background: var(--bg-input, #1c1c1c);
    transition: border-color 0.12s, background 0.12s;
}
.ch-wiz-import-dropzone:hover,
.ch-wiz-import-dropzone--over {
    border-color: var(--accent, #00B4EA);
    background: color-mix(in srgb, var(--accent, #00B4EA) 6%, transparent);
}
.ch-wiz-import-dropzone--loaded {
    border-style: solid;
    border-color: var(--accent, #00B4EA);
}
.ch-wiz-import-icon {
    font-size: 24px;
    margin-bottom: 8px;
}
.ch-wiz-import-board {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #e5e5e5);
    margin-bottom: 2px;
}
.ch-wiz-import-meta {
    font-size: 12px;
    color: var(--text-secondary, #aaa);
    margin-bottom: 6px;
}
.ch-wiz-import-hint {
    font-size: 12px;
    color: var(--text-muted, #888);
    line-height: 1.4;
}
.ch-wiz-import-replace {
    margin-top: 8px;
    font-size: 11px;
    color: var(--accent, #00B4EA);
}

/* ── Light theme overrides ── */
@media (prefers-color-scheme: light) {
    .ch-space-create-color-pop {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }

    .ch-space-create-swatch--active {
        border-color: #333;
    }
}

.ch-wiz-split-btn-wrapper { display: flex; }
.ch-wiz-split-btn-main { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ch-wiz-split-btn-chevron { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: none; padding: 0 8px; }
.ch-wiz-split-btn-menu { position: fixed; background: var(--bg-elevated, #1e1e1e); border: 1px solid var(--border, #2e2e2e); border-radius: 6px; padding: 4px; z-index: 10002; min-width: 180px; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.ch-wiz-split-btn-menu-item { padding: 6px 10px; border-radius: 4px; font-size: 13px; cursor: pointer; color: var(--text, #e8e8e8); }
.ch-wiz-split-btn-menu-item:hover { background: var(--hover, rgba(255,255,255,.06)); }
