/* Crop Disease Detection — v3 surface styles.
   Chrome (nav/menu/footer/drawer) and tokens come from /assets/css/site.css. */
*, *::before, *::after { box-sizing: border-box; }

/* ── Photo guide ────────────────────────────────────────── */
.guide-grid {
  list-style: none; margin: 0; padding: 0 0 6px;
  display: flex; gap: 10px;
  overflow-x: auto; scroll-snap-type: x mandatory;
}

.shot {
  margin: 0; flex: 0 0 148px; scroll-snap-align: start;
  background: var(--bg); border: 1px solid var(--ln);
}
.shot-good { border-color: rgba(34,59,195,.55); }
.shot-bad  { border-color: var(--red,#FE3D33); }

.shot-frame { display: block; aspect-ratio: 4 / 3; background: #111; border-bottom: 1px solid var(--ln); }
.shot-frame svg { width: 100%; height: 100%; display: block; }

.shot-caption { padding: 8px 10px 10px; }

.shot-label {
  display: flex; align-items: center; gap: 6px; margin: 0;
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: .04em; text-transform: uppercase;
}

.mark { width: 14px; height: 14px; flex: none; }

.shot-good .shot-label,
.shot-good .mark { color: var(--blue); }

.shot-bad .shot-label { color: var(--navy); }          /* red text measured 3.25:1 at 11px */
.shot-bad .mark { color: var(--red,#FE3D33); }        /* the red ✕ and frame carry the status */

.shot-note { margin: 5px 0 0; font-size: 13px; line-height: 1.35; color: var(--fg); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── Upload panel + results ─────────────────────────────── */
.tool-grid { display: grid; gap: 16px; }

.tool-panel { padding: 20px; display: grid; gap: 16px; align-content: start; }

.field { display: grid; gap: 6px; }

.field-label {
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--dim);
}

.field select:focus-visible,
.dropzone:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.dropzone {
  min-height: 220px;
  border: 1px solid var(--ln);
  display: grid; place-items: center;
  cursor: pointer; padding: 16px; text-align: center;
  transition: border-color .2s, box-shadow .2s, background .2s;
  color: var(--dim);
}

.dropzone.active,
.dropzone:hover {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
  background: rgba(34,59,195,.05);
}

.drop-sub { display: block; margin-top: 8px; font-family: var(--f-mono); font-size: 11px; }

.preview { max-width: 100%; max-height: 280px; object-fit: contain; }

/* site.css sets img { display:block } which beats the [hidden] UA rule */
.preview[hidden] { display: none; }

.tool-submit { width: 100%; }
.tool-submit:disabled { opacity: .45; cursor: default; }

.results { min-height: 64px; }

.results-empty {
  border: 1px solid var(--ln); background: var(--bg);
  padding: 28px 20px; text-align: center; color: var(--dim);
}
.results-empty p { margin: 0; }

.error {
  background: var(--bg); border: 1px solid var(--red,#FE3D33);
  padding: 16px 20px; color: var(--red,#FE3D33); margin: 0;
  font-family: var(--f-mono); font-size: 13px;
}

.card-result {
  position: relative; background: var(--bg);
  border: 1px solid var(--ln);
  box-shadow: inset 4px 0 0 var(--lime);
  padding: 20px;
}
.card-result.abstain { box-shadow: inset 4px 0 0 var(--red,#FE3D33); }

.card-result h2 { font-size: 22px; font-weight: 500; margin: 0 0 6px; }

.sep { margin: 0 6px; opacity: .45; }

.conf { margin: 0 0 12px; color: var(--dim); font-family: var(--f-mono); font-size: 12px; }

.topk { list-style: none; margin: 0; padding: 0; display: grid; }
.topk li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 8px 0; border-top: 1px solid var(--ln);
  color: var(--dim); font-size: 14px;
}
.topk li span:last-child { font-family: var(--f-mono); font-size: 11px; align-self: center; }

.tool-note { font-size: 12px; line-height: 1.8; }

@media (min-width: 980px) {
  .guide-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    overflow: visible; padding-bottom: 0;
  }
  .shot { flex: none; }
  .tool-grid { grid-template-columns: 1.1fr .9fr; align-items: start; }
}
