body { font-family: 'Manrope', system-ui, sans-serif; }

/* Stepper */
.stepper { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.step-btn { display: flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 600; color: #57534e; white-space: nowrap; transition: .15s; }
.step-btn:hover { background: #f5f5f4; }
.step-btn .num { width: 1.4rem; height: 1.4rem; border-radius: 999px; display: grid; place-items: center; font-size: .72rem; background: #e7e5e4; color: #57534e; }
.step-btn.active { background: #ecfdf5; color: #047857; }
.step-btn.active .num { background: #059669; color: #fff; }
.step-btn.done .num { background: #a7f3d0; color: #065f46; }
.step-btn.locked { opacity: .45; }
.sec-btn { padding: .4rem .7rem; border-radius: .6rem; font-weight: 600; color: #57534e; }
.sec-btn:hover, .sec-btn.active { background: #f5f5f4; color: #1c1917; }

/* Cards & controls */
.card { background: #fff; border: 1px solid #e7e5e4; border-radius: 1.1rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .75rem; border-radius: 999px; border: 1px solid #e7e5e4; background: #fff; font-size: .85rem; font-weight: 600; transition: .15s; cursor: pointer; }
.chip:hover { border-color: #a8a29e; }
.chip.on { background: #059669; border-color: #059669; color: #fff; }
.chip-sm { padding: .2rem .55rem; font-size: .75rem; }
.seg { display: inline-flex; background: #f5f5f4; border-radius: .7rem; padding: .2rem; gap: .15rem; flex-wrap: wrap; }
.seg button { padding: .35rem .7rem; border-radius: .55rem; font-size: .8rem; font-weight: 600; color: #57534e; }
.seg button.on { background: #fff; color: #047857; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .6rem 1rem; border-radius: .8rem; font-weight: 700; font-size: .9rem; transition: .15s; }
.btn-primary { background: #059669; color: #fff; }
.btn-primary:hover { background: #047857; }
.btn-primary:disabled { background: #a8a29e; cursor: not-allowed; }
.btn-ghost { background: #f5f5f4; color: #292524; }
.btn-ghost:hover { background: #e7e5e4; }
.btn-outline { border: 1px solid #d6d3d1; background: #fff; color: #292524; }
.btn-outline:hover { border-color: #78716c; }
.icon-btn { width: 2.1rem; height: 2.1rem; border-radius: .6rem; display: inline-grid; place-items: center; color: #57534e; background: #f5f5f4; transition: .15s; }
.icon-btn:hover { background: #e7e5e4; color: #1c1917; }
.icon-btn.on { background: #fef3c7; color: #b45309; }
.field { width: 100%; border: 1px solid #d6d3d1; border-radius: .7rem; padding: .55rem .75rem; background: #fff; font-size: .9rem; }
.field:focus { outline: 2px solid #6ee7b7; border-color: #10b981; }
.label { font-size: .78rem; font-weight: 700; color: #78716c; text-transform: uppercase; letter-spacing: .04em; }
input[type=range] { accent-color: #059669; }

/* Presets */
.preset-card { text-align: left; padding: 1rem; border-radius: 1rem; border: 1px solid #e7e5e4; background: #fff; transition: .15s; }
.preset-card:hover { border-color: #10b981; transform: translateY(-2px); box-shadow: 0 8px 20px -10px rgba(5,150,105,.4); }

/* Meal cards */
.meal-card { background: #fff; border: 1px solid #e7e5e4; border-radius: 1.1rem; padding: 1rem; transition: .2s; }
.meal-card.locked { border-color: #fcd34d; background: #fffdf5; }
.meal-emoji { width: 3.5rem; height: 3.5rem; border-radius: 1rem; background: #f0fdf4; display: grid; place-items: center; font-size: 1.9rem; flex-shrink: 0; }
.macro { display: inline-flex; gap: .25rem; align-items: baseline; font-size: .78rem; background: #f5f5f4; border-radius: .5rem; padding: .15rem .45rem; color: #44403c; }
.macro b { font-weight: 800; }
.macro.p { background: #eff6ff; color: #1e40af; }
.badge-change { font-size: .72rem; background: #fef9c3; color: #854d0e; border-radius: .45rem; padding: .1rem .45rem; }

/* Bars */
.bar { height: .55rem; background: #f5f5f4; border-radius: 999px; overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; border-radius: 999px; transition: width .4s; }
.bar .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #1c1917; border-radius: 2px; }
.ok-bg { background: #10b981; } .warn-bg { background: #f59e0b; } .bad-bg { background: #ef4444; } .neutral-bg { background: #a8a29e; }
.ok-t { color: #047857; } .warn-t { color: #b45309; } .bad-t { color: #dc2626; }

/* Input methods */
.method-card { border: 2px dashed #d6d3d1; border-radius: 1rem; padding: 1rem; text-align: center; background: #fff; transition: .15s; cursor: pointer; }
.method-card:hover, .method-card.on { border-color: #10b981; background: #f0fdf4; }
.method-card .ico { font-size: 1.7rem; }
.scan-wrap { position: relative; overflow: hidden; border-radius: 1rem; }
.scan-line { position: absolute; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, #10b981, transparent); box-shadow: 0 0 18px #10b981; animation: scan 1.4s linear infinite; }
@keyframes scan { from { top: 0; } to { top: 100%; } }
.rec-dot { width: .7rem; height: .7rem; border-radius: 999px; background: #ef4444; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* Store cards */
.store-card { border: 2px solid #e7e5e4; border-radius: 1rem; padding: .9rem; background: #fff; text-align: left; transition: .15s; width: 100%; }
.store-card:hover { border-color: #a8a29e; }
.store-card.on { border-color: #059669; box-shadow: 0 0 0 3px #d1fae5; }
.store-logo { width: 2.4rem; height: 2.4rem; border-radius: .7rem; display: grid; place-items: center; font-size: 1.2rem; }

/* Table */
.data-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #78716c; font-weight: 700; text-align: right; padding: .6rem .5rem; cursor: pointer; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table td { padding: .55rem .5rem; text-align: right; border-top: 1px solid #f5f5f4; font-size: .87rem; }
.data-table tr:hover td { background: #fafaf9; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(28,25,23,.5); z-index: 40; display: flex; align-items: flex-end; justify-content: center; padding: 0; animation: fade .15s; }
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 1.5rem; } }
.modal { background: #fff; width: 100%; max-width: 46rem; max-height: 92vh; overflow-y: auto; border-radius: 1.3rem 1.3rem 0 0; animation: up .2s; }
@media (min-width: 640px) { .modal { border-radius: 1.3rem; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

.toast { pointer-events: auto; background: #1c1917; color: #fff; padding: .7rem 1.1rem; border-radius: .8rem; font-size: .88rem; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: up .2s; max-width: 90vw; }
.toast.warn { background: #b45309; }

.fade-in { animation: up .25s; }
.dim { opacity: .5; }
