.muscle-memory-section {
  display: grid;
  gap: 14px;
}

.muscle-memory-run-panel {
  display: grid;
  gap: 0;
  margin: 0;
}

.muscle-memory-run-panel[hidden] {
  display: none;
}

#muscleMemoryTitle {
  margin-top: 0;
}

.muscle-memory-panel-title {
  margin: 0;
}

.muscle-memory-start-panel {
  margin-bottom: 14px;
}

.muscle-memory-lead {
  max-width: 760px;
  margin: 0 auto 4px;
  color: #111111;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.35;
  text-align: center;
}

.muscle-memory-hero-art {
  width: min(100%, 760px);
  margin: 0 auto 4px;
}

.muscle-memory-hero-art svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #000000;
  background: #ffffff;
}

.mm-art-bg {
  fill: #ffffff;
}

.mm-art-panel rect,
.mm-art-control > rect {
  fill: #f4f4ee;
  stroke: #000000;
  stroke-width: 2;
}

.mm-art-panel text,
.mm-art-control text {
  fill: #000000;
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 750;
}

.mm-art-control .mm-art-note {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mm-art-found-label,
.mm-art-found-tick {
  animation: muscleMemoryFoundConfirm 3.6s steps(2, end) infinite;
}

.mm-art-path {
  fill: none;
  stroke: #9c1d1d;
  stroke-width: 3;
  stroke-dasharray: 8 8;
  opacity: 0.72;
}

.mm-art-target {
  fill: #9c1d1d;
  stroke: #000000;
  stroke-width: 2;
  animation: muscleMemoryTargetPulse 2.6s steps(2, end) infinite;
}

.mm-art-target-b {
  animation-delay: 1.3s;
}

.mm-art-target-c {
  animation-delay: 0.65s;
}

.mm-art-cursor-2d,
.mm-art-crosshair-3d {
  stroke: #000000;
  stroke-width: 3;
  stroke-linecap: square;
}

.mm-art-cursor-2d {
  animation: muscleMemoryCursor2d 3.6s cubic-bezier(.35, 0, .2, 1) infinite;
}

.mm-art-crosshair-3d {
  animation: muscleMemoryCrosshair3d 3.6s cubic-bezier(.35, 0, .2, 1) infinite;
}

.mm-art-grid {
  fill: none;
  stroke: #666666;
  stroke-width: 1;
  opacity: 0.75;
}

.mm-art-room-face {
  fill: #ffffff;
  stroke: #000000;
  stroke-width: 1.4;
  opacity: 0.82;
}

.mm-art-key rect {
  fill: #ffffff;
  stroke: #000000;
  stroke-width: 2;
}

.mm-art-key-up {
  animation: muscleMemoryKeyUp 3.6s steps(2, end) infinite;
}

.mm-art-key-down {
  animation: muscleMemoryKeyDown 3.6s steps(2, end) infinite;
}

.mm-art-gauge line {
  stroke: #000000;
  stroke-width: 2;
}

.mm-art-gauge .mm-art-found-tick {
  stroke: #9c1d1d;
  stroke-width: 3;
}

.mm-art-gauge-dot {
  fill: #9c1d1d;
  stroke: #000000;
  stroke-width: 2;
  animation: muscleMemoryGauge 3.6s ease-in-out infinite;
}

.mm-art-aim-scene {
  animation: muscleMemoryAimScene 3.6s cubic-bezier(.35, 0, .2, 1) infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes muscleMemoryCursor2d {
  0%, 100% { transform: translate(88px, 218px); }
  42%, 52% { transform: translate(228px, 124px); }
  78% { transform: translate(122px, 188px); }
}

@keyframes muscleMemoryCrosshair3d {
  0%, 100% { transform: translate(563px, 178px); }
}

@keyframes muscleMemoryGauge {
  0%, 100% { transform: translateY(18px); }
  30% { transform: translateY(-24px); }
  58% { transform: translateY(4px); }
  78% { transform: translateY(-8px); }
}

@keyframes muscleMemoryAimScene {
  0%, 100% { transform: translate(0, 0) scale(1); }
  42%, 52% { transform: translate(-32px, 28px) scale(1.02); }
  78% { transform: translate(-14px, 12px) scale(1.01); }
}

@keyframes muscleMemoryKeyUp {
  0%, 14%, 100% { transform: translateY(0); }
  20%, 34% { transform: translateY(2px); }
}

@keyframes muscleMemoryKeyDown {
  0%, 46%, 100% { transform: translateY(0); }
  54%, 68% { transform: translateY(2px); }
}

@keyframes muscleMemoryTargetPulse {
  0%, 45%, 100% { fill: #9c1d1d; }
  50%, 70% { fill: #ffffff; }
}

@keyframes muscleMemoryFoundConfirm {
  0%, 58%, 100% { opacity: 0.32; }
  64%, 82% { opacity: 1; }
}

.muscle-memory-subnav .entry-section-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  position: relative;
  min-height: 30px;
  margin: 0;
  padding: 5px 8px;
  border: 1px solid transparent;
  color: #000000;
  opacity: 0.84;
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transform: none;
}

.muscle-memory-subnav .entry-section-button:hover,
.muscle-memory-subnav .entry-section-button:focus-visible {
  color: #000000;
  opacity: 1;
  background: #ffffff;
  border-color: #9a9a9a;
  outline: 1px solid #000000;
  outline-offset: 1px;
}

.muscle-memory-subnav .entry-section-button.is-active,
.muscle-memory-subnav .entry-section-button[aria-pressed="true"] {
  color: #000000;
  opacity: 1;
  background: #dcdcdc;
  border-color: #000000;
  box-shadow: inset 1px 1px 0 #ffffff;
  font-weight: 800;
}

.muscle-memory-subnav .entry-section-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.muscle-memory-subnav .entry-section-button:active {
  box-shadow: none;
  transform: none;
}

.muscle-memory-desktop-note {
  padding: 12px;
  border: 2px solid #000000;
  background: #ffffff;
  text-align: center;
  font-weight: 800;
}

.muscle-memory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  max-width: 860px;
  margin: 0 auto;
}

.muscle-memory-stage-panel {
  min-width: 0;
}

.muscle-memory-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
  justify-items: center;
  margin-bottom: 4px;
}

.muscle-memory-toolbar .study-task-picker {
  justify-content: center;
  margin: 0;
}

.muscle-memory-submit {
  min-height: 42px;
  padding: 8px 12px;
  border: 2px solid #000000;
  color: #000000;
  background: #f4f4ee;
  box-shadow: 2px 2px 0 #000000;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.muscle-memory-submit:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.muscle-memory-stage {
  min-height: clamp(420px, 58vh, 680px);
  touch-action: none;
  user-select: none;
}

.muscle-memory-overlay .muscle-memory-stage {
  width: 100vw;
  height: 100vh;
  min-height: 0;
  max-width: none;
  margin: 0;
  border: 0;
}

.muscle-memory-hud {
  z-index: 9;
}

.muscle-memory-target {
  z-index: 3;
  will-change: transform, width, height;
}

.muscle-memory-target.is-hot {
  background: #ffffff;
  border-color: #00d7ff;
}

.muscle-memory-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  width: 31px;
  height: 31px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='31' height='31' viewBox='0 0 31 31'%3E%3Cpath d='M15.5 4v23M4 15.5h23' stroke='%23ffffff' stroke-width='2.1' stroke-linecap='square'/%3E%3Cpath d='M15.5 4v23M4 15.5h23' stroke='%2300d7ff' stroke-width='0.95' stroke-linecap='square'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: translate(-50%, -50%);
  will-change: transform;
  pointer-events: none;
}

.muscle-memory-stage.aim-stage-3d .muscle-memory-cursor {
  display: none;
}

.muscle-memory-knob-zone {
  position: absolute;
  left: 0;
  right: auto;
  top: 50%;
  z-index: 5;
  display: grid;
  width: clamp(98px, 8vw, 122px);
  gap: 6px;
  justify-items: center;
  transform: translateY(-50%);
  cursor: auto;
  padding: 7px 6px;
  border: 2px solid rgba(0, 0, 0, 0.78);
  border-left: 0;
  background: rgba(255, 255, 255, 0.82);
}

.muscle-memory-altimeter-label {
  width: 100%;
  padding: 3px 4px 1px;
  border: 0;
  background: transparent;
  color: #000000;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.muscle-memory-knob {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid #000000;
  background: rgba(248, 248, 244, 0.94);
  box-shadow: 2px 2px 0 #000000;
  color: #000000;
  font-size: 31px;
  font-weight: 900;
  line-height: 1;
}

.muscle-memory-knob[data-direction="up"] {
  background: #ffffff;
}

.muscle-memory-knob[data-direction="down"] {
  background: #ecece4;
}

.muscle-memory-trim-value {
  min-width: 74px;
  padding: 4px 6px;
  border: 1px solid #000000;
  background: rgba(255, 255, 255, 0.92);
  color: #000000;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.muscle-memory-key-hints {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 6px;
  border: 1px solid #000000;
  background: rgba(255, 255, 255, 0.9);
  color: #000000;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.muscle-memory-key-hints div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.muscle-memory-key-hints span {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.muscle-memory-results-panel {
  display: grid;
  gap: 12px;
}

.muscle-memory-results-panel[hidden] {
  display: none;
}

.muscle-memory-results {
  display: grid;
  gap: 10px;
}

.muscle-memory-chart-panel {
  min-width: 0;
  border: 2px solid #000000;
  background: #ffffff;
}

.muscle-memory-chart {
  width: 100%;
  height: clamp(260px, 44vw, 380px);
}

.muscle-memory-method-panel {
  display: grid;
  gap: 12px;
  max-width: 920px;
  margin: 0 auto;
}

.muscle-memory-method-panel[hidden] {
  display: none;
}

.muscle-memory-method-panel > p {
  max-width: 780px;
  margin: 0;
  color: #111111;
  line-height: 1.5;
}

.muscle-memory-method-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.muscle-memory-last-result {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: center;
  max-width: 720px;
  margin: 10px auto 0;
  padding: 9px 12px;
  border: 1px solid #000000;
  background: #ffffff;
  font-size: var(--text-sm);
}

.muscle-memory-last-result[hidden] {
  display: none;
}

.muscle-memory-last-result span {
  color: #333333;
}

.muscle-memory-last-result strong {
  font-size: 16px;
}

.muscle-memory-last-result em {
  color: #333333;
  font-style: normal;
}

.muscle-memory-history-plot {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #000000;
  background: #ffffff;
}

.muscle-memory-history-axis {
  position: relative;
  height: 46px;
  border-bottom: 2px solid #000000;
}

.muscle-memory-history-axis::before,
.muscle-memory-history-axis::after {
  position: absolute;
  bottom: -5px;
  width: 2px;
  height: 9px;
  background: #000000;
  content: "";
}

.muscle-memory-history-axis::before {
  left: 7%;
}

.muscle-memory-history-axis::after {
  right: 7%;
}

.muscle-memory-history-dot {
  position: absolute;
  bottom: -6px;
  width: 10px;
  height: 10px;
  border: 1px solid #000000;
  border-radius: 50%;
  background: #000000;
  transform: translate(-50%, -50%);
}

.muscle-memory-history-labels {
  display: flex;
  justify-content: space-between;
  color: #333333;
  font-size: var(--text-sm);
}

.muscle-memory-key-hints kbd {
  min-width: 32px;
  padding: 4px 8px;
  border: 1px solid #000000;
  background: #f4f4ee;
  box-shadow: 1px 1px 0 #000000;
  font: inherit;
  font-weight: 900;
  text-align: center;
}

.muscle-memory-submit {
  width: 100%;
  min-width: 0;
  background: #ffffff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.15;
}

.muscle-memory-stage-warning {
  position: absolute;
  left: 50%;
  top: 18px;
  z-index: 6;
  width: min(760px, calc(100% - 180px));
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: clamp(14px, 1.4vw, 20px);
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.65),
    0 0 1px rgba(0, 0, 0, 0.9);
  opacity: 0.78;
  transform: translateX(-50%);
  pointer-events: none;
}

.muscle-memory-esc-message {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: 18px;
  z-index: 7;
  width: min(560px, calc(100% - 140px));
  margin: 0;
  color: #ffffff;
  font-size: clamp(15px, 1.6vw, 22px);
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.7),
    0 0 1px rgba(0, 0, 0, 0.9);
  opacity: 0.72;
  transform: translateX(-50%);
  pointer-events: none;
}

.muscle-memory-stage-prompt {
  position: absolute;
  left: 14px;
  top: auto;
  bottom: 72px;
  z-index: 6;
  max-width: min(300px, calc(100% - 28px));
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: clamp(13px, 1.3vw, 18px);
  font-weight: 850;
  line-height: 1.22;
  text-align: left;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.76),
    0 0 1px rgba(0, 0, 0, 0.95);
  opacity: 0.74;
  transform: none;
  pointer-events: none;
}

.muscle-memory-stage.is-locked .muscle-memory-stage-prompt {
  display: block;
}

.muscle-memory-empty {
  margin: 0;
  color: #333333;
  font-size: var(--text-sm);
}

@media (max-width: 760px) {
  .home-entry-grid {
    grid-template-columns: 1fr;
  }

  .mm-art-panel text,
  .mm-art-control text {
    font-size: 19px;
  }

  .muscle-memory-subnav .entry-section-button {
    display: none;
    grid-column: 1 / -1;
    min-width: 0;
    justify-content: flex-start;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid var(--rule);
    border-top: 0;
    opacity: 1;
    background: #ffffff;
    box-shadow: none;
    font-size: var(--text-table);
  }

  .muscle-memory-subnav.is-open .entry-section-button {
    display: flex;
    position: absolute;
    right: 6px;
    left: 6px;
    z-index: 2;
    min-height: 40px;
    border: 0;
    border-bottom: 1px solid var(--soft);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .muscle-memory-subnav.is-open .entry-section-button:nth-of-type(2) {
    top: calc(100% + 0px);
  }

  .muscle-memory-subnav.is-open .entry-section-button:nth-of-type(3) {
    top: calc(100% + 40px);
  }

  .muscle-memory-subnav.is-open .entry-section-button:nth-of-type(4) {
    top: calc(100% + 80px);
  }

  .muscle-memory-subnav .entry-section-button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

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

  .muscle-memory-toolbar {
    grid-template-columns: 1fr;
  }

  .muscle-memory-toolbar .study-task-picker {
    justify-content: center;
  }

  .muscle-memory-method-grid {
    grid-template-columns: 1fr;
  }

  .muscle-memory-stage {
    min-height: 360px;
  }

  .muscle-memory-knob-zone {
    width: 96px;
  }

  .muscle-memory-knob {
    width: 50px;
    height: 50px;
    font-size: 28px;
  }

  .muscle-memory-key-hints,
  .muscle-memory-submit {
    font-size: 11px;
  }

  .muscle-memory-stage-warning {
    left: calc(50% + 48px);
    top: 14px;
    width: min(420px, calc(100% - 128px));
    padding: 0;
    font-size: clamp(12px, 3.1vw, 15px);
  }

  .muscle-memory-stage-prompt {
    left: 10px;
    bottom: 58px;
    width: min(260px, calc(100% - 20px));
    max-width: min(260px, calc(100% - 20px));
    font-size: clamp(12px, 3vw, 15px);
  }

  .muscle-memory-esc-message {
    left: calc(50% + 48px);
    bottom: 12px;
    width: min(380px, calc(100% - 128px));
    font-size: clamp(12px, 3.1vw, 15px);
  }

  .muscle-memory-key-hints kbd {
    min-width: 28px;
    padding: 3px 7px;
  }
}
