.sortl-game {
  display: grid;
  gap: 14px;
}

.sortl-question {
  min-height: 52px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  color: #1f2937;
  font-size: 16px;
  font-weight: 760;
}

.sortl-board {
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fbfcfe 0%, #f3f7fb 100%),
    repeating-linear-gradient(90deg, rgba(37, 99, 235, 0.05) 0, rgba(37, 99, 235, 0.05) 1px, transparent 1px, transparent 18px);
  padding: 14px;
  display: grid;
  gap: 12px;
  overflow: hidden;
}

.sortl-meters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sortl-meter {
  min-width: 0;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #ffffff;
  padding: 9px 10px;
  display: grid;
  gap: 3px;
}

.sortl-meter span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.sortl-meter strong {
  color: #17202a;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.sortl-section {
  min-width: 0;
  border: 1px solid #d4dce8;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.sortl-section-ready {
  border-color: #99d8cf;
  background: #f3fffc;
}

.sortl-section-head {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.sortl-section-head strong {
  color: #17202a;
  font-size: 15px;
  font-weight: 900;
}

.sortl-section-head span {
  color: #667085;
  font-size: 12px;
  font-weight: 750;
}

.sortl-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sortl-cell {
  position: relative;
  min-width: 0;
  min-height: 104px;
  border: 1px solid #d7dfeb;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f7fafc);
  padding: 28px 8px 8px;
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 6px;
  align-items: center;
}

.sortl-cell-left {
  background: #eff6ff;
  border-color: #93c5fd;
}

.sortl-cell-right {
  background: #fff7ed;
  border-color: #fdba74;
}

.sortl-node {
  min-width: 0;
  min-height: 54px;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 950;
  box-shadow: 0 6px 14px rgba(20, 31, 50, 0.07);
}

.sortl-cell-slow .sortl-node {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18), 0 6px 14px rgba(20, 31, 50, 0.07);
}

.sortl-cell-fast .sortl-node {
  border-color: #d97706;
}

.sortl-pointer {
  position: absolute;
  top: 6px;
  width: 28px;
  height: 24px;
  border-radius: 999px;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 5px 12px rgba(20, 31, 50, 0.16);
}

.sortl-pointer-slow {
  left: 8px;
  background: #2563eb;
}

.sortl-pointer-fast {
  right: 8px;
  background: #d97706;
}

.sortl-cut {
  position: relative;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #aab7c7;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  touch-action: manipulation;
  display: grid;
  place-items: center;
  padding: 0;
}

.sortl-cut span {
  width: 30px;
  height: 4px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 -8px 0 #cbd5e1, 0 8px 0 #cbd5e1;
}

.sortl-cut:active,
.sortl-btn:active,
.sortl-merge-node:active {
  transform: scale(0.97);
}

.sortl-cut-done {
  border-color: #0f766e;
  background: #d7f4ef;
}

.sortl-cut-done span {
  width: 28px;
  background: transparent;
  box-shadow: none;
}

.sortl-cut-done span::before,
.sortl-cut-done span::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 21px;
  height: 4px;
  border-radius: 999px;
  background: #0f766e;
}

.sortl-cut-done span::before {
  transform: rotate(36deg);
}

.sortl-cut-done span::after {
  transform: rotate(-36deg);
}

.sortl-tail {
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  background: #eef2f6;
  color: #667085;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 850;
}

.sortl-split-view,
.sortl-merge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sortl-half,
.sortl-rail-wrap {
  min-width: 0;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.sortl-half-muted {
  background: #f8fafc;
  color: #667085;
}

.sortl-half > span,
.sortl-rail-title {
  color: #344054;
  font-size: 13px;
  font-weight: 850;
}

.sortl-mini-chain {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sortl-pill {
  min-width: 38px;
  min-height: 34px;
  border-radius: 8px;
  background: #eef2f6;
  color: #17202a;
  display: inline-grid;
  place-items: center;
  padding: 6px 9px;
  font-weight: 900;
}

.sortl-pill-raw {
  background: #fff7ed;
  color: #92400e;
}

.sortl-pill-ready {
  background: #d7f4ef;
  color: #0f514b;
}

.sortl-arrow-down {
  color: #667085;
  font-size: 17px;
  font-weight: 950;
  line-height: 1;
}

.sortl-rail {
  min-height: 66px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sortl-placeholder {
  grid-column: 1 / -1;
  min-height: 58px;
  border: 1px dashed #a7b0be;
  border-radius: 8px;
  background: #f8fafc;
  color: #667085;
  display: grid;
  place-items: center;
  padding: 8px;
  font-size: 13px;
  font-weight: 850;
}

.sortl-merge-node {
  min-width: 0;
  min-height: 58px;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #17202a;
  cursor: pointer;
  touch-action: manipulation;
  padding: 6px;
  display: grid;
  place-items: center;
  gap: 1px;
}

.sortl-merge-node span {
  color: #667085;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.sortl-merge-node strong {
  color: #111827;
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}

.sortl-merge-node-head {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.sortl-merge-node-used {
  border-color: #0f766e;
  background: #d7f4ef;
  opacity: 0.64;
}

.sortl-output {
  min-height: 68px;
  border: 1px dashed #98a2b3;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #667085;
  font-weight: 800;
}

.sortl-out-node {
  min-width: 48px;
  min-height: 46px;
  border-radius: 8px;
  background: #0f766e;
  color: #ffffff;
  display: grid;
  place-items: center;
  padding: 5px 9px;
  animation: sortl-pop 260ms ease;
}

.sortl-out-node span {
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.86;
}

.sortl-out-node strong {
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
}

.sortl-status {
  min-height: 58px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #ffffff;
  padding: 11px 12px;
  color: #344054;
  font-size: 15px;
}

.sortl-status-good {
  border-color: #0f766e;
  background: #d7f4ef;
  color: #134e4a;
}

.sortl-status-warn {
  border-color: #d97706;
  background: #fff7ed;
  color: #7c2d12;
}

.sortl-wrong {
  border-color: #b42318 !important;
  background: #fff1f0 !important;
  animation: sortl-shake 340ms ease;
}

.sortl-actions {
  display: grid;
  grid-template-columns: minmax(92px, 0.42fr) minmax(150px, 1fr);
  gap: 10px;
}

.sortl-btn {
  min-height: 48px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #ffffff;
  color: #17202a;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
  touch-action: manipulation;
}

.sortl-btn-primary {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

@keyframes sortl-pop {
  0% { transform: scale(0.78); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes sortl-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@media (min-width: 760px) {
  .sortl-flow {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .sortl-board {
    padding: 10px;
    gap: 10px;
  }

  .sortl-question,
  .sortl-status {
    font-size: 14px;
  }

  .sortl-meters {
    grid-template-columns: 1fr 1fr;
  }

  .sortl-meter:first-child {
    grid-column: 1 / -1;
  }

  .sortl-section {
    padding: 10px;
  }

  .sortl-cell {
    min-height: 98px;
    padding: 28px 6px 7px;
    gap: 5px;
  }

  .sortl-node {
    min-height: 50px;
    font-size: 20px;
  }

  .sortl-split-view,
  .sortl-merge-grid {
    grid-template-columns: 1fr;
  }

  .sortl-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .sortl-flow {
    gap: 6px;
  }

  .sortl-cell {
    grid-template-columns: minmax(0, 1fr) 44px;
    min-height: 94px;
    padding-left: 5px;
    padding-right: 5px;
  }

  .sortl-meter strong {
    font-size: 16px;
  }

  .sortl-rail {
    gap: 6px;
  }
}
