* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  background: #1e1f24;
  color: #e6e6e6;
}

header {
  padding: 12px 16px;
  background: #26282f;
  border-bottom: 1px solid #3a3d46;
}

header h1 {
  margin: 0 0 10px;
  font-size: 18px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.controls label {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.controls label.check { gap: 6px; }

.controls input[type="text"] { width: 130px; }
.controls input[type="number"] { width: 60px; }

input {
  background: #1a1b20;
  border: 1px solid #3a3d46;
  color: #e6e6e6;
  border-radius: 4px;
  padding: 4px 6px;
}

button {
  background: #3a3d46;
  border: none;
  color: #e6e6e6;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

button:hover { background: #474b56; }
button.primary { background: #2f7d4f; }
button.primary:hover { background: #379159; }

main {
  display: flex;
  gap: 16px;
  padding: 16px;
  align-items: flex-start;
}

.left { flex: 1; min-width: 0; }
.right { width: 420px; }

.drop-zone {
  border: 2px dashed #4a4e59;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  color: #9aa0ab;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.drop-zone.over {
  border-color: #2f7d4f;
  background: #233027;
}

.thumbs {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.thumb {
  position: relative;
  width: 96px;
  background: #26282f;
  border: 1px solid #3a3d46;
  border-radius: 6px;
  padding: 6px;
  cursor: grab;
}

.thumb.dragging { opacity: .4; }

.thumb img {
  width: 100%;
  height: 72px;
  object-fit: contain;
  background:
    linear-gradient(45deg, #2b2d34 25%, transparent 25%, transparent 75%, #2b2d34 75%) 0 0/16px 16px,
    linear-gradient(45deg, #2b2d34 25%, #1a1b20 25%, #1a1b20 75%, #2b2d34 75%) 8px 8px/16px 16px;
}

.thumb .name {
  font-size: 10px;
  margin-top: 4px;
  word-break: break-all;
  color: #aeb4be;
}

.thumb .remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  background: #c0392b;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
}

.preview-box {
  background:
    linear-gradient(45deg, #2b2d34 25%, transparent 25%, transparent 75%, #2b2d34 75%) 0 0/20px 20px,
    linear-gradient(45deg, #2b2d34 25%, #1a1b20 25%, #1a1b20 75%, #2b2d34 75%) 10px 10px/20px 20px;
  border: 1px solid #3a3d46;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.preview-box canvas { max-width: 100%; }

.preview-controls {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.thumb.selected {
  border-color: #2f7d4f;
  box-shadow: 0 0 0 1px #2f7d4f;
}

.details {
  margin-top: 16px;
  background: #26282f;
  border: 1px solid #3a3d46;
  border-radius: 8px;
  padding: 12px;
}

.details.hidden { display: none; }

.details h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.details .name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}

.details .name-row input { flex: 1; }

.details .grid {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 8px 12px;
  font-size: 13px;
  align-items: center;
}

.details .grid span { color: #9aa0ab; }
.details .grid b { font-weight: 600; }

.status {
  padding: 8px 16px;
  font-size: 13px;
  color: #9aa0ab;
  min-height: 20px;
}
