/* ================================================================
   PREDICTION ENGINE STYLES
================================================================ */

.main-wrapper {
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.view-section {
    max-width: 950px;
    margin: 0 auto; padding-top: 50px;
}
.view-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ================================================================
   STEP 1: INPUTS
================================================================ */
.drop-zone {
    border: 2px dashed rgba(2, 132, 199, 0.3);
    border-radius: 16px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.drop-zone:hover { 
    border-color: var(--accent-blue); 
    background: rgba(2, 132, 199, 0.05); 
    box-shadow: 0 0 20px rgba(2, 132, 199, 0.1);
}
.drop-zone::before {
    content: '';
    position: absolute;
    top: -100%; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    transition: 0.3s;
}
.drop-zone:hover::before {
    animation: scanLine 2s linear infinite;
}
@keyframes scanLine {
    0% { top: -10%; }
    100% { top: 110%; }
}

.manual-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}



.subject-label { font-weight: 600; font-size: 1.05rem; font-family: 'JetBrains Mono', monospace; color: var(--text-primary); }

.grade-input {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.4);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%2338bdf8" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    padding-right: 40px;
    transition: all 0.2s;
}
.grade-input:focus, .grade-input:hover { 
    border-color: var(--accent-blue); 
    background-color: rgba(56, 189, 248, 0.1);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.add-subject-wrapper { margin-bottom: 40px; text-align: left;}

.btn-add {
    background: transparent;
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
    padding: 12px 20px;
    border-radius: 10px;
    font-family: 'Lexend', sans-serif;
    font-weight: 600;
    width: 100%;
    outline: none;
    cursor: pointer;
    transition: 0.3s;
    appearance: none;
}
.btn-add:hover { border-color: var(--text-primary); color: var(--text-primary); }

.btn-analyze {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--accent-blue), #2563eb);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}
.btn-analyze:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 15px 25px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, #38bdf8, #1d4ed8);
    color: #ffffff;
}

/* ================================================================
   STEP 2: RESULTS & GAME
================================================================ */
.risk-pulse {
    animation: pulseRisk 2s infinite;
}
@keyframes pulseRisk {
    0% { text-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
    50% { text-shadow: 0 0 40px rgba(239, 68, 68, 0.8); }
    100% { text-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
}

.survival-value {
    font-size: 6rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 10px;
}
.val-risk { color: var(--accent-red); }
.val-success { color: var(--accent-green); text-shadow: 0 0 30px rgba(16, 185, 129, 0.4); }

.classification {
    font-size: 1.2rem;
    letter-spacing: 3px;
    margin-bottom: 40px;
    font-weight: 700;
}

.mission-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(241, 240, 245, 0.6);
    border: 2px solid rgba(2, 132, 199, 0.1);
    padding: 25px;
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.mission-card:hover { 
    border-color: var(--accent-green); 
    transform: translateY(-5px); 
    background: rgba(16, 185, 129, 0.05); 
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}
.mission-card::after {
    content: '▶ PLAY';
    position: absolute;
    right: 25px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--accent-green);
    opacity: 0;
    transform: translateX(10px);
    transition: 0.3s;
}
.mission-card:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.mission-icon { 
    font-size: 2.5rem; 
    background: rgba(16, 185, 129, 0.1); 
    padding: 15px; 
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.mission-info h4 { font-size: 1.2rem; margin-bottom: 8px; color: var(--text-primary);}
.mission-info p { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.5; padding-right: 60px;}

/* ================================================================
   STEP 3: VERDICT
================================================================ */
.verdict-badge {
    position: relative;
    padding: 30px;
    margin-bottom: 40px;
    border-radius: 16px;
    background: rgba(241, 240, 245, 0.8);
    border: 2px solid var(--accent-green);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.15), inset 0 0 20px rgba(16, 185, 129, 0.05);
}
.verdict-badge .verdict-label {
    font-size: 0.85rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 15px;
}
.verdict-badge .final-program {
    font-size: 2.2rem; font-weight: 800; color: var(--text-primary); text-shadow: 0 0 20px rgba(2, 132, 199,0.3);
}



        :root {
            --accent-gradient: linear-gradient(135deg, var(--accent-blue), #0ea5e9);
            --success-color: #10b981;
            --warning-color: #f59e0b;
            --danger-color:  #f43f5e;
        }

        /* ── STEP INDICATOR ── */
        .step-indicator {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            position: absolute; top: 0px; left: 50%; transform: translateX(-50%); margin-bottom: 0; z-index: 100;
        }
        .step-dot {
            width: 8px; height: 8px;
            border-radius: 50%;
            background: rgba(2, 132, 199, 0.15);
            transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
        }
        .step-line {
            width: 40px; height: 1px;
            background: rgba(2, 132, 199, 0.1);
            transition: background 0.4s;
        }
        .step-dot.active { background: var(--accent-blue); box-shadow: 0 0 12px var(--accent-blue), 0 0 24px rgba(56,189,248,0.3); transform: scale(1.3); }
        .step-dot.done   { background: #10b981; box-shadow: 0 0 10px #10b981; }

        .form-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(2, 132, 199, 0.12);
    border-top: 3px solid var(--accent-blue);
    border-radius: 20px;
    padding: 12px 24px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px rgba(2, 132, 199, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: cardIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
        @keyframes cardIn { from { opacity:0; transform: translateY(16px) scale(0.98); } to { opacity:1; transform: translateY(0) scale(1); } }
        .form-card h4 {
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: var(--accent-blue);
            margin-bottom: 16px;
            display: flex; align-items: center; gap: 6px;
        }
        .form-card h4::before { content: ''; display: inline-block; width: 16px; height: 2px; background: var(--accent-blue); border-radius: 1px; }

        /* ── UPLOAD ZONE ── */
        .drop-zone {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            border: 2px dashed rgba(56, 189, 248, 0.4);
            border-radius: 16px;
            padding: 30px 20px;
            min-height: 400px;
            background: rgba(241, 240, 245, 0.5);
            margin-bottom: 24px;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            text-align: center;
        }
        .drop-zone:hover, .drop-zone.drag-over { 
            border-color: var(--accent-blue); 
            background: rgba(56, 189, 248, 0.05); 
            box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
        }
        .drop-zone-icon {
            font-size: 2rem;
            margin-bottom: 10px;
            color: var(--accent-blue);
        }
        .drop-zone-text {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }
        .drop-zone-sub {
            color: var(--text-secondary);
            font-size: 0.75rem;
            margin-top: 6px;
        }
        .subject-grid {
            display: grid;
            gap: 6px;
        }
        .subject-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(2, 132, 199, 0.12);
    border-radius: 10px;
    transition: all 0.3s ease;
}
        .subject-row:hover { background: rgba(2, 132, 199, 0.04); border-color: rgba(2, 132, 199, 0.35); box-shadow: 0 2px 12px rgba(2, 132, 199, 0.1); }
        .subject-label {
            font-size: 0.9rem;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .subj-badge {
            font-size: 0.65rem;
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            padding: 2px 7px;
            border-radius: 4px;
            letter-spacing: 1px;
        }
        .badge-blue   { background: rgba(56,189,248,0.15); color: var(--accent-blue); }
        .badge-purple { background: rgba(139,92,246,0.15);  color: #a78bfa; }
        .badge-orange { background: rgba(245,158,11,0.15);  color: #fbbf24; }
        .badge-green  { background: rgba(16,185,129,0.15);  color: #34d399; }
        .badge-pink   { background: rgba(236,72,153,0.15);  color: #f472b6; }
        .badge-gray   { background: rgba(100,116,139,0.15); color: var(--text-secondary); }

        .grade-dropdown-container {
            position: relative;
            min-width: 80px;
        }
        .grade-dropdown-selected {
    background: rgba(2, 132, 199, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(2, 132, 199, 0.2);
    color: var(--accent-blue);
    padding: 8px 32px 8px 12px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230284c7' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s;
}
        .grade-dropdown-container.open .grade-dropdown-selected, .grade-dropdown-selected:hover { 
            border-color: var(--accent-blue); 
            box-shadow: 0 0 10px rgba(56,189,248,0.2);
        }
        .grade-dropdown-options {
    position: absolute;
    top: calc(100% + 4px);
    bottom: auto;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(2, 132, 199, 0.15);
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(2, 132, 199, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 105;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
        .grade-dropdown-container.open .grade-dropdown-options {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
            z-index: 1000;
        }
        .grade-option {
            padding: 8px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.85rem;
            font-weight: 700;
            color: var(--text-primary);
            cursor: pointer;
            text-align: center;
            transition: background 0.2s;
            border-bottom: 1px solid rgba(2, 132, 199, 0.1);
        }
        .grade-option:last-child { border-bottom: none; }
        .grade-option:hover {
            background: rgba(56, 189, 248, 0.2);
            color: var(--text-primary);
        }
        .grade-dropdown-options::-webkit-scrollbar { width: 4px; }
        .grade-dropdown-options::-webkit-scrollbar-track { background: rgba(2, 132, 199, 0.05); }
        .grade-dropdown-options::-webkit-scrollbar-thumb { background: rgba(56,189,248,0.3); border-radius: 4px; }
        .grade-dropdown-options::-webkit-scrollbar-thumb:hover { background: rgba(56,189,248,0.6); }

        .remove-btn {
            background: none; border: none; color: var(--text-secondary);
            cursor: pointer; font-size: 1.05rem; padding: 4px 8px;
            border-radius: 6px; transition: all 0.2s;
            display: flex; align-items: center;
        }
        .remove-btn:hover { color: #f43f5e; background: rgba(244,63,94,0.1); }

        /* ── ADD SUBJECT ── */
        .add-subject-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            margin-top: 12px;
        }
        .add-subject-btn {
            display: flex; align-items: center; gap: 8px;
            padding: 8px 12px;
            background: rgba(2, 132, 199, 0.1);
            border: 1px dashed rgba(2, 132, 199, 0.15);
            border-radius: 10px;
            color: var(--text-secondary);
            font-size: 0.82rem;
            cursor: pointer;
            transition: all 0.2s;
            font-family: 'Lexend', sans-serif;
        }
        .add-subject-btn:hover { border-color: var(--accent-blue); color: var(--accent-blue); background: rgba(56,189,248,0.05); }

        /* ── ELECTIVE SUBJECT SELECTOR ── */
        .custom-dropdown-container {
            position: relative;
            display: block; width: 100%; max-width: 450px; margin: 0 auto;
            height: 100%;
        }
        .custom-dropdown-selected {
    display: flex; width: 100%; max-width: 450px; margin: 0 auto;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border: 1px dashed rgba(2, 132, 199, 0.3);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 10px;
    font-family: 'Lexend', sans-serif;
    font-size: 0.82rem;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    text-align: center;
}
        .custom-dropdown-selected span {
            flex: 1;
        }
        .custom-dropdown-selected:hover, .custom-dropdown-container.open .custom-dropdown-selected {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(56,189,248,0.05);
}
        .custom-dropdown-options {
    position: absolute;
    top: auto;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(2, 132, 199, 0.15);
    border-radius: 10px;
    box-shadow: 0 -10px 30px rgba(2, 132, 199, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
        .custom-dropdown-container.open .custom-dropdown-options {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
            z-index: 1000;
        }
        .custom-dropdown-option {
            padding: 8px 12px;
            font-family: 'Lexend', sans-serif;
            font-size: 0.82rem;
            color: var(--text-primary);
            cursor: pointer;
            transition: background 0.2s;
            border-bottom: 1px solid rgba(2, 132, 199, 0.1);
        }
        .custom-dropdown-option:last-child { border-bottom: none; }
        .custom-dropdown-option:hover {
            background: rgba(56, 189, 248, 0.15);
            color: var(--text-primary);
        }
        /* Scrollbar styling for dropdown */
        .custom-dropdown-options::-webkit-scrollbar { width: 6px; }
        .custom-dropdown-options::-webkit-scrollbar-track { background: rgba(2, 132, 199, 0.05); border-radius: 10px; }
        .custom-dropdown-options::-webkit-scrollbar-thumb { background: rgba(56,189,248,0.3); border-radius: 10px; }
        .custom-dropdown-options::-webkit-scrollbar-thumb:hover { background: rgba(56,189,248,0.6); }

        /* ── MODEL SELECTOR ── */
        .model-chips {
            display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
        }
        .model-chip {
            padding: 6px 14px;
            border-radius: 20px;
            border: 1px solid rgba(255,255,255,0.1);
            background: transparent;
            color: var(--text-secondary);
            font-size: 0.78rem;
            font-family: 'JetBrains Mono', monospace;
            cursor: pointer;
            transition: all 0.2s;
        }
        .model-chip.active {
            border-color: var(--accent-blue);
            background: rgba(56,189,248,0.1);
            color: var(--accent-blue);
        }

        .btn-analyze-main {
            display: block; width: 100%; max-width: 450px; margin: 0 auto;
            padding: 12px 24px;
            border: none;
            border-radius: 14px;
            background: linear-gradient(135deg, #0ea5e9, var(--accent-blue), #2563eb);
            background-size: 200% 200%;
            color: #ffffff;
            font-family: 'Lexend', sans-serif;
            font-weight: 700;
            font-size: 1.05rem;
            letter-spacing: 3px;
            cursor: pointer;
            transition: all 0.3s;
            margin-top: 40px;
            box-shadow: 0 8px 25px rgba(56, 189, 248, 0.35);
            position: relative;
            overflow: hidden;
            animation: btnGradient 4s ease infinite;
        }
        @keyframes btnGradient {
            0%,100% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
        }
        .btn-analyze-main::before {
            content: '';
            position: absolute; inset: 0;
            background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), transparent);
            pointer-events: none;
        }
        .btn-analyze-main:hover { transform: translateY(-3px); box-shadow: 0 14px 35px rgba(56, 189, 248, 0.55); }
        .btn-analyze-main:active { transform: translateY(-1px); }
        .btn-analyze-main:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; animation: none; }

        /* ── LOADING ── */
        #loading-view {
            text-align: center;
            padding: 40px 20px;
        }
        .radar-scan {
            position: relative;
            width: 120px; height: 120px;
            margin: 0 auto 30px;
        }
        .radar-circle {
            display: block; width: 100%; max-width: 450px; margin: 0 auto; height: 100%;
            border-radius: 50%;
            border: 2px solid rgba(56,189,248,0.4);
            position: absolute;
            box-shadow: inset 0 0 40px rgba(56,189,248,0.2), 0 0 40px rgba(56,189,248,0.2);
        }
        .radar-circle::before, .radar-circle::after {
            content: '';
            position: absolute;
            border-radius: 50%;
            border: 2px solid rgba(56,189,248,0.25);
            box-shadow: 0 0 20px rgba(56,189,248,0.1);
        }
        .radar-circle::before { inset: 20px; }
        .radar-circle::after  { inset: 40px; }
        .radar-sweep {
            position: absolute;
            width: 50%; height: 2px;
            background: linear-gradient(to right, transparent, var(--accent-blue));
            box-shadow: 0 0 20px var(--accent-blue);
            top: 50%; left: 50%;
            transform-origin: left center;
            animation: sweep 2s linear infinite;
        }
        @keyframes sweep { to { transform: rotate(360deg); } }
        .loading-steps { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--text-secondary); }
        .loading-step { padding: 4px 0; opacity: 0; transition: opacity 0.4s; }
        .loading-step.show { opacity: 1; color: var(--accent-blue); }

        /* ── RESULT ── */
        .result-gauge-wrap {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-bottom: 36px;
        }
        .gauge-ring {
            position: relative;
            width: 180px; height: 180px;
            margin-bottom: 20px;
        }
        .gauge-svg { transform: rotate(-90deg); }
        .gauge-bg   { stroke: rgba(2, 132, 199, 0.1); stroke-width: 12; fill: none; }
        .gauge-fill { stroke-width: 12; fill: none; stroke-linecap: round; transition: stroke-dashoffset 1.5s ease; }
        .gauge-text {
            position: absolute;
            inset: 0;
            display: flex; flex-direction: column;
            align-items: center; justify-content: center;
        }
        .gauge-pct {
            font-size: 2.4rem;
            font-weight: 700;
            font-family: 'JetBrains Mono', monospace;
            line-height: 1;
        }
        .gauge-sub { font-size: 0.7rem; color: var(--text-secondary); margin-top: 4px; }

        .classification-badge {
            display: inline-flex; align-items: center; gap: 8px;
            padding: 8px 20px;
            border-radius: 24px;
            font-size: 0.82rem;
            font-weight: 600;
            letter-spacing: 1px;
            text-transform: uppercase;
        }
        .badge-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
        .badge-warning { background: rgba(245,158,11,0.15);  border: 1px solid rgba(245,158,11,0.3);  color: #fbbf24; }
        .badge-danger  { background: rgba(244,63,94,0.15);   border: 1px solid rgba(244,63,94,0.3);   color: #fb7185; }

        /* ── PROBABILITY BARS ── */
        .prob-bar-row {
            display: flex; align-items: center; gap: 12px;
            margin-bottom: 10px;
        }
        .prob-label { font-size: 0.8rem; color: var(--text-secondary); min-width: 150px; }
        .prob-track { flex: 1; height: 8px; background: rgba(2, 132, 199, 0.1); border-radius: 4px; overflow: hidden; }
        .prob-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
        .prob-val { font-size: 0.8rem; font-family: 'JetBrains Mono', monospace; min-width: 44px; text-align: right; }

        /* ── XAI FEATURE BREAKDOWN ── */
        .xai-card {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(241, 240, 245, 0.95));
            backdrop-filter: blur(20px);
            border: 1px solid rgba(56, 189, 248, 0.15);
            border-top: 1px solid rgba(56, 189, 248, 0.4);
            border-radius: 16px;
            padding: 12px 24px;
            margin-top: 20px;
            box-shadow: 0 10px 30px rgba(2, 132, 199, 0.1);
        }
        .xai-card h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 2px; color: var(--accent-blue); margin-bottom: 16px; }
        .xai-feat-row {
            display: grid;
            grid-template-columns: 130px 1fr auto;
            align-items: center;
            gap: 6px;
            margin-bottom: 10px;
        }
        .xai-feat-label { font-size: 0.82rem; color: var(--text-secondary); }
        .xai-feat-bar-track { height: 6px; background: rgba(2, 132, 199, 0.1); border-radius: 3px; overflow: hidden; }
        .xai-feat-bar-fill  { height: 100%; border-radius: 3px; background: var(--accent-gradient); transition: width 1s ease; }
        .xai-feat-pct { font-size: 0.75rem; font-family: 'JetBrains Mono', monospace; color: var(--text-secondary); }

        /* ── PROGRAM RECOMMENDATION ── */
        .program-card {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(241, 240, 245, 0.95));
            backdrop-filter: blur(20px);
            border: 1px solid rgba(56,189,248,0.3);
            border-top: 1px solid rgba(56, 189, 248, 0.6);
            box-shadow: inset 0 0 20px rgba(56,189,248,0.1), 0 10px 30px rgba(2, 132, 199, 0.1);
            border-radius: 16px;
            padding: 12px 24px;
            margin-top: 20px;
            display: flex; align-items: center; gap: 16px;
        }
        .program-icon { font-size: 2rem; }
        .program-label { font-size: 0.72rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }
        .program-name { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin-top: 4px; }
        /* ── LAYOUT STRUCTURE ── */
        .predictive-engine-container {
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            padding: 40px 20px 60px 20px;
            width: 100%;
            box-sizing: border-box;
            position: relative;
        }
        .main-wrapper {
            position: relative;
            z-index: 10;
            width: 100%;
            max-width: 950px;
            margin: 0 auto;
            text-align: left;
            box-sizing: border-box;
        }
        .view-section {
            width: 100%;
            max-width: 950px;
            margin: 0 auto;
            padding-top: 50px;
            box-sizing: border-box;
        }
        #input-view {
            max-width: 1000px;
        }
        .input-layout-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            align-items: start;
        }

    @keyframes spin { 100% { transform: rotate(360deg); } }

/* ════════════════════════════════════════
   GAMIFICATION CARD (READINESS ASSESSMENT)
════════════════════════════════════════ */
.gamification-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(56, 189, 248, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
}
.gamification-card::before {
    content: '';
    position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(16,185,129,0.1) 0%, transparent 50%);
    animation: spin 10s linear infinite;
}
.gamification-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
    position: relative; z-index: 1;
}
.gamification-cta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    position: relative; z-index: 1;
}
.game-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-family: 'Lexend', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(16,185,129,0.3);
    position: relative; z-index: 1;
    text-transform: uppercase; letter-spacing: 1px;
}
.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(16,185,129,0.4);
    background: linear-gradient(135deg, #34d399, #10b981);
}
.game-btn:active {
    transform: scale(0.98);
}

.return-home-btn {
    width: 100%; padding: 16px 20px; 
    background: rgba(255,255,255,0.7); 
    border: 1px solid var(--border); 
    border-radius: 12px; 
    color: var(--text-secondary); 
    font-family: 'Lexend', sans-serif; font-size: 0.85rem; font-weight: 600; cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}
.return-home-btn:hover {
    background: #ffffff;
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}
.return-home-btn:active {
    transform: scale(0.98);
}

.back-btn {
    position: fixed; top: 24px; left: 24px; z-index: 100;
    background: rgba(255,255,255,0.85); border: 1px solid var(--border);
    border-radius: 40px; padding: 8px 16px;
    color: var(--text-secondary);
    font-family: 'Lexend', sans-serif; font-size: 0.8rem;
    cursor: pointer; transition: all 0.2s;
    text-decoration: none; display: flex; align-items: center; gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.back-btn:hover { color: var(--accent-blue); border-color: rgba(2,132,199,0.3); background: #fff; }
.back-btn:active { transform: scale(0.96); }

.save-report-btn {
    position: fixed; top: 24px; right: 24px; z-index: 100;
    background: rgba(255,255,255,0.85); border: 1px solid var(--border);
    border-radius: 40px; padding: 8px 18px;
    color: var(--accent-blue);
    font-family: 'Lexend', sans-serif; font-size: 0.8rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
    text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.save-report-btn:hover {
    color: #0284c7; border-color: rgba(2,132,199,0.35); background: #fff;
    box-shadow: 0 4px 14px rgba(2,132,199,0.15); transform: translateY(-1px);
}
.save-report-btn:active { transform: scale(0.96); }

.btn-save-report-bottom {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(2,132,199,0.08), rgba(56,189,248,0.12));
    border: 1.5px solid rgba(2,132,199,0.25);
    border-radius: 14px;
    color: var(--accent-blue);
    font-family: 'Lexend', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(2,132,199,0.08);
}
.btn-save-report-bottom:hover {
    background: linear-gradient(135deg, rgba(2,132,199,0.15), rgba(56,189,248,0.22));
    border-color: rgba(2,132,199,0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(2,132,199,0.18);
}
.btn-save-report-bottom:active {
    transform: scale(0.98);
}

/* ════════════════════════════════════════════════════════════════
   COMPREHENSIVE DYNAMIC RESPONSIVE STYLES (MOBILE / TABLET)
════════════════════════════════════════════════════════════════ */

/* Tablets & Small Laptops (<= 900px) */
@media (max-width: 900px) {
    .input-layout-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

/* Standard Mobile & Phablets (<= 680px) */
@media (max-width: 680px) {
    .predictive-engine-container {
        padding: 68px 12px 40px 12px;
    }

    .view-section {
        padding-top: 10px;
    }

    /* Fixed Header Controls (Smooth Floating Controls) */
    .back-btn {
        top: 14px;
        left: 12px;
        padding: 7px 14px;
        font-size: 0.74rem;
        gap: 4px;
        background: rgba(255, 255, 255, 0.94);
        border: 1px solid rgba(2, 132, 199, 0.18);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
        z-index: 100;
    }
    .back-btn-text {
        display: none;
    }
    .back-btn::after {
        content: 'Back';
    }
    .save-report-btn {
        top: 14px !important;
        right: 12px !important;
        left: auto !important;
        padding: 7px 14px !important;
        font-size: 0.74rem !important;
        gap: 4px !important;
        background: rgba(255, 255, 255, 0.94) !important;
        border: 1px solid rgba(2, 132, 199, 0.18) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
        z-index: 100 !important;
    }
    .save-report-btn-text {
        display: none;
    }
    .save-report-btn::after {
        content: 'Report';
    }

    /* Step Dots as Floating Island */
    .step-indicator {
        position: fixed;
        top: 15px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 100;
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        padding: 7px 16px;
        border-radius: 20px;
        border: 1px solid rgba(2, 132, 199, 0.18);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
        gap: 6px;
    }
    .step-dot {
        width: 6px;
        height: 6px;
    }
    .step-indicator div[style*="width:24px"],
    .step-indicator div[style*="width: 24px"],
    .step-indicator div[style*="width:40px"],
    .step-indicator div[style*="width: 40px"] {
        width: 14px !important;
    }

    /* Hero / Title Section */
    .title-col {
        padding: 0 6px;
    }
    .title-col h2 {
        font-size: 1.55rem !important;
        line-height: 1.3 !important;
        letter-spacing: -0.5px;
        margin-bottom: 8px !important;
    }
    .title-col p {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
        padding: 0;
    }

    /* Drop Zone / Upload Card */
    .drop-zone {
        padding: 18px 14px !important;
        border-radius: 14px !important;
        min-height: unset !important;
        border-width: 1.5px !important;
    }
    .drop-zone:active {
        transform: scale(0.99);
        background: rgba(2, 132, 199, 0.08);
    }
    .drop-zone-icon {
        font-size: 1.8rem !important;
        margin-bottom: 6px !important;
    }
    .drop-zone-text {
        font-size: 0.86rem !important;
        font-weight: 600;
    }
    .drop-zone-sub {
        font-size: 0.72rem !important;
        margin-top: 4px !important;
    }

    /* Form Cards */
    .form-card {
        padding: 16px 12px !important;
        border-radius: 16px !important;
        margin-bottom: 14px !important;
    }
    .form-card h4 {
        font-size: 0.74rem !important;
        letter-spacing: 1.5px !important;
        margin-bottom: 12px !important;
    }

    /* Subject Rows */
    .subject-grid {
        gap: 8px !important;
    }
    .subject-row {
        padding: 8px 10px !important;
        gap: 8px !important;
        border-radius: 10px !important;
    }
    .subject-label {
        font-size: 0.82rem !important;
        gap: 6px !important;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .subj-badge {
        font-size: 0.58rem !important;
        padding: 2px 5px !important;
    }

    /* Grade Dropdowns (Ergonomic Touch Targets) */
    .grade-dropdown-container {
        min-width: 70px !important;
    }
    .grade-dropdown-selected {
        padding: 6px 26px 6px 8px !important;
        font-size: 0.8rem !important;
        border-radius: 8px !important;
        background-position: right 6px center !important;
    }
    .grade-option {
        padding: 10px 8px !important;
        font-size: 0.85rem !important;
    }

    /* Elective Picker Buttons */
    .add-subject-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .custom-dropdown-container {
        max-width: 100% !important;
    }
    .custom-dropdown-selected {
        width: 100% !important;
        max-width: 100% !important;
        padding: 11px 14px !important;
        font-size: 0.82rem !important;
        border-radius: 12px !important;
        min-height: 44px !important;
    }
    .custom-dropdown-selected:active {
        transform: scale(0.99);
    }
    .custom-dropdown-options {
        border-radius: 12px !important;
        max-height: 220px !important;
        -webkit-overflow-scrolling: touch;
    }
    .custom-dropdown-option {
        padding: 11px 14px !important;
        font-size: 0.82rem !important;
    }

    /* CTA / Submit Button */
    .btn-analyze-main {
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 24px !important;
        padding: 15px 20px !important;
        font-size: 0.95rem !important;
        letter-spacing: 2px !important;
        border-radius: 14px !important;
        box-shadow: 0 8px 20px rgba(56, 189, 248, 0.35) !important;
    }
    .btn-analyze-main:active {
        transform: scale(0.98);
    }

    /* Result View Mobile Optimizations */
    .result-gauge-wrap {
        margin-bottom: 20px !important;
    }
    .gauge-ring {
        width: 150px !important;
        height: 150px !important;
        margin-bottom: 12px !important;
    }
    .gauge-svg {
        width: 150px !important;
        height: 150px !important;
    }
    .gauge-pct {
        font-size: 2rem !important;
    }
    .classification-badge {
        padding: 6px 16px !important;
        font-size: 0.75rem !important;
    }
    #result-narrative {
        font-size: 0.86rem !important;
        line-height: 1.6 !important;
        margin-bottom: 18px !important;
        padding: 0 6px;
    }
    .program-card {
        padding: 16px 12px !important;
        border-radius: 14px !important;
        margin-top: 14px !important;
    }
    .program-icon {
        font-size: 1.6rem !important;
    }
    .program-name {
        font-size: 0.98rem !important;
    }
    #program-reasoning {
        font-size: 0.82rem !important;
        line-height: 1.5 !important;
        margin-top: 12px !important;
    }
    .xai-card {
        padding: 16px 12px !important;
        border-radius: 14px !important;
        margin-top: 14px !important;
    }
    .xai-card h4 {
        font-size: 0.74rem !important;
        margin-bottom: 10px !important;
    }
    .xai-feat-row {
        grid-template-columns: minmax(75px, auto) 1fr 36px !important;
        gap: 6px !important;
        margin-bottom: 8px !important;
    }
    .xai-feat-label {
        font-size: 0.75rem !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .xai-feat-pct {
        font-size: 0.72rem !important;
    }
    .gamification-card {
        padding: 18px 14px !important;
        border-radius: 14px !important;
        margin-top: 16px !important;
    }
    .gamification-card h4 {
        font-size: 0.98rem !important;
    }
    .gamification-cta {
        font-size: 0.82rem !important;
        line-height: 1.5 !important;
        margin-bottom: 14px !important;
    }
    .game-btn {
        padding: 14px !important;
        font-size: 0.9rem !important;
        border-radius: 12px !important;
    }
    .return-home-btn {
        padding: 14px !important;
        font-size: 0.82rem !important;
        border-radius: 12px !important;
    }
}

/* Ultra-Compact Phones (<= 380px) */
@media (max-width: 380px) {
    .predictive-engine-container {
        padding: 64px 8px 30px 8px;
    }
    .title-col h2 {
        font-size: 1.35rem !important;
    }
    .form-card {
        padding: 14px 10px !important;
    }
    .subject-label {
        font-size: 0.76rem !important;
    }
    .grade-dropdown-container {
        min-width: 64px !important;
    }
    .grade-dropdown-selected {
        padding: 5px 22px 5px 6px !important;
        font-size: 0.76rem !important;
    }
}


