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

:root {
  --bg: #0f1419; --surface: #1a1f2e; --surface2: #242a3a;
  --border: #2d3548; --text: #e2e8f0; --text-dim: #8892a4;
  --accent: #8b5cf6; --accent2: #f59e0b; --green: #10b981;
  --red: #ef4444; --blue: #3b82f6; --cyan: #06b6d4; --radius: 10px;
}

body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6; min-height: 100vh;
}

.ws-container { max-width: 1400px; margin: 0 auto; padding: 20px; }

header { text-align: center; margin-bottom: 24px; }
header h1 { font-size: 1.6rem; color: var(--accent); margin-bottom: 4px; }
.subtitle { color: var(--text-dim); font-size: 0.9rem; }

.main-layout {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 20px; margin-bottom: 24px;
}

.controls-panel {
  background: var(--surface); border-radius: var(--radius); padding: 16px;
  border: 1px solid var(--border); display: flex; flex-direction: column;
  gap: 12px; height: fit-content; max-height: calc(100vh - 100px); overflow-y: auto;
}
.controls-panel::-webkit-scrollbar { width: 4px; }
.controls-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.control-section h3 {
  font-size: 0.85rem; color: var(--accent); margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.preset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.preset-btn {
  padding: 6px 4px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface2); color: var(--text-dim); font-size: 0.7rem;
  cursor: pointer; transition: all 0.2s;
}
.preset-btn:hover { background: var(--border); color: var(--text); }
.preset-btn.active {
  background: rgba(139,92,246,0.22); border-color: var(--accent);
  color: var(--text); box-shadow: 0 0 0 1px rgba(139,92,246,0.2);
}

#comp-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }

.comp-slot {
  background: var(--surface2); border-radius: 8px; padding: 10px;
  border: 1px solid var(--border);
}
.comp-slot.disabled { opacity: 0.35; }

.comp-header {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.comp-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.comp-header select {
  flex: 1; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 4px; font-size: 0.75rem;
}
.comp-remove {
  background: none; border: none; color: var(--text-dim); font-size: 1rem;
  cursor: pointer; padding: 0 2px; line-height: 1;
}
.comp-remove:hover { color: var(--red); }

.comp-slider { margin-bottom: 4px; }
.comp-slider label {
  display: flex; justify-content: space-between;
  font-size: 0.7rem; color: var(--text-dim); margin-bottom: 2px;
}
.comp-slider .val { color: var(--accent); font-weight: 600; }

input[type="range"] {
  width: 100%; height: 4px; -webkit-appearance: none; appearance: none;
  background: var(--border); border-radius: 2px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px;
  border-radius: 50%; background: var(--accent); cursor: pointer;
}

.action-btn {
  width: 100%; padding: 7px; border: 1px dashed var(--border);
  border-radius: 6px; background: transparent; color: var(--text-dim);
  font-size: 0.78rem; cursor: pointer; transition: all 0.2s;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.action-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stat-item { background: var(--surface2); padding: 6px; border-radius: 6px; text-align: center; }
.stat-item .stat-label { display: block; font-size: 0.6rem; color: var(--text-dim); text-transform: uppercase; }
.stat-item .stat-val { display: block; font-size: 0.85rem; font-weight: 700; color: var(--accent); margin-top: 1px; }

.display-panel { min-width: 0; }
.viz-stack { display: flex; flex-direction: column; gap: 16px; }
.canvas-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 14px; overflow: hidden;
}
.canvas-card h3 {
  font-size: 0.8rem; color: var(--text-dim); margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.canvas-card canvas {
  width: 100%; height: 280px; display: block;
  border-radius: 6px; background: #0d1117;
}

.education {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 20px; margin-bottom: 20px;
}
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.tab-btn {
  padding: 8px 16px; border: none; background: transparent; color: var(--text-dim);
  font-size: 0.85rem; cursor: pointer; border-radius: 6px 6px 0 0; transition: all 0.2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); background: var(--surface2); font-weight: 600; }
.tab-content { min-height: 100px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.edu-card { background: var(--surface2); border-radius: 8px; padding: 16px; margin-bottom: 12px; }
.edu-card h3 { color: var(--accent); font-size: 0.95rem; margin-bottom: 8px; }
.edu-card p { color: var(--text-dim); font-size: 0.85rem; line-height: 1.7; }

footer { text-align: center; color: var(--text-dim); font-size: 0.75rem; padding: 12px 0; }

@media (max-width: 900px) {
  .main-layout { grid-template-columns: 1fr; }
  .controls-panel { flex-direction: row; flex-wrap: wrap; max-height: none; }
  .control-section { flex: 1; min-width: 220px; }
}
@media (max-width: 600px) {
  .ws-container { padding: 10px; }
  header h1 { font-size: 1.2rem; }
  .canvas-card canvas { height: 240px; }
}
