/* --- Critical Tipping / Strain Vignette --- */
#critical-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    box-shadow: inset 0 0 120px rgba(255, 0, 80, 0.0);
    z-index: 900;
    transition: box-shadow 0.4s ease;
}

#critical-vignette.active {
    box-shadow: inset 0 0 160px rgba(255, 0, 80, 0.65);
    animation: alarmPulse 1.2s infinite alternate;
}

@keyframes alarmPulse {
    0% { box-shadow: inset 0 0 120px rgba(255, 0, 80, 0.4); }
    100% { box-shadow: inset 0 0 200px rgba(255, 0, 80, 0.85); }
}

/* --- Astra Holographic Voice AI HUD (Grounded in docs/StoryBoard_SpecificTopics.docx) --- */
.aria-container, .astra-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: min(720px, 92vw);
    background: rgba(10, 16, 29, 0.85);
    border: 1px solid rgba(0, 245, 160, 0.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 245, 160, 0.15);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    z-index: 950;
    animation: astraSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes astraSlideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.aria-avatar, .astra-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aria-pulse-orb, .astra-pulse-orb {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 245, 160, 0.6) 0%, rgba(0, 210, 255, 0.2) 70%, transparent 100%);
    border: 1px solid rgba(0, 245, 160, 0.8);
    animation: orbPulse 2s infinite ease-in-out;
}

@keyframes orbPulse {
    0%, 100% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 15px #00f5a0; }
}

.aria-waveform, .astra-waveform {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 18px;
    z-index: 2;
}

.aria-waveform span, .astra-waveform span {
    width: 3px;
    height: 4px;
    background: #ffffff;
    border-radius: 2px;
    transition: height 0.1s ease;
}

.aria-waveform.speaking span:nth-child(1), .astra-waveform.speaking span:nth-child(1) { animation: wave 0.6s infinite 0.1s; }
.aria-waveform.speaking span:nth-child(2), .astra-waveform.speaking span:nth-child(2) { animation: wave 0.6s infinite 0.2s; }
.aria-waveform.speaking span:nth-child(3), .astra-waveform.speaking span:nth-child(3) { animation: wave 0.6s infinite 0.0s; }
.aria-waveform.speaking span:nth-child(4), .astra-waveform.speaking span:nth-child(4) { animation: wave 0.6s infinite 0.3s; }
.aria-waveform.speaking span:nth-child(5), .astra-waveform.speaking span:nth-child(5) { animation: wave 0.6s infinite 0.15s; }

@keyframes wave {
    0%, 100% { height: 4px; background: #00f5a0; }
    50% { height: 18px; background: #00d2ff; }
}

.aria-body, .astra-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.aria-title-row, .astra-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.aria-tag, .astra-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent-green);
    text-transform: uppercase;
}

.aria-freq, .astra-freq {
    font-size: 9px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.aria-subtitles, .astra-subtitles {
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.4;
    font-style: italic;
}

/* Psychometric Survey Modal */
.survey-card {
    max-width: 680px;
    max-height: 85vh;
    overflow-y: auto;
}

.survey-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.survey-tab-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.survey-tab-btn.active {
    background: rgba(0, 245, 160, 0.15);
    border-color: var(--accent-green);
    color: #ffffff;
}

.survey-question-item {
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
}

.survey-q-text {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #e2e8f0;
}

.likert-scale {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.likert-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-muted);
    cursor: pointer;
}

.likert-option input[type="radio"] {
    accent-color: var(--accent-green);
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Researcher Role Gating */
.researcher-only {
    display: none !important;
}

body.role-researcher .researcher-only {
    display: inline-flex !important;
}

body.role-researcher #stealth-inspector.researcher-only {
    display: flex !important;
}

/* Accessibility: Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    #critical-vignette.active {
        animation: none !important;
        box-shadow: inset 0 0 100px rgba(255, 0, 80, 0.4) !important;
    }
}
