:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #111;
  background: #f3f4f6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}
button,
input {
  font: inherit;
}
.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.card {
  width: min(100%, 760px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
}
.heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.eyebrow {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7280;
}
h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.1;
}
.subtitle {
  margin: 10px 0 0;
  color: #6b7280;
}
.status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  background: #f3f4f6;
}
.status.ready {
  background: #e8f7ed;
  color: #176b35;
}
.status.loading {
  background: #fff6dd;
  color: #825d00;
}
.status.bad {
  background: #feecec;
  color: #a52222;
}
.dropzone {
  border: 1.5px dashed #9ca3af;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: #fafafa;
  transition: 150ms ease;
}
.dropzone:hover,
.dropzone.dragging {
  background: #f4f4f5;
  border-color: #52525b;
}
.dropzone span {
  color: #71717a;
  font-size: 13px;
}
.file-input {
  display: none;
}
.examples {
  margin-top: 18px;
}
.examples-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
}
.examples-heading h2 {
  margin: 0;
  font-size: 15px;
}
.examples-heading span {
  color: #71717a;
  font-size: 13px;
}
.example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.example {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px;
  text-align: left;
  color: #27272a;
  background: #fafafa;
  border: 1px solid #d4d4d8;
  border-radius: 10px;
  cursor: pointer;
  transition: 150ms ease;
}
.example:hover,
.example:focus-visible {
  border-color: #52525b;
  background: #f4f4f5;
}
.example.selected {
  border-color: #176b35;
  box-shadow: 0 0 0 2px #cce8d5;
  background: #f5fbf7;
}
.example img {
  display: block;
  width: 48px;
  height: 60px;
  object-fit: cover;
  object-position: right center;
  border-radius: 5px;
  background: #111;
}
.example span {
  font-size: 14px;
  font-weight: 700;
}
.error {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff1f1;
  color: #991b1b;
  font-size: 14px;
}
.canvas-wrap {
  margin-top: 18px;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 14px;
  background: #111;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.processing {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #d4d4d8;
  pointer-events: none;
}
.processing {
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  font-weight: 700;
}
.source-image {
  position: fixed;
  left: -10000px;
  top: -10000px;
  width: auto;
  height: auto;
}
.inference-summary {
  margin-top: 16px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 14px;
  background: #fafafa;
}
.inference-summary.pending {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inference-summary.pending span,
.inference-note {
  color: #6b7280;
  font-size: 13px;
}
.inference-summary.complete {
  border-color: #cce8d5;
  background: #f5fbf7;
}
.inference-summary.no-detections {
  border-color: #f0dca5;
  background: #fffbeb;
}
.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid #e4e4e7;
}
.metric-row:last-of-type {
  border-bottom: 0;
}
.metric-row span {
  color: #52525b;
}
.metric-row.total {
  margin-top: 2px;
  padding-top: 9px;
}
.inference-note {
  margin: 10px 0 0;
  line-height: 1.45;
}
.detection-chips {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.detection-chips span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #e8f7ed;
  color: #176b35;
  font-size: 13px;
  font-weight: 700;
}
@media (max-width: 600px) {
  .card {
    padding: 16px;
    border-radius: 16px;
  }
  .heading {
    flex-direction: column;
  }
  .example-grid {
    grid-template-columns: 1fr;
  }
}
