* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.container {
  max-width: 760px;
  margin: 40px auto;
  padding: 0 16px 32px;
}

h1 {
  margin-bottom: 8px;
}

.subtitle {
  margin-top: 0;
  color: #4b5563;
}

.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.label {
  font-weight: 600;
}

button,
.download-link {
  width: fit-content;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #111827;
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
}

button.secondary {
  background: #6b7280;
}

input,
select {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 10px;
  background: #ffffff;
  color: #111827;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.drop-zone {
  border: 2px dashed #9ca3af;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  position: relative;
  background: #f9fafb;
  cursor: pointer;
}

.drop-zone.active {
  border-color: #111827;
  background: #eef2ff;
}

.drop-title {
  font-weight: 700;
  margin: 0;
}

.drop-subtitle {
  margin: 6px 0 0;
  color: #4b5563;
}

#imageInput {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.selected-files {
  margin-top: 2px;
  font-size: 14px;
  color: #374151;
}

.options-grid {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.options-grid legend {
  padding: 0 6px;
  font-weight: 600;
}

.option-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.option-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.option-toggle {
  width: fit-content;
}

.status {
  min-height: 24px;
  margin: 16px 0 8px;
  color: #1f2937;
}

.result {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.result-header h2 {
  margin: 0;
}

.result img {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 12px;
  background: #f9fafb;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.result-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.result-card.error {
  border-color: #fca5a5;
  background: #fef2f2;
}

.result-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.result-card img {
  width: 100%;
  border-radius: 8px;
  background: #f9fafb;
  margin-bottom: 8px;
  max-height: 280px;
  object-fit: contain;
}

.error-message {
  margin: 0;
  color: #991b1b;
  font-size: 13px;
  line-height: 1.4;
}

.hidden {
  display: none;
}
