:root {
  --ink: #10263a;
  --muted: #587086;
  --panel: #f6fbf8;
  --panel-solid: #ffffff;
  --line: rgba(16, 38, 58, .16);
  --teal: #00a997;
  --teal-soft: #dff7f4;
  --orange: #f97316;
  --orange-soft: #fff0e5;
  --blue: #3b82f6;
  --red: #e63946;
  --green: #2a9d4e;
  --yellow: #e9c46a;
  --purple: #8b5cf6;
  --amber: #b45309;
  --edutec: #43845f;
  --edutec-dark: #397452;
  --error: #c62828;
  --success: #2f7d4e;
  --alert: #e0217a;
  --shadow: 0 16px 42px rgba(16, 38, 58, .18);
  --small-shadow: 0 8px 24px rgba(16, 38, 58, .14);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  font-family: "Segoe UI", "Arial", sans-serif;
  color: var(--ink);
  background: #e8e8e8;
}

button,
input {
  font: inherit;
}

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: linear-gradient(135deg, #66c18e, #45825d);
  transition: opacity .35s ease, visibility .35s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-logo {
  width: 150px;
  height: auto;
  animation: pulse 2s infinite;
}

.progress-container {
  width: 280px;
  height: 12px;
  background: rgba(255, 255, 255, .25);
  border-radius: 20px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: #ffffff;
  border-radius: 20px;
  animation: loading 3s linear forwards;
}

.loading-text {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

@keyframes loading {
  from { width: 0%; }
  to { width: 100%; }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: .8; }
  100% { transform: scale(1); opacity: 1; }
}

.sim-app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #e7e7e7;
  transition: opacity .28s ease, transform .28s ease;
}

.sim-app.stage-transition {
  opacity: .38;
  transform: scale(.992);
}

#sim-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
}

.top-chrome,
.float-panel,
.objective-bar {
  position: absolute;
  z-index: 5;
}

.top-chrome {
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 18px 8px 24px;
  border: 0;
  border-radius: 0;
  background: var(--edutec);
  box-shadow: 0 2px 0 rgba(255,255,255,.55) inset;
}

.brand-lockup {
  display: flex;
  align-items: center;
  width: 250px;
  flex: 0 0 250px;
}

.brand-lockup img {
  width: 76px;
  height: 58px;
  object-fit: contain;
  flex: 0 0 auto;
}

.sim-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  color: #fff;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.curriculum-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin-left: auto;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 8px;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.curriculum-button:hover {
  transform: translateY(-1px);
  background: #fff;
  border-color: #fff;
  color: var(--edutec-dark);
}

.curriculum-icon {
  font-size: 15px;
  line-height: 1;
}

.tool-mode,
.toolbar-row,
.base-grid {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-tab,
.tool-button,
.replace-base {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.icon-tab.active,
.tool-button.active {
  background: var(--edutec);
  border-color: var(--edutec);
  color: #fff;
}

.icon-tab:hover,
.tool-button:hover,
.replace-base:hover,
.palette-item:hover,
.enzyme-chip:hover {
  transform: translateY(-1px);
}

.float-panel {
  width: 300px;
  max-height: none;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  box-shadow: none;
}

.left-panel {
  left: 20px;
  top: 96px;
  bottom: auto;
  padding: 0;
  width: 300px;
  max-height: calc(100vh - 116px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: transparent;
}

.right-panel {
  right: 0;
  top: 76px;
  bottom: 0;
  padding: 24px 20px;
}

.panel-title,
.tool-label {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #111;
}

.panel-title {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--edutec);
  font-size: 18px;
  letter-spacing: 0;
  text-transform: none;
}

.panel-card {
  border-radius: 14px;
  padding: 14px 16px 16px;
  background: linear-gradient(160deg, var(--edutec), var(--edutec-dark));
  box-shadow: 0 10px 26px rgba(16, 38, 58, .22);
  color: #fff;
  overflow: hidden;
}

.panel-card-tabs {
  padding: 8px;
}

.panel-card .tool-label {
  color: rgba(255, 255, 255, .78);
}

.panel-card .side-note {
  color: rgba(255, 255, 255, .92);
}

.panel-card .progress-pill {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.panel-card .icon-tab {
  border-color: rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.panel-card .icon-tab.active {
  background: #fff;
  border-color: #fff;
  color: var(--edutec-dark);
}

.tool-mode {
  margin-bottom: 12px;
}

.icon-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 34px;
  padding: 6px 3px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.tool-section,
.info-panel {
  display: none;
}

.tool-section.active,
.info-panel.active {
  display: block;
}

.tool-label {
  margin: 12px 0 8px;
}

.palette-item,
.enzyme-chip,
.module-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 36px;
  margin: 0 0 10px;
  padding: 0 14px;
  border: 2px solid rgba(67,132,95,.16);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: grab;
}

.palette-item::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
  opacity: .9;
}

.module-card {
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 64px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.module-card:hover {
  transform: translateY(-3px);
  border-color: var(--edutec);
  background: rgba(67, 132, 95, .09);
  box-shadow: 0 10px 22px rgba(16, 38, 58, .16);
}

.module-card.active:hover {
  background: rgba(67, 132, 95, .18);
}

.module-card:active {
  transform: translateY(-1px);
}

.module-card.active {
  border-color: var(--edutec);
  background: rgba(67, 132, 95, .12);
}

.module-card strong,
.module-card small {
  display: block;
  text-align: left;
}

.module-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.module-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--edutec);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  flex: 0 0 auto;
}

.palette-item.phosphate { color: #264653; }
.palette-item.sugar.deoxy { color: var(--orange); }
.palette-item.sugar.ribose { color: #12969b; }
.palette-item.a,
.replace-base.a,
.swatch.a { color: var(--red); }
.palette-item.t,
.replace-base.t,
.swatch.t { color: var(--blue); }
.palette-item.g,
.replace-base.g,
.swatch.g { color: var(--green); }
.palette-item.c,
.replace-base.c,
.swatch.c { color: #b08300; }
.palette-item.u { color: var(--purple); }

/* Minimal molecule icons inside the palette, matching the canvas shapes/colors */
.palette-item {
  justify-content: flex-start;
  gap: 12px;
}

.palette-item::after {
  content: none;
}

.piece-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: currentColor;
  color: inherit;
}

.piece-icon.shape-circle {
  border-radius: 50%;
}

.piece-icon.shape-pentagon {
  width: 30px;
  height: 28px;
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.piece-icon.shape-base {
  width: 34px;
  height: 22px;
  border-radius: 6px;
  position: relative;
}

.piece-icon.shape-base.purine { width: 38px; }
.piece-icon.shape-base.pyrimidine { width: 30px; }

.piece-icon.shape-base::after {
  content: attr(data-letter);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.palette-item.c .piece-icon.shape-base::after {
  color: var(--ink);
}

.piece-label {
  flex: 1 1 auto;
  text-align: left;
}

.rep-enzyme-tray,
.rep-base-panel {
  display: none;
  margin: 12px 0;
}

.rep-enzyme-tray.active,
.rep-base-panel.active {
  display: block;
}

.enzyme-chip {
  justify-content: flex-start;
  gap: 12px;
  cursor: grab;
}

.enzyme-shape {
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
  width: 32px;
  height: 28px;
}

.enzyme-shape.helicase {
  border-radius: 50%;
  background: var(--orange);
}

.enzyme-shape.helicase::before,
.enzyme-shape.helicase::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 8px;
  height: 14px;
  border-radius: 8px;
  background: #fff;
}

.enzyme-shape.helicase::before { left: 7px; transform: rotate(-28deg); }
.enzyme-shape.helicase::after { right: 7px; transform: rotate(28deg); }

.enzyme-shape.ssb {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
}

.enzyme-shape.ssb::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 10px 0 0 var(--purple), 20px 0 0 var(--purple);
}

.enzyme-shape.polymerase {
  border-radius: 8px 14px 14px 8px;
  background: var(--teal);
}

.enzyme-shape.polymerase::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 8px;
  border-left: 9px solid var(--teal);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.enzyme-shape.ligase {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--amber) 0 44%, transparent 44% 56%, var(--amber) 56% 100%);
}

.enzyme-shape.ligase::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
}

.toolbar-row {
  flex-wrap: wrap;
  margin-top: 10px;
}

.tool-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 850;
}

.base-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.tool-button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
}

.replace-base {
  height: 38px;
  border-radius: 8px;
  font-weight: 900;
}

.toggle-row,
.speed-control {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
  font-size: 13px;
  font-weight: 750;
  color: var(--ink);
}

.toggle-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
}

.speed-control {
  flex-direction: column;
  align-items: stretch;
}

.speed-control input {
  accent-color: var(--teal);
}

.status-line {
  display: none;
}

.status-line.is-success {
  color: var(--success);
}

.status-line.is-error {
  color: var(--error);
}

.detail-line {
  min-height: 52px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.feedback-line {
  min-height: 46px;
  margin: 0 0 12px;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--edutec), var(--edutec-dark));
  box-shadow: 0 10px 26px rgba(16, 38, 58, .22);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.feedback-line.is-success {
  background: linear-gradient(160deg, #379462, #235d3d);
  box-shadow: 0 10px 26px rgba(47, 125, 78, .32);
  color: #fff;
}

.feedback-line.is-error {
  background: linear-gradient(160deg, #d6555f, #a5303b);
  box-shadow: 0 10px 26px rgba(198, 40, 40, .32);
  color: #fff;
}

.legend {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.legend.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legend span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
}

.swatch,
.line-swatch {
  display: inline-block;
  flex: 0 0 auto;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
}

.swatch.phosphate { color: #264653; }
.swatch.sugar { color: var(--orange); }
.swatch.base { color: var(--red); }

.line-swatch {
  width: 22px;
  height: 5px;
  border-radius: 4px;
}

.line-swatch.original { background: var(--orange); }
.line-swatch.new { background: var(--teal); }

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.stat-row .is-success { color: var(--success); }
.stat-row .is-error { color: var(--error); }

.quick-check {
  display: none;
  margin: 4px 0 12px;
  padding: 12px;
  border: 1px solid rgba(67, 132, 95, .28);
  border-radius: 8px;
  background: var(--teal-soft);
}

.quick-check.active {
  display: block;
}

.quick-check-question {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.35;
}

.quick-check-buttons {
  display: flex;
  gap: 8px;
}

.quick-check-buttons .tool-button {
  flex: 1;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  text-align: center;
  line-height: 1.3;
  font-weight: 400;
}

.quick-check-result {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 800;
  min-height: 16px;
}

.quick-check-result.is-success { color: var(--success); }
.quick-check-result.is-error { color: var(--error); }

.reset-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin-top: 13px;
  padding: 0 14px;
  border: 2px solid rgba(0, 169, 151, .3);
  border-radius: 8px;
  background: var(--teal-soft);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.reset-link:hover {
  transform: translateY(-3px);
  border-color: var(--teal);
  background: rgba(0, 169, 151, .16);
  box-shadow: 0 10px 22px rgba(16, 38, 58, .16);
}

.reset-link:active {
  transform: translateY(-1px);
}

.reset-link .ribbon-text {
  color: var(--teal);
  font-size: 13px;
  font-weight: 850;
}

[data-tools="2"] .tool-label {
  background: linear-gradient(90deg, var(--orange), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme="dark"] .reset-link {
  background: rgba(0, 169, 151, .16);
  border-color: rgba(0, 169, 151, .4);
}

[data-theme="dark"] .reset-link:hover {
  background: rgba(0, 169, 151, .26);
}

.mini-controls {
  display: flex;
  gap: 8px;
  width: fit-content;
  margin-top: 14px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(16, 38, 58, .06);
  border: 1px solid rgba(16, 38, 58, .1);
}

.mini-control-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--edutec-dark);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--edutec), var(--edutec-dark));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(67, 132, 95, .35), 0 0 0 rgba(102, 193, 142, 0);
  transition: transform .18s ease, box-shadow .25s ease, background .25s ease;
}

.mini-control-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #66c18e, var(--edutec));
  box-shadow: 0 6px 16px rgba(67, 132, 95, .45), 0 0 18px 4px rgba(102, 193, 142, .55);
}

.mini-control-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(67, 132, 95, .4), 0 0 10px 2px rgba(102, 193, 142, .4);
}

.mini-control-btn svg {
  width: 17px;
  height: 17px;
}

.mini-control-btn.muted {
  background: linear-gradient(135deg, #8b98a0, #64727a);
  border-color: #5b686f;
}

.mini-control-btn.muted:hover {
  background: linear-gradient(135deg, #a2adb3, #78848a);
  box-shadow: 0 6px 16px rgba(16, 38, 58, .3), 0 0 14px 3px rgba(139, 152, 160, .4);
}

.mini-control-btn.muted .wave {
  opacity: 0;
}

.mini-control-btn.muted::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transform: rotate(-45deg);
  box-shadow: 0 0 0 1px var(--error);
}

.objective-bar {
  left: 50%;
  bottom: 18px;
  width: fit-content;
  max-width: min(calc(100vw - 580px), 880px);
  min-height: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: 0;
  border-radius: 14px;
  background: var(--edutec);
  color: #fff;
  box-shadow: 0 8px 22px rgba(16, 38, 58, .18);
  text-align: center;
  font-size: 16px;
  font-weight: 800;
}

.objective-bar.is-success {
  background: var(--success);
}

.objective-bar.is-error {
  background: var(--error);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.edutec-ai {
  position: fixed;
  z-index: 80;
  right: 32px;
  bottom: 28px;
  width: 0;
  height: 0;
  font-family: "Segoe UI", Arial, sans-serif;
}

.ai-window {
  position: absolute;
  right: 0;
  bottom: 80px;
  display: flex;
  width: min(500px, calc(100vw - 48px));
  max-height: min(560px, calc(100vh - 132px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(67, 132, 95, .2);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 22px 50px rgba(16, 38, 58, .25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(.98);
  transform-origin: right bottom;
  transition: opacity .2s ease, transform .2s ease;
}

.edutec-ai.is-open .ai-window {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.edutec-ai.is-expanded .ai-window {
  position: fixed;
  inset: 0;
  z-index: 300;
  width: 100vw;
  height: 100vh;
  max-height: none;
  border-radius: 0;
  transform: none;
}

.edutec-ai.is-expanded .ai-body {
  flex: 1 1 auto;
}

.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #4f976d, #2f714f);
  color: #fff;
}

.ai-identity,
.ai-actions {
  display: flex;
  align-items: center;
}

.ai-identity {
  min-width: 0;
  gap: 12px;
}

.ai-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .42);
  border-radius: 50%;
  object-fit: cover;
  object-position: center 12%;
  background: #dff0e4;
}

.ai-header strong {
  display: block;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .01em;
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: rgba(255, 255, 255, .93);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.ai-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #73f0a3;
  box-shadow: 0 0 0 3px rgba(115, 240, 163, .15);
}

.ai-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.ai-action {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 25px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}

.ai-action:first-child {
  font-size: 21px;
}

.ai-action:hover,
.ai-action:focus-visible {
  background: rgba(255, 255, 255, .28);
  transform: translateY(-1px);
}

.ai-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 14px;
  padding: 20px 20px 14px;
  background: #fff;
}

.ai-messages {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 120px;
  max-height: 200px;
  gap: 10px;
  overflow: auto;
  padding: 0 5px 2px 1px;
}

.edutec-ai.is-expanded .ai-messages {
  max-height: none;
}

.ai-message {
  max-width: 92%;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

.ai-bot {
  align-self: flex-start;
  border-left: 4px solid #4f976d;
  border-radius: 16px 16px 16px 6px;
  background: #eaf5ed;
  color: var(--ink);
}

.ai-bot a {
  color: #2e6347;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.ai-bot a:hover,
.ai-bot a:focus-visible {
  color: #1f4a34;
}

.ai-user {
  align-self: flex-end;
  border-radius: 16px 16px 6px 16px;
  background: #4f976d;
  color: #fff;
}

.ai-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 -20px;
  padding: 12px 20px;
  border-top: 1px solid #e2ece5;
  border-bottom: 1px solid #e2ece5;
  background: #fbfdfb;
}

.ai-chip {
  min-height: 33px;
  padding: 0 12px;
  border: 1px solid #d4e2d8;
  border-radius: 999px;
  background: #fff;
  color: #386c4e;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.ai-chip:hover,
.ai-chip:focus-visible {
  border-color: #4f976d;
  background: #edf7ef;
  transform: translateY(-1px);
}

.ai-form {
  display: flex;
  gap: 10px;
}

.ai-form textarea {
  flex: 1 1 auto;
  min-width: 0;
  height: 54px;
  max-height: 100px;
  padding: 15px 18px;
  border: 2px solid #4f976d;
  border-radius: 27px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  resize: none;
  overflow-y: auto;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.ai-form textarea::placeholder {
  color: #93a79c;
  font-weight: 600;
}

.ai-form textarea:focus {
  outline: none;
  border-color: #3c7b58;
  box-shadow: 0 0 0 3px rgba(79, 151, 109, .18);
}

.ai-form button {
  flex: 0 0 auto;
  min-height: 54px;
  padding: 0 24px;
  border: 0;
  border-radius: 27px;
  background: #4f976d;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.ai-form button:hover,
.ai-form button:focus-visible {
  background: #3c7b58;
  transform: translateY(-1px);
}

.ai-disclaimer {
  margin: -3px 0 0;
  color: #82948a;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}

.ai-launcher {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  padding: 0;
  border: 3px solid #e6f2e8;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 9px 24px rgba(16, 38, 58, .24);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.ai-launcher:hover,
.ai-launcher:focus-visible {
  box-shadow: 0 13px 30px rgba(16, 38, 58, .3);
  transform: translateY(-3px) scale(1.03);
}

.ai-launcher img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 12%;
}

.ai-launcher span {
  position: absolute;
  top: 65px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .94);
  color: #4e6658;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

/* ---- Breathing launcher + status ring ---- */

@keyframes eai-breathe {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 9px 24px rgba(16, 38, 58, .24), 0 0 0 0 rgba(67, 132, 95, 0);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 13px 32px rgba(16, 38, 58, .3), 0 0 0 10px rgba(67, 132, 95, .12);
  }
}

@keyframes eai-breathe-active {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 9px 24px rgba(16, 38, 58, .24), 0 0 0 0 rgba(67, 132, 95, 0);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 13px 32px rgba(16, 38, 58, .3), 0 0 0 10px rgba(67, 132, 95, .18);
  }
}

@keyframes eai-ring-pulse {
  0% { transform: scale(1); opacity: .6; }
  100% { transform: scale(1.24); opacity: 0; }
}

@keyframes eai-status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 232, 154, .45); }
  50% { box-shadow: 0 0 0 7px rgba(91, 232, 154, 0); }
}

@keyframes eai-status-pulse-active {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 232, 154, .55); }
  50% { box-shadow: 0 0 0 7px rgba(91, 232, 154, 0); }
}

.ai-launcher {
  animation: eai-breathe 3s ease-in-out infinite;
}

.ai-launcher:hover,
.ai-launcher:focus-visible {
  animation-play-state: paused;
}

.ai-launcher.is-active {
  animation: eai-breathe-active 2s ease-in-out infinite;
  border-color: rgba(67, 132, 95, .4);
}

.ai-launcher::before {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: -1;
  border-radius: 50%;
  border: 2px solid rgba(67, 132, 95, .35);
  animation: eai-ring-pulse 2.2s ease-out infinite;
  pointer-events: none;
}

.ai-launcher.is-active::before {
  border-color: rgba(67, 132, 95, .5);
}

.ai-launcher::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #5be89a;
  border: 2px solid #fff;
  animation: eai-status-pulse 2s ease-in-out infinite;
  pointer-events: none;
}

.ai-launcher.is-active::after {
  background: #3fd47e;
  animation-name: eai-status-pulse-active;
}

.ai-status i {
  animation: eai-status-pulse 2s ease-in-out infinite;
}

/* ---- Typing indicator ---- */

.ai-message.ai-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 17px 18px;
  border-left: 4px solid #4f976d;
  border-radius: 16px 16px 16px 6px;
  background: #eaf5ed;
}

.ai-message.ai-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4f976d;
  animation: eai-typing-dot 1.4s ease-in-out infinite;
}

.ai-message.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-message.ai-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes eai-typing-dot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: .4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* ---- Notification popup card ---- */

.ai-popup {
  position: absolute;
  right: 0;
  bottom: 86px;
  width: min(300px, calc(100vw - 48px));
  padding: 14px 32px 14px 16px;
  border-left: 4px solid #4f976d;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(16, 38, 58, .22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(.96);
  transform-origin: right bottom;
  transition: opacity .35s ease, transform .35s ease;
}

.ai-popup.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.ai-popup-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ai-popup-identity img {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 12%;
  background: #dff0e4;
}

.ai-popup-identity span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  color: #386c4e;
}

.ai-popup-identity i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5be89a;
  animation: eai-status-pulse 2s ease-in-out infinite;
}

.ai-popup p {
  margin: 0;
  padding-left: 34px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.45;
}

.ai-popup-close {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: #9db3a8;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.ai-popup-close:hover,
.ai-popup-close:focus-visible {
  color: var(--alert);
}

@media (max-width: 920px) {
  .top-chrome {
    left: 0;
    right: 0;
    top: 0;
    align-items: stretch;
    flex-direction: column;
    min-height: 116px;
  }

  .brand-lockup {
    width: auto;
    flex: 0 0 auto;
  }

  .brand-lockup img {
    width: 58px;
    height: 44px;
  }

  .sim-title {
    position: static;
    transform: none;
    font-size: 20px;
    white-space: normal;
  }

  .curriculum-button {
    width: 100%;
    margin-left: 0;
    justify-content: center;
  }

  .left-panel,
  .right-panel {
    top: auto;
    bottom: 72px;
    width: calc(50vw - 16px);
    max-height: 35vh;
    border-radius: 8px 8px 0 0;
  }

  .left-panel {
    left: 10px;
  }

  .right-panel {
    right: 10px;
  }

  .objective-bar {
    bottom: 12px;
    width: fit-content;
    max-width: calc(100vw - 28px);
    min-height: 0;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
  }

  .edutec-ai {
    right: 16px;
    bottom: 16px;
  }

  .ai-window {
    width: min(460px, calc(100vw - 32px));
    bottom: 80px;
  }
}

@media (max-width: 620px) {
  .float-panel {
    width: calc(100vw - 20px);
  }

  .left-panel {
    display: none;
  }

  .right-panel {
    left: 10px;
    right: 10px;
  }

  .edutec-ai {
    right: 12px;
    bottom: 12px;
  }

  .ai-window {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 110px);
    border-radius: 18px;
  }

  .edutec-ai.is-expanded .ai-window {
    width: 100vw;
    height: 100vh;
    max-height: none;
    border-radius: 0;
  }

  .ai-popup {
    width: calc(100vw - 24px);
  }

  .ai-header {
    padding: 14px 16px;
  }

  .ai-avatar {
    width: 44px;
    height: 44px;
  }

  .ai-actions {
    gap: 5px;
  }

  .ai-action {
    width: 34px;
    height: 34px;
  }

  .ai-body {
    gap: 11px;
    padding: 14px 16px 11px;
  }

  .ai-messages {
    min-height: 96px;
    max-height: 160px;
  }

  .ai-message {
    padding: 11px 12px;
    font-size: 13px;
  }

  .ai-quick-row {
    gap: 6px;
    margin: 0 -16px;
    padding: 9px 16px;
  }

  .ai-chip {
    min-height: 29px;
    padding: 0 9px;
    font-size: 10px;
  }

  .ai-form textarea,
  .ai-form button {
    min-height: 46px;
    height: 46px;
  }

  .ai-form button {
    padding: 0 15px;
  }

  .ai-launcher {
    width: 56px;
    height: 56px;
  }

  .ai-launcher img {
    width: 48px;
    height: 48px;
  }

  .ai-launcher span {
    top: 57px;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(16, 38, 58, .58);
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  width: min(760px, 100%);
  max-height: 90vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.modal-close {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 38, 58, .08);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease;
}

.modal-close:hover {
  background: rgba(16, 38, 58, .16);
}

#helix3d-viewport {
  position: relative;
  width: 100%;
  height: min(74vh, 680px);
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(60, 200, 190, .16), transparent 45%),
    radial-gradient(circle at 72% 65%, rgba(40, 140, 170, .14), transparent 50%),
    radial-gradient(circle at 50% 50%, #0e2b30, #061014 78%);
  cursor: grab;
  touch-action: none;
  box-shadow: inset 0 0 90px rgba(0,0,0,.55);
}

#helix3d-viewport:active {
  cursor: grabbing;
}

#helix3d-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.helix3d-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: #cfe0ea;
  font-size: 13px;
  font-weight: 700;
}

.modal-hint {
  margin: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
}

.modal-card-wide {
  width: min(920px, 100%);
}

.protein3d-card {
  width: min(1100px, 96vw);
}

#curriculum-viewport {
  width: 100%;
  height: min(70vh, 620px);
  border-radius: 12px;
  overflow: hidden;
  background: #e7ebe6;
}

#curriculum-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.modal-footer .modal-hint {
  text-align: right;
  flex: 1 1 auto;
}

.modal-card-narrow {
  width: min(400px, 100%);
}

.protein3d-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  animation: protein3d-cta-pulse 1.8s ease-in-out infinite;
}

.protein3d-cta-icon {
  flex: 0 0 auto;
  line-height: 1;
}
@keyframes protein3d-cta-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,169,151,.35); }
  50% { box-shadow: 0 0 0 8px rgba(0,169,151,0); }
}

/* ---------- Settings dropdown (anchored to the settings button, no dark backdrop) ---------- */
#settings-overlay {
  align-items: stretch;
  justify-content: flex-start;
  background: transparent;
  padding: 0;
  pointer-events: none;
}

#settings-overlay.open {
  display: block;
  pointer-events: auto;
}

#settings-overlay .modal-card {
  position: absolute;
  width: min(300px, calc(100vw - 20px));
  max-height: min(72vh, 540px);
  overflow: auto;
  padding: 16px 18px 14px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  animation: settingsDropIn .16s ease;
  transform-origin: top right;
}

#settings-overlay .modal-card.drop-up {
  transform-origin: bottom right;
}

@keyframes settingsDropIn {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#settings-overlay .modal-card.drop-up {
  animation-name: settingsDropInUp;
}

@keyframes settingsDropInUp {
  from { opacity: 0; transform: translateY(6px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

[data-theme="dark"] #settings-overlay .modal-card {
  background: var(--panel-solid);
  border-color: var(--line);
  color: var(--ink);
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.settings-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.settings-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.settings-segmented {
  display: flex;
  gap: 6px;
}

.segmented-btn {
  flex: 1 1 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}

.segmented-btn:hover {
  transform: translateY(-1px);
}

.segmented-btn.active {
  background: var(--edutec);
  border-color: var(--edutec);
  color: #fff;
}

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

.settings-hint {
  text-align: left;
  margin-top: 2px;
}

#reset-all-progress {
  width: 100%;
  justify-content: center;
  color: var(--error);
  border-color: rgba(198, 40, 40, .35);
}

#reset-all-progress:hover {
  background: rgba(198, 40, 40, .08);
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --ink: #eef3f6;
  --muted: #9db0bf;
  --panel: #1c232a;
  --panel-solid: #232b33;
  --line: rgba(238, 243, 246, .14);
  --shadow: 0 16px 42px rgba(0, 0, 0, .5);
  --small-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}

[data-theme="dark"] body {
  background: #14181c;
}

[data-theme="dark"] .icon-tab,
[data-theme="dark"] .tool-button,
[data-theme="dark"] .replace-base,
[data-theme="dark"] .module-card,
[data-theme="dark"] .modal-card,
[data-theme="dark"] .segmented-btn,
[data-theme="dark"] #curriculum-viewport {
  background: var(--panel-solid);
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .icon-tab.active,
[data-theme="dark"] .tool-button.active,
[data-theme="dark"] .segmented-btn.active {
  background: var(--edutec);
  border-color: var(--edutec);
  color: #fff;
}

[data-theme="dark"] .module-card:hover {
  background: rgba(67, 132, 95, .18);
}

[data-theme="dark"] .quick-check-result {
  background: var(--panel-solid);
}

[data-theme="dark"] #curriculum-viewport {
  background: #10151a;
}

.btn-3d {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--edutec), var(--edutec-dark));
  border: 1px solid var(--edutec-dark);
  color: #fff;
  font-weight: 850;
  letter-spacing: .2px;
  box-shadow: 0 3px 10px rgba(67, 132, 95, .35), 0 0 0 rgba(102, 193, 142, 0);
  transition: transform .18s ease, box-shadow .25s ease, background .25s ease;
}

.rep-antiparallel-actions {
  flex-direction: column;
  align-items: stretch;
}

.rep-antiparallel-actions .btn-3d {
  width: 100%;
  justify-content: center;
}

.btn-3d-icon {
  font-size: 11px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .5s ease;
}

.btn-3d:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #66c18e, var(--edutec));
  box-shadow: 0 6px 16px rgba(67, 132, 95, .45), 0 0 18px 4px rgba(102, 193, 142, .55);
}

.btn-3d:hover .btn-3d-icon {
  transform: rotate(180deg);
}

.btn-3d:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(67, 132, 95, .4), 0 0 10px 2px rgba(102, 193, 142, .4);
}

[data-theme="dark"] .btn-3d {
  border-color: #2c5c40;
}

[data-theme="dark"] .btn-3d:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4), 0 0 20px 5px rgba(102, 193, 142, .5);
}

[data-theme="dark"] .mini-control-btn {
  border-color: #2c5c40;
}

[data-theme="dark"] .mini-control-btn:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4), 0 0 20px 5px rgba(102, 193, 142, .5);
}

[data-theme="dark"] .mini-controls {
  background: rgba(255, 255, 255, .05);
  border-color: var(--line);
}

/* ---------- Gene Mutations sim: additions ---------- */
.swatch.alert { color: var(--alert); }

.side-note {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.effect-card {
  margin: 4px 0 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(224, 33, 122, .28);
  background: rgba(224, 33, 122, .07);
}

.effect-card .tag {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--alert);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.effect-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

[data-theme="dark"] .effect-card {
  background: rgba(224, 33, 122, .14);
  border-color: rgba(224, 33, 122, .35);
}

[data-theme="dark"] .effect-card p {
  color: var(--ink);
}

#lab-base-grid-wrap {
  margin-bottom: 4px;
}

.quick-check {
  display: block;
}

/* ---------- Protein Synthesis sim: additions ---------- */
.swatch.u { color: var(--purple); }

.progress-pill {
  display: inline-block;
  margin: 6px 0 4px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--teal-soft, rgba(0,169,151,.12));
  color: var(--teal);
  font-family: var(--mono, 'Courier New', monospace);
  font-size: 12px;
  font-weight: 800;
}

.side-note {
  margin: 6px 0 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.panel-hint {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 8px;
}

/* ── tRNA shelf (drag source) ─────────────────────────── */
.shelf-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.shelf-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid rgba(16,38,58,.14);
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: border-color .15s, box-shadow .15s, opacity .15s, transform .15s;
}
.shelf-item:hover {
  border-color: var(--teal);
  box-shadow: 0 2px 8px rgba(0,169,151,.18);
  transform: translateY(-2px);
}
.shelf-item:active {
  transform: translateY(0);
}
.shelf-item.dragging { opacity: .35; }
.shelf-item .icon { flex-shrink: 0; width: 30px; height: 32px; display: flex; align-items: center; justify-content: center; }
.shelf-item .icon svg { display: block; }
.shelf-item .name { font-size: 11px; font-weight: 700; color: var(--ink); line-height: 1.3; }

.shelf-item.pop {
  animation: nucleotide-pop .38s ease-out;
  border-color: var(--edutec);
}
.shelf-item.shake {
  animation: nucleotide-shake .4s ease-in-out;
  border-color: var(--alert);
}

.shelf-list.locked .shelf-item {
  cursor: default;
  opacity: .4;
  pointer-events: none;
  transform: none;
}
.anticodon-label { font-family: var(--mono, 'Courier New', monospace); font-size: 10.5px; color: var(--muted); font-weight: 700; }

.mutation-type-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.mutation-type-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1.5px solid rgba(16, 38, 58, .14);
  background: #fff;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
}
.mutation-type-btn:hover {
  border-color: var(--teal);
  box-shadow: 0 2px 8px rgba(0, 169, 151, .18);
  transform: translateY(-2px);
}
.mutation-type-btn:active { transform: translateY(0); }
.mutation-type-btn.active {
  border-color: var(--edutec);
  background: linear-gradient(160deg, var(--edutec), var(--edutec-dark));
  box-shadow: 0 8px 20px rgba(16, 38, 58, .22);
}
.mutation-type-btn.active .mut-type-name,
.mutation-type-btn.active .mut-type-blurb { color: #fff; }
.mut-type-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  background: rgba(0, 169, 151, .14);
  color: var(--edutec-dark);
}
.mutation-type-btn.active .mut-type-icon { background: rgba(255, 255, 255, .24); color: #fff; }
.mut-type-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mut-type-name { font-size: 12.5px; font-weight: 850; color: var(--ink); }
.mut-type-blurb { font-size: 10.5px; font-weight: 600; color: var(--muted); line-height: 1.25; }

.mutation-outcome-tag {
  margin: 4px 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.4;
  background: rgba(0, 169, 151, .12);
  color: var(--edutec-dark);
  border: 1.5px solid rgba(0, 169, 151, .3);
}
.mutation-outcome-tag.is-frameshift {
  background: rgba(224, 33, 122, .1);
  color: #a5164f;
  border-color: rgba(224, 33, 122, .28);
}

.export-report-btn {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--edutec), var(--edutec-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(67, 132, 95, .24);
}
.export-report-btn:hover { filter: brightness(1.06); }

[data-theme="dark"] .mutation-type-btn { background: #1c2b31; border-color: rgba(238, 243, 246, .16); }
[data-theme="dark"] .mut-type-name { color: #eef3f6; }
[data-theme="dark"] .mut-type-blurb { color: rgba(238, 243, 246, .62); }
[data-theme="dark"] .mutation-outcome-tag { background: rgba(0, 169, 151, .16); color: #8bd6cc; border-color: rgba(0, 169, 151, .34); }
[data-theme="dark"] .mutation-outcome-tag.is-frameshift { background: rgba(224, 33, 122, .16); color: #f2a7c5; border-color: rgba(224, 33, 122, .32); }

/* ---------- Living cell object model additions ---------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-actions .curriculum-button {
  margin-left: 0;
}

.full-width {
  width: 100%;
  justify-content: center;
  margin: 2px 0 12px;
}

.primary-flow {
  background: var(--edutec);
  border-color: var(--edutec);
  color: #fff;
}

.primary-flow:hover {
  background: var(--edutec-dark);
  border-color: var(--edutec-dark);
}

.chart-under-controls {
  margin-top: 10px;
  margin-bottom: 0;
}

.nucleotide-pool {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.helicase-control {
  margin-top: 10px;
  text-align: center;
}

.helicase-button {
  margin: 8px 0 4px;
}

@keyframes nucleotide-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.nucleotide-chip {
  min-width: 0;
  min-height: 42px;
  border: 1.5px solid rgba(16,38,58,.14);
  border-radius: 10px;
  background: var(--panel-solid);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  font-family: "Courier New", monospace;
  font-size: 18px;
  font-weight: 900;
  animation: nucleotide-float 2.6s ease-in-out infinite;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease, background .18s ease;
}

.nucleotide-pool .nucleotide-chip:nth-child(1) { animation-delay: 0s; }
.nucleotide-pool .nucleotide-chip:nth-child(2) { animation-delay: .3s; }
.nucleotide-pool .nucleotide-chip:nth-child(3) { animation-delay: .6s; }
.nucleotide-pool .nucleotide-chip:nth-child(4) { animation-delay: .9s; }

.nucleotide-chip:hover {
  animation-play-state: paused;
  transform: translateY(-3px) scale(1.06);
  border-color: var(--edutec);
  background: var(--panel);
  box-shadow: 0 6px 16px rgba(67, 132, 95, .28), 0 0 0 3px rgba(67, 132, 95, .12);
}

.nucleotide-chip:active {
  animation-play-state: paused;
  transform: translateY(-1px) scale(1.02);
}

.nucleotide-chip:disabled {
  animation-play-state: paused;
  cursor: default;
  opacity: .35;
  pointer-events: none;
}

@keyframes nucleotide-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.28); box-shadow: 0 0 0 6px rgba(67, 132, 95, .22); }
  100% { transform: scale(1); box-shadow: none; }
}

@keyframes nucleotide-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.nucleotide-chip.pop {
  animation: nucleotide-pop .38s ease-out;
  border-color: var(--edutec);
}

.nucleotide-chip.shake {
  animation: nucleotide-shake .4s ease-in-out;
  border-color: var(--alert);
}

.nucleotide-chip.a { color: var(--red); }
.nucleotide-chip.u { color: var(--purple); }
.nucleotide-chip.g { color: var(--green); }
.nucleotide-chip.c { color: #b08300; }

.codon-card {
  gap: 12px;
}

.codon-hint {
  text-align: left;
}

.codon-chart {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: min(66vh, 560px);
  overflow: auto;
  padding-right: 4px;
}

.codon-family {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  overflow: hidden;
}

.codon-family h4 {
  margin: 0;
  padding: 7px 9px;
  background: rgba(67, 132, 95, .12);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.codon-family dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
}

.codon-family dt,
.codon-family dd {
  margin: 0;
  padding: 5px 8px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.25;
}

.codon-family dt {
  color: var(--ink);
  font-family: "Courier New", monospace;
  font-weight: 900;
}

.codon-family dd {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.codon-family .stop {
  color: var(--alert);
}

@media (max-width: 920px) {
  .header-actions {
    width: 100%;
  }

  .header-actions .curriculum-button {
    flex: 1 1 0;
  }

  .codon-chart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .codon-chart {
    grid-template-columns: 1fr;
  }
}

/* Keep all simulation text at a regular weight. */
body * {
  font-weight: 400 !important;
}

.sim-title {
  font-weight: 700 !important;
}
