/* ── "Ask a question" composer (post style) — platform identity ── */

.qc-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(15, 23, 42, 0.45);
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: #0f172a;
}
.qc-overlay[style*="flex"] { display: flex; }

.qc-panel {
    width: 100%;
    max-width: 600px;
    max-height: calc(100vh - 48px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: qcPop 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes qcPop { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

.qc-handle { display: none; }

.qc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}
.qc-heading { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: #0f172a; }
.qc-cancel { display: none; }
.qc-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}
.qc-close:hover { background: #f8fafc; color: #0f172a; }

.qc-form { display: flex; flex-direction: column; min-height: 0; flex: 1; margin: 0; }
.qc-body {
    padding: 18px 20px 4px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    min-height: 0;
}

.qc-author { display: flex; align-items: center; gap: 12px; }
.qc-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    object-fit: cover;
    flex-shrink: 0;
}
.qc-author-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.qc-author-name { font-size: 15px; font-weight: 600; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qc-audience {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: max-content;
    padding: 2px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 500;
}
.qc-audience i { font-size: 10px; }
.qc-audience.is-anon { background: #eff6ff; color: #1d4ed8; }

.qc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.qc-title-input {
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 4px 0 10px;
    font-family: inherit;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    background: transparent;
    outline: none;
}
.qc-title-input:focus { border-bottom-color: #2563eb; }

.qc-text {
    width: 100%;
    box-sizing: border-box;
    min-height: 130px;
    max-height: 40vh;
    border: none;
    outline: none;
    resize: none;
    padding: 0;
    font-family: inherit;
    font-size: 17px;
    line-height: 1.6;
    color: #0f172a;
    background: transparent;
}
.qc-text::placeholder { color: #94a3b8; }

.qc-title-preview {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
    color: #475569;
}
.qc-title-preview i { color: #2563eb; font-size: 12px; margin-top: 3px; }
.qc-title-preview strong { color: #0f172a; font-weight: 600; }

.qc-link {
    align-self: flex-start;
    border: none;
    background: none;
    padding: 0;
    color: #2563eb;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.qc-link:hover { text-decoration: underline; }

.qc-helpers { display: flex; flex-wrap: wrap; gap: 8px; }
.qc-helper {
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px dashed #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.qc-helper:hover { border-color: #2563eb; color: #1d4ed8; background: #eff6ff; }

.qc-section { display: flex; flex-direction: column; gap: 8px; }
.qc-section-label { font-size: 13px; font-weight: 500; color: #64748b; }
.qc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qc-chip { position: relative; cursor: pointer; margin: 0; }
.qc-chip input { position: absolute; opacity: 0; pointer-events: none; }
.qc-chip span,
.qc-chip-more {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.qc-chip:hover span { border-color: #cbd5e1; }
.qc-chip input:checked + span { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.qc-chip input:checked + span::before { content: "\2713"; margin-inline-end: 6px; font-size: 12px; }
.qc-chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25); }
.qc-chip-more { color: #2563eb; cursor: pointer; }
.qc-chip-extra { display: none; }
.qc-chips.is-open .qc-chip-extra { display: inline-block; }
.qc-chips.is-open .qc-chip-more { display: none; }

.qc-photo-preview { position: relative; width: max-content; max-width: 100%; }
.qc-photo-preview img { display: block; max-height: 160px; max-width: 100%; border-radius: 12px; border: 1px solid #e2e8f0; }
.qc-photo-remove {
    position: absolute;
    top: 6px;
    inset-inline-end: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.qc-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    margin-top: 14px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
}
.qc-tool {
    height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #475569;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
    transition: background 0.15s;
}
.qc-tool:hover { background: #f8fafc; }
.qc-tool .fa-camera { color: #059669; font-size: 16px; }
.qc-switch input { position: absolute; opacity: 0; pointer-events: none; }
.qc-switch-track {
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s;
}
.qc-switch-track span {
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
    transition: transform 0.2s;
}
.qc-switch input:checked + .qc-switch-track { background: #2563eb; }
.qc-switch input:checked + .qc-switch-track span { transform: translateX(14px); }
[dir="rtl"] .qc-switch input:checked + .qc-switch-track span { transform: translateX(-14px); }
.qc-switch input:focus-visible + .qc-switch-track { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25); }

.qc-spacer { flex: 1; }
.qc-min { font-size: 12px; color: #94a3b8; }
.qc-min.is-hidden { display: none; }
.qc-submit {
    height: 42px;
    padding: 0 22px;
    border: none;
    border-radius: 12px;
    background: #2563eb;
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}
.qc-submit:hover:not(:disabled) { background: #1d4ed8; }
.qc-submit:disabled { background: #bfdbfe; cursor: not-allowed; }
[dir="rtl"] .qc-submit .fa-paper-plane { transform: scaleX(-1); }

/* ── Closed "What's your question?" box on the Questions page ── */
.qc-launcher {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: 'Inter', system-ui, sans-serif;
}
.qc-launcher-row { display: flex; align-items: center; gap: 12px; }
.qc-launcher-input {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 999px;
    padding: 0 18px;
    text-align: start;
    font-family: inherit;
    font-size: 15px;
    color: #64748b;
    cursor: text;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.qc-launcher-input:hover { background: #f1f5f9; border-color: #cbd5e1; }
.qc-launcher-divider { height: 1px; background: #f1f5f9; }
.qc-launcher-actions { display: flex; gap: 4px; }
.qc-launcher-actions .qc-tool { flex: 1; justify-content: center; }
.qc-launcher-actions .fa-user-secret { color: #2563eb; }
.qc-launcher-actions .fa-tag { color: #d97706; }

/* ── Phone: bottom sheet ── */
@media (max-width: 640px) {
    .qc-overlay { padding: 0; align-items: flex-end; }
    .qc-panel {
        max-width: none;
        height: 92vh;
        height: 92dvh;
        max-height: none;
        border-radius: 22px 22px 0 0;
        animation: qcSheet 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }
    @keyframes qcSheet { from { transform: translateY(100%); } to { transform: none; } }
    .qc-handle { display: flex; justify-content: center; padding-top: 8px; }
    .qc-handle span { width: 40px; height: 5px; border-radius: 999px; background: #cbd5e1; }
    .qc-head { padding: 6px 12px 10px; }
    .qc-heading { font-size: 16px; }
    .qc-cancel {
        display: inline-flex;
        align-items: center;
        height: 44px;
        padding: 0 6px;
        border: none;
        background: none;
        color: #475569;
        font-family: inherit;
        font-size: 15px;
        cursor: pointer;
    }
    .qc-close { visibility: hidden; }
    .qc-body { padding: 14px 16px 4px; flex: 1; }
    .qc-text { max-height: none; }
    .qc-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
    .qc-chips::-webkit-scrollbar { display: none; }
    .qc-chip-extra { display: inline-block; }
    .qc-chip-more { display: none; }
    .qc-chip span { height: 36px; }
    .qc-bar { padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px)); margin-top: 8px; }
    .qc-tool { height: 44px; background: #f8fafc; }
    .qc-launcher-actions .qc-tool { background: transparent; }
    .qc-launcher-actions .qc-tool span { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .qc-panel { animation: none; }
}
