:root {
  --yellow: #ffe600; --red: #e4002b; --ink: #111111; --paper: #fffdf3; --card: #ffffff; --muted: #5d5a4e; --rule: #e6e1c9;
  --ww: #178841; --co: #e4002b; --al: #1f4e9c; --shadow: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ink: #f4f1e6; --paper: #15140f; --card: #1f1d16; --muted: #b3ae9c; --rule: #37342a; --shadow: #000; }
}
:root[data-theme="dark"] { --ink: #f4f1e6; --paper: #15140f; --card: #1f1d16; --muted: #b3ae9c; --rule: #37342a; --shadow: #000; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif; font-variant-numeric: tabular-nums; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.brand { font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; margin: 0; }

/* ---------- landing ---------- */
.landing { background: var(--yellow); color: #111; min-height: 100svh; padding: 36px 0 56px; }
.landing .wrap { position: relative; max-width: 720px; }
.sticker { display: inline-flex; align-items: center; justify-content: center; text-align: center; background: var(--red); color: #fff; font-weight: 800; border: 3px solid #111; border-radius: 50%; transform: rotate(-10deg); line-height: 1.05; letter-spacing: 0.01em; }
.sticker.big { width: 104px; height: 104px; font-size: 14px; padding: 10px; box-shadow: 4px 4px 0 #111; margin: 0 0 4px 6px; }
@media (min-width: 720px) { .sticker.big { position: absolute; right: 18px; top: -6px; width: 118px; height: 118px; font-size: 15px; margin: 0; } }
.landing .brand { font-size: clamp(54px, 13vw, 112px); margin-top: 16px; max-width: 8ch; }
.intro { font-size: clamp(18px, 2.4vw, 22px); font-weight: 500; max-width: 30ch; margin: 18px 0 30px; line-height: 1.3; }
.goals { display: grid; gap: 16px; }
.tag { background: #fff; border: 3px solid #111; border-radius: 16px; box-shadow: 6px 6px 0 #111; padding: 14px 18px 16px; }
.tag label { display: block; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: #111; }
.val { display: flex; align-items: baseline; gap: 12px; margin-top: 4px; }
.val .pre { font-weight: 600; color: #6b675a; font-size: 18px; }
.val input { font-size: clamp(52px, 12vw, 76px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; width: 2.3em; background: transparent; border: 0; padding: 0; color: #111; -moz-appearance: textfield; }
.val input::-webkit-outer-spin-button, .val input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.val input:focus { outline: none; }
.val input::placeholder { color: #e3dfc9; }
.val .unit { font-weight: 700; font-size: 22px; color: #6b675a; }
.tag:focus-within { box-shadow: 6px 6px 0 var(--red); }
fieldset.stores { border: 0; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
fieldset.stores legend { font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; padding: 0; }
.chip { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: 10px 16px; border: 3px solid #111; border-radius: 999px; background: #fff; color: #111; font-weight: 700; box-shadow: 4px 4px 0 #111; transition: transform .08s ease, box-shadow .08s ease; }
.chip input:checked + span { color: #fff; }
.chip.ww input:checked + span { background: var(--ww); }
.chip.co input:checked + span { background: var(--co); }
.chip.al input:checked + span { background: var(--al); }
.chip:active span, .chip input:focus-visible + span { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #111; }
.go { margin-top: 12px; justify-self: start; background: var(--red); color: #fff; border: 3px solid #111; border-radius: 999px; padding: 16px 28px; font-size: 20px; font-weight: 800; box-shadow: 6px 6px 0 #111; cursor: pointer; transition: transform .08s ease, box-shadow .08s ease; }
.go::after { content: " →"; }
.go:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 7px 7px 0 #111; }
.go:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: 2px 2px 0 #111; }
.go:disabled { background: #fff; color: #9a9680; cursor: not-allowed; box-shadow: 6px 6px 0 #c9c4a6; border-color: #c9c4a6; }
.fine { margin: 4px 0 0; color: #5d5a4e; font-weight: 500; }
.err { color: var(--red); font-weight: 700; }

/* ---------- results ---------- */
.results { padding: 22px 0 60px; }
.top { display: grid; gap: 10px 20px; align-items: center; padding-bottom: 18px; }
.brand.small { font-size: 30px; text-decoration: none; }
.title { margin: 0; font-size: clamp(22px, 3.4vw, 30px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.title mark { background: var(--yellow); color: #111; padding: 0 6px; border-radius: 6px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { display: inline-block; border: 3px solid var(--ink); border-radius: 999px; padding: 8px 14px; font-weight: 700; text-decoration: none; background: var(--card); color: var(--ink); cursor: pointer; box-shadow: 3px 3px 0 var(--shadow); font-size: 14px; transition: transform .08s ease, box-shadow .08s ease; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
.btn.pick { background: var(--yellow); color: #111; }
.tools select { font-size: 14px; font-weight: 600; background: var(--card); color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; padding: 8px 32px 8px 14px; appearance: none; -webkit-appearance: none; box-shadow: 3px 3px 0 var(--shadow);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='2.4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
@media (min-width: 760px) { .top { grid-template-columns: auto 1fr; } .tools { grid-column: 1 / -1; } }

.tiles { list-style: none; margin: 0; padding: 6px 0 0; display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { position: relative; background: var(--card); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 6px 6px 0 var(--shadow); animation: pop .32s ease both; animation-delay: calc(var(--i, 0) * 45ms); }
.tile.open { grid-column: 1 / -1; }
.tile.open .sticker.sm { display: none; }
.tile.nofit { opacity: 0.72; }
.tile.hit { animation: wobble .5s ease; box-shadow: 6px 6px 0 var(--red); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes wobble { 0% { transform: rotate(0); } 25% { transform: rotate(-1.5deg) scale(1.01); } 75% { transform: rotate(1.5deg) scale(1.01); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .tile { animation: none; } .tile.hit { animation: none; } }
.face { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; width: 100%; text-align: left; background: none; border: 0; padding: 18px 18px 16px; cursor: pointer; border-radius: 15px; }
.face .name { grid-column: 1; margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.face .meta { grid-column: 1; margin: 0; color: var(--muted); font-weight: 500; font-size: 14px; }
.face .macros { grid-column: 1; margin: 6px 0 0; font-weight: 700; font-size: 14px; }
.face .macros b { background: var(--yellow); color: #111; padding: 1px 6px; border-radius: 6px; margin-right: 6px; }
.pricetag { grid-column: 2; grid-row: 1 / 4; align-self: start; justify-self: end; background: var(--yellow); color: #111; border: 3px solid #111; border-radius: 12px; padding: 7px 10px 6px; text-align: center; line-height: 1; min-width: 84px; box-shadow: 3px 3px 0 #111; transform: rotate(3deg); }
.pricetag .d { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
.pricetag .c { font-size: 16px; font-weight: 800; vertical-align: top; position: relative; top: 2px; }
.pricetag .per { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }
.sticker.sm { position: absolute; bottom: -16px; right: -10px; width: 64px; height: 64px; font-size: 11px; padding: 6px; box-shadow: 3px 3px 0 #111; z-index: 1; transform: rotate(8deg); }
.sticker.half { background: #111; color: var(--yellow); }
.nofit .pricetag { background: var(--card); color: var(--muted); border-style: dashed; }

.detail { padding: 0 18px 20px; font-size: 15px; border-top: 3px solid var(--ink); margin-top: 2px; padding-top: 14px; }
.why { margin: 0 0 12px; font-weight: 500; }
.note { margin: 0 0 12px; color: var(--red); font-weight: 700; }
.ings { width: 100%; border-collapse: collapse; }
.ings td { vertical-align: top; padding: 7px 0; border-top: 1px solid var(--rule); }
.ings tr:first-child td { border-top: 0; }
.ings .amt { width: 6.5em; white-space: nowrap; font-weight: 800; padding-right: 12px; }
.ings .prod a { text-decoration: none; border-bottom: 2px solid var(--yellow); font-weight: 600; }
.ings .prod a:hover { border-bottom-color: var(--ink); }
.ings .price { display: block; color: var(--muted); font-size: 14px; }
mark.sp { background: var(--red); color: #fff; font-weight: 800; padding: 1px 7px; border-radius: 999px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.ings .pantry td { color: var(--muted); }
.ings .pantry .amt { font-weight: 500; }
.steps { margin: 14px 0 0; padding-left: 0; list-style: none; counter-reset: s; }
.steps li { margin: 6px 0; padding-left: 2.4em; position: relative; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--ink); color: var(--paper); font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.none { padding: 30px 0; font-weight: 600; color: var(--muted); }
