* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(145deg, #0a0f1c 0%, #060b17 100%);
    color: #eef5ff;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 24px 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

h2 {
    font-weight: 500;
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #c0e0ff, #7aa9ff);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    display: inline-block;
}

.sub {
    color: #8aa0c0;
    margin-bottom: 28px;
    border-left: 3px solid #3b82f6;
    padding-left: 14px;
}

.plot-card {
    background: #0f172ad9;
    backdrop-filter: blur(2px);
    border-radius: 24px;
    padding: 12px;
    margin-bottom: 28px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.5);
    border: 1px solid #1e2a4a;
}

.plot {
    height: 420px;
    width: 100%;
    border-radius: 20px;
}

.controls-panel {
    background: #0b1222e6;
    backdrop-filter: blur(8px);
    border-radius: 28px;
    padding: 24px 28px;
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    align-items: stretch;
    justify-content: space-between;
}

.control-group {
    flex: 1;
    min-width: 220px;
}

.control-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9bb9f0;
}

input, select {
    background: #010514;
    border: 1px solid #2f4172;
    color: white;
    padding: 12px 16px;
    border-radius: 18px;
    width: 100%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    transition: 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px #3b82f640;
}

.info-card {
    background: #050a16;
    border-radius: 24px;
    padding: 18px 22px;
    min-width: 260px;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.info-card b {
    color: #7aaef0;
}

.badge-mode {
    background: #1f2a48;
    border-radius: 60px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 12px;
}

hr {
    border-color: #1e2a44;
    margin: 16px 0;
}

.value-hint {
    font-size: 0.7rem;
    color: #6c86a8;
    margin-top: 6px;
}

.tf-display {
    background: #010514cc;
    border-radius: 20px;
    padding: 14px 18px;
    margin-top: 18px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    border: 1px solid #2a3a60;
    backdrop-filter: blur(4px);
}

.tf-display span {
    color: #ffd966;
    font-weight: 500;
}

.tf-equation {
    word-break: break-all;
    line-height: 1.4;
}

/* =========================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================= */

/* Tablet & Smaller Laptops */
@media (max-width: 860px) {
    .controls-panel {
        flex-direction: column;
        gap: 24px;
    }
    
    .control-group, .info-card {
        width: 100%;
        min-width: 100%; /* Force full width to prevent overflow */
    }

    .plot {
        height: 340px;
    }
}

/* Mobile Phones */
@media (max-width: 600px) {
    body {
        padding: 16px 12px; /* Reduce outer padding */
    }

    h2 {
        font-size: 1.4rem; /* Scale down header */
    }

    .sub {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .plot-card {
        padding: 8px; /* Give more space to the plot itself */
        border-radius: 16px;
        margin-bottom: 20px;
    }

    .plot {
        height: 280px; /* Shorter plots for smaller screens */
    }

    .controls-panel {
        padding: 20px 16px; /* Tighter padding */
        border-radius: 20px;
    }

    .info-card {
        padding: 16px;
    }
    
    input, select {
        padding: 10px 14px;
    }
}