.spt-reorder {
  box-sizing: border-box;
  max-width: 860px;
  margin: 2rem auto;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #d9dde3;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.08);
  color: #172033;
}

.spt-reorder *,
.spt-reorder *::before,
.spt-reorder *::after { box-sizing: inherit; }
.spt-reorder [hidden] { display: none !important; }
.spt-reorder__header { margin-bottom: 1.25rem; text-align: center; }
.spt-reorder__title { margin: 0 0 0.5rem; font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.15; }
.spt-reorder__intro { max-width: 680px; margin: 0 auto; color: #526076; line-height: 1.65; }

.spt-reorder__dropzone {
  display: flex;
  min-height: 250px;
  padding: 2rem 1rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.65rem;
  border: 2px dashed #8b98aa;
  border-radius: 16px;
  background: #f8fafc;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.spt-reorder__dropzone:hover,
.spt-reorder__dropzone:focus,
.spt-reorder__dropzone.is-drag-over { border-color: #3157d5; background: #eef3ff; outline: none; }
.spt-reorder__dropzone.is-drag-over { transform: scale(1.01); }
.spt-reorder__drop-title { font-size: 1.25rem; font-weight: 700; }
.spt-reorder__drop-subtitle,
.spt-reorder__limits,
.spt-reorder__file-meta,
.spt-reorder__help,
.spt-reorder__result-meta,
.spt-reorder__position { color: #667085; }
.spt-reorder__limits { margin: 0.75rem 0 0; text-align: center; font-size: 0.9rem; }
.spt-reorder__workspace { margin-top: 1.5rem; }

.spt-reorder__file-card,
.spt-reorder__result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid #d9dde3;
  border-radius: 12px;
  background: #f8fafc;
}
.spt-reorder__file-details,
.spt-reorder__result-details { min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.spt-reorder__file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spt-reorder__file-meta,
.spt-reorder__result-meta { font-size: 0.88rem; }

.spt-reorder__order-section { margin-top: 1.25rem; }
.spt-reorder__order-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.spt-reorder__order-title { margin: 0 0 0.25rem; font-size: 1.1rem; }
.spt-reorder__help { margin: 0; font-size: 0.9rem; line-height: 1.5; }
.spt-reorder__list { display: grid; gap: 0.6rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.spt-reorder__item {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 54px;
  padding: 0.65rem 0.75rem;
  border: 1px solid #d9dde3;
  border-radius: 10px;
  background: #fff;
  cursor: grab;
}
.spt-reorder__item:active { cursor: grabbing; }
.spt-reorder__item.is-dragging { opacity: 0.45; }
.spt-reorder__item.is-drag-target { border-color: #3157d5; background: #eef3ff; }
.spt-reorder__handle { color: #8b98aa; font-weight: 700; letter-spacing: -0.2em; }
.spt-reorder__page-label { font-weight: 700; }
.spt-reorder__position { font-size: 0.82rem; }
.spt-reorder__item-controls { display: inline-flex; gap: 0.35rem; }
.spt-reorder__move {
  width: 36px;
  height: 36px;
  border: 1px solid #cfd5df;
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.spt-reorder__move:hover:not(:disabled) { border-color: #3157d5; background: #eef3ff; }
.spt-reorder__move:disabled { cursor: not-allowed; opacity: 0.35; }

.spt-reorder-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}
.spt-reorder-button:hover:not(:disabled) { transform: translateY(-1px); }
.spt-reorder-button:focus-visible,
.spt-reorder__move:focus-visible { outline: 3px solid rgba(49, 87, 213, 0.28); outline-offset: 2px; }
.spt-reorder-button:disabled { cursor: not-allowed; opacity: 0.48; }
.spt-reorder-button--primary { min-width: 220px; padding: 0.85rem 1.25rem; background: #3157d5; color: #fff; }
.spt-reorder-button--secondary { margin-top: 0.35rem; padding: 0.75rem 1.1rem; background: #172033; color: #fff; }
.spt-reorder-button--text { padding: 0.5rem; background: transparent; color: #3157d5; }
.spt-reorder-button--download { flex: 0 0 auto; padding: 0.65rem 0.9rem; background: #3157d5; color: #fff; }
.spt-reorder__actions { display: flex; justify-content: center; margin-top: 1.35rem; }
.spt-reorder__result { margin-top: 1.5rem; background: #fff; }
.spt-reorder__status { min-height: 1.5em; margin-top: 1rem; text-align: center; line-height: 1.5; }
.spt-reorder__status--success { color: #176b3a; }
.spt-reorder__status--error,
.spt-reorder__error { color: #a61b1b; }

@media (max-width: 600px) {
  .spt-reorder { margin: 1rem auto; border-radius: 14px; }
  .spt-reorder__dropzone { min-height: 210px; }
  .spt-reorder__file-card,
  .spt-reorder__result,
  .spt-reorder__order-header { align-items: stretch; flex-direction: column; }
  .spt-reorder__item { grid-template-columns: auto minmax(0, 1fr) auto; }
  .spt-reorder__position { display: none; }
  .spt-reorder-button--download { width: 100%; }
}
