@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Figtree:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --glass-bg: rgba(255, 255, 255, 0.02);          /* more transparent */
    --glass-bg-hover: rgba(255, 255, 255, 0.05);    /* subtle hover */
    --glass-border: rgba(255, 255, 255, 0.10);      /* slightly softer */
    --glass-border-hover: rgba(255, 255, 255, 0.22);

    --glass-shine: rgba(255, 255, 255, 0.14);
    --glass-shadow: rgba(0, 0, 0, 0.5);

    /* Balanced blur: visible but not milky */
    --blur: blur(18px) saturate(160%);

    /* Accent palette — iridescent cosmic */
    --cyan: #67e8f9;
    --cyan-glow: rgba(103, 232, 249, 0.3);
    --violet: #a78bfa;
    --violet-glow: rgba(167, 139, 250, 0.3);
    --pink: #f472b6;
    --pink-glow: rgba(244, 114, 182, 0.25);
    --teal: #2dd4bf;
    --aurora: #818cf8;
    --star-white: #f0f4ff;

    --text-primary: #e8f0ff;
    --text-muted: rgba(200, 215, 255, 0.55);
    --success: #4ade80;
    --success-bg: rgba(74, 222, 128, 0.1);
    --error: #f87171;
    --error-bg: rgba(248, 113, 113, 0.1);
    --info-bg: rgba(103, 232, 249, 0.08);

    --radius: 20px;
    --radius-sm: 12px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Figtree', sans-serif;
    background: var(--space-black);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
}

/* ── Deep Space Background ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        /* Nebula clouds */
        radial-gradient(ellipse 80% 60% at 10% 20%, rgba(99, 62, 200, 0.22) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 90% 15%, rgba(56, 100, 255, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 50% 70% at 75% 80%, rgba(167, 78, 230, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse 70% 40% at 30% 85%, rgba(56, 189, 248, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse 40% 55% at 55% 50%, rgba(244, 114, 182, 0.07) 0%, transparent 60%),
        /* Core deep space */
        radial-gradient(ellipse 100% 100% at 50% 50%, #0b0d1f 0%, #04060f 100%);
    pointer-events: none;
    z-index: 0;
}

/* ── Animated Starfield ── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        /* Bright stars */
        radial-gradient(2px 2px at 5% 8%, rgba(255,255,255,1) 0%, transparent 100%),
        radial-gradient(2px 2px at 18% 22%, rgba(200,220,255,0.95) 0%, transparent 100%),
        radial-gradient(2.5px 2.5px at 32% 5%, rgba(255,255,255,1) 0%, transparent 100%),
        radial-gradient(2px 2px at 45% 18%, rgba(220,240,255,0.9) 0%, transparent 100%),
        radial-gradient(2.5px 2.5px at 62% 7%, rgba(255,255,255,0.95) 0%, transparent 100%),
        radial-gradient(2px 2px at 78% 14%, rgba(200,220,255,0.9) 0%, transparent 100%),
        radial-gradient(2px 2px at 91% 28%, rgba(255,255,255,1) 0%, transparent 100%),

        /* Medium stars (more added) */
        radial-gradient(1.5px 1.5px at 3% 55%, rgba(255,255,255,0.75) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 14% 35%, rgba(200,220,255,0.7) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 26% 47%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 37% 58%, rgba(200,220,255,0.65) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 48% 30%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 60% 48%, rgba(220,240,255,0.65) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 72% 35%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 84% 42%, rgba(200,220,255,0.65) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 93% 60%, rgba(255,255,255,0.65) 0%, transparent 100%),

        /* EXTRA density layer */
        radial-gradient(1.2px 1.2px at 10% 12%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 22% 18%, rgba(200,220,255,0.55) 0%, transparent 100%),
        radial-gradient(1px 1px at 36% 22%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 10%, rgba(200,220,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 64% 18%, rgba(255,255,255,0.55) 0%, transparent 100%),
        radial-gradient(1px 1px at 78% 6%, rgba(220,240,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 92% 14%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 6% 28%, rgba(200,220,255,0.45) 0%, transparent 100%),
        radial-gradient(1px 1px at 28% 38%, rgba(255,255,255,0.45) 0%, transparent 100%),
        radial-gradient(1px 1px at 43% 44%, rgba(200,220,255,0.45) 0%, transparent 100%),
        radial-gradient(1px 1px at 68% 55%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 86% 48%, rgba(220,240,255,0.45) 0%, transparent 100%),

        /* Colored stars */
        radial-gradient(1.5px 1.5px at 25% 15%, rgba(167,139,250,0.9) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 67% 28%, rgba(103,232,249,0.85) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 88% 35%, rgba(244,114,182,0.8) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
    animation: twinkle 8s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.85; }
    25% { opacity: 1; }
    50% { opacity: 0.9; }
    75% { opacity: 1; }
    100% { opacity: 0.8; }
}

/* Shooting star layer */
.shooting-stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.shooting-stars::before,
.shooting-stars::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
    border-radius: 50%;
    animation: shoot1 12s linear infinite;
    top: 15%;
    left: -120px;
    transform: rotate(20deg);
    box-shadow: 0 0 6px rgba(255,255,255,0.6), 0 0 12px rgba(167,139,250,0.4);
}

.shooting-stars::after {
    width: 80px;
    top: 55%;
    animation: shoot2 18s linear infinite 5s;
    background: linear-gradient(90deg, transparent, rgba(103,232,249,0.9), transparent);
    box-shadow: 0 0 6px rgba(103,232,249,0.6);
}

@keyframes shoot1 {
    0% {
        transform: translate(-120px, 0) rotate(15deg);
        opacity: 0;
    }
    5% { opacity: 1; }
    100% {
        transform: translate(120vw, 60vh) rotate(15deg);
        opacity: 0;
    }
}

@keyframes shoot2 {
    0% {
        transform: translate(-80px, 0) rotate(15deg);
        opacity: 0;
    }
    5% { opacity: 1; }
    100% {
        transform: translate(120vw, 50vh) rotate(15deg);
        opacity: 0;
    }
}

/* ── Layout ── */
.title_card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--glass-border);
    padding: 36px 40px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow:
        inset 0 1px 0 var(--glass-shine),
        0 8px 40px rgba(0, 0, 0, 0.4);
}

.title_card::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(103,232,249,0.5),
        rgba(167,139,250,0.5),
        rgba(244,114,182,0.4),
        transparent);
    opacity: 0.8;
}

/* Aurora shimmer on header */
.title_card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(103,232,249,0.04) 0%,
        transparent 40%,
        rgba(167,139,250,0.04) 70%,
        transparent 100%);
    pointer-events: none;
}

.title_brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.title_icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg,
        rgba(103,232,249,0.15),
        rgba(167,139,250,0.2));
    border: 1px solid rgba(255,255,255,0.18);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.25),
        0 4px 20px rgba(103,232,249,0.15),
        0 0 0 1px rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

.title_card h1 {
    font-family: 'Orbitron', monospace;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 0.08em;
    background: linear-gradient(90deg,
        var(--cyan),
        #c4b5fd,
        var(--pink),
        var(--star-white));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer-text 6s linear infinite;
    line-height: 1.1;
}

@keyframes shimmer-text {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.title_card .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-top: 4px;
}

.title_actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Model status badge */
.model-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    border: 1px solid;
    letter-spacing: 0.03em;
    transition: all 0.3s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.model-badge.ready {
    background: rgba(74,222,128,0.08);
    border-color: rgba(74,222,128,0.25);
    color: var(--success);
    box-shadow: 0 0 20px rgba(74,222,128,0.1), inset 0 1px 0 rgba(255,255,255,0.1);
}

.model-badge.not-ready {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    color: var(--text-muted);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.model-badge .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.model-badge.ready .dot { animation: pulse-dot 2s ease-in-out infinite; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 currentColor; }
    50% { opacity: 0.7; transform: scale(0.8); box-shadow: 0 0 0 4px transparent; }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 32px auto;
    padding: 0 24px;
}

/* ── Workflow Steps ── */
.workflow-steps {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    align-items: center;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 50px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.4s ease;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 4px 16px rgba(0,0,0,0.2);
}

.step-number {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.4s ease;
}

.step.completed {
    border-color: rgba(74,222,128,0.3);
    background: rgba(74,222,128,0.07);
    color: var(--success);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 0 20px rgba(74,222,128,0.08);
}

.step.completed .step-number {
    background: rgba(74,222,128,0.15);
    border-color: rgba(74,222,128,0.35);
    color: var(--success);
}

.step-arrow {
    color: rgba(255,255,255,0.2);
    font-size: 16px;
    flex-shrink: 0;
}

/* ── Cards ── */
.bigbox {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.box {
    background: none;
    border: none;
    box-shadow: none;
    padding: 28px;
    backdrop-filter: none;
}

.box h2 {
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    background: linear-gradient(90deg, var(--cyan), #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
}

.box h2 .icon {
    font-size: 18px;
    font-family: 'Figtree', sans-serif;
    -webkit-text-fill-color: initial;
}

/* ── Upload Area ── */
.upload-area {
    border: 1.5px dashed rgba(255,255,255,0.18);
    border-radius: var(--radius-sm);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.35s ease;
    background: rgba(255,255,255,0.02);
    margin-bottom: 16px;
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.upload-area:hover, .upload-area.dragover {
    border-color: rgba(103,232,249,0.55);
    background: rgba(103,232,249,0.05);
    box-shadow:
        inset 0 0 40px rgba(103,232,249,0.04),
        0 0 30px rgba(103,232,249,0.1);
}

.upload-area p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 14px;
}

.upload-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
    opacity: 0.7;
}

input[type="file"] { display: none; }

.file-label {
    display: inline-block;
    padding: 9px 20px;
    background: rgba(255,255,255,0.07);
    color: var(--cyan);
    border: 1px solid rgba(103,232,249,0.3);
    border-radius: 50px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: all 0.3s ease;
    text-decoration: none;
    backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}

.file-label:hover {
    background: rgba(103,232,249,0.12);
    border-color: var(--cyan);
    box-shadow: 0 0 24px rgba(103,232,249,0.2), inset 0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.file-name-display {
    margin-top: 10px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--teal);
}

/* ── Buttons ── */
.btn-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

button {
    padding: 10px 22px;
    border: none;
    border-radius: 50px;
    font-family: 'Figtree', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: rgba(255,255,255,0.35);
    border-radius: inherit;
}

button.primary {
    background: linear-gradient(135deg,
        rgba(103,232,249,0.35),
        rgba(167,139,250,0.35));
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(16px);
    box-shadow:
        0 4px 24px rgba(103,232,249,0.2),
        inset 0 1px 0 rgba(255,255,255,0.25),
        0 0 0 1px rgba(255,255,255,0.05);
    text-shadow: 0 1px 8px rgba(103,232,249,0.4);
}

button.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow:
        0 8px 32px rgba(103,232,249,0.3),
        0 0 60px rgba(167,139,250,0.15),
        inset 0 1px 0 rgba(255,255,255,0.3);
    background: linear-gradient(135deg,
        rgba(103,232,249,0.45),
        rgba(167,139,250,0.45));
}

button.ghost {
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

button.ghost:hover:not(:disabled) {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.22);
    color: var(--text-primary);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 4px 16px rgba(0,0,0,0.2);
}

button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

button:not(.primary):not(.ghost) {
    background: rgba(103,232,249,0.08);
    color: var(--cyan);
    border: 1px solid rgba(103,232,249,0.25);
    backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

button:not(.primary):not(.ghost):hover:not(:disabled) {
    background: rgba(103,232,249,0.14);
    border-color: rgba(103,232,249,0.5);
    box-shadow: 0 0 24px rgba(103,232,249,0.18), inset 0 1px 0 rgba(255,255,255,0.18);
    transform: translateY(-1px);
}

/* ── Output Section ── */
.output-section {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 18px;
    min-height: 160px;
    backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ── Status Messages ── */
.status-message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 8px 0;
    font-size: 14px;
    border-left: 3px solid;
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.status-message.success {
    background: rgba(74,222,128,0.08);
    border-color: var(--success);
    color: #86efac;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 20px rgba(74,222,128,0.06);
}

.status-message.error {
    background: rgba(248,113,113,0.08);
    border-color: var(--error);
    color: #fca5a5;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.status-message.info {
    background: rgba(103,232,249,0.07);
    border-color: var(--cyan);
    color: #a5f3fc;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ── Loader ── */
.loader {
    border: 2px solid rgba(255,255,255,0.08);
    border-top: 2px solid var(--cyan);
    border-right: 2px solid var(--violet);
    border-radius: 50%;
    width: 36px; height: 36px;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
    box-shadow: 0 0 16px rgba(103,232,249,0.3);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
}

/* ── Prediction Card ── */
.prediction-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin: 12px 0;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 4px 24px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
}

.prediction-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.prediction-card h3 {
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 14px;
}

.prediction-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 6px 0;
}

.prediction-card p strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ── Probability Bar ── */
.prob-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 13px;
}

.prob-label-row span:first-child { color: var(--text-primary); font-weight: 500; }
.prob-label-row span:last-child { font-family: 'JetBrains Mono', monospace; color: var(--cyan); font-size: 12px; }

.probability-bar {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    height: 36px;
    border-radius: 50px;
    overflow: hidden;
    margin: 6px 0 14px;
    backdrop-filter: blur(8px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.probability-fill {
    height: 100%;
    background: linear-gradient(90deg,
        rgba(103,232,249,0.7),
        rgba(167,139,250,0.7),
        rgba(45,212,191,0.7));
    display: flex;
    align-items: center;
    padding: 0 16px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: fit-content;
    box-shadow: 0 0 20px rgba(103,232,249,0.35);
    border-radius: 50px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ── Metric Cards ── */
.model-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.metric-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 16px 12px;
    text-align: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 4px 16px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.metric-card:hover {
    transform: translateY(-3px);
    border-color: rgba(103,232,249,0.3);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 8px 32px rgba(0,0,0,0.3), 0 0 30px rgba(103,232,249,0.1);
}

.metric-value {
    font-family: 'Orbitron', monospace;
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(90deg, var(--cyan), var(--violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 6px 0;
    letter-spacing: -0.02em;
}

.metric-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Confusion Matrix ── */
.confusion-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    margin-top: 12px;
}

.confusion-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 360px;
    font-size: 13px;
}

.confusion-table th,
.confusion-table td {
    border: 1px solid rgba(255,255,255,0.08);
    padding: 10px 14px;
    text-align: center;
}

.confusion-table th {
    background: rgba(103,232,249,0.07);
    color: var(--cyan);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.confusion-table td {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    background: rgba(255,255,255,0.02);
}

.confusion-table tr:hover td { background: rgba(103,232,249,0.05); }

/* ── Feature Grid ── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.feature-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.feature-item:hover {
    border-color: rgba(103,232,249,0.25);
    background: rgba(103,232,249,0.04);
}

.feature-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 3px;
}

.feature-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--star-white);
    font-family: 'JetBrains Mono', monospace;
}

/* ── Row Input Section ── */
.row-input-section {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 16px 0;
}

input[type="number"] {
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    flex: 1;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), inset 0 2px 8px rgba(0,0,0,0.2);
}

input[type="number"]:focus {
    outline: none;
    border-color: rgba(103,232,249,0.45);
    box-shadow:
        0 0 20px rgba(103,232,249,0.12),
        inset 0 1px 0 rgba(255,255,255,0.12),
        inset 0 2px 8px rgba(0,0,0,0.2);
    background: rgba(103,232,249,0.05);
}

input[type="number"]::placeholder { color: rgba(200,215,255,0.3); }

/* ── Predicted label badge ── */
.predicted-badge {
    background: rgba(74,222,128,0.07);
    border: 1px solid rgba(74,222,128,0.22);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    margin: 12px 0;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.12),
        0 0 30px rgba(74,222,128,0.06);
    position: relative;
    overflow: hidden;
}

.predicted-badge::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(74,222,128,0.4), transparent);
}

.predicted-badge .label-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 8px;
}

.predicted-badge .label-value {
    font-family: 'Orbitron', monospace;
    font-size: 22px;
    font-weight: 700;
    color: var(--success);
    letter-spacing: 0.05em;
    text-shadow: 0 0 20px rgba(74,222,128,0.4);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(103,232,249,0.3); }

/* ── Selection ── */
::selection {
    background: rgba(103,232,249,0.25);
    color: var(--text-primary);
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .container { padding: 0 16px; }
}

@media (max-width: 900px) {
    .bigbox { grid-template-columns: 1fr; gap: 16px; }
    .title_card { flex-direction: column; align-items: flex-start; gap: 14px; padding: 24px 20px; }
    .title_actions { width: 100%; justify-content: flex-end; }
    .workflow-steps { overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
    .step { flex: 0 0 auto; min-width: 160px; }
    .step-arrow { flex-shrink: 0; }
}

@media (max-width: 600px) {
    .title_card h1 { font-size: 20px; }
    .container { padding: 0 12px; margin: 20px auto; }
    .box { padding: 18px; }
    .workflow-steps { flex-direction: column; overflow: visible; }
    .step { width: 100%; min-width: unset; }
    .step-arrow { display: none; }
    .btn-row { flex-direction: column; }
    .btn-row button { width: 100%; }
    .file-label { display: block; width: 100%; text-align: center; }
    .model-results { grid-template-columns: 1fr 1fr; }
    .row-input-section { flex-direction: column; }
    input[type="number"] { width: 100%; }
    .feature-grid { grid-template-columns: 1fr 1fr; }
}

@media (pointer: coarse) {
    button, .file-label { min-height: 44px; }
}
