/* Original model-specific structure, reference diagram and label styles. */
.hidden-labels [class*="label"], .hidden-labels text.model-label, .hidden-labels text.tiny-label { opacity: 0 !important; pointer-events: none !important; }

.dna-visual-wrap {
  padding: 0;
}

.dna-3d-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 300px;
  display: grid;
  place-items: stretch;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background:
    radial-gradient(circle at 50% 45%, rgba(37, 99, 235, 0.05), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.82));
}

.dna-3d-shell:active {
  cursor: grabbing;
}

.dna-3d-shell.is-panning,
.dna-3d-shell.is-panning:active {
  cursor: move;
}

.dna-viewport {
  width: 100%;
  height: 100%;
  min-height: 300px;
}

.dna-webgl-shell {
  height: clamp(360px, 58vh, 620px);
  min-height: 360px;
  overflow: hidden;
}

.dna-webgl-stack {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 8px;
  align-self: stretch;
  align-content: start;
}

.dna-webgl-viewport-frame {
  position: absolute;
  inset: 0;
}

.dna-webgl-host {
  position: absolute;
  inset: 0;
}

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

.dna-webgl-labels {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.dna-webgl-label {
  position: absolute;
  max-width: min(220px, 38vw);
  padding: 5px 8px;
  border: 1px solid rgba(216, 225, 236, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--label-color, #0f172a);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.dna-reference-disclosure {
  width: min(100%, 920px);
  justify-self: center;
  border: 1px solid rgba(216, 225, 236, 0.96);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.dna-reference-toggle {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.dna-reference-toggle span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dna-reference-toggle strong {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary-dark);
  font-size: 12px;
}

.dna-reference-disclosure.is-open .dna-reference-toggle {
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: var(--radius) var(--radius) 0 0;
}

.dna-reference-panel-wrap[hidden] {
  display: none;
}

.dna-reference-panel {
  position: static;
  width: auto;
  max-height: 270px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 0;
  background: rgba(248, 250, 252, 0.72);
  box-shadow: none;
  cursor: default;
  user-select: text;
  touch-action: pan-y;
}

.dna-reference-panel section {
  display: grid;
  gap: 7px;
}

.dna-reference-panel h3 {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.dna-reference-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.dna-reference-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 46px;
  padding: 5px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.82);
}

.dna-reference-card--nucleotide {
  grid-template-columns: 72px minmax(0, 1fr);
}

.dna-reference-card strong,
.dna-reference-card span,
.dna-reference-card p {
  display: block;
}

.dna-reference-card strong {
  color: var(--text);
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.2;
}

.dna-reference-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.2;
}

.dna-reference-card p {
  margin: 3px 0 0;
  color: #475569;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.2;
}

.dna-reference-structure {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.dna-reference-structure polygon,
.dna-reference-structure path,
.dna-reference-structure circle {
  fill: var(--base-color);
  stroke: #334155;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.dna-reference-structure line {
  stroke: #64748b;
  stroke-width: 2.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.dna-reference-structure .purine-shared-edge {
  stroke: #334155;
  stroke-width: 1.8;
}

.dna-reference-structure text {
  fill: #0f172a;
  font-size: 13px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 3px;
}

.dna-reference-nucleotide .phosphate-node {
  fill: #06b6d4;
  stroke: #0891b2;
}

.dna-reference-nucleotide .sugar-node {
  fill: #fbbf24;
  stroke: #d97706;
}

.dna-reference-nucleotide .base-ring {
  fill: var(--base-color);
}

.dna-reference-nucleotide .phosphate-label,
.dna-reference-nucleotide .sugar-label {
  font-size: 10px;
}

.protein-webgl-stack {
  width: 100%;
}

.protein-webgl-shell {
  min-width: 0;
}

.protein-state-control {
  width: min(340px, calc(100% - 24px));
}

.protein-progress-marks {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 6px;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.protein-progress-marks span:first-child {
  text-align: left;
}

.protein-progress-marks span:last-child {
  text-align: right;
}

.protein-stage-note {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  max-width: min(330px, calc(100% - 24px));
  padding: 9px 11px;
  border: 1px solid rgba(216, 225, 236, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #334155;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  pointer-events: none;
}

.dna-webgl-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  pointer-events: none;
}

.dna-webgl-loading[hidden] {
  display: none;
}

.dna-hit {
  cursor: pointer;
}

.dna-floating-label-layer {
  pointer-events: none;
}

.dna-base-text {
  font-family:
    "Microsoft YaHei",
    Arial,
    sans-serif;
  font-weight: 900;
  fill: #0f172a;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 4.5px;
}

.dna-floating-label {
  font-size: 14px;
  font-weight: 800;
  fill: #102033;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 5px;
}

.dna-label-line {
  pointer-events: none;
}

.dna-hud text {
  fill: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.dna-feedback {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid rgba(216, 225, 236, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
}

.dna-state-control {
  position: absolute;
  top: 12px;
  right: 12px;
  width: min(260px, calc(100% - 24px));
  padding: 10px 12px;
  border: 1px solid rgba(216, 225, 236, 0.96);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  cursor: default;
}

.dna-state-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.dna-state-header strong {
  color: var(--primary);
}

.dna-state-control label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dna-state-control input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.protein-shell,
.carrier-domain,
.pump-head {
  stroke-linejoin: round;
  stroke-linecap: round;
}

.protein-shell.channel-shell {
  fill: url("#channelBlue");
  stroke: #276F8B;
  stroke-width: 4.5px;
}

.protein-loop {
  fill: none;
  stroke: rgba(19, 66, 99, 0.55);
  stroke-width: 7px;
  stroke-linecap: round;
}

.protein-pocket {
  fill: rgba(255, 255, 255, 0.62);
  stroke: rgba(19, 66, 99, 0.3);
  stroke-width: 2.2px;
}

.protein-state-label {
  fill: #334155;
  font-size: 11px;
  font-weight: 850;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.86);
  stroke-width: 4px;
  stroke-linejoin: round;
}
