* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  max-width: 1000px;
  width: 100%;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 26px 30px;
}

.header-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

header h1 {
  font-size: 28px;
}

.header-link {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.2s ease;
}

.header-link:hover {
  background: rgba(255, 255, 255, 0.25);
}

.header-sub {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hotkeys {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  opacity: 0.95;
}

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 700;
}

.session {
  display: flex;
  gap: 12px;
  font-size: 13px;
  opacity: 0.95;
}

main {
  padding: 30px;
}

.state {
  text-align: center;
  padding: 70px 10px;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.state-empty h2 {
  font-size: 30px;
  margin-bottom: 10px;
  color: #333;
}

.state-empty p {
  color: #666;
  font-size: 16px;
  margin-bottom: 18px;
}

.product-info {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.row-meta {
  margin-top: 12px;
  grid-template-columns: 1fr;
}

.label {
  font-size: 12px;
  text-transform: uppercase;
  color: #888;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.value {
  font-size: 18px;
  color: #333;
  font-weight: 700;
  word-break: break-word;
}

.value-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #444;
}

.card-wrap {
  display: flex;
  justify-content: center;
  margin: 18px 0 16px;
}

.card {
  position: relative;
  width: min(720px, 100%);
  height: min(560px, 70vh);
  background: #111;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,0.18);
  touch-action: pan-y;
  outline: none;
}

.card:focus {
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.35), 0 18px 40px rgba(0,0,0,0.18);
}

.images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 100%;
}

.image-pane {
  position: relative;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.image-pane:last-child {
  border-right: none;
}

.pane-label {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 6px 10px;
  border-radius: 10px;
}

.image-pane img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
}

.stamp {
  position: absolute;
  top: 18px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  border: 3px solid;
  opacity: 0;
  transform: rotate(-10deg);
  user-select: none;
  pointer-events: none;
}

.stamp-bad {
  left: 18px;
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.stamp-good {
  right: 18px;
  color: #10b981;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  transform: rotate(10deg);
}

.stamp-warn {
  left: 50%;
  transform: translateX(-50%) rotate(0deg);
  color: #f59e0b;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
}

.card.dragging .stamp {
  opacity: 1;
}

.image-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  padding: 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.65);
}

.actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn {
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-good {
  background: #10b981;
  color: white;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.25);
}

.btn-bad {
  background: #ef4444;
  color: white;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.22);
}

.btn-warn {
  background: #f59e0b;
  color: #1f2937;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.22);
}

.btn-secondary {
  background: #6c757d;
  color: white;
  box-shadow: 0 8px 18px rgba(108, 117, 125, 0.2);
}

.toast {
  margin: 14px auto 0;
  max-width: 720px;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 700;
  text-align: center;
  color: #111;
  background: #e5e7eb;
}

@media (max-width: 720px) {
  main { padding: 22px; }
  .row { grid-template-columns: 1fr; }
  .card { height: min(520px, 66vh); }
  .images { grid-template-columns: 1fr; }
  .image-pane { border-right: none; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .image-pane:last-child { border-bottom: none; }
}
