.ml-pattern {
  position: relative;
}

.ml-pattern-locked {
  opacity: .55;
  cursor: not-allowed;
}

.ml-lock {
  position: absolute;
  top: 6px;
  right: 8px;
  background: rgba(255,255,255,.95);
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 15px;
}
.ml-rhythm-workshop {
  margin: 30px 0;
  padding: 24px;
  background: #f7f9fb;
  border: 1px solid #dde5ec;
  border-radius: 14px;
}

.ml-rhythm-intro h2 {
  margin-top: 0;
}

.ml-rhythm-panel {
  margin-bottom: 20px;
}

.ml-rhythm-panel,
.ml-rhythm-builder {
  background: #fff;
  border: 1px solid #e1e6eb;
  border-radius: 12px;
  padding: 18px;
}

.ml-rhythm-patterns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.ml-pattern {
  padding: 8px;
  background: #fff;
  border: 1px solid #d8e0e7;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s ease,
              background-color .15s ease;
}

.ml-pattern:hover {
  background: #f7f9fb;
  border-color: #336699;
}

.ml-pattern img {
  display: block;
  width: 180px;
  height: 90px;
  object-fit: contain;
}

.ml-rhythm-sequence {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.ml-rhythm-slot {
  min-height: 150px;
  padding: 12px;
  border: 3px solid #d8e0e7;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #7a8793;
}

.ml-rhythm-slot.filled {
  background: #fff;
}

.ml-rhythm-slot.active {
  background: #fff;
  border-color: #336699;
}

.ml-rhythm-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ml-rhythm-img {
  display: block;
  width: 180px;
  height: 90px;
  object-fit: contain;
}

.ml-rhythm-remove {
  margin-top: 8px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: #eeeeee;
  cursor: pointer;
  line-height: 1;
}

.ml-rhythm-remove:hover {
  background: #dddddd;
}

.ml-rhythm-pulse {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
  text-align: center;
}

.ml-rhythm-pulse span {
  display: block;
  padding: 10px;
  border-radius: 999px;
  background: #eef2f5;
  color: #6c7884;
  font-weight: 600;
}

.ml-rhythm-pulse span.active {
  background: #336699;
  color: #fff;
}

.ml-rhythm-player {
  display: flex;
  flex-direction: column;
  gap: 14px;

  margin-top: 22px;
  padding: 16px;

  background: #fff;
  border: 1px solid #e1e6eb;
  border-radius: 12px;
}

.ml-rhythm-player-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ml-rhythm-player button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #336699;
  color: #fff;
  cursor: pointer;
}

.ml-rhythm-player button:hover {
  background: #2a5880;
}

.ml-rhythm-player-options {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.ml-rhythm-player-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.ml-rhythm-player-tempo {
  display: flex;
  align-items: center;
}

.ml-tempo-control {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ml-tempo-control span:first-child {
  font-weight: 600;
}

.ml-tempo-control input[type="range"] {
  width: 260px;
}

.ml-tempo-control strong {
  min-width: 70px;
  color: #336699;
}

@media (max-width: 700px) {

  .ml-rhythm-player-buttons,
  .ml-rhythm-player-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .ml-tempo-control {
    width: 100%;
  }

  .ml-tempo-control input[type="range"] {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 900px) {

  .ml-rhythm-sequence {
    grid-template-columns: repeat(2, 1fr);
  }

  .ml-rhythm-pulse {
    grid-template-columns: repeat(2, 1fr);
  }

  .ml-pattern img,
  .ml-rhythm-img {
    width: 160px;
    height: 80px;
  }
}

@media (max-width: 600px) {

  .ml-rhythm-sequence {
    grid-template-columns: 1fr;
  }

  .ml-rhythm-pulse {
    grid-template-columns: 1fr;
  }

  .ml-pattern img,
  .ml-rhythm-img {
    width: 140px;
    height: 70px;
  }
}