/* --- Keep all previous CSS rules up to .control-group label --- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Inter', sans-serif; background-color: #000000; color: #ffffff; display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }
.top-bar { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; background: rgba(10, 10, 10, 0.8); border-bottom: 1px solid #1a1a1a; backdrop-filter: blur(10px); z-index: 10; flex-wrap: wrap; gap: 0.5rem; }
.back-link { color: #888888; text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.2s; white-space: nowrap; }
.back-link:hover { color: #ffffff; }
.sim-title { font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #f59e0b; font-size: 0.9rem; text-align: right; }
.sim-container { display: flex; flex-direction: column; flex: 1; width: 100%; }
.canvas-wrapper { width: 100%; height: 45vh; min-height: 280px; position: relative; background: radial-gradient(circle at center, #0a101f 0%, #000000 100%); border-bottom: 1px solid #1a1a1a; }
canvas { width: 100%; height: 100%; display: block; }
.control-panel { width: 100%; background: #050505; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; }
h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: #666666; border-bottom: 1px solid #1a1a1a; padding-bottom: 0.5rem; }
.control-group { display: flex; flex-direction: column; gap: 0.75rem; }
.control-group label { font-size: 0.95rem; font-weight: 500; display: flex; justify-content: space-between; }

/* --- New Synchronized Input Controls --- */
.input-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

input[type=range] {
    -webkit-appearance: none;
    flex: 1;
    background: transparent;
    padding: 10px 0;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #1a1a1a;
    border-radius: 2px;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background: #ffffff;
    margin-top: -9px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255,255,255,0.2);
}

input[type=number] {
    width: 70px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #1a1a1a;
    color: #f59e0b; /* Yellowish-Orange focus */
    padding: 0.5rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    text-align: center;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

input[type=number]:focus {
    border-color: #3b82f6; /* Precision Blue */
}

/* Hide default up/down arrows in number box */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}

/* --- Element Info & Grid (Unchanged) --- */
.element-info { display: flex; align-items: center; gap: 1.5rem; background: #0a0a0a; padding: 1rem; border-radius: 12px; border: 1px solid #1a1a1a; }
.element-symbol { font-size: 2.25rem; font-weight: 700; color: #f59e0b; width: 50px; text-align: center; }
.element-name { font-size: 1.15rem; color: #ffffff; font-weight: 500; }
.readout-panel { display: flex; flex-direction: column; gap: 1rem; margin-top: auto; }
.quantum-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.q-box { background: #0a0a0a; padding: 0.75rem; border-radius: 8px; border: 1px solid #1a1a1a; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.q-label { font-size: 0.75rem; color: #888888; margin-bottom: 0.25rem; text-align: center; }
.q-val { font-size: 1.25rem; font-weight: 700; color: #3b82f6; }
.readout-item { background: #0a0a0a; padding: 1rem; border-radius: 12px; border: 1px solid #1a1a1a; display: flex; flex-direction: column; gap: 0.5rem; }
.config-item { margin-top: 0.5rem; }
.readout-item span:first-child { font-size: 0.8rem; color: #888888; }
.value { font-size: 1.25rem; font-weight: 700; text-align: right; }
.chem-val { color: #f59e0b; } 

@media (min-width: 800px) {
    body { height: 100vh; overflow: hidden; }
    .sim-container { flex-direction: row; height: calc(100vh - 70px); }
    .canvas-wrapper { flex: 1; height: 100%; border-bottom: none; }
    .control-panel { width: 400px; height: 100%; border-left: 1px solid #1a1a1a; overflow-y: auto; padding: 2.5rem 2rem; }
    .sim-title { font-size: 1rem; }
}
