:root {
  --ink: #142d39;
  --ink-soft: #35515c;
  --muted: #5d727a;
  --paper: #f4f7f5;
  --white: #ffffff;
  --line: #d8e1df;
  --line-dark: #83989a;
  --purple: #7652c7;
  --purple-dark: #52339e;
  --purple-soft: #eee9fa;
  --teal: #07988f;
  --teal-dark: #08726d;
  --teal-soft: #e3f5f2;
  --gold: #9b6910;
  --gold-soft: #fff3d6;
  --coral: #d9414b;
  --coral-dark: #a92331;
  --coral-soft: #fde8ea;
  --blue: #3977a8;
  --blue-soft: #e8f1f8;
  --shadow: 0 22px 60px rgba(19, 45, 57, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 91% 6%, rgba(118, 82, 199, 0.1), transparent 30rem),
    radial-gradient(circle at 7% 35%, rgba(7, 152, 143, 0.06), transparent 24rem),
    linear-gradient(180deg, #fafcfb 0, var(--paper) 35rem);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(7, 152, 143, 0.38);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 500;
  top: 0.75rem;
  left: 0.75rem;
  transform: translateY(-180%);
  padding: 0.7rem 1rem;
  border-radius: 9px;
  color: white;
  background: var(--ink);
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
main,
footer {
  width: min(1440px, calc(100% - 3rem));
  margin-inline: auto;
}

.site-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 830;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  transform: rotate(-17deg);
  border: 3px solid var(--purple);
  border-radius: 50%;
}

.brand-mark i {
  width: 7px;
  height: 17px;
  border-radius: 99px;
  background: var(--teal);
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.draft-pill,
.scope-pill,
.unknown-badge,
.provenance-chip {
  border-radius: 999px;
  font-size: 0.61rem;
  font-weight: 860;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.draft-pill {
  padding: 0.42rem 0.7rem;
  border: 1px solid #d8d0ee;
  color: var(--purple-dark);
  background: rgba(255, 255, 255, 0.76);
}

.scope-pill {
  padding: 0.42rem 0.7rem;
  border: 1px solid #bfddda;
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.intro {
  min-height: 178px;
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.84fr);
  align-items: center;
  gap: 4rem;
  padding: 2.25rem 2.1rem 2rem;
}

.eyebrow,
.phase-name {
  margin: 0 0 0.48rem;
  color: var(--teal-dark);
  font-size: 0.65rem;
  font-weight: 880;
  letter-spacing: 0.135em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 0;
  font-size: clamp(2.35rem, 4.55vw, 4.9rem);
  line-height: 0.96;
  letter-spacing: -0.069em;
}

h1 span {
  color: var(--teal);
}

.intro-copy {
  max-width: 580px;
  margin: 1rem 0 0 auto;
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 1.2vw, 1.08rem);
  line-height: 1.62;
}

.briefing {
  display: grid;
  grid-template-columns: minmax(250px, 0.32fr) minmax(0, 1fr);
  gap: 2rem;
  margin-bottom: 1.4rem;
  padding: 1.35rem 1.5rem;
  border: 1px solid rgba(180, 197, 194, 0.78);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.72);
}

.briefing h2 {
  margin-bottom: 0.55rem;
  font-size: 1.15rem;
  letter-spacing: -0.035em;
}

.briefing-heading > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.guide-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 0.72rem;
}

.loading-guide {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.48rem;
  list-style: none;
}

.guide-step {
  min-height: 66px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.58rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 1px 2px rgba(20, 45, 57, 0.025);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.guide-step-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.34rem;
}

.guide-step-number,
.guide-step-state {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 840;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.guide-step strong {
  display: block;
  margin: 0;
  font-size: 0.79rem;
  line-height: 1.22;
}

.guide-step.is-complete {
  border-color: #bfddda;
  background: #f4fbf9;
}

.guide-step.is-complete .guide-step-number,
.guide-step.is-complete .guide-step-state {
  color: var(--teal-dark);
}

.guide-step.is-next {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 0 0 2px rgba(7, 152, 143, 0.15);
}

.guide-step.is-next .guide-step-number,
.guide-step.is-next .guide-step-state {
  color: var(--teal-dark);
}

.guide-step.is-future {
  background: #fbfcfc;
}

.guide-step.is-future strong {
  color: #74878d;
}

.guide-detail {
  min-height: 0;
  padding: 1rem 1.05rem;
  border: 1px solid #b8ceca;
  border-radius: 13px;
  background: linear-gradient(145deg, #f4fbf9, #ffffff 72%);
  box-shadow: inset 3px 0 0 var(--teal);
}

.guide-detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.72rem;
  color: var(--teal-dark);
  font-size: 0.58rem;
  font-weight: 880;
  letter-spacing: 0.105em;
}

.guide-detail h3 {
  margin-bottom: 0.42rem;
  font-size: 1rem;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.guide-detail > p:not(.guide-status) {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}

.guide-status {
  margin: 0.78rem 0 0;
  padding-top: 0.62rem;
  border-top: 1px solid var(--line);
  color: var(--teal-dark) !important;
  font-size: 0.7rem !important;
  font-weight: 730;
  line-height: 1.4 !important;
}

.workbench-card {
  overflow: hidden;
  border: 1px solid rgba(174, 191, 189, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
}

.workbench-header {
  min-height: 116px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(440px, 0.88fr);
  align-items: center;
  gap: 2rem;
  padding: 1.2rem 1.55rem;
  border-bottom: 1px solid var(--line);
}

.status-copy h2 {
  margin-bottom: 0.28rem;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.status-copy > p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.workbench-readouts {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8faf9;
}

.workbench-readouts > div {
  min-height: 62px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.55rem 0.78rem;
  border-right: 1px solid var(--line);
}

.workbench-readouts span {
  font-size: 1.05rem;
  font-weight: 860;
  font-variant-numeric: tabular-nums;
}

.workbench-readouts small {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.secondary-button,
.primary-button,
.icon-button,
.text-button,
.alternate-orc-button,
.atp-button,
.molecule-card,
.molecule-action,
.structure-card {
  cursor: pointer;
}

.secondary-button {
  min-width: 102px;
  border: 0;
  color: var(--ink-soft);
  background: white;
  font-size: 0.7rem;
  font-weight: 810;
}

.secondary-button:hover {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.provenance-strip {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.55rem;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.provenance-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.provenance-chip {
  padding: 0.38rem 0.58rem;
  border: 1px solid #b9ddd9;
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.provenance-chip.is-alternative {
  border-color: #e4c987;
  color: var(--gold);
  background: var(--gold-soft);
}

.provenance-chip.is-broken {
  border-color: #efb0b5;
  color: var(--coral-dark);
  background: var(--coral-soft);
}

.workbench-grid {
  display: grid;
  grid-template-columns: 240px minmax(500px, 1fr) 260px;
  min-height: 650px;
}

.inventory-panel,
.console-panel {
  min-width: 0;
  padding: 1.05rem;
  background: #fbfcfc;
}

.inventory-panel {
  border-right: 1px solid var(--line);
}

.console-panel {
  border-left: 1px solid var(--line);
}

.panel-heading h3,
.reaction-toolbar h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.025em;
}

.panel-help,
.console-note {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.42;
}

.panel-help {
  margin: 0.75rem 0 0.85rem;
}

.inventory-groups {
  display: grid;
  gap: 0.8rem;
}

.inventory-group {
  display: grid;
  gap: 0.4rem;
}

.inventory-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.57rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.inventory-group-title span:last-child {
  color: var(--line-dark);
  font-variant-numeric: tabular-nums;
}

.molecule-card-wrap {
  position: relative;
}

.molecule-card {
  min-height: 48px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.38rem 2.75rem 0.38rem 0.42rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: white;
  text-align: left;
  touch-action: none;
}

.molecule-card:hover,
.molecule-card.is-selected {
  border-color: var(--purple);
  box-shadow: 0 8px 20px rgba(82, 51, 158, 0.1);
}

.molecule-card.is-selected {
  background: var(--purple-soft);
}

.molecule-card.is-spent {
  cursor: default;
  opacity: 0.5;
}

.inventory-glyph {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}

.molecule-card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.molecule-card-copy strong {
  overflow: hidden;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.molecule-card-copy small {
  color: var(--muted);
  font-size: 0.56rem;
}

.inventory-flip-button {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  width: 31px;
  height: 31px;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid #d9cfef;
  border-radius: 9px;
  color: var(--purple-dark);
  background: var(--purple-soft);
  font-size: 0.9rem;
  font-weight: 880;
  line-height: 1;
}

.inventory-flip-button:hover:not(:disabled),
.inventory-flip-button:focus-visible {
  border-color: var(--purple);
  background: #e6ddf8;
}

.inventory-flip-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.alternate-orc-button {
  width: 100%;
  min-height: 42px;
  margin-top: 0.9rem;
  border: 1px dashed #c9b9ec;
  border-radius: 12px;
  color: var(--purple-dark);
  background: var(--purple-soft);
  font-size: 0.67rem;
  font-weight: 820;
}

.alternate-orc-button:hover {
  border-style: solid;
  background: #e7def8;
}

.reaction-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1.05rem 1rem 0.85rem;
  background: white;
}

.reaction-toolbar {
  min-height: 47px;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.toolbar-actions {
  display: flex;
  gap: 0.35rem;
}

.back-button:not(:disabled) {
  border-color: #bcb0db;
  color: var(--purple-dark);
  background: var(--purple-soft);
}

.icon-button,
.text-button {
  min-height: 34px;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  background: white;
  font-size: 0.65rem;
  font-weight: 770;
}

.icon-button:hover:not(:disabled),
.text-button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.icon-button:disabled {
  cursor: default;
  opacity: 0.4;
}

.reaction-stage {
  position: relative;
  min-height: 520px;
  flex: 1;
  overflow: hidden;
  border: 1px solid #ccd8d6;
  border-radius: 18px;
  background:
    radial-gradient(circle at 72% 18%, rgba(118, 82, 199, 0.07), transparent 18rem),
    linear-gradient(180deg, #fbfdfc, #f3f7f5);
  touch-action: none;
  user-select: none;
}

.reaction-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background-image: radial-gradient(#8ca09f 0.6px, transparent 0.7px);
  background-size: 18px 18px;
  pointer-events: none;
}

.stage-background,
.tether-layer,
.target-layer,
.molecule-layer,
.transition-layer,
.stage-callout-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage-background,
.tether-layer,
.target-layer,
.transition-layer,
.stage-callout-layer {
  pointer-events: none;
}

.stage-background { z-index: 0; }
.tether-layer { z-index: 1; }
.target-layer { z-index: 2; }
.molecule-layer { z-index: 3; }
.transition-layer { z-index: 24; }
.playback-status {
  position: absolute;
  z-index: 42;
  top: 0.72rem;
  left: 50%;
  max-width: calc(100% - 1.4rem);
  padding: 0.44rem 0.7rem;
  transform: translateX(-50%);
  overflow: hidden;
  border: 1px solid rgba(7, 114, 109, 0.4);
  border-radius: 999px;
  color: white;
  background: rgba(20, 45, 57, 0.94);
  box-shadow: 0 8px 24px rgba(20, 45, 57, 0.2), inset 3px 0 0 var(--teal);
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.035em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.reaction-stage.is-playback {
  box-shadow: inset 0 0 0 2px rgba(7, 152, 143, 0.22);
}

.reaction-stage.is-playback .molecule-layer {
  pointer-events: none;
}

.reaction-stage.is-playback .stage-callout-layer,
.reaction-stage.is-playback .selection-toolbar,
.reaction-stage.is-playback .empty-stage-copy {
  opacity: 0;
}

.stage-callout-layer {
  z-index: 30;
  display: flex;
  align-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.52rem;
  padding: 0.72rem;
}

.dna-shadow {
  fill: none;
  stroke: rgba(20, 45, 57, 0.09);
  stroke-width: 19;
  filter: url(#soft-glow);
  vector-effect: non-scaling-stroke;
}

.dna-line {
  fill: none;
  stroke: url(#dna-gradient);
  stroke-linecap: round;
  stroke-width: 3.5;
  vector-effect: non-scaling-stroke;
}

.dna-line-secondary {
  stroke-width: 2.5;
}

.dna-rungs path {
  fill: none;
  stroke: rgba(72, 96, 103, 0.52);
  stroke-linecap: round;
  stroke-width: 1.05;
  vector-effect: non-scaling-stroke;
}

.dna-end {
  fill: #637a7f;
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-anchor: middle;
}

.dna-end {
  font-size: 17px;
  letter-spacing: 0;
}

.empty-stage-copy {
  position: absolute;
  top: 24px;
  left: 50%;
  display: flex;
  flex-direction: column;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}

.empty-stage-copy strong {
  color: var(--ink-soft);
}

.molecule {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  touch-action: none;
}

.molecule-shell {
  position: relative;
  display: grid;
  place-items: center;
  transition: filter 160ms ease, transform 160ms ease;
}

.molecule:hover .molecule-shell,
.molecule.is-selected .molecule-shell {
  filter: drop-shadow(0 8px 9px rgba(20, 45, 57, 0.18));
}

.molecule.is-selected .molecule-shell::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 2px solid var(--purple);
  border-radius: 18px;
  animation: select-pulse 1.8s ease-in-out infinite;
}

.molecule.is-dragging {
  z-index: 20;
}

.molecule.is-dragging .molecule-shell {
  filter: drop-shadow(0 14px 15px rgba(20, 45, 57, 0.24));
  transition: none;
}

.molecule.is-bound .molecule-shell {
  filter: drop-shadow(0 0 7px rgba(7, 152, 143, 0.28));
}

.molecule.is-loaded .molecule-shell {
  filter: drop-shadow(0 0 8px rgba(118, 82, 199, 0.31));
}

.molecule.is-orientation-blocked .molecule-shell {
  filter: drop-shadow(0 0 11px rgba(217, 65, 75, 0.56));
  animation: orientation-blocked 420ms ease-in-out 2;
}

.molecule.is-workspace-blocked .molecule-shell {
  filter: drop-shadow(0 0 11px rgba(155, 105, 16, 0.52));
  animation: orientation-blocked 420ms ease-in-out 2;
}

.molecule.is-released {
  opacity: 0.52;
}

.drag-ghost {
  position: fixed;
  z-index: 1000;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%) scale(0.86);
  pointer-events: none;
  filter: drop-shadow(0 16px 18px rgba(20, 45, 57, 0.28));
}

.drag-ghost::before {
  content: "";
  position: absolute;
  inset: -10px;
  border: 2px solid var(--purple);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(4px);
}

.drag-ghost > * {
  position: relative;
}

.drag-ghost > span {
  margin-top: 0.2rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  color: white;
  background: var(--ink);
  font-size: 0.6rem;
  font-weight: 820;
}

.molecule-label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.18rem 0.38rem;
  border: 1px solid rgba(204, 216, 214, 0.86);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.94);
  font-size: 0.56rem;
  font-weight: 810;
  white-space: nowrap;
}

.protein-svg {
  display: block;
  overflow: visible;
}

.protein-svg .outline {
  vector-effect: non-scaling-stroke;
}

.protein-svg .face-label,
.protein-svg .part-label,
.protein-svg .face-badge,
.protein-svg .gate-label {
  font-family: Inter, ui-sans-serif, sans-serif;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

.protein-svg .face-badge {
  fill: var(--purple-dark);
  font-size: 12px;
  paint-order: stroke;
  stroke: white;
  stroke-width: 4px;
}

.protein-svg .gate-label {
  fill: var(--coral-dark);
  font-size: 6px;
  letter-spacing: 0.08em;
}

.molecule[data-kind="orc"] .molecule-shell {
  width: 112px;
  height: 92px;
}

.molecule[data-kind="mcm"] .molecule-shell {
  width: 128px;
  height: 92px;
}

.molecule[data-kind="cdc6"] .molecule-shell {
  width: 70px;
  height: 58px;
}

.molecule[data-kind="cdt1"] .molecule-shell {
  width: 82px;
  height: 74px;
}

.selection-toolbar {
  position: absolute;
  z-index: 30;
  right: 12px;
  bottom: 12px;
  width: min(280px, calc(100% - 24px));
  padding: 0.62rem;
  border: 1px solid #c7d4d2;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 28px rgba(20, 45, 57, 0.13);
}

.selection-toolbar-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.selection-toolbar-copy strong {
  font-size: 0.72rem;
}

.selection-toolbar-copy span {
  color: var(--muted);
  font-size: 0.58rem;
}

.selection-toolbar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.molecule-action {
  min-height: 35px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  background: #f8faf9;
  font-size: 0.62rem;
  font-weight: 790;
}

.molecule-action:hover {
  border-color: var(--purple);
  color: var(--purple-dark);
  background: var(--purple-soft);
}

.tether-path-underlay {
  fill: none;
  stroke: rgba(82, 51, 158, 0.13);
  stroke-linecap: round;
  stroke-width: 13;
  vector-effect: non-scaling-stroke;
}

.tether-path {
  fill: none;
  stroke: var(--purple);
  stroke-linecap: round;
  stroke-width: 3.2;
  vector-effect: non-scaling-stroke;
}

.tether-path.is-taut {
  stroke: var(--gold);
}

.tether-anchor {
  fill: var(--purple);
  stroke: white;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.tether-caption {
  fill: var(--purple-dark);
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.05em;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 4px;
  text-anchor: middle;
}

.head-to-head-target {
  position: absolute;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
}

.head-to-head-target .protein-svg path,
.head-to-head-target .protein-svg ellipse {
  opacity: 0.15;
}

.head-to-head-target .protein-svg .face-badge {
  opacity: 0.88;
  fill: var(--purple-dark);
  stroke-width: 5px;
}

.head-to-head-target .protein-svg .part-label,
.head-to-head-target .protein-svg .gate-label {
  opacity: 0.34;
}

.target-kicker {
  position: absolute;
  bottom: calc(100% + 3px);
  padding: 0.18rem 0.42rem;
  border: 1px dashed rgba(82, 51, 158, 0.55);
  border-radius: 999px;
  color: var(--purple-dark);
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

.stage-callout {
  position: relative;
  flex: 1 1 210px;
  width: auto;
  max-width: 238px;
  display: grid;
  gap: 0.22rem;
  padding: 0.58rem 0.68rem;
  border: 1px solid #c9d7d5;
  border-radius: 11px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 26px rgba(20, 45, 57, 0.14);
  font-size: 0.69rem;
  line-height: 1.38;
}

.stage-callout strong {
  color: var(--ink);
  font-size: 0.74rem;
}

.stage-callout.is-tether {
  border-color: #bcb0db;
  box-shadow: inset 3px 0 0 var(--purple), 0 10px 26px rgba(20, 45, 57, 0.14);
}

.stage-callout.is-head-to-head {
  border-style: dashed;
  border-color: #bcb0db;
}

.stage-callout.is-orientation {
  border-color: #e59aa1;
  background: rgba(255, 247, 248, 0.98);
  box-shadow: inset 3px 0 0 var(--coral), 0 10px 26px rgba(20, 45, 57, 0.14);
}

.stage-callout.is-workspace {
  border-color: #dfc177;
  background: rgba(255, 250, 238, 0.98);
  box-shadow: inset 3px 0 0 var(--gold), 0 10px 26px rgba(20, 45, 57, 0.14);
}

.transition-molecule,
.gate-close-transition {
  position: absolute;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
}

.transition-molecule.is-fly-out {
  animation-name: molecule-fly-out;
  animation-duration: var(--fly-duration, 760ms);
  animation-timing-function: cubic-bezier(0.2, 0.75, 0.25, 1);
  animation-delay: var(--fly-delay, 0ms);
  animation-fill-mode: both;
}

.transition-glyph {
  display: block;
}

.transition-label,
.gate-transition-label {
  position: absolute;
  top: calc(100% + 5px);
  padding: 0.2rem 0.42rem;
  border-radius: 999px;
  color: white;
  background: rgba(20, 45, 57, 0.9);
  font-size: 0.54rem;
  font-weight: 840;
  white-space: nowrap;
}

.gate-close-transition {
  grid-template: 1fr / 1fr;
}

.gate-state {
  grid-area: 1 / 1;
}

.gate-state.is-open {
  animation: gate-open-state 960ms ease-in-out forwards;
}

.gate-state.is-open .mcm-gate {
  animation: gate-highlight 480ms ease-in-out 2;
}

.gate-state.is-closed {
  opacity: 0;
  animation: gate-closed-state 960ms ease-in-out forwards;
}

.gate-transition-label {
  opacity: 0;
  animation: gate-label-state 960ms ease-in-out forwards;
}

.observation-controls {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.observable-bar {
  min-height: 52px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.58rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faf9;
}

.observable-bar > span {
  color: var(--teal-dark);
  font-size: 0.57rem;
  font-weight: 880;
  letter-spacing: 0.11em;
}

.observable-bar p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.69rem;
  line-height: 1.4;
}

.observation-tools {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.next-observation-wrap {
  position: relative;
  min-width: 0;
}

.next-observation-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  font-size: 0.62rem;
  font-weight: 790;
}

.next-observation-button {
  max-width: 390px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.65rem;
  color: var(--ink-soft);
  text-align: left;
}

.next-observation-button > span {
  flex: 0 0 21px;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--teal);
  font-size: 0.72rem;
}

.next-observation-button:hover,
.next-observation-button[aria-expanded="true"] {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.next-observation-tooltip {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 0;
  width: min(390px, calc(100vw - 3rem));
  padding: 0.8rem 0.9rem;
  border: 1px solid #b8ceca;
  border-radius: 12px;
  color: var(--ink);
  background: white;
  box-shadow: 0 16px 38px rgba(20, 45, 57, 0.18);
  font-size: 0.72rem;
  line-height: 1.5;
}

.next-observation-tooltip::before {
  content: "SINGLE-MOLECULE OBSERVATION";
  display: block;
  margin-bottom: 0.35rem;
  color: var(--teal-dark);
  font-size: 0.54rem;
  font-weight: 880;
  letter-spacing: 0.1em;
}

.console-section {
  padding: 0.82rem 0;
  border-bottom: 1px solid var(--line);
}

.console-section:last-child {
  border-bottom: 0;
}

.console-section h4 {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  letter-spacing: -0.015em;
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.unknown-badge {
  padding: 0.27rem 0.42rem;
  color: var(--gold);
  background: var(--gold-soft);
}

.atp-button {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
  padding: 0.48rem;
  border: 1px solid #cbbbea;
  border-radius: 12px;
  color: var(--purple-dark);
  background: white;
  text-align: left;
}

.atp-button:hover {
  border-color: var(--purple);
  background: var(--purple-soft);
}

.atp-button:active {
  transform: translateY(1px);
}

.atp-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--purple);
  font-size: 0.62rem;
  font-weight: 900;
}

.atp-button > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.atp-button small {
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.09em;
}

.atp-button strong {
  overflow: hidden;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-note {
  margin: 0.55rem 0 0;
}

.inventory-atp-controls {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.inventory-atp-controls .section-label-row {
  margin-bottom: 0.6rem;
}

.inventory-atp-controls h4 {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: -0.015em;
}

.atp-control-grid {
  display: grid;
  gap: 0.45rem;
}

.atp-control-grid .atp-button {
  margin-bottom: 0;
}

.structure-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  padding-bottom: 0.82rem;
  border-bottom: 1px solid var(--line);
}

.structure-library {
  min-width: 0;
}

.structure-panel-heading h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.025em;
}

.structure-count {
  flex: 0 0 auto;
  padding: 0.28rem 0.45rem;
  border: 1px solid #cbbbea;
  border-radius: 999px;
  color: var(--purple-dark);
  background: var(--purple-soft);
  font-size: 0.56rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.structures-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.structures-empty {
  margin: 0;
  padding: 0.8rem;
  border: 1px dashed var(--line-dark);
  border-radius: 12px;
  color: var(--muted);
  background: white;
  font-size: 0.65rem;
  line-height: 1.45;
}

.structure-card {
  width: 100%;
  min-width: 0;
  min-height: 70px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  background: white;
  text-align: left;
}

.structure-card:hover,
.structure-card:focus-visible {
  border-color: var(--purple);
  color: var(--ink);
  background: var(--purple-soft);
  box-shadow: 0 7px 18px rgba(82, 51, 158, 0.1);
}

.structure-card-preview {
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid #ddd4ef;
  border-radius: 10px;
  background: #f4f0fb;
}

.structure-card-preview img,
.structure-card-preview svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.structure-card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.structure-card-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.68rem;
  line-height: 1.3;
  text-overflow: ellipsis;
}

.structure-card-copy small,
.structure-card-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.structure-card-arrow {
  align-self: start;
  color: var(--purple);
  font-size: 0.72rem;
  font-weight: 850;
}

.selected-summary p,
.selected-summary dl {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.43;
}

.selected-summary dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.55rem;
}

.selected-summary dt {
  font-weight: 820;
}

.selected-summary dd {
  margin: 0;
  text-align: right;
}

.workbench-actions {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.55rem;
  border-top: 1px solid var(--line);
  background: #fbfcfc;
}

.action-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.action-copy strong {
  font-size: 0.8rem;
}

.action-copy span {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.primary-button {
  min-width: 182px;
  min-height: 44px;
  padding: 0.62rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 11px;
  color: white;
  background: var(--ink);
  font-size: 0.72rem;
  font-weight: 830;
  box-shadow: inset 4px 0 0 var(--teal);
}

.primary-button:hover {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

footer {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.65rem;
}

footer p {
  margin: 0;
}

footer nav {
  display: flex;
  gap: 1rem;
}

footer a {
  color: var(--purple-dark);
  font-weight: 750;
}

dialog {
  width: min(520px, calc(100% - 2rem));
  padding: 0;
  border: 0;
  border-radius: 19px;
  color: var(--ink);
  background: white;
  box-shadow: 0 30px 90px rgba(9, 31, 39, 0.3);
}

dialog::backdrop {
  background: rgba(12, 32, 40, 0.48);
  backdrop-filter: blur(3px);
}

dialog form {
  padding: 1.35rem;
}

.dialog-kicker {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 880;
  letter-spacing: 0.13em;
}

dialog h2 {
  margin-bottom: 0.6rem;
  font-size: 1.35rem;
  letter-spacing: -0.045em;
}

dialog p {
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.55;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.dialog-actions button {
  min-height: 40px;
  padding: 0.55rem 0.82rem;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: white;
  font-size: 0.7rem;
  font-weight: 810;
}

.dialog-actions button[value="continue"] {
  border-color: var(--ink);
  color: white;
  background: var(--ink);
}

.evaluation-dialog {
  width: min(620px, calc(100% - 2rem));
}

.cryo-dialog {
  width: min(860px, calc(100% - 2rem));
  max-height: min(88vh, 820px);
}

.cryo-dialog form {
  max-height: min(88vh, 820px);
  overflow: auto;
}

.cryo-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.cryo-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: white;
  font-size: 1.2rem;
  line-height: 1;
}

.cryo-record {
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(300px, 1.22fr);
  gap: 1.1rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.cryo-preview {
  min-height: 260px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d5dce0;
  border-radius: 13px;
  background: #111820;
}

.cryo-preview img {
  width: 100%;
  height: 100%;
  max-height: 330px;
  display: block;
  object-fit: contain;
}

.cryo-identifiers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.cryo-identifiers span {
  padding: 0.24rem 0.42rem;
  border-radius: 999px;
  color: var(--purple-dark);
  background: var(--purple-soft);
  font-size: 0.58rem;
  font-weight: 850;
}

.cryo-record-copy h3 {
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
  letter-spacing: -0.025em;
}

.cryo-citation {
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.66rem;
}

.cryo-record-copy dl {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 0.5rem 0.7rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}

.cryo-record-copy dt {
  color: var(--ink);
  font-weight: 850;
}

.cryo-record-copy dd {
  margin: 0;
}

.cryo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.cryo-links a {
  padding: 0.48rem 0.62rem;
  border: 1px solid #c6b9e6;
  border-radius: 9px;
  color: var(--purple-dark);
  background: var(--purple-soft);
  font-size: 0.66rem;
  font-weight: 820;
  text-decoration: none;
}

.evaluation-grid {
  display: grid;
  gap: 0.55rem;
  margin: 0.9rem 0 1rem;
}

.evaluation-row {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 0.6rem;
  align-items: start;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafcfb;
}

.evaluation-state {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
}

.evaluation-row.is-pending .evaluation-state {
  color: var(--gold);
  background: var(--gold-soft);
}

.evaluation-row.is-failed .evaluation-state {
  background: var(--coral);
}

.evaluation-row strong {
  display: block;
  margin-bottom: 0.12rem;
  font-size: 0.73rem;
}

.evaluation-row span {
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.4;
}

.completion-toast {
  position: fixed;
  z-index: 520;
  right: 1.25rem;
  bottom: 1.25rem;
  width: min(430px, calc(100vw - 2.5rem));
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid #c9d7d5;
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 62px rgba(9, 31, 39, 0.22), inset 0 3px 0 var(--teal);
  animation: completion-toast-in 220ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.completion-toast-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-top: 0.1rem;
  border-radius: 50%;
  color: white;
  background: var(--teal);
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 0 0 5px var(--teal-soft);
}

.completion-toast-content {
  min-width: 0;
}

.completion-toast-kicker {
  margin: 0 0 0.3rem;
  color: var(--teal-dark);
  font-size: 0.59rem;
  font-weight: 880;
  letter-spacing: 0.13em;
}

.completion-toast h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.completion-toast-content > p:not(.completion-toast-kicker) {
  margin: 0.42rem 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.5;
}

.completion-toast-content > .completion-toast-route {
  padding-top: 0.48rem;
  border-top: 1px solid var(--line);
  color: var(--teal-dark);
  font-weight: 780;
}

.completion-toast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.completion-toast-actions button {
  min-height: 38px;
  padding: 0.5rem 0.72rem;
  border-radius: 9px;
  font-size: 0.67rem;
  font-weight: 820;
  cursor: pointer;
}

.completion-toast-primary {
  border: 1px solid var(--ink);
  color: white;
  background: var(--ink);
  box-shadow: inset 3px 0 0 var(--teal);
}

.completion-toast-primary:hover {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.completion-toast-secondary { border: 1px solid var(--teal); color: var(--teal-dark); background: var(--teal-soft); }
.completion-toast-secondary:hover { color: white; background: var(--teal-dark); }
.alternate-orc-button:disabled { border-color: var(--line); color: var(--muted); background: #edf1f0; box-shadow: none; cursor: not-allowed; opacity: 0.72; }
.second-orc-lock-copy { margin: 0.45rem 0 0; color: var(--muted); font-size: 0.64rem; line-height: 1.4; }

.question-section { margin: 1.5rem 0 2.2rem; padding: clamp(1.1rem, 2vw, 1.7rem); border: 1px solid rgba(180, 197, 194, 0.9); border-radius: 20px; background: rgba(255, 255, 255, 0.9); box-shadow: var(--shadow); }
.question-section-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr); gap: 2rem; align-items: end; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.question-section-heading h2 { margin: 0; font-size: 1.45rem; letter-spacing: -0.04em; }
.question-section-heading > p { margin: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }
.question-list { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); align-items: stretch; gap: 0.65rem; padding-top: 1rem; overflow-x: auto; }
.question-card { position: relative; min-width: 0; min-height: 340px; display: grid; grid-template-rows: minmax(4.5rem, auto) auto 5rem 5.5rem auto; gap: 0.45rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 5px 16px rgba(20, 45, 57, 0.04); transition: border-color 140ms linear, background-color 140ms linear, box-shadow 140ms linear; }
.question-card-heading { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: start; gap: 0.55rem; padding-right: 4.2rem; }
.question-card-heading h3 { margin: 0.3rem 0 0; font-size: 0.78rem; font-weight: 820; line-height: 1.3; overflow-wrap: anywhere; }
.question-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--purple-dark); background: var(--purple-soft); font-size: 0.66rem; font-weight: 900; }
.question-state { position: absolute; top: 0; right: 0; padding: 0.22rem 0.38rem; border: 1px solid currentColor; border-radius: 999px; font-size: 0.54rem; font-weight: 900; line-height: 1; white-space: nowrap; }
.question-prompt { color: var(--muted); font-size: 0.6rem; font-weight: 840; letter-spacing: 0.04em; text-transform: uppercase; }
.question-card textarea { width: 100%; height: 5rem; resize: none; padding: 0.55rem; border: 1px solid var(--line-dark); border-radius: 8px; color: var(--ink); background: #fff; font-size: 0.73rem; line-height: 1.38; }
.question-card textarea[readonly] { color: var(--ink-soft); background: rgba(255, 255, 255, 0.72); }
.question-feedback { height: 5.5rem; margin: 0; overflow: auto; color: var(--ink-soft); font-size: 0.7rem; font-weight: 590; line-height: 1.45; overflow-wrap: anywhere; scrollbar-width: thin; }
.question-check-button { width: 100%; min-height: 42px; padding: 0.5rem 0.75rem; border: 1px solid var(--purple-dark); border-radius: 9px; color: #fff; background: var(--purple-dark); font-size: 0.69rem; font-weight: 840; cursor: pointer; }
.question-check-button:hover:not([aria-disabled='true']) { border-color: var(--purple); background: var(--purple); }
.question-card[data-state='loading'] .question-check-button { cursor: wait; opacity: 0.82; }
.question-card[data-state='partial'] { border-color: var(--gold); background: var(--gold-soft); }
.question-card[data-state='partial'] .question-state, .question-card[data-state='partial'] .question-feedback { color: var(--gold); }
.question-card[data-state='supported'] { border-color: var(--teal); background: var(--teal-soft); }
.question-card[data-state='supported'] .question-state, .question-card[data-state='supported'] .question-feedback { color: var(--teal-dark); }
.question-card[data-state='supported'] .question-check-button { border-color: var(--teal-dark); background: var(--teal-dark); cursor: default; }
.question-card[data-state='revise'] { border-color: var(--purple); background: var(--purple-soft); }
.question-card[data-state='revise'] .question-state, .question-card[data-state='revise'] .question-feedback { color: var(--purple-dark); }
.question-card[data-state='unavailable'] { border-color: #d6b15e; background: var(--gold-soft); }
.question-card[data-state='unavailable'] .question-state, .question-card[data-state='unavailable'] .question-feedback { color: var(--gold); }
.computing-indicator { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; }
.computing-indicator i { width: 13px; height: 13px; border: 2px solid rgba(255,255,255,0.42); border-top-color: #fff; border-radius: 50%; animation: feedback-spin 0.72s linear infinite; }
.question-privacy-note { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.62rem; line-height: 1.45; }

.completion-toast-dismiss {
  border: 1px solid var(--line-dark);
  color: var(--ink-soft);
  background: white;
}

.completion-toast-dismiss:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: var(--teal-soft);
}

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

@keyframes select-pulse {
  0%, 100% { opacity: 0.72; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.03); }
}

@keyframes orientation-blocked {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-6px); }
  70% { transform: translateX(6px); }
}

@keyframes completion-toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes feedback-spin { to { transform: rotate(360deg); } }

@keyframes molecule-fly-out {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: drop-shadow(0 0 7px rgba(7, 152, 143, 0.34));
  }
  26% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.07);
    filter: drop-shadow(0 0 14px rgba(7, 152, 143, 0.52));
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--fly-x)), calc(-50% + var(--fly-y))) scale(0.78);
    filter: blur(1.5px);
  }
}

@keyframes gate-open-state {
  0%, 38% { opacity: 1; }
  58%, 100% { opacity: 0; }
}

@keyframes gate-closed-state {
  0%, 42% { opacity: 0; transform: scale(0.96); }
  62%, 100% { opacity: 1; transform: scale(1); }
}

@keyframes gate-highlight {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(217, 65, 75, 0)); }
  50% { filter: drop-shadow(0 0 7px rgba(217, 65, 75, 0.88)); }
}

@keyframes gate-label-state {
  0%, 54% { opacity: 0; transform: translateY(4px); }
  70%, 100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .workbench-grid {
    grid-template-columns: 230px minmax(460px, 1fr);
  }

  .console-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.6fr);
    gap: 1rem;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .structure-library {
    grid-column: 1;
  }

  .structures-list {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  .console-panel > .selected-summary {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    padding: 0 0 0 1rem;
    border-bottom: 0;
    border-left: 1px solid var(--line);
  }
}

@media (max-width: 930px) {
  .intro,
  .briefing,
  .workbench-header {
    grid-template-columns: 1fr;
  }

  .intro {
    gap: 0.5rem;
    padding-inline: 0.5rem;
  }

  .intro-copy {
    margin-left: 0;
  }

  .workbench-grid {
    grid-template-columns: 1fr;
  }

  .inventory-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .inventory-groups {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .inventory-group {
    min-width: 0;
  }

  .molecule-card {
    grid-template-columns: 34px 1fr;
  }

  .alternate-orc-button {
    max-width: 220px;
  }

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

  .workbench-readouts {
    width: 100%;
  }

  .reaction-stage {
    min-height: 500px;
  }
}

@media (max-width: 680px) {
  .site-header,
  main,
  footer {
    width: min(100% - 1rem, 1440px);
  }

  .site-header {
    min-height: 60px;
  }

  .brand span:last-child,
  .scope-pill {
    display: none;
  }

  .intro {
    min-height: 155px;
    padding-block: 1.7rem;
  }

  h1 {
    font-size: clamp(2.25rem, 13vw, 3.7rem);
  }

  .briefing {
    padding: 1rem;
  }

  .guide-layout {
    grid-template-columns: 1fr;
  }

  .inventory-groups,
  .console-panel,
  .structures-list,
  .atp-control-grid {
    grid-template-columns: 1fr;
  }

  .loading-guide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .guide-step {
    min-height: 0;
    padding: 0.62rem 0.72rem;
  }

  .workbench-header,
  .workbench-actions {
    padding-inline: 1rem;
  }

  .workbench-readouts {
    grid-template-columns: repeat(2, 1fr);
  }

  .workbench-readouts .secondary-button {
    grid-column: 1 / -1;
    min-height: 38px;
    border-top: 1px solid var(--line);
  }

  .provenance-strip,
  .workbench-actions,
  .observation-tools,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .reaction-panel {
    padding-inline: 0.5rem;
  }

  .reaction-stage {
    min-height: 430px;
  }

  .next-observation-wrap,
  .next-observation-button {
    width: 100%;
    max-width: none;
  }

  .cryo-record {
    grid-template-columns: 1fr;
  }

  .cryo-record-copy dl {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .cryo-record-copy dd {
    margin-bottom: 0.45rem;
  }

  .molecule {
    transform: translate(-50%, -50%) scale(0.82);
  }

  .stage-callout {
    flex-basis: min(210px, calc(50% - 0.3rem));
    max-width: none;
  }

  .console-section {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 0;
  }

  .console-panel > .selected-summary {
    grid-column: 1;
    grid-row: auto;
    margin-top: 0.25rem;
    padding: 0.75rem 0 0;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    border-left: 0;
  }

  .structure-library {
    grid-column: 1;
  }

  .workbench-actions {
    align-items: stretch;
  }

  .primary-button {
    width: 100%;
  }

  footer {
    justify-content: center;
    padding-block: 1rem;
  }

  footer nav {
    flex-wrap: wrap;
  }

  .completion-toast {
    right: 0.5rem;
    bottom: 0.5rem;
    width: calc(100vw - 1rem);
  }

  .question-section-heading { grid-template-columns: 1fr; gap: 0.55rem; }
  .question-list { grid-template-columns: repeat(4, minmax(250px, 82vw)); }
}

@media (max-width: 460px) {
  .loading-guide {
    grid-template-columns: 1fr;
  }

  .guide-step {
    min-height: 48px;
  }

  .completion-toast {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 0.7rem;
    padding: 0.85rem;
  }

  .completion-toast-mark {
    width: 28px;
    height: 28px;
    box-shadow: 0 0 0 4px var(--teal-soft);
    font-size: 0.82rem;
  }

  .completion-toast-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .completion-toast-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .computing-indicator i { animation: none; }
}
