/* Popup A — centered modal */
#feedback-popup-a-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(15, 23, 42, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
#feedback-popup-a-overlay.is-open { display: flex; }

#feedback-popup-a-panel {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 560px;
    max-height: min(90vh, 720px);
    display: flex;
    flex-direction: column;
    position: relative;
    animation: feedbackFadeIn 0.25s ease;
}

.feedback-skip-top {
    font-size: 0.8125rem;
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.feedback-skip-top:hover { color: #6b7280; }

#feedback-popup-a-panel .feedback-skip-top {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    z-index: 2;
}

.feedback-popup-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem;
    line-height: 1.35;
}
.feedback-optional-tag {
    font-weight: 500;
    color: #9ca3af;
    font-size: 0.875rem;
}
.feedback-popup-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 1.25rem;
    line-height: 1.45;
}
.feedback-reward-highlight {
    color: #4f46e5;
    font-weight: 600;
}
.feedback-section-heading {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6366f1;
    margin: 0 0 0.75rem;
}

.feedback-stars-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}
.feedback-scale-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.4;
    flex: 1;
    min-width: 10rem;
}

.feedback-nps-ends-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 0.35rem;
}
.feedback-nps-control-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.feedback-nps-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #4f46e5;
    min-width: 1.75rem;
    text-align: right;
    line-height: 1;
}
.feedback-nps-segments-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: #9ca3af;
    margin-top: 0.5rem;
    gap: 0.25rem;
}

#feedback-popup-a-body {
    overflow-y: auto;
    padding: 2rem 1.5rem 1rem;
    flex: 1;
}

.feedback-q-label {
    font-weight: 600;
    color: #111827;
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}
.feedback-q-num { color: #6366f1; margin-right: 0.25rem; }
.feedback-q-hint { font-size: 0.75rem; color: #6b7280; margin-bottom: 0.75rem; }
.feedback-q-block { margin-bottom: 1.25rem; }

/* Bordered card per radio/checkbox choice (popups A & B) */
.feedback-option {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.625rem;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.feedback-option:last-child {
    margin-bottom: 0;
}
.feedback-option:hover {
    border-color: #d1d5db;
    background: #fafafa;
}
.feedback-option.is-selected,
.feedback-option:has(input:checked) {
    background: #f5f7ff;
    border-color: #a5b4fc;
}
.feedback-option input[type="checkbox"],
.feedback-option input[type="radio"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    accent-color: #6366f1;
    cursor: pointer;
}
.feedback-option input[type="radio"] {
    border-radius: 50%;
}

.feedback-stars { display: flex; gap: 0.25rem; font-size: 1.75rem; cursor: pointer; }
.feedback-stars .star { color: #d1d5db; transition: color 0.15s; }
.feedback-stars .star.active { color: #f59e0b; }

.feedback-nps-slider {
    width: 100%;
    accent-color: #6366f1;
}
.feedback-nps-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}
.feedback-nps-segment,
.feedback-nps-segment-label {
    text-align: center;
    font-size: 0.75rem;
    color: #4b5563;
    margin-top: 0.5rem;
    font-weight: 500;
}

#feedback-popup-a-footer {
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid #f3f4f6;
}

.feedback-footer-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.625rem;
}
@media (min-width: 400px) {
    .feedback-footer-actions {
        flex-direction: row;
        align-items: center;
    }
    .feedback-btn-primary { flex: 1.4; }
    .feedback-btn-skip { flex: 1; }
}

.feedback-btn-primary {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    cursor: pointer;
}
.feedback-btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.feedback-btn-skip {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: #6b7280;
    background: #fff;
    border: 1px solid #e5e7eb;
    cursor: pointer;
}
.feedback-btn-skip:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.feedback-thanks {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 1rem;
    color: #059669;
    font-weight: 600;
}

/* Popup B — bottom-right card; optional full-screen expand */
#feedback-popup-b-root {
    position: fixed;
    z-index: 10040;
    pointer-events: none;
}
#feedback-popup-b-root > * { pointer-events: auto; }

#feedback-popup-b-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10039;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    pointer-events: auto;
}
#feedback-popup-b-backdrop.is-visible { display: block; }

#feedback-popup-b-card {
    position: fixed;
    bottom: 5.5rem;
    right: 1rem;
    width: min(380px, calc(100vw - 2rem));
    max-height: 480px;
    background: #fff;
    border-radius: 1rem 1rem 0.75rem 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0,0,0,0.05);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, border-radius 0.2s ease;
    transform: translateY(100%);
    opacity: 0;
    z-index: 10041;
}
#feedback-popup-b-card.is-open {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}
#feedback-popup-b-card.is-expanded {
    max-height: 92vh;
}

/* Full-screen mode — survey only; shrink returns to corner card over chat */
#feedback-popup-b-card.is-fullscreen {
    inset: 0;
    bottom: 0;
    right: 0;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    height: 100% !important;
    border-radius: 0;
    z-index: 10050;
}
#feedback-popup-b-card.is-fullscreen #feedback-popup-b-drag {
    display: none;
}
#feedback-popup-b-card.is-fullscreen .feedback-b-header {
    padding: 2rem 1.5rem 0.75rem;
    max-width: 42rem;
    margin: 0 auto;
    width: 100%;
}
#feedback-popup-b-card.is-fullscreen #feedback-popup-b-body {
    max-width: 42rem;
    margin: 0 auto;
    width: 100%;
    padding: 0.5rem 1.5rem 1rem;
}
#feedback-popup-b-card.is-fullscreen #feedback-popup-b-footer {
    max-width: 42rem;
    margin: 0 auto;
    width: 100%;
    padding: 1rem 1.5rem 1.5rem;
}

#feedback-popup-b-drag {
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
}
#feedback-popup-b-drag::before {
    content: '';
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
}

.feedback-b-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem 0;
}
.feedback-b-header-text {
    flex: 1;
    min-width: 0;
    padding-right: 0.25rem;
}
.feedback-b-header-text .feedback-popup-title {
    font-size: 0.9375rem;
    margin-bottom: 0;
}
.feedback-b-header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}
.feedback-b-header-actions .feedback-skip-top {
    position: static;
    padding: 0.25rem 0.5rem;
}

.feedback-b-icon-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    color: #4b5563;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.feedback-b-icon-btn:hover { background: #e5e7eb; color: #111827; }
.feedback-b-icon-btn.hidden { display: none; }

.feedback-close-icon {
    width: 28px;
    height: 28px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    color: #6b7280;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.feedback-close-icon:hover { background: #e5e7eb; }

#feedback-popup-b-body {
    overflow-y: auto;
    padding: 0.5rem 1rem 0.75rem;
    flex: 1;
    min-height: 0;
}

#feedback-popup-b-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #f3f4f6;
    flex-shrink: 0;
}
#feedback-popup-b-footer .feedback-btn-primary {
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
}
#feedback-popup-b-footer .feedback-btn-skip {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
}

#feedback-popup-b-fab {
    position: fixed;
    bottom: 5.5rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border: none;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    z-index: 10039;
}
#feedback-popup-b-fab.is-visible { display: flex; }

@keyframes feedbackFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 767px) {
    #feedback-popup-a-panel { max-width: 100%; max-height: 92vh; }
    #feedback-popup-b-card {
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
        bottom: 4.5rem;
    }
    #feedback-popup-b-fab {
        right: 0.75rem;
        /* Fallback before JS positions it above the full-height mobile composer;
           positionSggFabAboveSend() sets the exact offset at runtime. */
        bottom: 7.5rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    #feedback-popup-a-panel { max-width: 520px; }
    #feedback-popup-b-card { width: min(360px, calc(100vw - 2rem)); }
}

@media (min-width: 1024px) {
    #feedback-popup-a-panel { max-width: 560px; }
}

/* Popup C — report relevance */
#feedback-popup-c-overlay {
    position: fixed;
    inset: 0;
    z-index: 10048;
    background: rgba(15, 23, 42, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
#feedback-popup-c-overlay.is-open { display: flex; }

#feedback-popup-c-panel {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 480px;
    max-height: min(85vh, 560px);
    display: flex;
    flex-direction: column;
    position: relative;
    animation: feedbackFadeIn 0.25s ease;
}

#feedback-popup-c-panel .feedback-skip-top {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    z-index: 2;
}

#feedback-popup-c-body {
    padding: 1.5rem 1.25rem 0.5rem;
    overflow-y: auto;
}

#feedback-popup-c-footer {
    padding: 0.75rem 1.25rem 1.25rem;
    border-top: 1px solid #f3f4f6;
}

.feedback-thumb-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.feedback-thumb-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.feedback-thumb-btn:hover { border-color: #a5b4fc; background: #f5f3ff; }
.feedback-thumb-btn.is-selected {
    border-color: #6366f1;
    background: #eef2ff;
    color: #4338ca;
}

/* Inline section ratings on career report */
.feedback-section-rating {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--ci-line, #e8ebef);
}
.feedback-section-rating-inner {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
}
.feedback-section-rating-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 0.5rem;
}
.feedback-section-why-label {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0.75rem 0 0.35rem;
}
.feedback-c-if-no {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}
.feedback-section-thanks {
    font-size: 0.875rem;
    color: #059669;
    font-weight: 500;
}

/* Aurora next-step widget (end of career report) */
.feedback-aurora-next {
    margin: 0 auto;
    max-width: 640px;
}
.feedback-aurora-next-inner {
    background: linear-gradient(135deg, #eef3ff 0%, #f5f3ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 1rem;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 4px 24px rgba(79, 70, 229, 0.08);
}
.feedback-aurora-next-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e1b4b;
    margin: 0 0 1rem;
    line-height: 1.4;
}
.feedback-aurora-next-btn {
    margin-top: 1.25rem;
    width: 100%;
}
