:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #162032;
  --border: rgba(6,182,212,0.12);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --cyan: #06b6d4;
  --cyan-dim: rgba(6,182,212,0.12);
  --accent: #22d3ee;
}

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

body {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #06101d, #0b1424 40%, var(--bg));
  color: var(--text);
  min-height: 100vh;
}

.dna-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px;
}

header {
  margin-bottom: 18px;
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(30,41,59,0.96), rgba(15,23,42,0.96));
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

header h1 {
  font-size: clamp(1.6rem, 2.8vw, 2.6rem);
  line-height: 1.1;
}

.subtitle {
  max-width: 800px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.main-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 18px;
}

.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.control-section {
  padding: 16px;
  background: linear-gradient(180deg, rgba(30,41,59,0.98), rgba(22,32,50,0.98));
  border: 1px solid var(--border);
  border-radius: 16px;
}

.control-section h3 {
  font-size: 0.92rem;
  margin-bottom: 12px;
  color: var(--cyan);
}

.mode-toggle {
  display: flex;
  gap: 8px;
}

.mode-btn {
  flex: 1;
  padding: 9px 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 150ms ease;
}

.mode-btn:hover {
  background: rgba(255,255,255,0.08);
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--cyan), #3db8ff);
  color: #06101d;
  border-color: transparent;
  font-weight: 700;
}

.control-group {
  margin-bottom: 12px;
}

.control-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.control-group .val {
  color: var(--accent);
  font-weight: 600;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
}

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.action-btn {
  flex: 1;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 120ms ease;
}

.action-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--border);
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--cyan), #3db8ff);
  color: #06101d;
  border: none;
  font-weight: 700;
}

.step-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 150ms ease;
}

.step-dot.done {
  background: rgba(6,182,212,0.15);
  border-color: rgba(6,182,212,0.3);
  color: var(--cyan);
}

.step-dot.active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #06101d;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(6,182,212,0.4);
}

.step-desc {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
  min-height: 2.5em;
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--muted);
}

.swatch {
  display: inline-block;
  width: 20px;
  height: 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.swatch.strand { background: #64748b; }
.swatch.new-strand { background: #22d3ee; }
.swatch.rna { background: #c084fc; }
.swatch.primer { background: #f472b6; }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.base-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: monospace;
}

.enzyme-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.display-panel {
  min-width: 0;
}

.canvas-card {
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(5,10,18,0.95), rgba(8,14,25,0.95));
  border: 1px solid rgba(255,255,255,0.05);
  height: 420px;
}

.canvas-card canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.education {
  margin-top: 18px;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.tab-btn {
  padding: 9px 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border-radius: 12px 12px 0 0;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 150ms ease;
}

.tab-btn:hover {
  background: rgba(255,255,255,0.07);
}

.tab-btn.active {
  background: linear-gradient(180deg, rgba(30,41,59,0.98), rgba(22,32,50,0.98));
  color: var(--cyan);
  border-color: var(--border);
  border-bottom-color: transparent;
}

.tab-pane {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.tab-pane.active {
  display: grid;
}

.edu-card {
  padding: 18px;
  background: linear-gradient(180deg, rgba(30,41,59,0.98), rgba(22,32,50,0.98));
  border: 1px solid var(--border);
  border-radius: 16px;
}

.edu-card h3 {
  font-size: 0.96rem;
  color: var(--cyan);
  margin-bottom: 8px;
}

.edu-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

@media (max-width: 960px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .canvas-card {
    height: 360px;
  }
}

@media (max-width: 640px) {
  .dna-container { padding: 10px; }
  .canvas-card { height: 300px; }
  .btn-row { flex-wrap: wrap; }
  .step-dots { gap: 4px; }
  .step-dot { width: 24px; height: 24px; font-size: 0.72rem; }
  .tab-pane { grid-template-columns: 1fr; }
}
