:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --card: #171a21;
  --border: #2a2f3a;
  --text: #e8eaed;
  --muted: #9aa3af;
  --accent: #4f8cff;
  --ok: #35c072;
  --bad: #ef5468;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1rem;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.card {
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}

h1 { margin-top: 0; font-size: 1.5rem; }
h2 { font-size: 1rem; color: var(--muted); margin-bottom: 0.75rem; }
.subtitle { color: var(--muted); line-height: 1.5; }

.uploads { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.upload-slot { flex: 1 1 200px; }

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  text-align: center;
  padding: 0.5rem;
  overflow: hidden;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.options {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.option {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.6rem;
  align-items: baseline;
  cursor: pointer;
}
.option input { margin: 0.15rem 0 0 0; }
.option small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.actions { margin-top: 1.25rem; display: flex; align-items: center; gap: 0.75rem; }
.attempts-left { color: var(--muted); font-size: 0.85rem; }

button {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 0.95rem;
  cursor: pointer;
}
button:disabled { opacity: 0.4; cursor: not-allowed; }

.result {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  line-height: 1.6;
}
.result.ok { border-color: var(--ok); }
.result.bad { border-color: var(--bad); }
.result img.annotated { max-width: 100%; border-radius: 8px; margin-top: 0.5rem; }

.raw-json {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.raw-json summary { cursor: pointer; }
.raw-json pre {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  color: var(--text);
  font-size: 0.8rem;
}
