:root {
  --scanner-ink: #171712;
  --scanner-muted: #68675f;
  --scanner-paper: #f4f0e6;
  --scanner-card: #fffdf7;
  --scanner-line: #d9d2c2;
  --scanner-yellow: #f5dd31;
  --scanner-yellow-deep: #cfb914;
  --scanner-olive: #8f8618;
  --scanner-good: #246944;
  --scanner-error: #a9362c;
  --scanner-shadow: 0 24px 70px rgba(43, 39, 25, .1);
  --scanner-radius: 28px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  color: var(--scanner-ink);
  background:
    radial-gradient(circle at 8% 5%, rgba(245, 221, 49, .16), transparent 23rem),
    linear-gradient(180deg, #f9f6ef 0, var(--scanner-paper) 72%, #ece7dc 100%);
  font-family: "Barlow", sans-serif;
  font-size: 18px;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .18;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 16px;
  color: #000;
  background: var(--scanner-yellow);
  border-radius: 10px;
  transform: translateY(-150%);
}

.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 {
  padding: 18px 0;
  border-bottom: 1px solid rgba(72, 68, 51, .14);
  background: rgba(249, 246, 239, .87);
  backdrop-filter: blur(16px);
}

.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; text-decoration: none; }
.brand-mark { display: inline-flex; width: 64px; height: 64px; align-items: center; justify-content: center; overflow: hidden; background: #12120f; border-radius: 16px; }
.brand img { display: block; width: 100%; height: 100%; object-fit: contain; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 800;
  text-decoration: none;
}

.back-link span { color: var(--scanner-olive); }
.back-link:hover, .back-link:focus-visible { text-decoration: underline; text-underline-offset: 5px; }

.intro { padding: 76px 0 44px; text-align: center; }
.app-identity {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 13px;
  margin: 0 auto 20px;
  color: #45433b;
  font-family: "Barlow Condensed", sans-serif;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.app-identity img {
  display: block;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(23, 23, 18, .16);
  border-radius: 20px;
  box-shadow: 0 14px 30px rgba(35, 32, 18, .17);
}
.eyebrow, .step-kicker {
  margin: 0 0 10px;
  color: #5d5707;
  font-family: "Barlow Condensed", sans-serif;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  padding: 8px 13px;
  background: var(--scanner-yellow);
  border-radius: 9px 16px 9px 16px;
  transform: rotate(-1deg);
}

.intro h1 {
  max-width: 860px;
  margin: 22px auto 14px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(3.4rem, 8vw, 6.7rem);
  font-weight: 800;
  line-height: .86;
  letter-spacing: -.035em;
  text-transform: uppercase;
}

.intro h1 span { color: var(--scanner-olive); }
.intro-copy { max-width: 670px; margin: 0 auto; color: #4d4c46; font-size: clamp(1.08rem, 2vw, 1.35rem); }

.intro-points { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 22px; margin-top: 24px; }
.intro-points span { display: inline-flex; align-items: center; gap: 9px; font-size: .9rem; font-weight: 700; }
.intro-points span::before { content: "✓"; display: grid; width: 23px; height: 23px; place-items: center; color: #16160d; background: var(--scanner-yellow); border-radius: 50%; font-size: .73rem; font-weight: 900; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 24px; align-items: start; padding-bottom: 80px; }
.workspace > *, .scanner-card, .scan-progress, .step-heading > div { min-width: 0; }
.scanner-card, .guidance-card, .results { border: 1px solid var(--scanner-line); background: var(--scanner-card); box-shadow: var(--scanner-shadow); }
.scanner-card { padding: clamp(24px, 4vw, 44px); border-radius: var(--scanner-radius); }
.scan-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}
.scan-progress li { position: relative; display: flex; align-items: center; gap: 8px; color: #918d80; font-size: .72rem; }
.scan-progress li:not(:last-child)::after { content: ""; position: absolute; right: 3px; left: 40px; bottom: -7px; height: 2px; background: #ded8ca; }
.scan-progress span { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid #c9c2b2; border-radius: 50%; background: #f6f2e9; font-size: .72rem; font-weight: 800; }
.scan-progress b { font-weight: 800; }
.scan-progress li.is-complete, .scan-progress li.is-active { color: var(--scanner-ink); }
.scan-progress li.is-complete span { border-color: #918a22; background: #fff8a7; }
.scan-progress li.is-active span { border-color: var(--scanner-yellow); background: var(--scanner-yellow); box-shadow: 0 0 0 5px rgba(245, 221, 49, .17); }
.scan-progress li.is-complete:not(:last-child)::after { background: var(--scanner-yellow-deep); }
.step-heading { display: flex; align-items: center; gap: 15px; margin-bottom: 24px; }
.step-number { display: grid; flex: 0 0 48px; height: 48px; place-items: center; color: #181810; background: var(--scanner-yellow); border-radius: 13px; font-family: "Barlow Condensed", sans-serif; font-size: 1.15rem; font-weight: 800; }
.step-heading h2, .guidance-content h2, .results-header h2 { margin: 0; font-family: "Barlow Condensed", sans-serif; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; line-height: .98; text-transform: uppercase; }
.step-heading .step-kicker { margin-bottom: 2px; }

.upload-zone { overflow: hidden; border: 2px dashed #bbb39f; border-radius: 22px; background: #f8f5ec; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.upload-zone.is-dragging { border-color: var(--scanner-olive); background: #fffce6; transform: translateY(-2px); }
.upload-empty { padding: clamp(28px, 6vw, 54px) 24px; text-align: center; }
.camera-icon { display: grid; width: 66px; height: 66px; margin: 0 auto 18px; place-items: center; background: var(--scanner-yellow); border-radius: 20px; transform: rotate(-3deg); }
.camera-icon svg { width: 32px; fill: var(--scanner-ink); }
.upload-empty > strong { display: block; font-size: 1.15rem; }
.upload-empty > p { max-width: 470px; margin: 7px auto 0; color: var(--scanner-muted); font-size: .92rem; }
.upload-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 23px 0 0; }
.upload-empty .file-help { margin-top: 15px; font-size: .76rem; }

.button {
  position: relative;
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 21px;
  border: 1px solid transparent;
  border-radius: 15px;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:focus-visible, .text-button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .assumption-toggle:focus-visible { outline: 3px solid rgba(143, 134, 24, .32); outline-offset: 3px; }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button-primary { color: #17170f; background: var(--scanner-yellow); box-shadow: 0 13px 30px rgba(207, 185, 20, .22); }
.button-primary:hover:not(:disabled) { background: #ffe957; box-shadow: 0 16px 34px rgba(207, 185, 20, .3); }
.button-secondary { border-color: #aaa38f; background: transparent; box-shadow: none; }
.button-secondary:hover:not(:disabled) { border-color: var(--scanner-ink); background: #fff; }
.button-small { min-height: 43px; padding-inline: 16px; font-size: .9rem; }
.button-arrow { display: grid; width: 28px; height: 28px; place-items: center; background: rgba(0, 0, 0, .82); border-radius: 50%; color: #fff45e; }

.preview-panel { position: relative; background: #171712; }
.preview-panel img { display: block; width: 100%; height: min(52vw, 470px); min-height: 300px; object-fit: contain; background: #171712; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; color: #fff; background: #171712; }
.preview-bar strong, .preview-bar span { display: block; }
.preview-bar strong { overflow: hidden; max-width: 430px; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.preview-bar span { margin-top: 2px; color: #bbbbae; font-size: .75rem; }
.text-button { min-height: 44px; padding: 0; border: 0; color: #fff45e; background: transparent; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; white-space: nowrap; }
.text-button-dark { color: #625b00; }

.photo-quality { display: flex; align-items: flex-start; gap: 10px; margin-top: 13px; padding: 11px 13px; border: 1px solid #b9d4c3; border-radius: 12px; color: #1f5b3b; background: #f0f9f3; font-size: .76rem; line-height: 1.4; }
.photo-quality::before { content: "✓"; display: grid; flex: 0 0 23px; height: 23px; place-items: center; border-radius: 50%; color: #fff; background: var(--scanner-good); font-weight: 900; }
.photo-quality.is-warning { color: #655900; border-color: #ded06d; background: #fffbe4; }
.photo-quality.is-warning::before { content: "!"; background: #a28e0f; }

.scan-choice { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--scanner-line); }
.scan-choice-heading h2, .details-heading-row h2 { margin: 0; font-family: "Barlow Condensed", sans-serif; font-size: 1.75rem; line-height: 1; text-transform: uppercase; }
.scan-choice-heading .step-kicker, .details-heading-row .step-kicker { margin-bottom: 4px; }
.scan-choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 17px; }
.scan-choice-card { display: flex; min-height: 176px; align-items: flex-start; flex-direction: column; padding: 18px; border: 1px solid #c9c1af; border-radius: 18px; color: var(--scanner-ink); background: #faf7ef; text-align: left; cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.scan-choice-card:hover { transform: translateY(-3px); border-color: #817900; box-shadow: 0 14px 26px rgba(56, 51, 27, .09); }
.scan-choice-card:focus-visible, .choice-chips button:focus-visible { outline: 3px solid rgba(143, 134, 24, .32); outline-offset: 3px; }
.scan-choice-card.is-primary { border-color: #d8c20f; background: linear-gradient(145deg, #fffdf1, #fff9b8); }
.scan-choice-card .choice-time { padding: 4px 8px; border-radius: 999px; color: #5a5300; background: rgba(245, 221, 49, .55); font-size: .62rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.scan-choice-card strong { margin-top: 13px; font-family: "Barlow Condensed", sans-serif; font-size: 1.25rem; text-transform: uppercase; }
.scan-choice-card small { margin-top: 4px; color: var(--scanner-muted); font-size: .75rem; line-height: 1.45; }
.scan-choice-card em { margin-top: auto; padding-top: 16px; color: #595200; font-size: .72rem; font-style: normal; font-weight: 800; text-transform: uppercase; }
.scan-choice-privacy { margin: 12px 2px 0; color: var(--scanner-muted); font-size: .68rem; line-height: 1.45; }

.details-block { display: grid; gap: 25px; margin-top: 30px; }
.details-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--scanner-line); }
.field-group label, .portion-field legend { display: block; margin-bottom: 9px; font-weight: 800; }
.field-group label span, .portion-field legend span { color: var(--scanner-muted); font-size: .78rem; font-weight: 500; }
textarea { width: 100%; min-height: 120px; padding: 15px 16px; resize: vertical; color: var(--scanner-ink); border: 1px solid #bcb5a3; border-radius: 14px; background: #fff; }
textarea::placeholder { color: #8a887f; }
.field-hint { margin: 8px 0 0; color: var(--scanner-muted); font-size: .8rem; }
.portion-field { margin: 0; padding: 0; border: 0; }
.segmented-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 5px; border: 1px solid #c2bbaa; border-radius: 15px; background: #f1ede4; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span { display: grid; min-height: 44px; place-items: center; border-radius: 10px; color: #59584f; font-weight: 700; cursor: pointer; }
.segmented-control input:checked + span { color: var(--scanner-ink); background: #fff; box-shadow: 0 3px 13px rgba(32, 31, 24, .1); }
.segmented-control input:focus-visible + span { outline: 3px solid rgba(143, 134, 24, .32); }
.quick-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.quick-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.quick-field-wide { grid-column: 1 / -1; }
.quick-field legend { margin-bottom: 8px; font-size: .78rem; font-weight: 800; }
.quick-field legend span { color: var(--scanner-muted); font-size: .68rem; font-weight: 500; }
.choice-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.choice-chips button { min-height: 39px; padding: 7px 12px; border: 1px solid #bbb4a2; border-radius: 999px; color: #4f4d45; background: #fff; font-size: .72rem; font-weight: 700; cursor: pointer; }
.choice-chips button:hover { border-color: #817900; }
.choice-chips button.is-selected { color: #17170f; border-color: #c6b10d; background: #fff47b; box-shadow: 0 4px 12px rgba(165, 146, 7, .15); }

.precision-details {
  overflow: hidden;
  border: 1px solid #cfc7b5;
  border-radius: 18px;
  background: #f8f5ed;
}
.precision-details > summary {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}
.precision-details > summary::-webkit-details-marker { display: none; }
.precision-details > summary::after {
  content: "+";
  display: grid;
  flex: 0 0 34px;
  height: 34px;
  place-items: center;
  color: #19190e;
  background: var(--scanner-yellow);
  border-radius: 50%;
  font-size: 1.3rem;
  font-weight: 800;
}
.precision-details[open] > summary::after { content: "−"; }
.precision-details > summary span { display: grid; gap: 2px; }
.precision-details > summary b { font-size: .95rem; }
.precision-details > summary small { color: var(--scanner-muted); font-size: .75rem; font-weight: 500; }
.precision-details > summary em {
  margin-left: auto;
  padding: 6px 9px;
  color: #5b5506;
  background: #fff9bd;
  border-radius: 999px;
  font-size: .68rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}
.precision-content { display: grid; gap: 0; border-top: 1px solid #d8d0bf; }
.precision-progress { display: grid; gap: 11px; padding: 18px 18px 0; }
.precision-progress-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.precision-progress-copy span {
  color: #706d63;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.precision-progress-copy strong { font-size: .82rem; }
.precision-progress-track { overflow: hidden; height: 7px; background: #e2dccd; border-radius: 999px; }
.precision-progress-track span { display: block; width: 25%; height: 100%; background: var(--scanner-yellow); border-radius: inherit; transition: width .25s ease; }
.precision-section { min-height: 250px; padding: 22px 18px; }
.precision-step { animation: precision-step-in .22s ease both; }
@keyframes precision-step-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
.precision-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 17px; }
.precision-heading > span {
  display: grid;
  flex: 0 0 32px;
  height: 32px;
  place-items: center;
  color: #19190e;
  background: var(--scanner-yellow);
  border-radius: 9px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: .82rem;
  font-weight: 800;
}
.precision-heading h3 { margin: 0; font-size: 1rem; line-height: 1.2; }
.precision-heading p { margin: 3px 0 0; color: var(--scanner-muted); font-size: .75rem; }
.aux-upload-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.aux-upload-card { display: flex; min-height: 170px; align-items: flex-start; flex-direction: column; padding: 15px; border: 1px dashed #bdb5a2; border-radius: 14px; background: #fffdf8; }
.aux-upload-card strong { font-size: .86rem; }
.aux-upload-card p { margin: 4px 0 14px; color: var(--scanner-muted); font-size: .72rem; line-height: 1.45; }
.aux-upload-card .button { width: 100%; margin-top: auto; }
.aux-preview-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.aux-preview { position: relative; overflow: hidden; min-height: 132px; border: 1px solid #cfc8b8; border-radius: 13px; background: #1a1a16; }
.aux-preview img { display: block; width: 100%; height: 100px; object-fit: cover; }
.aux-preview footer { display: flex; min-height: 32px; align-items: center; justify-content: space-between; gap: 4px; padding: 5px 7px; color: #f5f2e9; background: #1a1a16; }
.aux-preview footer span { overflow: hidden; font-size: .62rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.aux-remove { display: grid; flex: 0 0 28px; height: 28px; place-items: center; padding: 0; border: 0; color: #171712; background: var(--scanner-yellow); border-radius: 50%; cursor: pointer; font-weight: 900; }
.optional-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.optional-grid.single-column { grid-template-columns: 1fr; }
.compact-field { display: grid; align-content: start; gap: 6px; }
.compact-field > span:first-child { color: #4d4b43; font-size: .72rem; font-weight: 800; }
.compact-field input, .compact-field select, .compact-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--scanner-ink);
  border: 1px solid #bcb5a3;
  border-radius: 11px;
  background: #fff;
}
.compact-field textarea { min-height: 86px; }
.unit-input { position: relative; display: block; }
.unit-input input { padding-right: 44px; }
.unit-input em { position: absolute; right: 12px; top: 50%; color: #76736a; font-size: .72rem; font-style: normal; transform: translateY(-50%); }
.precision-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 16px 18px 18px;
  border-top: 1px solid #ddd6c6;
  background: #f3efe5;
}
.precision-actions .button { min-width: 112px; }
.precision-skip {
  min-height: 43px;
  padding: 5px 10px;
  color: #656258;
  border: 0;
  background: transparent;
  font-size: .75rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.precision-skip:hover:not(:disabled) { color: var(--scanner-ink); }
.precision-skip:focus-visible { outline: 3px solid rgba(143, 134, 24, .32); outline-offset: 2px; }
.precision-skip:disabled { cursor: not-allowed; opacity: .5; }

.privacy-note { display: flex; gap: 12px; margin-top: 28px; padding: 16px; border: 1px solid #dad3c1; border-radius: 14px; background: #f7f3e9; }
.privacy-icon { display: grid; flex: 0 0 25px; height: 25px; place-items: center; color: #fff; background: #5e5c53; border-radius: 50%; font-family: Georgia, serif; font-size: .82rem; font-weight: 700; }
.privacy-note p { margin: 0; color: #615f56; font-size: .75rem; line-height: 1.55; }
.button-analyze { width: 100%; min-height: 62px; margin-top: 18px; font-size: 1.05rem; }
.spinner { display: none; width: 20px; height: 20px; border: 2px solid rgba(0, 0, 0, .22); border-top-color: #111; border-radius: 50%; animation: spin .8s linear infinite; }
.button-analyze.is-loading .spinner { display: block; }
.button-analyze.is-loading .button-arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.status-message { min-height: 0; margin-top: 0; border-radius: 13px; font-size: .86rem; }
.status-message:not(:empty) { min-height: 50px; margin-top: 14px; padding: 13px 15px; }
.status-message.error { color: #7d241e; border: 1px solid #e8b6b0; background: #fff0ee; }
.status-message.success { color: #174f31; border: 1px solid #abd2bc; background: #effaf3; }
.status-message.info { color: #504a09; border: 1px solid #d7cb60; background: #fffbe2; }

.guidance-card { position: sticky; top: 24px; overflow: hidden; border-radius: var(--scanner-radius); }
.guidance-visual { position: relative; display: grid; height: 340px; place-items: center; overflow: hidden; background: #1c1c17; }
.guidance-visual::before { content: ""; position: absolute; width: 290px; height: 290px; border-radius: 50%; background: radial-gradient(circle, rgba(245, 221, 49, .3), transparent 66%); }
.plate { position: relative; width: 220px; aspect-ratio: 1; border: 20px solid #eee9dc; border-radius: 50%; background: #c8bfae; box-shadow: 0 25px 50px rgba(0, 0, 0, .35), inset 0 0 0 2px #aca28f; transform: rotate(-7deg); }
.food { position: absolute; display: block; box-shadow: inset 0 -6px 14px rgba(0, 0, 0, .15); }
.food-a { width: 72px; height: 96px; top: 26px; left: 24px; border-radius: 42% 58% 47% 53%; background: #b86931; transform: rotate(18deg); }
.food-b { width: 78px; height: 70px; right: 13px; top: 34px; border-radius: 50%; background: repeating-radial-gradient(circle at 25% 35%, #e4c753 0 8px, #cbac37 9px 14px); }
.food-c { width: 95px; height: 58px; right: 20px; bottom: 20px; border-radius: 50%; background: radial-gradient(circle at 25% 30%, #9cc859 0 6px, transparent 7px), radial-gradient(circle at 55% 60%, #6d9f3f 0 8px, transparent 9px), #4f8c38; }
.scan-corner { position: absolute; z-index: 2; width: 48px; height: 48px; border-color: var(--scanner-yellow); border-style: solid; }
.corner-a { top: 28px; left: 28px; border-width: 3px 0 0 3px; }
.corner-b { top: 28px; right: 28px; border-width: 3px 3px 0 0; }
.corner-c { bottom: 28px; left: 28px; border-width: 0 0 3px 3px; }
.corner-d { right: 28px; bottom: 28px; border-width: 0 3px 3px 0; }
.guidance-content { padding: 30px; }
.guidance-content ol { display: grid; gap: 18px; margin: 25px 0; padding: 0; list-style: none; }
.guidance-content li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: center; color: #424139; font-size: .9rem; }
.guidance-content li span { display: grid; width: 32px; height: 32px; place-items: center; background: #f2eddc; border-radius: 9px; font-weight: 800; }
.guidance-small { margin: 0; padding-top: 18px; border-top: 1px solid var(--scanner-line); color: var(--scanner-muted); font-size: .78rem; }

.results { margin-bottom: 80px; padding: clamp(24px, 4vw, 44px); border-radius: var(--scanner-radius); scroll-margin-top: 30px; }
.results-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.meal-name { margin: 7px 0 0; color: var(--scanner-muted); }
.estimate-quality { display: flex; align-items: center; gap: 15px; margin: -6px 0 22px; padding: 14px 16px; border: 1px solid #d8d0bb; border-radius: 15px; background: #f8f4e8; }
.estimate-quality > span { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; color: #453f00; background: #fff47b; font-size: .66rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.estimate-quality strong { display: block; font-size: .85rem; }
.estimate-quality p { margin: 2px 0 0; color: var(--scanner-muted); font-size: .72rem; }
.follow-up-panel { margin: 0 0 22px; padding: 20px; border: 1px solid #d6c62d; border-radius: 19px; background: #fffbe2; }
.follow-up-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.follow-up-heading .step-kicker { margin-bottom: 3px; }
.follow-up-heading h3 { margin: 0; font-family: "Barlow Condensed", sans-serif; font-size: 1.55rem; line-height: 1; text-transform: uppercase; }
.follow-up-heading p:not(.step-kicker) { margin: 6px 0 0; color: #66614a; font-size: .78rem; }
.follow-up-questions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 17px; }
.follow-up-question { min-width: 0; margin: 0; padding: 13px; border: 1px solid #d8d0b4; border-radius: 14px; background: rgba(255,255,255,.68); }
.follow-up-question legend { display: flex; align-items: center; gap: 8px; padding: 0 2px; font-size: .73rem; font-weight: 800; line-height: 1.3; }
.follow-up-question legend span { display: grid; flex: 0 0 23px; height: 23px; place-items: center; border-radius: 7px; background: var(--scanner-yellow); font-size: .66rem; }
.follow-up-options { display: grid; gap: 6px; margin-top: 10px; }
.follow-up-options label { position: relative; }
.follow-up-options input { position: absolute; opacity: 0; pointer-events: none; }
.follow-up-options span { display: flex; min-height: 38px; align-items: center; padding: 7px 10px; border: 1px solid #c7bfaa; border-radius: 10px; background: #fff; font-size: .72rem; font-weight: 700; cursor: pointer; }
.follow-up-options input:checked + span { color: #17170f; border-color: #a89500; background: #fff36d; box-shadow: inset 0 0 0 1px #c3ad00; }
.follow-up-options input:focus-visible + span { outline: 3px solid rgba(143,134,24,.32); outline-offset: 2px; }
.follow-up-actions { display: flex; align-items: center; gap: 14px; margin-top: 15px; }
.follow-up-actions small { color: #777158; font-size: .67rem; }
.macro-summary { display: grid; grid-template-columns: 1.55fr repeat(3, 1fr); gap: 12px; }
.calorie-card, .macro-card { min-height: 145px; padding: 22px; border: 1px solid #d8d1bf; border-radius: 19px; background: #f7f3e8; }
.calorie-card { color: #fff; border-color: #1b1b16; background: #1b1b16; }
.calorie-card > span, .macro-card > span { display: block; color: #77756b; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.calorie-card > span { color: #cfcec2; }
.calorie-card div { display: flex; align-items: baseline; gap: 8px; margin-top: 5px; }
.calorie-card strong { color: #fff15a; font-family: "Barlow Condensed", sans-serif; font-size: 3.4rem; line-height: 1; }
.calorie-card em { font-style: normal; font-weight: 800; }
.calorie-card p { margin: 10px 0 0; color: #cfcec2; font-size: .78rem; }
.macro-card { display: flex; flex-direction: column; justify-content: space-between; }
.macro-card strong { font-family: "Barlow Condensed", sans-serif; font-size: 2rem; line-height: 1; }
.macro-card strong b { font-size: 2.8rem; }
.macro-card.protein { border-top: 5px solid #cf8d3f; }
.macro-card.carbs { border-top: 5px solid #8f8618; }
.macro-card.fat { border-top: 5px solid #4f6d67; }

.daily-goal-panel { margin-top: 16px; padding: 18px 20px; border: 1px solid #d6cfbe; border-radius: 18px; background: #f7f3e8; }
.daily-goal-panel.has-goal { border-color: #c6b92d; background: #fffce8; }
.daily-goal-empty, .daily-goal-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.daily-goal-panel h3 { margin: 2px 0 0; font-family: "Barlow Condensed", sans-serif; font-size: 1.35rem; line-height: 1; text-transform: uppercase; }
.daily-goal-panel p { margin: 5px 0 0; color: var(--scanner-muted); font-size: .76rem; }
.goal-label { color: #6e6600; font-size: .65rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.daily-goal-heading a { flex: 0 0 auto; color: #615a00; font-size: .72rem; font-weight: 800; text-underline-offset: 4px; }
.goal-progress-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 15px; }
.goal-progress { min-width: 0; }
.goal-progress > span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: #565247; font-size: .65rem; }
.goal-progress b { color: var(--scanner-ink); font-size: .7rem; }
.goal-progress em { overflow: hidden; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.goal-progress > div { height: 8px; margin-top: 5px; overflow: hidden; border-radius: 999px; background: #ded8c7; }
.goal-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: #8f8618; transition: width .25s ease; }
.goal-progress-kcal i { background: var(--scanner-yellow-deep); }

.assumption-panel { margin-top: 18px; overflow: hidden; border: 1px solid #d4ca64; border-radius: 16px; background: #fffbe1; }
.assumption-toggle { display: flex; width: 100%; min-height: 70px; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 18px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.assumption-toggle b, .assumption-toggle small { display: block; }
.assumption-toggle small { margin-top: 2px; color: #6a6650; }
.assumption-toggle > span:last-child { font-size: 1.5rem; transition: transform .2s ease; }
.assumption-toggle[aria-expanded="true"] > span:last-child { transform: rotate(45deg); }
.assumption-panel ul { margin: 0; padding: 0 24px 20px 44px; color: #4d4a38; font-size: .86rem; }
.assumption-panel li + li { margin-top: 6px; }

.ingredients-panel { margin-top: 26px; }
.ingredients-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 15px; }
.ingredients-heading h3 { margin: 0; font-family: "Barlow Condensed", sans-serif; font-size: 1.6rem; text-transform: uppercase; }
.ingredients-heading p { max-width: 760px; margin: 4px 0 0; color: var(--scanner-muted); font-size: .8rem; }
.ingredient-heading-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ingredient-list { display: grid; gap: 10px; }
.ingredient-row { display: grid; grid-template-columns: minmax(170px, 1.4fr) 156px 145px 115px auto; gap: 10px; align-items: end; padding: 16px; border: 1px solid var(--scanner-line); border-radius: 17px; background: #faf7ef; }
.ingredient-row.is-dirty { border-color: #b9a900; background: #fffce8; }
.ingredient-field label { display: block; margin-bottom: 5px; color: #777469; font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.ingredient-field input, .ingredient-field select { width: 100%; min-height: 44px; padding: 8px 10px; color: var(--scanner-ink); border: 1px solid #bbb4a2; border-radius: 10px; background: #fff; }
.ingredient-amount-wrap { position: relative; }
.ingredient-amount-wrap input { padding-right: 32px; }
.ingredient-amount-wrap span { position: absolute; right: 10px; top: 50%; color: #77746a; font-size: .78rem; transform: translateY(-50%); }
.amount-shortcuts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 5px; }
.amount-shortcuts button { min-width: 0; min-height: 29px; padding: 0 3px; border: 1px solid #cec6b4; border-radius: 8px; color: #5d594e; background: #fff; font-size: .64rem; font-weight: 800; cursor: pointer; }
.amount-shortcuts button:hover { color: #17170f; border-color: #a89819; background: #fff9b7; }
.ingredient-values { align-self: center; text-align: right; }
.ingredient-values strong, .ingredient-values span { display: block; }
.ingredient-values strong { font-family: "Barlow Condensed", sans-serif; font-size: 1.35rem; }
.ingredient-values span { color: var(--scanner-muted); font-size: .7rem; }
.ingredient-source { max-width: 180px; margin-top: 4px; color: #767368; font-size: .63rem; line-height: 1.25; }
.ingredient-assumption { grid-column: 1 / -1; margin: 1px 0 0; padding: 8px 10px; border-radius: 9px; color: #665d00; background: #fff8bf; font-size: .68rem; line-height: 1.4; }
.ingredient-actions { display: flex; align-self: center; gap: 7px; }
.icon-button { display: grid; width: 43px; height: 43px; place-items: center; border: 1px solid #bdb6a4; border-radius: 11px; background: #fff; cursor: pointer; }
.icon-button:hover { border-color: var(--scanner-ink); }
.icon-button.remove { color: #8d2c25; }
.icon-button.lookup { width: auto; padding: 0 12px; color: #4b4600; border-color: #bbae22; background: #fffbd1; font-size: .73rem; font-weight: 800; }
.icon-button[disabled] { cursor: wait; opacity: .55; }
.row-message { grid-column: 1 / -1; margin: 0; color: var(--scanner-error); font-size: .75rem; }
.source-warning { color: #856c00; }
.undo-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; padding: 12px 14px; border-radius: 12px; color: #efeee6; background: #25251f; font-size: .78rem; }
.undo-bar button { min-height: 36px; padding: 0 12px; border: 1px solid #eee45c; border-radius: 9px; color: #fff45e; background: transparent; font-weight: 800; cursor: pointer; }

.disclaimer { display: flex; gap: 20px; margin-top: 24px; padding: 18px 20px; border-left: 5px solid var(--scanner-yellow); background: #efeadf; }
.disclaimer strong { white-space: nowrap; }
.disclaimer p { margin: 0; color: #5b5951; }
.result-coaching-cta { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 22px; padding: 24px; border-radius: 20px; color: #fff; background: #1a1a16; }
.result-coaching-cta > div { max-width: 680px; }
.result-coaching-cta > div > span { color: var(--scanner-yellow); font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.result-coaching-cta h3 { margin: 7px 0 6px; color: #fff; font-family: "Barlow Condensed", sans-serif; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1; text-transform: uppercase; }
.result-coaching-cta p { margin: 0; color: #c8c6bc; font-size: .86rem; line-height: 1.55; }
.result-coaching-cta .button { flex: 0 0 auto; }
.result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.mobile-scan-bar { display: none; }

.scanner-footer { padding: 34px 0 max(34px, env(safe-area-inset-bottom)); color: #d8d6cc; background: #1a1a16; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.footer-row strong, .footer-row span { display: block; }
.footer-row span { margin-top: 4px; color: #aaa89f; font-size: .78rem; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-row a { color: #d8d6cc; font-size: .78rem; text-underline-offset: 4px; }
.noscript { padding: 16px; color: #fff; background: #8d2c25; text-align: center; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .guidance-card { position: static; display: grid; grid-template-columns: .82fr 1.18fr; }
  .guidance-visual { height: 100%; min-height: 330px; }
  .macro-summary { grid-template-columns: repeat(3, 1fr); }
  .calorie-card { grid-column: 1 / -1; }
  .ingredient-row { grid-template-columns: minmax(180px, 1fr) 120px 140px; }
  .ingredient-values { text-align: left; }
  .ingredient-actions { justify-self: end; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .shell { width: min(100% - 24px, 1180px); }
  .site-header { padding: 12px 0; }
  .brand-mark { width: 54px; height: 54px; border-radius: 13px; }
  .back-link { font-size: .8rem; }
  .intro { padding: 48px 0 30px; text-align: left; }
  .app-identity { margin-inline: 0; }
  .app-identity img { width: 68px; height: 68px; border-radius: 17px; }
  .intro h1 { max-width: 100%; margin-inline: 0; font-size: clamp(3.15rem, 16vw, 5rem); overflow-wrap: anywhere; white-space: normal; }
  .intro-copy { margin-left: 0; }
  .intro-points { justify-content: flex-start; gap: 8px 14px; }
  .intro-points span { font-size: .78rem; }
  .workspace { gap: 16px; padding-bottom: 50px; }
  .scanner-card, .results { padding: 20px; border-radius: 22px; }
  .step-number { flex-basis: 43px; height: 43px; }
  .upload-empty { padding: 31px 14px; }
  .upload-actions { display: grid; grid-template-columns: 1fr; }
  .upload-actions .button { width: 100%; }
  .preview-panel img { height: 66vw; min-height: 235px; }
  .preview-bar { align-items: flex-start; padding: 12px; }
  .preview-bar strong { max-width: 190px; }
  .segmented-control { grid-template-columns: 1fr; }
  .precision-details > summary { align-items: flex-start; flex-wrap: wrap; gap: 8px 12px; }
  .precision-details > summary em { order: 3; margin-left: 0; }
  .precision-details > summary::after { margin-left: auto; }
  .precision-section { min-height: 0; }
  .aux-upload-grid, .optional-grid { grid-template-columns: 1fr; }
  .aux-preview-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .precision-actions { grid-template-columns: 1fr 1fr; }
  .precision-actions .button { width: 100%; min-width: 0; }
  .precision-skip { grid-column: 1 / -1; grid-row: 2; }
  .scan-choice-grid { grid-template-columns: 1fr; }
  .scan-choice-card { min-height: 150px; }
  .quick-details { grid-template-columns: 1fr; }
  .quick-field-wide { grid-column: auto; }
  .privacy-note { align-items: flex-start; }
  .guidance-card { display: block; border-radius: 22px; }
  .guidance-visual { min-height: 250px; }
  .plate { width: 170px; border-width: 16px; }
  .food-a { width: 56px; height: 76px; }
  .food-b { width: 60px; height: 54px; }
  .food-c { width: 74px; height: 45px; }
  .guidance-content { padding: 24px 20px; }
  .results { margin-bottom: 50px; }
  .results-header { align-items: flex-start; }
  .results-header .button { display: none; }
  .estimate-quality { align-items: flex-start; flex-direction: column; gap: 9px; }
  .follow-up-heading, .daily-goal-empty, .daily-goal-heading { align-items: flex-start; flex-direction: column; }
  .follow-up-questions { grid-template-columns: 1fr; }
  .follow-up-actions { align-items: stretch; flex-direction: column; }
  .follow-up-actions .button { width: 100%; }
  .goal-progress-grid { grid-template-columns: 1fr 1fr; }
  .macro-summary { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .calorie-card, .macro-card { min-height: 116px; padding: 15px; border-radius: 15px; }
  .calorie-card strong { font-size: 3rem; }
  .macro-card strong { font-size: 1.25rem; }
  .macro-card strong b { font-size: 2rem; }
  .ingredients-heading { align-items: stretch; flex-direction: column; gap: 13px; }
  .ingredients-heading .button { width: 100%; }
  .ingredient-heading-actions { width: 100%; }
  .ingredient-heading-actions .button { flex: 1 1 100%; }
  .ingredient-row { grid-template-columns: minmax(0, 1fr) 105px; padding: 13px; }
  .ingredient-field.state { grid-column: 1 / 2; }
  .ingredient-values { grid-column: 2 / 3; grid-row: 2; }
  .ingredient-actions { grid-column: 1 / -1; width: 100%; justify-content: space-between; }
  .ingredient-actions .lookup { flex: 1; }
  .disclaimer { display: block; }
  .disclaimer p { margin-top: 5px; }
  .result-coaching-cta { align-items: stretch; flex-direction: column; padding: 22px 18px; }
  .result-coaching-cta .button { width: 100%; }
  .result-actions .button { width: 100%; }
  .footer-row { align-items: flex-start; flex-direction: column; }
  body.has-mobile-scan-bar { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  .mobile-scan-bar:not([hidden]) { position: fixed; right: 0; bottom: 0; left: 0; z-index: 70; display: block; padding: 10px 12px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(23, 23, 18, .14); background: rgba(255, 253, 247, .94); box-shadow: 0 -12px 30px rgba(30, 28, 18, .13); backdrop-filter: blur(14px); }
  .mobile-scan-bar .button { width: 100%; min-height: 56px; }
}

@media (max-width: 430px) {
  .nav-row { gap: 10px; }
  .back-link { max-width: 112px; text-align: right; line-height: 1.15; }
  .scan-progress b { display: none; }
  .scan-progress li { justify-content: center; }
  .scan-progress li:not(:last-child)::after { right: -18px; left: 58%; bottom: 50%; }
  .macro-summary { grid-template-columns: repeat(3, 1fr); }
  .calorie-card { grid-column: 1 / -1; }
  .macro-card { min-height: 90px; padding: 12px 8px; }
  .macro-card > span { font-size: .62rem; }
  .macro-card strong b { font-size: 1.75rem; }
  .ingredient-row { grid-template-columns: 1fr; }
  .ingredient-field, .ingredient-field.state, .ingredient-values, .ingredient-actions { grid-column: 1; grid-row: auto; }
  .ingredient-values { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .aux-preview-list { grid-template-columns: 1fr; }
  .precision-progress-copy { align-items: flex-start; flex-direction: column; gap: 2px; }
}

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