:root {
  --ink: #17231d;
  --muted: #657168;
  --forest: #193c2d;
  --forest-2: #2d5a43;
  --leaf: #b9d77c;
  --leaf-soft: #e7f0cf;
  --paper: #fffefa;
  --canvas: #f5f3eb;
  --line: #dcded3;
  --line-strong: #c7cbbd;
  --danger: #9f382d;
  --danger-soft: #fae7e2;
  --warning: #8a5a15;
  --warning-soft: #f8eed5;
  --success: #276448;
  --success-soft: #e0f0e7;
  --shadow: 0 24px 70px rgba(25, 60, 45, 0.10);
  --shadow-soft: 0 12px 34px rgba(25, 60, 45, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shell: min(1180px, calc(100% - 40px));
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 10% 6%, rgba(185, 215, 124, 0.24), transparent 26rem),
    var(--canvas);
  color: var(--ink);
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button,
a,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.site-header {
  border-bottom: 1px solid rgba(25, 60, 45, 0.10);
  background: rgba(245, 243, 235, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--forest);
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
}

.header-badge {
  padding: 7px 11px;
  border: 1px solid rgba(25, 60, 45, 0.16);
  border-radius: 999px;
  color: var(--forest-2);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero {
  min-height: 475px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  align-items: center;
  gap: 80px;
  padding-block: 74px 66px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--forest-2);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3.3rem, 7.4vw, 6.8rem);
  line-height: 0.92;
  letter-spacing: -0.072em;
  font-weight: 820;
}

.hero h1 span {
  color: var(--forest-2);
}

.hero-text {
  max-width: 650px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.14rem);
}

.hero-visual {
  position: relative;
  min-height: 360px;
  isolation: isolate;
}

.visual-card {
  position: absolute;
  width: min(390px, 90%);
  aspect-ratio: 1.18;
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.visual-card-back {
  right: 0;
  top: 32px;
  border: 1px solid rgba(25, 60, 45, 0.12);
  background: var(--leaf);
  transform: rotate(8deg);
}

.visual-card-front {
  left: 0;
  bottom: 4px;
  padding: 30px;
  border: 1px solid rgba(25, 60, 45, 0.12);
  background: var(--paper);
  transform: rotate(-4deg);
}

.visual-topline {
  width: 76px;
  height: 9px;
  border-radius: 999px;
  background: var(--forest);
  opacity: 0.16;
}

.visual-product {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 24px;
  margin-top: 38px;
}

.visual-package {
  width: 92px;
  height: 116px;
  border-radius: 17px 17px 12px 12px;
  background:
    linear-gradient(135deg, transparent 0 18px, rgba(255, 255, 255, 0.26) 18px 30px, transparent 30px),
    var(--forest-2);
  box-shadow: inset 0 -35px 0 rgba(0, 0, 0, 0.09);
}

.visual-line {
  height: 11px;
  border-radius: 999px;
  background: var(--ink);
}

.visual-line-long {
  width: 90%;
}

.visual-line-short {
  width: 55%;
  margin-top: 15px;
  opacity: 0.22;
}

.visual-scores {
  display: flex;
  gap: 9px;
  margin-top: 32px;
}

.visual-scores span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--leaf-soft);
  color: var(--forest);
  font-weight: 850;
}

.visual-scores span:nth-child(2) {
  background: #f8eed5;
  color: #7b4e0d;
}

.scan-corners {
  position: absolute;
  inset: 7% 4% auto auto;
  width: 118px;
  height: 118px;
  border-top: 4px solid var(--forest);
  border-right: 4px solid var(--forest);
  border-radius: 0 20px 0 0;
  z-index: 3;
}

.scan-corners::before,
.scan-corners::after {
  content: "";
  position: absolute;
  background: var(--forest);
  border-radius: 999px;
}

.scan-corners::before {
  width: 4px;
  height: 36px;
  top: -4px;
  left: 0;
}

.scan-corners::after {
  width: 36px;
  height: 4px;
  bottom: 0;
  right: -4px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.86fr) minmax(0, 1.14fr);
  align-items: start;
  gap: 24px;
  padding-bottom: 38px;
}

.card {
  border: 1px solid rgba(25, 60, 45, 0.12);
  border-radius: var(--radius-xl);
  background: rgba(255, 254, 250, 0.94);
  box-shadow: var(--shadow-soft);
}

.scanner-card,
.result-card {
  padding: clamp(20px, 3vw, 32px);
}

.scanner-card {
  position: sticky;
  top: 96px;
}

.section-heading,
.recent-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-heading h2,
.recent-heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.privacy-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
}

.privacy-chip svg {
  width: 16px;
  height: 16px;
}

.scanner-stage {
  position: relative;
  min-height: 310px;
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid rgba(25, 60, 45, 0.18);
  border-radius: 22px;
  background: #e8ebe1;
}

#reader {
  position: absolute;
  inset: 0;
  min-height: 100%;
  background: #17231d;
}

#reader video,
#reader img,
#reader canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 22px;
}

#reader__scan_region,
#reader__dashboard,
#reader__header_message {
  display: none !important;
}

.scanner-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55)),
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(25, 60, 45, 0.035) 12px 24px),
    #e8ebe1;
  color: var(--forest-2);
  text-align: center;
}

.scanner-placeholder svg {
  width: 64px;
  height: 64px;
  margin-bottom: 4px;
  opacity: 0.72;
}

.scanner-placeholder strong {
  font-size: 1.05rem;
}

.scanner-placeholder span {
  color: var(--muted);
  font-size: 0.87rem;
}

.scanner-frame {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 4;
  width: min(82%, 330px);
  aspect-ratio: 1.55;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.scanner-frame::before,
.scanner-frame::after,
.scanner-frame span::before,
.scanner-frame span::after {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border-color: var(--leaf);
  border-style: solid;
}

.scanner-frame::before {
  top: 0;
  left: 0;
  border-width: 3px 0 0 3px;
  border-radius: 12px 0 0 0;
}

.scanner-frame::after {
  top: 0;
  right: 0;
  border-width: 3px 3px 0 0;
  border-radius: 0 12px 0 0;
}

.scanner-frame span::before {
  bottom: 0;
  left: 0;
  border-width: 0 0 3px 3px;
  border-radius: 0 0 0 12px;
}

.scanner-frame span::after {
  right: 0;
  bottom: 0;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 12px 0;
}

.scanner-frame i {
  display: none;
}

.scanner-stage.is-scanning .scanner-frame i {
  position: absolute;
  inset: 50% 8px auto;
  display: block;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--leaf), transparent);
  box-shadow: 0 0 16px rgba(185, 215, 124, 0.7);
  animation: scan-line 2.1s ease-in-out infinite;
}

@keyframes scan-line {
  0%, 100% { transform: translateY(-78px); opacity: 0.55; }
  50% { transform: translateY(78px); opacity: 1; }
}

.scanner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 760;
  line-height: 1.1;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.button svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:focus-visible,
.text-button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(45, 90, 67, 0.28);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button-primary {
  background: var(--leaf);
  color: var(--forest);
  box-shadow: 0 8px 20px rgba(78, 111, 41, 0.12);
}

.button-primary:hover:not(:disabled) {
  background: #c6e18d;
}

.button-secondary {
  border-color: var(--line);
  background: var(--paper);
  color: var(--forest);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--line-strong);
  box-shadow: 0 7px 18px rgba(25, 60, 45, 0.07);
}

.button-dark {
  background: var(--forest);
  color: white;
  box-shadow: 0 8px 20px rgba(25, 60, 45, 0.16);
}

.button-dark:hover:not(:disabled) {
  background: #244d3a;
}

.file-button {
  user-select: none;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
  color: #8a928b;
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.manual-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.84rem;
  font-weight: 760;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.input-row input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: white;
  color: var(--ink);
}

.input-row input::placeholder {
  color: #929a93;
}

.field-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.status-message {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #edf0ea;
  color: var(--forest);
  font-size: 0.84rem;
}

.status-message.is-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-message.is-success {
  background: var(--success-soft);
  color: var(--success);
}

.result-card {
  min-height: 625px;
}

.text-button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--forest-2);
  cursor: pointer;
  font-weight: 760;
  text-decoration: underline;
  text-decoration-color: rgba(45, 90, 67, 0.3);
  text-underline-offset: 4px;
}

.empty-state,
.loading-state {
  min-height: 500px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 44px 24px;
  text-align: center;
}

.empty-icon {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 30px;
  background: var(--leaf-soft);
  color: var(--forest-2);
  transform: rotate(-3deg);
}

.empty-icon svg {
  width: 62px;
  height: 62px;
}

.empty-state h3 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.empty-state p {
  max-width: 430px;
  margin: 10px 0 0;
  color: var(--muted);
}

.empty-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.empty-tags span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.loading-state {
  gap: 7px;
  color: var(--muted);
}

.loading-state strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.spinner {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border: 4px solid var(--line);
  border-top-color: var(--forest-2);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.product-hero-panel {
  display: grid;
  grid-template-columns: 145px 1fr;
  align-items: center;
  gap: 24px;
  margin-top: 25px;
  padding: 22px;
  border-radius: 22px;
  background: #eef0e8;
}

.product-image-wrap {
  position: relative;
  width: 145px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 18px;
  background: white;
  box-shadow: inset 0 0 0 1px rgba(25, 60, 45, 0.08);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.image-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #8c968d;
}

.image-fallback svg {
  width: 58px;
  height: 58px;
}

.product-brand {
  margin: 0 0 3px;
  color: var(--forest-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-name {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.product-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.score-chip {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px 7px 12px;
  border: 1px solid rgba(25, 60, 45, 0.10);
  border-radius: 12px;
  background: var(--paper);
}

.score-chip small {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.score-chip strong {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #dde3dc;
  color: var(--forest);
  font-size: 0.92rem;
}

.score-chip.grade-a strong { background: #18864b; color: white; }
.score-chip.grade-b strong { background: #72a93c; color: white; }
.score-chip.grade-c strong { background: #e1be36; color: #332b0d; }
.score-chip.grade-d strong { background: #e7812f; color: white; }
.score-chip.grade-e strong { background: #c13e34; color: white; }
.score-chip.nova-1 strong { background: #299267; color: white; }
.score-chip.nova-2 strong { background: #82aa47; color: white; }
.score-chip.nova-3 strong { background: #dc9e35; color: white; }
.score-chip.nova-4 strong { background: #b94439; color: white; }

.data-completeness {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.completeness-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.79rem;
}

.completeness-label span {
  color: var(--muted);
}

.progress-track {
  height: 7px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e6df;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--forest-2);
}

.alert-panel {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-top: 14px;
  padding: 15px 17px;
  border: 1px solid rgba(159, 56, 45, 0.16);
  border-radius: 15px;
  background: var(--danger-soft);
  color: var(--danger);
}

.alert-icon {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  font-weight: 900;
}

.alert-panel strong {
  display: block;
}

.alert-panel p {
  margin: 2px 0 0;
  font-size: 0.86rem;
}

.quick-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.fact-chip,
.tag-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf0ea;
  color: var(--forest-2);
  font-size: 0.76rem;
  font-weight: 730;
}

.fact-chip::before {
  content: "•";
  font-size: 1rem;
  line-height: 0;
}

.fact-chip.is-positive {
  background: var(--success-soft);
  color: var(--success);
}

.fact-chip.is-negative {
  background: var(--danger-soft);
  color: var(--danger);
}

.fact-chip.is-neutral {
  background: var(--warning-soft);
  color: var(--warning);
}

.details-grid {
  margin-top: 16px;
}

.detail-section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.detail-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.detail-title span {
  color: #a3aaa3;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.detail-title h4 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.ingredients-text {
  margin: 0;
  color: #3f4c44;
  font-size: 0.92rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.tag-list span {
  background: var(--warning-soft);
  color: var(--warning);
}

.nutrition-head,
.nutrition-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(90px, 0.8fr) minmax(90px, 0.8fr);
  gap: 14px;
  align-items: center;
}

.nutrition-head {
  padding: 0 10px 8px;
  color: #89918a;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nutrition-head span:not(:first-child),
.nutrition-row span:not(:first-child) {
  text-align: right;
}

.nutrition-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.nutrition-row {
  min-height: 43px;
  padding: 8px 10px;
  background: white;
  font-size: 0.82rem;
}

.nutrition-row:nth-child(even) {
  background: #f6f7f3;
}

.nutrition-row + .nutrition-row {
  border-top: 1px solid #e9ebe5;
}

.nutrition-row strong {
  font-weight: 720;
}

.nutrition-row span {
  font-variant-numeric: tabular-nums;
}

.nutrition-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.facts-list {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.facts-list > div {
  display: grid;
  grid-template-columns: minmax(125px, 0.7fr) minmax(0, 1.3fr);
  gap: 16px;
  padding: 10px 12px;
  background: white;
  font-size: 0.82rem;
}

.facts-list > div:nth-child(even) {
  background: #f6f7f3;
}

.facts-list > div + div {
  border-top: 1px solid #e9ebe5;
}

.facts-list dt {
  color: var(--muted);
}

.facts-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 660;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 3px;
}

.data-note {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
}

.generic-panel {
  min-height: 470px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 35px 10px;
  text-align: center;
}

.generic-icon {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: var(--leaf-soft);
  color: var(--forest-2);
  font-size: 2rem;
  font-weight: 900;
}

.generic-panel.is-warning .generic-icon {
  background: var(--warning-soft);
  color: var(--warning);
}

.generic-panel h3 {
  margin: 18px 0 0;
  font-size: 1.4rem;
  letter-spacing: -0.035em;
}

.generic-panel p {
  max-width: 470px;
  margin: 9px auto 0;
  color: var(--muted);
}

.scanned-value {
  width: min(100%, 520px);
  margin-top: 20px;
  padding: 12px 14px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f3f5ef;
  color: #3e4b43;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  text-align: left;
}

.generic-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.recent-section {
  padding-block: 46px 56px;
}

.recent-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.recent-item {
  width: 100%;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 12px;
  border: 1px solid rgba(25, 60, 45, 0.12);
  border-radius: 16px;
  background: var(--paper);
  color: inherit;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 22px rgba(25, 60, 45, 0.05);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.recent-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.recent-thumb {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #edf0ea;
  color: var(--forest-2);
  font-weight: 850;
}

.recent-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.recent-copy {
  min-width: 0;
}

.recent-copy strong,
.recent-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-copy strong {
  font-size: 0.86rem;
}

.recent-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.recent-arrow {
  color: var(--forest-2);
  font-size: 1.2rem;
}

.info-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 68px;
  overflow: hidden;
  border: 1px solid rgba(25, 60, 45, 0.12);
  border-radius: 20px;
  background: var(--line);
  box-shadow: var(--shadow-soft);
}

.info-strip > div {
  padding: 20px;
  background: var(--paper);
}

.info-strip strong,
.info-strip span {
  display: block;
}

.info-strip strong {
  color: var(--forest);
  font-size: 0.8rem;
}

.info-strip span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
}

.site-footer {
  padding-block: 24px;
  border-top: 1px solid rgba(25, 60, 45, 0.12);
  color: var(--muted);
  font-size: 0.76rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.footer-inner a {
  color: var(--forest-2);
  font-weight: 720;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr 330px;
    gap: 38px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .scanner-card {
    position: static;
  }

  .result-card {
    min-height: 560px;
  }

  .recent-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --shell: min(100% - 24px, 700px);
  }

  .header-inner {
    min-height: 64px;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-block: 48px 42px;
  }

  .hero h1 {
    font-size: clamp(3.1rem, 15vw, 5rem);
  }

  .hero-visual {
    display: none;
  }

  .workspace {
    gap: 16px;
  }

  .card {
    border-radius: 22px;
  }

  .scanner-card,
  .result-card {
    padding: 20px;
  }

  .privacy-chip {
    display: none;
  }

  .scanner-stage {
    min-height: 280px;
  }

  .product-hero-panel {
    grid-template-columns: 112px 1fr;
    gap: 16px;
    padding: 16px;
  }

  .product-image-wrap {
    width: 112px;
  }

  .nutrition-head,
  .nutrition-row {
    grid-template-columns: minmax(100px, 1.1fr) minmax(78px, 0.8fr) minmax(78px, 0.8fr);
    gap: 8px;
  }

  .recent-list,
  .info-strip {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .header-badge {
    display: none;
  }

  .scanner-actions .button,
  .scanner-actions .file-button {
    flex: 1 1 calc(50% - 5px);
  }

  .scanner-actions .button-primary {
    flex-basis: 100%;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .input-row .button {
    width: 100%;
  }

  .product-hero-panel {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .product-image-wrap {
    width: 120px;
  }

  .nutrition-head {
    display: none;
  }

  .nutrition-row {
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    padding-block: 11px;
  }

  .nutrition-row strong {
    grid-row: span 2;
  }

  .nutrition-row span:not(:first-child) {
    text-align: right;
  }

  .nutrition-row span:nth-child(2)::before {
    content: "100 g/ml: ";
    color: var(--muted);
    font-size: 0.69rem;
  }

  .nutrition-row span:nth-child(3)::before {
    content: "Portion: ";
    color: var(--muted);
    font-size: 0.69rem;
  }

  .facts-list > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .result-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
