*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: monospace;
  background: #fff;
  color: #222;
  min-height: 100vh;
}

nav {
  font-family: monospace;
  font-size: 0.85em;
  padding: 12px 20px;
  border-bottom: 1px solid #e0e0e0;
}

nav a {
  color: inherit;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

h1 {
  font-size: 1.4em;
  font-weight: normal;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.desc {
  font-size: 0.85em;
  color: #aaa;
  margin: 0 0 40px;
}

/* List */
#sort-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.sort-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 8px;
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: background 0.15s, border-color 0.15s;
}

.sort-item:active {
  cursor: grabbing;
}

.sort-item.is-dragging {
  opacity: 0.45;
  background: #fff;
  border-color: #aaa;
  border-style: dashed;
  cursor: grabbing;
}

.sort-item.drag-over {
  background: #f0f0f0;
  border-color: #222;
}

.handle {
  font-size: 1.1em;
  color: #aaa;
  letter-spacing: -1px;
  line-height: 1;
  flex-shrink: 0;
}

.label {
  font-size: 1em;
  font-weight: normal;
}

/* Ghost (floating clone while dragging) */
.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.9;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  background: #fff;
  border: 1px solid #222;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  transition: box-shadow 0.1s;
  transform: rotate(1.5deg) scale(1.02);
}

/* Placeholder slot */
.slot-placeholder {
  height: 54px;
  margin-bottom: 8px;
  background: transparent;
  border: 1.5px dashed #e0e0e0;
  border-radius: 4px;
  transition: border-color 0.15s;
}

.slot-placeholder.active {
  border-color: #aaa;
  background: #f8f8f8;
}

/* Order display */
#order-display {
  margin-top: 32px;
  padding: 14px 18px;
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 0.82em;
  color: #aaa;
  display: flex;
  gap: 10px;
  align-items: center;
}

.order-label {
  color: #aaa;
  flex-shrink: 0;
}

#order-output {
  color: #222;
  letter-spacing: 0.03em;
}
