.scan-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 48px;
  margin: 40px 0;
}

.scanner {
  padding: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.25);
}

.scanner video {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  background: #111;
  margin: 12px 0;
}

.secondary {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
  margin-left: 8px;
}

.product-head {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  align-items: center;
  gap: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}

.product-head img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: white;
}

.product-head h1 {
  margin: 0.2rem 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.photo-grid figure {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.25);
  text-align: center;
}

.photo-grid a {
  display: block;
}

.photo-grid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: white;
}

.source-comparison {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.95rem;
}

.source-comparison th,
.source-comparison td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.source-comparison th {
  background: rgba(255, 255, 255, 0.15);
  font-weight: 600;
}

.source-comparison td:first-child {
  font-weight: 600;
}

.source-comparison td:nth-child(5) {
  background: rgba(49, 91, 69, 0.08);
}

.info-dialog {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0;
  max-width: 560px;
  width: 90vw;
  background: white;
  color: var(--ink);
}

.info-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.info-dialog[open] {
  display: block;
}

.info-dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.info-dialog h2 {
  margin: 0;
  font-size: 1.2rem;
}

.info-dialog .close {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.info-dialog ol {
  padding: 1.25rem 2.5rem;
  margin: 0;
  line-height: 1.6;
}

.info-dialog .fine-print {
  padding: 0 1.25rem 1.25rem;
  margin: 0;
  color: var(--muted);
}

.how-it-works-open {
  align-self: flex-start;
}

.page-head .how-it-works-open {
  margin-right: 12px;
}

@media (max-width: 700px) {
  .scan-grid,
  .product-head {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .product-head img {
    max-height: 240px;
  }

  .nutrition-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .add-to-meal form {
    grid-template-columns: 1fr;
  }

  .scanner {
    padding: 18px;
  }
}

.creation-head {
  max-width: 720px;
  margin-bottom: 2rem;
}

.creation-head h1 {
  margin: 0.15rem 0;
}

.creation-head > p:last-child {
  font-size: 1.2rem;
  color: var(--muted);
}

.creation-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  max-width: 900px;
}

.creation-option {
  display: grid;
  gap: 0.55rem;
  min-height: 180px;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.28);
  color: var(--ink);
  text-decoration: none;
}

.creation-option:hover,
.creation-option:focus-visible {
  border-color: var(--green);
  box-shadow: inset 0 0 0 2px var(--green);
  background: rgba(49, 91, 69, 0.06);
}

.creation-option strong {
  font-family: Georgia, serif;
  font-size: 1.65rem;
  color: var(--green);
}

.creation-option span {
  color: var(--muted);
}

.creation-manual {
  display: grid;
  gap: 0.2rem;
  margin-top: 1.75rem;
}

.creation-manual a {
  font-weight: 700;
}

.creation-manual span {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 700px) {
  .creation-options {
    grid-template-columns: 1fr;
  }

  .creation-option {
    min-height: 150px;
    padding: 1.5rem;
  }
}
