/* ════════════════════════════════════════════════════
   apps/signals-create.css — the create-signal dialog (`.csd-*`)
   ════════════════════════════════════════════════════
   Moved out of signals.css (far past the 600-line cap) with the Signal Spaces
   arc P5.2, which grows the dialog a Space selector. The dialog's mobile
   bottom-sheet override still rides signals.css's shared responsive block with
   the wizard's (`.wizard-overlay, .csd-overlay`), since the two share it. */
/* ── Create Signal Dialog ─────────────────────────── */
.csd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(2px);
}
.csd-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 32px 24px;
    width: 400px;
    max-width: calc(100vw - 32px);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.45);
}
.csd-panel--wide {
    width: 560px;
}
.csd-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
}
.csd-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.csd-identity {
    display: flex;
    align-items: center;
    gap: 14px;
}
.csd-type-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}
.csd-identity-text { display: flex; flex-direction: column; gap: 3px; }
.csd-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}
.csd-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}
.csd-name-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
}
.csd-name-input::placeholder { color: var(--text-muted); }
.csd-name-input:focus { border-color: var(--text-muted); }
.csd-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}
.csd-btn-primary {
    padding: 9px 22px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
}
.csd-btn-primary:hover { opacity: 0.85; }
.csd-btn-back {
    padding: 9px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.csd-btn-back:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ── Type selection step ─────────────────────────── */
.csd-choose-header { display: flex; flex-direction: column; gap: 4px; }
.csd-type-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.csd-type-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-surface);
    transition: border-color 0.12s, background 0.12s;
}
.csd-type-card:hover { border-color: var(--text-muted); }
.csd-type-card.selected { border-color: var(--text-primary); background: var(--bg-hover); }
.csd-type-card-preview {
    position: relative;
    height: 72px;
    background: var(--bg-primary);
    overflow: hidden;
    border-radius: 2px 2px 0 0;
}
.csd-preview-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.9);
    pointer-events: none;
    line-height: 1.4;
}
.csd-type-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px 4px;
}
.csd-type-card-icon { font-size: 16px; }
.csd-type-card-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.csd-type-card-desc {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 10px 8px;
    line-height: 1.4;
    height: 31px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ── The Space row (Signal Spaces arc P5.2, AB#13103): at the top of both steps.
   The pill anchors the shared Space picker (controls/space-picker.js), which
   mounts into the pill's parent — hence the row is positioned. ── */
.csd-space {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
    padding-right: 28px;   /* clear of the close button */
}
.csd-space-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.csd-space-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease;
}
.csd-space-pill:hover { background: var(--bg-hover); border-color: var(--accent); }
.csd-space-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.csd-space-dot {
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}
.csd-space-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.csd-space-caret { color: var(--text-muted); font-size: 11px; }
.csd-space-note {
    flex-basis: 100%;
    font-size: 12px;
    color: var(--warning, var(--text-secondary));
}
.csd-space-note[hidden] { display: none; }
