.product-tester {
  max-width: 720px;
  margin: 0 auto 42px;
  border: 1px solid rgba(140, 117, 172, .24);
  border-radius: 20px;
  padding: clamp(20px, 3.5vw, 30px);
  background:
    radial-gradient(circle at 100% 0, rgba(220, 208, 239, .72), transparent 38%),
    var(--paper);
  box-shadow: 0 18px 48px rgba(56, 43, 68, .09);
}

.product-tester-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.product-tester-badge {
  display: inline-flex;
  border: 1px solid rgba(140, 117, 172, .22);
  border-radius: 99px;
  padding: 6px 9px;
  background: rgba(255, 253, 249, .72);
  color: #6f578f;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.product-tester h2 {
  margin: 13px 0 0;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 400;
  line-height: 1;
}

.product-tester-head p {
  max-width: 510px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.product-tester-spark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--lavender-deep);
}

.product-lookup-form {
  display: flex;
  gap: 8px;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(42, 34, 27, .07);
}

.product-lookup-form input {
  min-width: 0;
  min-height: 44px;
  flex: 1;
  border: 0;
  padding: 0 15px;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.product-lookup-form button,
.barcode-start,
.product-ask-iris,
.product-analyze {
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
  cursor: pointer;
}

.product-lookup-form button {
  min-width: 104px;
  padding: 0 18px;
}

.product-lookup-form button:disabled,
.barcode-start:disabled { cursor: wait; opacity: .6; }

.product-tester-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.barcode-start {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(140, 117, 172, .3);
  padding: 0 14px;
  background: var(--lavender);
  color: #4f3f64;
  font-size: 11px;
}

.barcode-start svg { width: 17px; height: 17px; }
.product-tester-actions > span { color: var(--ink-soft); font-size: 10px; }

.barcode-camera {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  border-radius: 16px;
  background: #161614;
}

.barcode-camera video {
  display: block;
  width: 100%;
  max-height: 390px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.barcode-target {
  position: absolute;
  top: 44%;
  left: 50%;
  width: min(74%, 390px);
  height: 112px;
  border: 2px solid rgba(255, 255, 255, .88);
  border-radius: 13px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .28);
  transform: translate(-50%, -50%);
}

.barcode-target::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  left: 12px;
  height: 2px;
  background: var(--coral);
  box-shadow: 0 0 12px rgba(238, 154, 133, .8);
}

.barcode-camera-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: #24241f;
  color: var(--white);
  font-size: 10px;
}

.barcode-camera-foot button {
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 99px;
  padding: 7px 10px;
  background: transparent;
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.product-lookup-status {
  min-height: 18px;
  margin: 15px 2px 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.product-lookup-status.is-error { color: #a54836; }
.product-lookup-results { display: grid; gap: 12px; margin-top: 5px; }
.lookup-brand-alternatives { margin: 8px 0 2px; color: #5d477a; font-size: 11px; font-weight: 850; }

.lookup-product {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 253, 249, .86);
}

.lookup-product-image,
.lookup-product-placeholder {
  width: 86px;
  height: 102px;
  border-radius: 10px;
  background: #ece8df;
  object-fit: contain;
}

.lookup-product-placeholder {
  display: grid;
  place-items: center;
  color: var(--lavender-deep);
  font-family: var(--serif);
  font-size: 28px;
}

.lookup-product-brand {
  display: block;
  color: var(--lavender-deep);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.lookup-product h3 {
  margin: 4px 0 8px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.12;
}

.lookup-product-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.lookup-product-meta span {
  border-radius: 99px;
  padding: 5px 8px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 9px;
}

.lookup-product details { margin-top: 10px; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.lookup-product summary { color: var(--ink); font-weight: 800; cursor: pointer; }
.lookup-product details p { margin: 7px 0 0; }
.lookup-product-missing { margin: 10px 0 0; color: var(--ink-soft); font-size: 10px; }
.lookup-product-price { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; margin-top: 11px; border-left: 3px solid var(--sage); padding: 8px 10px; background: rgba(238, 240, 231, .72); color: var(--ink-soft); font-size: 10px; }
.lookup-product-price strong { color: var(--ink); font-family: var(--serif); font-size: 17px; font-weight: 400; }
.lookup-product-price a { color: var(--lavender-deep); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.lookup-product-price .lookup-price-note { color: var(--ink-soft); font-size: 9px; }
.lookup-product-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 12px; }

.product-ask-iris {
  min-height: 36px;
  padding: 0 13px;
  background: var(--lavender-deep);
  font-size: 10px;
}

.product-analyze { min-height: 36px; border: 1px solid rgba(140,117,172,.35); padding: 0 13px; background: var(--lavender); color: #4f3f64; font-size: 10px; }

.lookup-product-source { color: var(--ink-soft); font-size: 10px; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.lookup-product-source:not(a) { text-decoration: none; }
.product-tester-source { margin: 16px 2px 0; color: var(--ink-soft); font-size: 9px; }

.label-entry { margin-top: 24px; border: 1px dashed rgba(140, 117, 172, .45); border-radius: 14px; padding: 16px; background: rgba(255, 253, 249, .62); }
.label-entry-badge { color: var(--lavender-deep); font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.label-entry h3 { margin: 5px 0 0; font-family: var(--serif); font-size: 22px; font-weight: 400; }
.label-entry p { margin: 6px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.label-entry form { display: grid; gap: 7px; margin-top: 14px; }
.label-entry form[hidden] { display: none; }
.label-entry label { color: var(--ink); font-size: 10px; font-weight: 800; }
.label-entry label span { color: var(--ink-soft); font-weight: 500; }
.label-entry input, .label-entry textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 9px; padding: 10px; background: var(--white); color: var(--ink); font: inherit; font-size: 11px; }
.label-entry textarea { resize: vertical; line-height: 1.45; }
.label-entry button { justify-self: start; min-height: 38px; border: 0; border-radius: 99px; padding: 0 14px; background: var(--lavender); color: #4f3f64; font-size: 10px; font-weight: 800; cursor: pointer; }
.label-manual-toggle { margin-top: 11px; background: transparent !important; color: var(--lavender-deep) !important; text-decoration: underline; text-underline-offset: 3px; }
.label-photo-picker { display: grid; gap: 8px; border: 1px dashed rgba(140, 117, 172, .52); border-radius: 10px; padding: 12px; background: rgba(220, 208, 239, .22); cursor: pointer; }
.label-photo-picker > span { display: flex; justify-content: space-between; gap: 12px; }
.label-photo-picker em { color: var(--ink-soft); font-style: normal; font-weight: 500; }
.label-photo-picker input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.label-photo-picker strong { justify-self: start; border-radius: 99px; padding: 8px 11px; background: var(--white); color: #4f3f64; font-size: 10px; }
.label-photo-picker.is-reading strong { background: var(--lavender); color: #4f3f64; }
.label-photo-picker.is-reading { cursor: wait; }
.label-photo-picker:focus-within { outline: 3px solid var(--lavender-deep); outline-offset: 3px; }
.label-ocr-status { min-height: 16px; margin: 0 !important; color: var(--ink-soft); font-size: 10px !important; }
.label-ocr-status.is-working { color: #6f578f; font-weight: 750; }
.label-ocr-status.is-error { color: #a54836; font-weight: 750; }

@media (max-width: 700px) {
  .product-tester { margin-bottom: 30px; border-radius: 16px; }
  .product-lookup-form { border-radius: 14px; }
  .product-lookup-form input { min-height: 46px; padding-inline: 10px; }
  .product-lookup-form button { min-width: 82px; padding-inline: 12px; }
  .product-tester-actions { align-items: flex-start; flex-direction: column; gap: 7px; }
}

@media (max-width: 430px) {
  .lookup-product { grid-template-columns: 64px minmax(0, 1fr); gap: 11px; padding: 11px; }
  .lookup-product-image,
  .lookup-product-placeholder { width: 64px; height: 78px; }
  .lookup-product h3 { font-size: 18px; }
  .barcode-camera-foot { align-items: flex-start; flex-direction: column; }
}
