#wave-sim-container {
    --billy-orange: #F5A623; 
    --billy-blue: #008080; 
    --bg-light: #f9f9f9; 
    --slate-200: #e2e8f0;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-800: #1e293b;
    
    width: 100%; 
    max-width: 800px;
    margin: 0 auto; 
    font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    -webkit-font-smoothing: antialiased;
}

#wave-sim-container * {
    box-sizing: border-box;
}

#wave-sim-container .note-card { 
    background: var(--bg-light); 
    border-radius: 12px; 
    padding: 0; 
    margin: 20px 0; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    border-top: 4px solid var(--billy-blue); 
    overflow: hidden;
}

#wave-sim-container .card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    flex-wrap: wrap;
    gap: 10px;
}

#wave-sim-container .status-badge {
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    border: 1px solid transparent;
}
#wave-sim-container .status-running { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
#wave-sim-container .status-paused { background: #f1f5f9; color: var(--slate-500); border-color: var(--slate-200); }

#wave-sim-container .diagram-container {
    position: relative;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid var(--slate-200);
    line-height: 0;
    aspect-ratio: 800 / 350;
}
#wave-sim-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

#wave-sim-container .sliders-wrapper {
    padding: 20px;
    background: #fff;
    border-bottom: 1px solid var(--slate-200);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

#wave-sim-container .toggles-wrapper {
    padding: 20px 20px 0 20px;
    background: #fff;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

#wave-sim-container .slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#wave-sim-container .slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--slate-800);
}

#wave-sim-container .val-badge {
    background: var(--bg-light);
    border: 1px solid var(--slate-200);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
}

#wave-sim-container input[type=range] {
    -webkit-appearance: none; 
    width: 100%; 
    background: transparent; 
}
#wave-sim-container input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--billy-blue);
    cursor: pointer;
    margin-top: -6px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid white;
}
#wave-sim-container input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--slate-200);
    border-radius: 3px;
}

#wave-sim-container .toggle-container {
    display: flex;
    background: var(--slate-200);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}
#wave-sim-container .toggle-btn {
    flex: 1;
    padding: 8px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--slate-500);
    cursor: pointer;
    transition: all 0.2s;
}
#wave-sim-container .toggle-btn.active {
    background: #fff;
    color: var(--billy-blue);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#wave-sim-container .controls {
    padding: 20px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    background: #fff;
}

#wave-sim-container button.main-btn {
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

#wave-sim-container .btn-start {
    background: var(--billy-orange);
    color: white;
}
#wave-sim-container .btn-start.paused {
    background: #22c55e;
}
#wave-sim-container .btn-reset {
    background: white;
    border: 2px solid var(--billy-blue);
    color: var(--billy-blue);
}

@media (max-width: 600px) {
    #wave-sim-container .controls { grid-template-columns: 1fr; }
    #wave-sim-container .card-header { flex-direction: column; align-items: flex-start; }
}