:root {
  color-scheme: light;
  --ink: #15352e;
  --muted: #64736e;
  --green: #07513e;
  --green-dark: #06382e;
  --lime: #a8c83b;
  --paper: #fbfbf6;
  --cream: #f1f2e8;
  --line: rgba(6, 63, 50, 0.14);
  --shadow: 0 24px 70px rgba(7, 50, 39, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(168, 200, 59, 0.18), transparent 27rem),
    radial-gradient(circle at 88% 80%, rgba(7, 81, 62, 0.12), transparent 30rem),
    var(--cream);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.3;
  background-image: linear-gradient(rgba(7, 81, 62, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(7, 81, 62, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.page-shell {
  display: flex;
  flex-direction: column;
  width: min(100% - 32px, 920px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 0 24px;
}

.hero { text-align: center; }

.hero__logo {
  display: block;
  width: clamp(170px, 25vw, 244px);
  height: auto;
  margin: 0 auto 20px;
  border: 7px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 18px 55px rgba(7, 64, 49, 0.18), 0 0 0 1px rgba(7, 81, 62, 0.14);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--green-dark);
  font-size: clamp(2.45rem, 8vw, 4.6rem);
  font-weight: 790;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

h1 span { color: var(--green); }

.instructions {
  max-width: 620px;
  margin: 15px auto 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.08rem);
}

.lookup { width: min(100%, 680px); margin: 30px auto 0; }
.lookup__form { position: relative; z-index: 3; }
.combobox-wrap { position: relative; }

#batch-input {
  width: 100%;
  height: 68px;
  padding: 0 78px 0 58px;
  color: var(--ink);
  background: rgba(255, 255, 252, 0.96);
  border: 1px solid rgba(7, 81, 62, 0.2);
  border-radius: 18px;
  box-shadow: 0 15px 45px rgba(7, 50, 39, 0.1);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 680;
  letter-spacing: 0.035em;
  outline: none;
  text-transform: uppercase;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

#batch-input::placeholder { color: #8b9793; font-weight: 520; letter-spacing: 0; text-transform: none; }
#batch-input:focus { border-color: var(--green); box-shadow: 0 18px 48px rgba(7, 50, 39, 0.14), 0 0 0 4px rgba(7, 81, 62, 0.1); }

.search-icon {
  position: absolute;
  top: 23px;
  left: 21px;
  z-index: 1;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-button {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  width: 50px;
  height: 50px;
  padding: 0;
  color: white;
  background: var(--green);
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  place-items: center;
  transition: background 160ms ease, transform 160ms ease;
}

.search-button:hover { background: var(--green-dark); transform: translateX(2px); }
.search-button:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.search-button svg { width: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  overflow: hidden;
  padding: 7px;
  background: rgba(255, 255, 252, 0.99);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font: inherit;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-align: left;
}

.option::after { color: var(--green); content: "View COA  →"; font-size: 0.76rem; font-weight: 700; letter-spacing: 0; }
.option:hover, .option[aria-selected="true"] { background: #edf3e5; }

.status { min-height: 24px; margin: 12px 0 0; color: var(--muted); font-size: 0.9rem; text-align: center; }
.status.is-error { color: #9b342a; }

.result {
  width: min(100%, 780px);
  margin: 18px auto 36px;
  transform-origin: 50% 0;
}

.result.is-entering { animation: card-in 480ms cubic-bezier(0.18, 0.88, 0.28, 1.12) both; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(26px) scale(0.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.coa-card {
  overflow: hidden;
  background: rgba(255, 255, 252, 0.98);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.coa-card__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 23px 28px;
  color: white;
  background: linear-gradient(125deg, var(--green-dark), var(--green));
}

.coa-card__kicker { margin: 0 0 3px; color: #dceacb; font-size: 0.72rem; font-weight: 760; letter-spacing: 0.16em; text-transform: uppercase; }
.coa-card h2 { margin: 0; font-size: clamp(1.65rem, 5vw, 2.35rem); letter-spacing: -0.035em; }
.verified { display: inline-flex; flex: 0 0 auto; gap: 6px; align-items: center; padding: 8px 11px; color: var(--green-dark); background: #ddea9c; border-radius: 999px; font-size: 0.75rem; font-weight: 800; }

.report { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 26px; padding: 28px; }
.report + .report { border-top: 1px solid var(--line); }
.sample { margin: 0 0 18px; color: var(--green-dark); font-size: 1.25rem; font-weight: 750; }
.metadata { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: -7px 0 19px; color: var(--muted); font-size: 0.84rem; }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.result-item { padding: 12px 14px; background: #f4f5ed; border: 1px solid rgba(7, 81, 62, 0.08); border-radius: 12px; }
.result-item dt { margin: 0 0 3px; color: var(--muted); font-size: 0.72rem; font-weight: 680; text-transform: uppercase; }
.result-item dd { margin: 0; color: var(--green-dark); font-size: 1rem; font-weight: 800; }
.detail-notice { padding: 15px 16px; color: #6d4d16; background: #fff5d9; border: 1px solid #efdca7; border-radius: 12px; line-height: 1.45; }

.report__action { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.qr-frame { display: grid; width: 186px; height: 186px; padding: 9px; background: white; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 10px 30px rgba(7, 50, 39, 0.1); place-items: center; }
.qr-frame img { display: block; width: 100%; height: 100%; }
.source-link { display: inline-flex; align-items: center; justify-content: center; width: 100%; margin-top: 13px; padding: 11px 14px; color: white; background: var(--green); border-radius: 11px; font-size: 0.88rem; font-weight: 780; text-decoration: none; transition: background 160ms ease, transform 160ms ease; }
.source-link:hover { background: var(--green-dark); transform: translateY(-1px); }
.qr-caption { margin: 9px 0 0; color: var(--muted); font-size: 0.72rem; text-align: center; }

footer { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: auto; padding-top: 26px; color: #76827e; font-size: 0.76rem; text-align: center; }
.sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
  .page-shell { width: min(100% - 22px, 920px); padding-top: 24px; }
  .hero__logo { width: 155px; margin-bottom: 16px; border-width: 5px; }
  .instructions { max-width: 340px; }
  .lookup { margin-top: 24px; }
  #batch-input { height: 62px; padding-right: 70px; padding-left: 51px; border-radius: 16px; }
  .search-icon { top: 20px; left: 18px; }
  .search-button { top: 8px; right: 8px; width: 46px; height: 46px; }
  .coa-card { border-radius: 20px; }
  .coa-card__header { align-items: center; padding: 19px 20px; }
  .report { grid-template-columns: 1fr; gap: 24px; padding: 20px; }
  .results-grid { grid-template-columns: 1fr; }
  .report__action { width: min(100%, 260px); margin: 0 auto; }
  .qr-frame { width: 174px; height: 174px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
