#solver {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  height: 100%;
  min-height: 600px;
}

#solver-viewer,
.solver-viewer {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  cursor: grab;
  margin-bottom: 20px;
}

#solver-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: min(360px, 90%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}

#solver-loading .solver-loading__svg {
  display: block;
  width: 100%;
  height: auto;
}

#solver-viewer.is-dragging,
.solver-viewer.is-dragging {
  cursor: grabbing;
}

#solver-viewer canvas,
.solver-viewer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.solver-controls {
  flex: 0 1 auto;
  max-width: 100%;
}

.solver-description {
  margin-bottom: 1rem;
  color: #555;
}

.solver-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.solver-actions .btn {
  min-width: 140px;
}

.solver-piece-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  background: #fff;
}

.solver-piece-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.solver-piece-list li:last-child {
  border-bottom: none;
}

.solver-piece-list input[type='checkbox'] {
  margin: 0;
}

.solver-piece-swatch {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.solver-piece-hidden {
  opacity: 0.55;
}

@media (max-width: 768px) {
  .solver {
    flex-direction: column;
  }

  .solver-controls {
    width: 100%;
  }
}
