/* ==================== ROOT VARIABLES — Quiet Luxury ==================== */
:root {
    /* ---- Background depths (warm deep, not cold tech) ---- */
    --bg-deep: #020510;
    --bg-graphite: #060c1e;
    --bg-panel: #080c1e;
    --bg-glass: rgba(8, 12, 30, 0.85);
    --bg-glass-strong: rgba(12, 16, 36, 0.92);

    /* ---- Borders (softer, warmer) ---- */
    --border-subtle: rgba(110, 231, 255, 0.08);
    --border-mid: rgba(110, 231, 255, 0.15);

    /* ---- Text (warm white, not cold) ---- */
    --text-primary: #e0f0ff;
    --text-secondary: #8090b0;
    --text-tertiary: #506080;

    /* ---- Accent colors (quiet luxury: gold, beige, sage) ---- */
    --accent-blue: #6ee7ff;
    --accent-beige: #b8a0ff;
    --accent-green: #4aff9e;
    --accent-blue-dim: rgba(196, 168, 124, 0.14);
    --accent-beige-dim: rgba(200, 189, 168, 0.14);
    --accent-green-dim: rgba(154, 170, 154, 0.14);

    /* ---- Glow (soft, warm, never harsh) ---- */
    --glow-blue: rgba(110, 231, 255, 0.3);
    --glow-strong: rgba(110, 231, 255, 0.5);

    /* ---- Border radius (generous, editorial) ---- */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;

    /* ---- Transitions (slow, deliberate, breathing) ---- */
    --transition-fast: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 1.1s cubic-bezier(0.4, 0, 0.2, 1);

    /* ======== EXTENDED VARIABLES (v4) ======== */

    /* ---- Glass & Depth ---- */
    --backdrop-blur: blur(12px);
    --blur-behind: 6px;
    --transmission: 0.45;
    --surface-roughness: 0.5;
    --specular-intensity: 0.35;

    /* ---- Grid & Structure ---- */
    --grid-opacity: 0.04;
    --depth-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --parallax-intensity: 0.4;

    /* ---- Typography (light, editorial, airy) ---- */
    --heading-weight: 300;
    --heading-letter-spacing: 0.04em;
    --font-body: "Manrope", "Inter", sans-serif;
    --font-display: "Manrope", "Inter", sans-serif;

    /* ---- Color processing ---- */
    --color-interpolation: oklch;
    --saturation-boost: 0.9;
    --contrast-multiplier: 0.95;

    /* ---- Animation & Spring (slower, heavier) ---- */
    --spring-tension: 140;
    --spring-friction: 22;
    --spring-mass: 1.2;

    /* ---- Layout ---- */
    --glass-layers: 2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    height: 100%;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
body {
    font-family: var(--font-body);
    font-weight: 300;
    letter-spacing: 0.02em;
    background: var(--bg-deep);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* user-select removed for debugging */
}

/* ==================== HUD HEADER ==================== */
.hud-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 20px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    z-index: 100;
}

.hud-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-logo-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: linear-gradient(
        135deg,
        var(--accent-blue),
        var(--accent-beige)
    );
    color: var(--bg-deep);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.5px;
}

.hud-logo-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.hud-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.hud-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(165, 214, 167, 0.6);
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.hud-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-version {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 300;
    letter-spacing: 0.04em;
}

/* ==================== WORKSPACE ==================== */
.workspace {
    display: grid;
    grid-template-areas:
        "controllers field"
        "output      field";
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 3fr auto;
    flex: 1;
    height: calc(100vh - 48px);
    overflow: hidden;
    position: relative;
}

/* ==================== TOP PANEL: QUESTION AREA (LEFT) ==================== */
.panel-controllers {
    grid-area: controllers;
    min-width: 0;
    max-height: 100%;
    overflow-y: auto;
    background: transparent;
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10;
}

.controllers-header {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    text-align: center;
    padding-bottom: 4px;
}

/* ---- JOG DIALS ---- */
.jog-dials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.jog-dial-container {
    width: 115px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.jog-dial-track {
    width: 90px;
    height: 90px;
    position: relative;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jog-dial-track:active {
    cursor: grabbing;
}

.jog-ring-svg {
    width: 90px;
    height: 90px;
    position: absolute;
    top: 0;
    left: 0;
}

.jog-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 3;
}

.jog-ring-fill {
    fill: none;
    stroke: var(--accent-blue);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 301.59;
    stroke-dashoffset: 150.8;
    transition:
        stroke-dashoffset 0.3s ease,
        stroke 0.5s ease;
}

.jog-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    position: absolute;
    box-shadow:
        0 0 14px rgba(255, 255, 255, 0.6),
        0 0 4px var(--glow-strong);
    pointer-events: none;
    z-index: 5;
}

.jog-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
}

.jog-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    font-family: "Inter", "Manrope", sans-serif;
}

.jog-label-ru {
    font-size: 9px;
    color: var(--text-tertiary);
    font-weight: 300;
    letter-spacing: 0.04em;
}

/* ---- PRESETS ---- */
.presets-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
}

.presets-header {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    text-align: center;
}

.presets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.preset-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    position: relative;
}

.preset-dot:hover {
    transform: scale(1.35);
    box-shadow: 0 0 18px currentColor;
    z-index: 2;
}

.preset-dot:active {
    transform: scale(0.9);
}

.preset-dot[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-glass-strong);
    color: var(--text-primary);
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    border: 1px solid var(--border-mid);
    backdrop-filter: blur(12px);
}

/* ==================== CENTER: ARCHETYPE FIELD ==================== */
.panel-field {
    grid-area: field;
    border-left: 1px solid var(--border-mid);
    position: relative;
    background: radial-gradient(ellipse at center, #060c1e 0%, #020510 100%);
    overflow: hidden;
    cursor: crosshair;
    min-height: 300px;
}

#field-canvas {
    position: absolute;
    filter: brightness(1.1);
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.field-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.field-brand-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow:
        0 0 24px rgba(255, 255, 255, 0.7),
        0 0 8px rgba(255, 255, 255, 0.9),
        0 0 2px #fff;
    pointer-events: auto;
    cursor: grab;
    z-index: 10;
    transition: box-shadow 0.5s ease;
}

.field-brand-dot:active {
    cursor: grabbing;
    box-shadow:
        0 0 40px rgba(255, 255, 255, 0.9),
        0 0 16px rgba(255, 255, 255, 1);
}

/* Field legend */
.field-legend {
    position: absolute;
    bottom: 14px;
    right: 20px;
    display: flex;
    gap: 14px;
    z-index: 10;
}

.legend-item {
    font-size: 10px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.legend-primary {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}
.legend-secondary {
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}
.legend-conflict {
    background: rgba(255, 80, 80, 0.7);
    box-shadow: 0 0 6px rgba(255, 80, 80, 0.5);
}
.legend-brand {
    background: #ffffff;
    box-shadow: 0 0 8px #fff;
}

/* ==================== RIGHT PANEL: OUTPUT ==================== */
/* ==================== TOP PANEL: RESULT PREVIEW (RIGHT) ==================== */
.panel-output {
    grid-area: output;
    width: auto;
    min-height: 90px;
    max-height: 130px;
    border-top: 1px solid var(--border-mid);
    background: transparent;
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px 20px;
    gap: 8px;
    overflow: hidden;
    z-index: 5;
    flex-shrink: 0;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 16px 14px;
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10;
}

.output-header {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    text-align: center;
    padding-bottom: 2px;
}

/* Output cards */
.output-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    position: relative;
    backdrop-filter: blur(16px);
    transition:
        border-color 0.5s ease,
        box-shadow 0.5s ease;
}

#panel-output {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: stretch;
}
.output-card-primary {
    border-color: var(--border-mid);
}

.output-card-glow {
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-md);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.5s ease,
        box-shadow 0.5s ease;
}

.output-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.output-card-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.output-card-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
}

.output-card-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.output-card-behavior {
    font-size: 9px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.3;
    font-weight: 300;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.output-card-secondary,
.output-card-conflict {
    padding: 10px 14px;
}

.output-card-secondary .output-card-name,
.output-card-conflict .output-card-name {
    font-size: 14px;
}

/* Rules */
.output-rules {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    backdrop-filter: blur(16px);
}

.output-rules-header {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}

.output-rules-list {
}

.output-rule {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.output-rule-label {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 400;
    flex-shrink: 0;
}

.output-rule-value {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: right;
    line-height: 1.4;
    font-weight: 300;
}

/* Actions */
.output-actions {
    margin-top: auto;
    padding-top: 8px;
}

.btn-export {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--accent-blue-dim);
    border: 1px solid rgba(123, 188, 212, 0.25);
    border-radius: var(--radius-sm);
    color: var(--accent-blue);
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
    letter-spacing: 0.02em;
}

.btn-export:hover {
    background: rgba(123, 188, 212, 0.25);
    border-color: rgba(123, 188, 212, 0.45);
    box-shadow: 0 0 24px var(--glow-blue);
}

.btn-export:active {
    background: rgba(123, 188, 212, 0.35);
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-panel);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-lg);
    width: 90vw;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-archetype {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-archetype .modal-archetype-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.modal-code {
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px;
    overflow-x: auto;
}

.modal-code pre {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 11px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-subtle);
    justify-content: flex-end;
}

.btn-secondary {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-mid);
    background: transparent;
    color: var(--text-secondary);
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* ==================== SCROLLBARS ==================== */
.panel-controllers::-webkit-scrollbar,
.panel-output::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 4px;
}

.panel-controllers::-webkit-scrollbar-track,
.panel-output::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.panel-controllers::-webkit-scrollbar-thumb,
.panel-output::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1100px) {
    .panel-controllers {
        width: 260px;
        min-width: 260px;
    }
    .panel-output {
        width: 260px;
        min-width: 260px;
    }
    .jog-dial-container {
        width: 100px;
    }
    .jog-dial-track {
        width: 78px;
        height: 78px;
    }
    .jog-ring-svg {
        width: 78px;
        height: 78px;
    }
}



/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 860px) {
    /* Header */
    .hud-header {
        padding: 0 12px;
    }
    .hud-logo-text {
        font-size: 12px;
    }
    .hud-status {
        display: none;
    }
    .quiz-launch-btn-header span:last-child {
        display: none;
    }
    .quiz-launch-btn-header {
        padding: 5px 8px;
        margin-right: 4px;
    }
    .hud-version {
        display: none;
    }

    /* Workspace */
    .workspace {
        grid-template-areas:
            "controllers"
            "output"
            "field";
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
    }

    /* Controllers */
    .panel-controllers {
        width: 100%;
        min-width: 100%;
        max-height: 35%;
        flex-shrink: 0;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px;
        gap: 10px;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
    .controllers-header,
    .presets-header {
        display: none;
    }
    .jog-dials {
        flex-direction: row;
        gap: 8px;
    }
    .jog-dial-container {
        width: 70px;
    }
    .jog-dial-track {
        width: 56px;
        height: 56px;
    }
    .jog-ring-svg {
        width: 56px;
        height: 56px;
    }
    .jog-value {
        font-size: 16px;
    }
    .presets-grid {
        gap: 4px;
    }
    .preset-dot {
        width: 18px;
        height: 18px;
    }

    /* Output */
    .panel-output {
        width: 100%;
        min-width: 100%;
        max-height: 30%;
        flex-shrink: 0;
        border-left: none;
        border-top: 1px solid var(--border-subtle);
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }
    .output-header {
        display: none;
    }
    .output-card {
        flex: 1;
        min-width: 120px;
        padding: 10px;
    }
    .output-rules {
        flex: 1;
        min-width: 120px;
    }
    .output-actions {
        width: 100%;
    }

    /* Field */
    .panel-field {
        border-left: none;
        border-top: 1px solid var(--border-mid);
        min-height: 250px;
        flex: 1;
    }

    /* Overlays */
    .live-analytics {
        display: none;
    }

    /* Result */
    .result-codex {
        grid-template-columns: 1fr;
    }

    /* Quiz */
    .quiz-container {
        padding: 12px;
        gap: 10px;
    }
    .quiz-question {
        font-size: 16px;
    }
    .quiz-option-btn {
        padding: 12px 14px;
    }
    .quiz-likert-btn {
        width: 48px;
        padding: 8px 2px;
    }
    .quiz-likert-num {
        font-size: 16px;
    }
    .quiz-result-card {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .hud-header {
        height: 40px;
        padding: 0 10px;
    }
    .hud-logo-text {
        display: none;
    }
    .hud-logo-icon {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .workspace {
        grid-template-rows: auto auto 1fr;
    }
    .panel-controllers {
        max-height: none;
        padding: 8px;
        gap: 6px;
    }
    .jog-dials {
        gap: 6px;
    }
    .jog-dial-container {
        width: 60px;
    }
    .jog-dial-track {
        width: 48px;
        height: 48px;
    }
    .jog-ring-svg {
        width: 48px;
        height: 48px;
    }
    .jog-label {
        font-size: 9px;
    }
    .jog-value {
        font-size: 14px;
    }
    .jog-label-ru {
        font-size: 8px;
    }

    .panel-output {
        flex-direction: column;
        max-height: none;
        gap: 6px;
        padding: 8px;
    }
    .output-card {
        min-width: 0;
        width: 100%;
        padding: 8px 10px;
    }
    .output-card-name {
        font-size: 12px;
    }

    .panel-field {
        min-height: 200px;
    }

    .result-modal {
        padding: 24px 16px 20px;
        width: 96vw;
    }
    .result-name {
        font-size: 24px;
    }
    .result-codex {
        grid-template-columns: 1fr;
    }

    .quiz-container {
        padding: 8px;
    }
    .quiz-question {
        font-size: 15px;
    }
    .quiz-option-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    .quiz-likert-btn {
        width: 40px;
        padding: 6px 2px;
    }
    .quiz-likert-num {
        font-size: 14px;
    }
}

/* ==================== LIVE ANALYTICS HUD ==================== */
.live-analytics {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 240px;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    z-index: 100;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.live-analytics-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.live-analytics-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green-dim);
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.live-analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.live-analytics-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.live-analytics-label {
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.live-analytics-value {
    font-family: "Manrope", monospace;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.live-analytics-signals {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.live-signal {
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-signal-label {
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    text-transform: uppercase;
    width: 48px;
    flex-shrink: 0;
}

.live-signal-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.live-signal-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent-blue);
    width: 50%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.live-signal-val {
    font-family: "Manrope", monospace;
    font-size: 9px;
    font-weight: 500;
    color: var(--text-secondary);
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

/* Signal bar colors per dimension */
#hud-signal-bar-control {
    background: #7bbcd4;
}
#hud-signal-bar-energy {
    background: #e74c3c;
}
#hud-signal-bar-focus {
    background: #f39c12;
}
#hud-signal-bar-method {
    background: #9b59b6;
}

/* Hide on mobile */


/* ==================== PIVOT SCAN OVERLAY ==================== */
.pivot-scan-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.pivot-scan-overlay.active {
    opacity: 1;
}
.pivot-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    pointer-events: none;
}
.pivot-scan-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 0.3em;
    color: #fff;
    text-transform: uppercase;
    pointer-events: none;
}

/* ==================== DIAGNOSTIC QUEST ==================== */
.diag-overlay {
    position: fixed;
    inset: 0;
    z-index: 9990;
    font-family: "Manrope", "Inter", sans-serif;
}
.diag-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 6, 10, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.diag-container {
    position: relative;
    z-index: 2;
    max-width: 620px;
    margin: 0 auto;
    padding: 40px 24px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}
.diag-progress {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 1px;
    margin-bottom: 32px;
    flex-shrink: 0;
}
.diag-progress-bar {
    height: 100%;
    background: var(--accent-green);
    border-radius: 1px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}
.diag-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.diag-question-num {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    text-transform: uppercase;
    margin-bottom: 16px;
}
.diag-question-title {
    font-size: 24px;
    font-weight: 300;
    color: var(--text-primary);
    margin: 0 0 10px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}
.diag-question-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 32px;
    line-height: 1.6;
}
.diag-answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.diag-answer-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    animation: fadeSlideIn 0.4s ease both;
}
.diag-answer-card:hover {
    border-color: var(--border-mid);
    background: var(--bg-glass-strong);
    transform: translateX(4px);
}
.diag-answer-card.selected {
    border-color: var(--accent-green) !important;
    background: rgba(165, 214, 167, 0.08) !important;
}
.diag-answer-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 44px;
    text-align: center;
}
.diag-answer-content {
    flex: 1;
}
.diag-answer-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.diag-answer-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.diag-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    flex-shrink: 0;
}
.diag-footer-text {
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    text-transform: uppercase;
}
.diag-skip {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}
.diag-skip:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
}
.diag-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.diag-particle {
    position: absolute;
    border-radius: 50%;
    background: var(--accent-blue);
    animation: diagFloat linear infinite;
}
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes diagFloat {
    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
    50% {
        transform: translateY(-40px) scale(1.5);
        opacity: 0.3;
    }
}
.btn-start-diag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-start-diag:hover {
    background: var(--bg-glass);
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px var(--accent-blue-dim);
}

/* ==================== HOLOGRAPHIC BUBBLES ==================== */
#holo-bubbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}
.holo-bubble {
    position: absolute;
    transform: translate(-50%, -50%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.holo-welcome {
    text-align: center;
    pointer-events: none;
}
.holo-pulse-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: holoPulse 2s ease-out infinite;
    margin: 0 auto 20px;
}
@keyframes holoPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}
.holo-welcome-text {
    font-size: 17px;
    font-weight: 300;
    color: var(--text-primary);
    line-height: 1.5;
    letter-spacing: -0.01em;
}
.holo-welcome-sub {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 8px;
}
.holo-title {
    text-align: center;
    pointer-events: none;
}
.holo-title span {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    display: block;
}
.holo-title small {
    display: block;
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 4px;
}
.holo-answer,
.holo-sound {
    width: 200px;
    padding: 14px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.holo-answer.hovered,
.holo-sound.hovered {
    border-color: var(--accent-blue);
    background: var(--bg-glass-strong);
    box-shadow: 0 0 24px var(--accent-blue-dim);
    transform: translate(-50%, -50%) scale(1.05);
}
.holo-answer.selected,
.holo-sound.selected {
    border-color: var(--accent-green) !important;
    box-shadow: 0 0 28px var(--accent-green-dim) !important;
    transform: translate(-50%, -50%) scale(1.08) !important;
}
.holo-answer-icon {
    font-size: 26px;
    display: block;
    margin-bottom: 6px;
}
.holo-answer-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}
.holo-answer-text {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.holo-waveform {
    color: var(--accent-blue);
    margin-bottom: 8px;
}
.holo-sound.hovered .holo-waveform {
    color: var(--glow-strong);
}

/* ==================== RESULT POPUP ==================== */
.result-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.result-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 9, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.result-modal {
    position: relative;
    width: min(560px, 92vw);
    max-height: 85vh;
    overflow-y: auto;
    background: radial-gradient(ellipse at center, #060c1e 0%, #020510 100%);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-lg);
    padding: 36px 28px 28px;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.result-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.result-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}
.result-header {
    text-align: center;
    margin-bottom: 28px;
}
.result-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    margin-bottom: 14px;
}
.result-name {
    font-size: 32px;
    font-weight: 300;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}
.result-model {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}
.result-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 28px;
}
.result-section h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}
.result-section p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 4px;
    line-height: 1.6;
}
.result-section p strong {
    color: var(--text-primary);
}
.result-psych {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.7;
}
.result-swatches {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.result-swatch {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}
.result-swatch-dot {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.result-swatch code {
    font-size: 10px;
    color: var(--text-tertiary);
}
.result-vector-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.result-vector-label {
    font-size: 11px;
    color: var(--text-secondary);
    width: 70px;
    flex-shrink: 0;
}
.result-vector-track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}
.result-vector-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s ease;
}
.result-vector-val {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
    width: 30px;
    text-align: right;
}
.result-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.result-btn-primary,
.result-btn-secondary,
.result-btn-ghost {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    border: none;
}
.result-btn-primary {
    color: #fff;
}
.result-btn-primary:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}
.result-btn-secondary {
    background: var(--bg-glass-strong);
    color: var(--text-primary);
    border: 1px solid var(--border-mid);
}
.result-btn-secondary:hover {
    background: var(--bg-glass);
    border-color: var(--accent-blue);
}
.result-btn-ghost {
    background: none;
    color: var(--text-tertiary);
}
.result-btn-ghost:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

/* ==================== BRAND PASSPORT (v4) ==================== */
.result-section-manifesto {
    margin-bottom: 8px;
}
.result-manifesto-card {
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-top: 8px;
}
.result-manifesto-text {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.8;
    margin: 0 0 12px;
}
.result-manifesto-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-subtle);
    padding-top: 10px;
}
.result-manifesto-meta strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* Codex (Do / Don't) */
.result-codex {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
}
.result-codex-col {
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.result-codex-label {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}
.result-codex-item {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-left: 8px;
    border-left: 2px solid var(--border-subtle);
}
.result-codex-do .result-codex-item {
    border-left-color: var(--accent-green);
}
.result-codex-dont .result-codex-item {
    border-left-color: rgba(231, 76, 60, 0.5);
}

/* Token rows */
.result-tokens-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}
.result-token-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--bg-glass);
    border-radius: 6px;
}
.result-token-label {
    font-size: 11px;
    color: var(--text-secondary);
}
.result-token-value {
    font-size: 10px;
    color: var(--text-tertiary);
    max-width: 55%;
    text-align: right;
    word-break: break-all;
}



/* ==================== QUEST START SCREEN ==================== */
.quest-start-overlay {
    position: fixed;
    inset: 0;
    z-index: 9995;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.quest-start-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 10, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.quest-start-card {
    position: relative;
    text-align: center;
    padding: 44px 32px;
    max-width: 440px;
    width: 90vw;
    background: linear-gradient(
        135deg,
        rgba(22, 22, 30, 0.95),
        rgba(18, 18, 26, 0.95)
    );
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    animation: questCardIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes questCardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.quest-start-icon {
    font-size: 48px;
    margin-bottom: 16px;
}
.quest-start-title {
    font-size: 26px;
    font-weight: 300;
    color: #e8e8ed;
    margin: 0 0 12px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}
.quest-start-sub {
    font-size: 13px;
    color: #9a9aa8;
    line-height: 1.7;
    margin: 0 0 24px;
}
.quest-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    background: linear-gradient(135deg, #7bbcd4, #9b59b6);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 32px rgba(123, 188, 212, 0.25);
}
.quest-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(123, 188, 212, 0.4);
    filter: brightness(1.1);
}
.quest-start-btn span {
    font-size: 18px;
}
.quest-start-hint {
    font-size: 11px;
    color: #6a6860;
    margin-top: 14px;
    letter-spacing: 0.04em;
}
.quest-start-subtitle {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-tertiary);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 16px;
}
.quest-start-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 360px;
    margin: 0 auto 16px;
}
.quest-start-principles {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-tertiary);
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}
.quest-start-principles span:first-child,
.quest-start-principles span:nth-child(3),
.quest-start-principles span:nth-child(5) {
    color: var(--accent-blue);
}
.quest-start-method {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    font-style: italic;
    margin: 0 0 20px;
}
.quest-q-subtitle {
    font-size: 11px;
    color: var(--text-tertiary);
    margin: 4px 0 0;
    font-style: italic;
}

/* ==================== HELP BUTTON ==================== */
.quest-help-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9998;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-mid);
    color: var(--text-secondary);
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.quest-help-btn:hover {
    background: var(--bg-glass);
    border-color: var(--accent-blue);
    color: var(--text-primary);
    box-shadow: 0 0 20px var(--accent-blue-dim);
}

/* ==================== HELP POPUP ==================== */
.quest-help-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.quest-help-inner {
    background: radial-gradient(ellipse at center, #060c1e 0%, #020510 100%);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 360px;
    width: 88vw;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.quest-help-inner strong {
    display: block;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.quest-help-inner p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 8px;
}
.quest-help-close {
    margin-top: 14px;
    padding: 8px 20px;
    background: var(--bg-glass-strong);
    color: var(--text-primary);
    border: 1px solid var(--border-mid);
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.quest-help-close:hover {
    background: var(--bg-glass);
    border-color: var(--accent-blue);
}

/* ==================== STEP BADGE ==================== */
.holo-step-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}

/* ==================== QUEST PANEL ELEMENTS ==================== */
.quest-panel-header {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    text-transform: uppercase;
}
.quest-question-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.quest-q-num {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--accent-blue);
    text-transform: uppercase;
}
.quest-q-title {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.quest-q-bar {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 1px;
}
.quest-q-bar-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 1px;
    transition: width 0.5s ease;
}
.quest-answers-list {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-wrap: wrap;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.quest-answer-card {
    flex: 1;
    min-width: 150px;
    max-width: 240px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
}
.quest-answer-card:hover {
    border-color: var(--accent-blue);
    background: var(--bg-glass-strong);
    box-shadow: 0 0 16px var(--accent-blue-dim);
}
.quest-answer-card.selected {
    border-color: var(--accent-green) !important;
    background: rgba(165, 214, 167, 0.08) !important;
    box-shadow: 0 0 20px var(--accent-green-dim) !important;
}
.quest-answer-card.selected .quest-ans-label {
    color: var(--accent-green);
}
.quest-ans-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}
.quest-ans-content {
    flex: 1;
    min-width: 0;
}
.quest-ans-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.quest-ans-text {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.quest-sound-card .quest-waveform {
    color: var(--accent-blue);
    margin-right: 4px;
}
.quest-next-btn {
    width: 100%;
    padding: 12px;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    margin-top: 4px;
}
.quest-next-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.quest-next-btn:not(:disabled):hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

/* Right panel elements */
.quest-right-card {
    padding: 14px;
    border: 1px solid;
    border-radius: var(--radius-md);
    text-align: center;
    margin-bottom: 12px;
}
.quest-right-archetype {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.quest-right-sub {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.quest-right-section {
    margin-bottom: 14px;
}
.quest-right-section-title {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}
.quest-vector-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}
.quest-vector-label {
    font-size: 10px;
    color: var(--text-secondary);
    width: 60px;
    flex-shrink: 0;
}
.quest-vector-track {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}
.quest-vector-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}
.quest-vector-val {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-primary);
    width: 26px;
    text-align: right;
}
.quest-right-steps {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.quest-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border-subtle);
    color: var(--text-tertiary);
    transition: all 0.3s;
}
.quest-step-dot.done {
    background: var(--accent-green-dim);
    border-color: var(--accent-green);
    color: var(--accent-green);
}
.quest-step-dot.current {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue-dim);
}

#rate-slider {
    height: 8px;
    background: rgba(110, 231, 255, 0.15);
    border-radius: 4px;
    outline: none;
}
#rate-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    border: 2px solid #020510;
    box-shadow: 0 0 16px var(--accent-blue);
}
#rate-slider::-moz-range-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    border: 2px solid #020510;
    box-shadow: 0 0 16px var(--accent-blue);
}
#rate-slider::-ms-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
}

/* ==================== QUIZ ENGINE — Block 1 ==================== */

/* ---- Launch button ---- */
.quiz-launch-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: linear-gradient(
        135deg,
        rgba(110, 231, 255, 0.08),
        rgba(184, 160, 255, 0.06)
    );
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.35s ease;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}
.quiz-launch-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(110, 231, 255, 0.12),
        rgba(184, 160, 255, 0.08)
    );
    opacity: 0;
    transition: opacity 0.35s ease;
}
.quiz-launch-btn:hover::before {
    opacity: 1;
}
.quiz-launch-btn:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(110, 231, 255, 0.1);
    transform: translateY(-1px);
}
.quiz-launch-icon {
    font-size: 18px;
    line-height: 1;
    opacity: 0.9;
}
.quiz-launch-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    position: relative;
    z-index: 1;
}
.quiz-launch-sub {
    font-size: 9px;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
    position: relative;
    z-index: 1;
}

/* ---- Quiz container ---- */
.quiz-container {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: 14px 16px;
    gap: 12px;
    animation: quiz-fade-in 0.4s ease;
}
@keyframes quiz-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Header ---- */
.quiz-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.quiz-block-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--accent-blue);
    text-align: center;
}
.quiz-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}
.quiz-progress-track {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}
.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-beige));
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.quiz-counter {
    font-size: 10px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    text-align: right;
}

/* ---- Question card ---- */
.quiz-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    min-height: 0;
}
.quiz-question {
    font-size: clamp(15px, 2.2vw, 20px);
    font-weight: 300;
    line-height: 1.45;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: 0.01em;
    padding: 0 4px;
}

/* ---- Dual options (A vs B) ---- */
.quiz-options-dual {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}
.quiz-option-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.quiz-option-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.quiz-option-btn:hover {
    border-color: var(--accent-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(110, 231, 255, 0.08);
}
.quiz-option-btn:active {
    transform: scale(0.98);
}
.quiz-option-label {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    position: relative;
    z-index: 1;
}
.quiz-or {
    text-align: center;
    font-size: 10px;
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---- Likert options ---- */
.quiz-options-likert {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.quiz-likert-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 52px;
    padding: 10px 4px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s ease;
}
.quiz-likert-btn:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(110, 231, 255, 0.1);
}
.quiz-likert-btn:active {
    transform: scale(0.95);
}
.quiz-likert-num {
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    font-family: "Inter", "Manrope", sans-serif;
}
.quiz-likert-label {
    font-size: 8px;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
    text-align: center;
    line-height: 1.2;
}

/* ---- Transition flash ---- */
.quiz-transition-flash {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-blue);
    background: var(--bg-glass-strong);
    padding: 8px 16px;
    border-radius: 100px;
    border: 1px solid var(--border-mid);
    backdrop-filter: blur(8px);
    animation: quiz-flash-in 0.25s ease forwards;
    pointer-events: none;
    z-index: 20;
}
@keyframes quiz-flash-in {
    0% {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* ---- Footer / Exit ---- */
.quiz-footer {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
    padding-top: 4px;
}
.quiz-exit-btn {
    font-size: 10px;
    color: var(--text-tertiary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s ease;
    letter-spacing: 0.04em;
}
.quiz-exit-btn:hover {
    color: var(--text-secondary);
}

/* ---- Result card ---- */
.quiz-result-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    animation: quiz-fade-in 0.5s ease;
}
.quiz-result-title {
    font-size: 14px;
    font-weight: 300;
    text-align: center;
    color: var(--text-primary);
    letter-spacing: 0.04em;
}

/* Vector HUD inside result */
.quiz-vector-hud {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    padding: 10px 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}
.quiz-vector-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}
.quiz-vector-dim {
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}
.quiz-vector-val {
    font-weight: 600;
    color: var(--text-primary);
    font-family: "Inter", "Manrope", sans-serif;
    font-variant-numeric: tabular-nums;
}

/* Top 3 */
.quiz-top3 {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.quiz-top3-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}
.quiz-top3-primary {
    border-color: rgba(255, 255, 255, 0.12);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent);
}
.quiz-top3-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.quiz-top3-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.quiz-top3-label {
    font-size: 8px;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
}
.quiz-top3-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Confidence */
.quiz-confidence {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-top: 1px solid var(--border-subtle);
    font-size: 11px;
}
.quiz-confidence-label {
    color: var(--text-secondary);
}
.quiz-confidence-val {
    font-weight: 600;
    color: var(--accent-green);
    font-family: "Inter", "Manrope", sans-serif;
}

/* ---- Result action buttons ---- */
.quiz-action-btn {
    flex: 1;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    text-align: center;
}
.quiz-action-primary {
    background: linear-gradient(
        135deg,
        rgba(110, 231, 255, 0.15),
        rgba(184, 160, 255, 0.1)
    );
    border-color: var(--border-mid);
    color: var(--text-primary);
}
.quiz-action-primary:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(110, 231, 255, 0.1);
    transform: translateY(-1px);
}
.quiz-action-secondary {
    background: transparent;
    border-color: var(--border-subtle);
    color: var(--text-tertiary);
}
.quiz-action-secondary:hover {
    border-color: var(--border-mid);
    color: var(--text-secondary);
}

/* ==================== QUIZ RESPONSIVE ==================== */


/* ---- Quiz launch button in HUD header ---- */
.quiz-launch-btn-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: linear-gradient(
        135deg,
        rgba(110, 231, 255, 0.12),
        rgba(184, 160, 255, 0.08)
    );
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 8px;
}
.quiz-launch-btn-header:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 14px rgba(110, 231, 255, 0.12);
    transform: translateY(-1px);
}
