* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, system-ui, sans-serif;
  color: #1d1d1f;
  background: #f5f5f3;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #e3e3df;
  flex-wrap: wrap;
}

h1 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.muted {
  color: #8a8a8f;
}

.center {
  text-align: center;
}

.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
}

.controls select {
  margin-left: 0.35rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid #d2d2cd;
  border-radius: 6px;
  background: #fff;
}

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem 1.25rem;
  align-items: start;
}

.pane {
  background: #fff;
  border: 1px solid #e3e3df;
  border-radius: 12px;
  padding: 1rem;
  min-height: 60vh;
}

.thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.thumbs:empty {
  display: none;
}

.thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
}

.thumb.active {
  border-color: #2f6fed;
}

.thumb.pending {
  opacity: 0.45;
}

.thumb.review {
  outline: 2px solid #e0a200;
  outline-offset: 1px;
}

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 55vh;
  border: 2px dashed #c9c9c3;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone.over {
  border-color: #2f6fed;
  background: #f0f5ff;
}

.preview {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.result-wrap {
  position: relative;
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #d8d8d3;
  border-top-color: #2f6fed;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: absolute;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.details {
  margin-top: 1rem;
  font-size: 0.85rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.78rem;
}

.badge.ok {
  background: #e3f6e8;
  color: #1c7a3e;
}

.badge.review {
  background: #fdf0d2;
  color: #8a6200;
}

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 0.9rem;
  margin: 0.75rem 0;
}

.kv dt {
  color: #8a8a8f;
}

.kv dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  background: #efeff0;
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-size: 0.78rem;
}

.section-title {
  font-weight: 600;
  margin: 0.9rem 0 0.4rem;
}

@media (max-width: 820px) {
  main {
    grid-template-columns: 1fr;
  }
}
