#app { --panel-w: 316px; --gene-line: #243042; --gene-control: #141d2b; }
#stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  background: #05070d;
  padding: clamp(16px, 2.4vw, 34px);
}
.gene-header, .gene-figure, .transport { width: 100%; max-width: 1080px; margin-inline: auto; }
.gene-heading, .figure-heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gene-heading h1 { font-size: 22px; line-height: 1.25; margin: 0; }
.gene-heading a { color: #a3b1c5; font-size: 12px; text-decoration: none; flex: none; padding-block: 12px; }
.gene-heading a:hover { color: var(--accent); }
#scenes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
#app button {
  color: var(--text);
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--gene-line);
  border-radius: 8px;
  background: var(--gene-control);
  min-height: 44px;
  padding: 5px 12px;
  -webkit-tap-highlight-color: transparent;
}
#app button:hover:not(:disabled), #variant:hover { border-color: #71849e; }
#app button:active:not(:disabled) { filter: brightness(1.15); }
#app button:disabled { opacity: .45; cursor: default; }
#app :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#scenes button { display: flex; align-items: center; justify-content: center; gap: 10px; }
#scenes button.on { color: #ffda78; border-color: #a17b34; background: #2b2418; }
#scenes strong { font-size: 14px; }
#scenes small { font-size: 11px; color: #a5b2c5; }
#scenes .on small { color: #d6bc80; }
.gene-figure {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--gene-line);
  border-radius: 14px;
  background: #0a0f19;
}
.figure-heading { min-height: 54px; padding: 8px 18px; border-bottom: 1px solid #202a39; }
.figure-heading h2 { font-size: 18px; margin: 0; }
#count { color: #ffda78; white-space: nowrap; font-family: var(--mono); font-size: 13px; }
#gene { width: 100%; height: 100%; outline-offset: -3px !important; }
.probe {
  margin: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 5px 15px;
  color: #b7c6d9;
  font-size: 12px;
  border-top: 1px solid #202a39;
}
.transport { display: grid; grid-template-columns: minmax(100px, 1fr) auto; align-items: center; gap: 16px; }
#progress { margin: 0; height: 36px; cursor: pointer; }
.actions { display: grid; grid-auto-flow: column; gap: 6px; }
#app #play { color: #211805; background: #ffcf63; border-color: #ffcf63; font-weight: 700; min-width: 92px; }
#app #play:hover { background: #ffe095; }
#panel { padding: 25px 18px 20px; background: #0e1521; border-color: var(--gene-line); }
#panel h2 { font-size: 16px; color: var(--text); letter-spacing: 0; margin: 0; }
.panel-heading { margin-bottom: 12px; }
#panel h3 { color: #b8c8dc; font-size: 13px; margin: 0 0 8px; }
#panel p { margin: 0; line-height: 1.68; }
#panel section { padding: 15px 0; }
#explain { font-size: 13px; }
#legend { margin-top: 12px; color: #b3bfd0; }
#variant { height: 44px; font-size: 13px; }
.comparison { margin-top: 10px; padding: 11px 12px; border: 1px solid var(--gene-line); border-radius: 8px; background: #101b29; }
.comparison strong { font-size: 14px; color: #ffda78; }
#peptideResult { margin-top: 4px !important; font-size: 12px; }
#panel #mutationNote { margin-top: 6px; }
#panel #shareStatus:not(:empty) { margin-top: 8px; overflow-wrap: anywhere; }
.scope { padding: 8px 0; font-size: 13px; color: #b8c8dc; }
.scope summary { cursor: pointer; padding-block: 5px; }
.scope p { padding-top: 4px; }
#panelToggle, #panelClose { display: none; }
.learn .table-wrap { margin-top: 8px; }
@media (max-width: 760px) {
  #app { min-height: 570px; }
  #stage { padding: 8px 10px 10px; gap: 8px; }
  .gene-heading h1 { font-size: 18px; }
  #scenes { margin-top: 4px; gap: 5px; }
  #scenes button { flex-direction: column; gap: 0; padding-inline: 3px; }
  .figure-heading { min-height: 43px; padding: 5px 10px; }
  .figure-heading h2 { font-size: 16px; }
  #count { font-size: 11px; }
  .probe { min-height: 42px; padding: 4px 10px; }
  .transport { grid-template-columns: 1fr; gap: 0; }
  #progress { height: 28px; }
  .actions { grid-template-columns: 1fr 1fr .75fr 1.25fr; gap: 5px; }
  #app .actions button { padding-inline: 3px; min-width: 0; font-size: 12px; }
  #panelToggle { display: block; position: static; z-index: auto; }
  #panelClose { display: inline-block; min-width: 44px; font-size: 21px; }
  #panel { visibility: hidden; max-height: min(74%, 550px); padding: 10px 14px 20px; }
  #panel.open { visibility: visible; }
  .panel-heading { margin-bottom: 4px; }
}
@media (min-width: 761px) and (max-height: 650px) {
  #app { min-height: 565px; }
  #stage { padding: 12px 16px; gap: 8px; }
}
