@font-face {
  font-family: Inter;
  src: url('/fonts/InterVariable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #121417;
  --card: #1B1F24;
  --surface: #242A31;
  --border: #343B44;
  --text: #F5F7FA;
  --muted: #A6ABB3;
  --lime: #B7FF3C;
  --fit-yellow: #FFE16A;
  --fit-orange: #FF9B42;
  --mint: #62E6A7;
  --blue: #5DA9FF;
  --orange: #FFB84D;
  --coral: #FF6464;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-width: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

.app-shell { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(92px + var(--safe-bottom)); }
.page { width: min(100%, 640px); margin: 0 auto; padding: 0 20px 32px; animation: page-in 240ms ease-out; }
.page.wide-page { width: min(100%, 980px); }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 88px; padding-top: max(10px, var(--safe-top)); }
.brand { min-width: 0; display: inline-flex; align-items: flex-end; gap: 8px; border: 0; background: none; padding: 0; cursor: pointer; }
.brand-mark { width: 44px; height: 24px; flex: 0 0 44px; display: block; overflow: hidden; }
.brand-mark img { width: 82px; height: 82px; max-width: none; display: block; transform: translate(-19px, -29px); }
.brand-copy { display: flex; align-items: flex-end; gap: 7px; white-space: nowrap; }
.brand-word { width: 83px; height: 21px; flex: 0 0 83px; display: block; overflow: hidden; }
.brand-word img { width: 120px; height: 54px; max-width: none; display: block; transform: translate(-21px, -16px); }
.brand-tagline { padding-left: 7px; border-left: 1px solid var(--border); color: var(--muted); font-size: 14px; line-height: 1; letter-spacing: -.01em; transform: translateY(-2px); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: linear-gradient(145deg, #3d4651, #20252b); border: 1px solid var(--border); font-weight: 750; font-size: 13px; }
.avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }

.icon-button { width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--border); background: var(--card); display: grid; place-items: center; cursor: pointer; }
.icon-button:active { transform: scale(.97); }
.page-heading { display: flex; align-items: center; gap: 12px; min-height: 82px; }
.page-heading h1 { font-size: 21px; margin: 0; letter-spacing: -.02em; }
.heading-copy { flex: 1; min-width: 0; }
.eyebrow { margin: 0 0 7px; text-transform: uppercase; letter-spacing: .13em; color: var(--lime); font-size: 11px; font-weight: 800; }
.muted { color: var(--muted); }
.caption { font-size: 12px; color: var(--muted); line-height: 1.45; }

.onboarding-page { width: min(100%, 640px); min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: 0 20px max(30px, var(--safe-bottom)); background: radial-gradient(circle at 50% 14%, rgba(183,255,60,.07), transparent 32%); }
.onboarding-header { min-height: calc(72px + var(--safe-top)); padding-top: var(--safe-top); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.onboarding-header > button { border: 0; background: none; color: var(--muted); font-size: 11px; cursor: pointer; }
.onboarding-brand { display: inline-flex; align-items: flex-end; gap: 8px; }
.onboarding-screen { min-height: calc(100vh - 112px); min-height: calc(100dvh - 112px - var(--safe-top)); display: flex; flex-direction: column; }
.onboarding-progress { display: flex; gap: 5px; margin: 7px 0 26px; }
.onboarding-progress i { width: 20px; height: 3px; border-radius: 999px; background: var(--border); transition: width 180ms, background 180ms; }
.onboarding-progress i.active { width: 34px; background: var(--lime); }
.onboarding-content { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 24px; animation: page-in 240ms ease-out; }
.onboarding-content > h1, .onboarding-copy h1 { margin: 7px 0 12px; font-size: clamp(31px, 9vw, 46px); line-height: 1.04; letter-spacing: -.045em; }
.onboarding-content > h1 em { color: var(--lime); font-style: normal; }
.onboarding-content > p, .onboarding-copy > p:not(.eyebrow) { margin: 0 0 28px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.onboarding-visual { position: relative; width: 124px; height: 124px; margin: 0 auto 35px; display: grid; place-items: center; border: 1px solid rgba(183,255,60,.25); border-radius: 38px; color: var(--lime); background: linear-gradient(145deg, rgba(183,255,60,.12), var(--card)); box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.hero-visual { width: 180px; height: 110px; border: 0; border-radius: 0; background: none; box-shadow: none; }
.onboarding-hero-logo { width: 142px; height: 78px; display: block; overflow: hidden; }
.onboarding-hero-logo img { width: 265px; height: 265px; max-width: none; display: block; transform: translate(-61px, -94px); }
.onboarding-visual > i { position: absolute; right: -9px; top: -9px; width: 39px; height: 39px; display: grid; place-items: center; border-radius: 13px; background: var(--lime); color: var(--bg); }
.onboarding-visual > i svg { width: 18px; height: 18px; }
.onboarding-benefits { display: grid; gap: 9px; margin: 0 0 24px; }
.onboarding-benefits > div { display: grid; grid-template-columns: 40px 1fr; column-gap: 11px; padding: 13px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); }
.onboarding-benefits span { grid-row: span 2; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--lime); background: rgba(183,255,60,.08); }
.onboarding-benefits strong { align-self: end; font-size: 12px; }
.onboarding-benefits p { align-self: start; margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.onboarding-name-form { display: grid; gap: 9px; margin-bottom: 15px; }
.onboarding-name-form label { color: var(--muted); font-size: 11px; }
.onboarding-name-form .text-input { height: 54px; font-size: 15px; }
.onboarding-info, .onboarding-privacy, .onboarding-scan-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.onboarding-info { margin-bottom: 9px; }
.onboarding-info > svg, .onboarding-privacy > svg, .onboarding-scan-note > svg { flex: 0 0 auto; color: var(--lime); }
.onboarding-info strong, .onboarding-privacy strong { display: block; margin-bottom: 4px; font-size: 11px; }
.onboarding-info p, .onboarding-privacy p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.onboarding-privacy { border-color: rgba(93,169,255,.2); background: rgba(93,169,255,.05); }
.onboarding-privacy > svg { color: var(--blue); }
.onboarding-privacy button { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--blue); font-size: 10px; font-weight: 750; cursor: pointer; }
.ready-visual { width: 96px; height: 96px; border-radius: 50%; }
.ready-visual > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--lime); color: var(--bg); }
.ready-visual > span svg { width: 22px; height: 22px; }
.onboarding-final-actions { display: grid; gap: 9px; }
.onboarding-final-actions .secondary-button { width: 100%; }
.onboarding-scan-note { margin-top: 14px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.settings-links { display: grid; gap: 8px; }
.settings-links button { width: 100%; display: grid; grid-template-columns: 22px 1fr 16px; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.settings-links button > svg:first-child { color: var(--lime); }
.settings-links span strong, .settings-links span small { display: block; }
.settings-links span strong { margin-bottom: 3px; font-size: 10px; }
.settings-links span small { color: var(--muted); font-size: 10px; }
.privacy-page-card { display: grid; gap: 9px; }
.privacy-page-card > div { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 17px; background: var(--card); }
.privacy-page-card > div > svg { flex: 0 0 auto; color: var(--lime); }
.privacy-page-card strong { display: block; margin-bottom: 5px; font-size: 12px; }
.privacy-page-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.privacy-actions { padding: 18px; border: 1px solid var(--border); border-radius: 19px; background: var(--card); }
.privacy-actions h2 { margin: 0 0 5px; font-size: 15px; }
.privacy-actions > p { margin: 0 0 14px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.privacy-action { width: 100%; display: grid; grid-template-columns: 1fr 16px; align-items: center; gap: 10px; margin-top: 8px; padding: 13px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.privacy-action strong, .privacy-action small { display: block; }
.privacy-action strong { margin-bottom: 4px; font-size: 10px; }
.privacy-action small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.privacy-action.danger { border-color: rgba(255,100,100,.38); }
.privacy-action.danger strong, .privacy-action.danger > svg { color: var(--coral); }
.privacy-action:disabled { cursor: not-allowed; opacity: .58; }
.retention-note { margin-top: 12px; padding: 11px 12px; border-radius: 12px; background: rgba(183,255,60,.07); color: var(--muted); font-size: 10px; line-height: 1.5; }

.hero { padding: 18px 0 22px; }
.hero-intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.hero-intro-copy { flex: 1; min-width: 0; }
.hero-intro .eyebrow { margin-bottom: 7px; font-size: 11px; line-height: 1.3; }
.hero h1 { margin: 0; font-size: clamp(30px, 8vw, 44px); line-height: 1.04; letter-spacing: -.045em; }
.hero-avatar { width: 88px; height: 88px; flex: 0 0 88px; font-size: 26px; cursor: pointer; }
.hero h1 span { color: var(--lime); }
.hero p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 15px; max-width: 440px; }

.scan-card { position: relative; overflow: hidden; border: 1px solid rgba(183,255,60,.22); border-radius: 24px; background: linear-gradient(145deg, #252c2c 0%, var(--card) 62%); padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.18); }
.scan-card::after { content: ""; position: absolute; width: 190px; height: 190px; top: -90px; right: -70px; border-radius: 50%; background: rgba(183,255,60,.09); filter: blur(8px); }
.scan-card-top { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.scan-visual { width: 54px; height: 54px; flex: 0 0 auto; display: grid; place-items: center; background: var(--lime); color: #121417; border-radius: 17px; }
.scan-flow { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 18px 1fr 18px 1fr; align-items: center; gap: 3px; margin: 0 0 8px; padding: 4px 0; }
.scan-flow-step { min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.scan-flow-step > span { width: 68px; height: 64px; display: grid; place-items: center; margin-bottom: 8px; color: var(--lime); }
.scan-flow-step > span svg { width: 51px; height: 51px; }
.scan-flow-step strong { font-size: 15px; line-height: 1.1; }
.scan-flow-step small { margin-top: 4px; color: var(--muted); font-size: 10.5px; line-height: 1.1; white-space: nowrap; }
.scan-flow > i { display: grid; place-items: center; color: #626a73; }
.scan-flow > i svg { width: 13px; height: 13px; }
.scan-card h2 { font-size: 22px; letter-spacing: -.035em; margin: 20px 0 7px; }
.scan-card p { font-size: 14px; color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.primary-button, .secondary-button { min-height: 52px; border-radius: 15px; padding: 0 18px; font-weight: 800; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; transition: transform 120ms, background 120ms; }
.primary-button { width: 100%; background: var(--lime); color: #121417; box-shadow: 0 8px 25px rgba(183,255,60,.12); }
.primary-button:hover { background: #c4ff61; }
.secondary-button { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.primary-button:active, .secondary-button:active { transform: scale(.985); }
.primary-button:disabled { opacity: .55; cursor: wait; }

.section { margin-top: 30px; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-header h2 { font-size: 17px; margin: 0; letter-spacing: -.02em; }
.text-button { border: 0; background: none; color: var(--lime); padding: 5px 0; font-size: 13px; font-weight: 750; cursor: pointer; }

.goal-card { display: grid; grid-template-columns: 82px 1fr; gap: 17px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 21px; padding: 17px; }
.progress-ring { --value: 68; width: 76px; height: 76px; position: relative; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--lime) calc(var(--value) * 1%), var(--surface) 0); }
.progress-ring::before { content: ""; position: absolute; inset: 6px; background: var(--card); border-radius: inherit; }
.progress-ring strong, .progress-ring span { position: relative; z-index: 1; }
.progress-ring strong { font-size: 17px; }
.progress-ring span { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.ring-copy { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.goal-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.goal-meta strong { font-size: 15px; }
.goal-meta span { font-size: 12px; color: var(--muted); }
.macro-bars { display: grid; gap: 10px; margin-top: 13px; }
.macro-row { display: grid; grid-template-columns: 52px 1fr 56px; gap: 8px; align-items: center; color: var(--muted); font-size: 10px; }
.bar { height: 5px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.macro-row:nth-child(2) .bar > i { background: var(--orange); }
.macro-row:nth-child(3) .bar > i { background: var(--mint); }
.macro-row b { color: var(--text); font-size: 10px; text-align: right; }

.recent-card { width: 100%; border: 1px solid var(--border); border-radius: 18px; padding: 15px; background: var(--card); color: inherit; text-align: left; display: flex; align-items: center; gap: 13px; cursor: pointer; }
.recent-thumb { width: 52px; height: 52px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; color: var(--lime); background: radial-gradient(circle at 70% 30%, #4b5835, #252b25 45%, #1c211d); }
.recent-info { flex: 1; min-width: 0; }
.recent-info strong { display: block; font-size: 14px; margin-bottom: 5px; }
.recent-info span { display: block; color: var(--muted); font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.score-tone-good { --score-color: var(--lime); --score-tint: rgba(183,255,60,.1); --score-border: rgba(183,255,60,.42); }
.score-tone-medium { --score-color: var(--fit-yellow); --score-tint: rgba(255,225,106,.1); --score-border: rgba(255,225,106,.42); }
.score-tone-low { --score-color: var(--fit-orange); --score-tint: rgba(255,155,66,.1); --score-border: rgba(255,155,66,.42); }
.score-tone-excluded { --score-color: var(--coral); --score-tint: rgba(255,100,100,.1); --score-border: rgba(255,100,100,.42); }
.score-pill { min-width: 46px; height: 31px; border-radius: 10px; display: grid; place-items: center; background: var(--score-tint, rgba(183,255,60,.1)); color: var(--score-color, var(--lime)); font-weight: 850; font-size: 12px; }

.bottom-nav { position: fixed; z-index: 40; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 640px); min-height: calc(72px + var(--safe-bottom)); padding: 8px 18px calc(8px + var(--safe-bottom)); background: rgba(20,23,27,.94); border-top: 1px solid rgba(52,59,68,.75); backdrop-filter: blur(18px); display: grid; grid-template-columns: 1fr 1fr 72px 1fr 1fr; align-items: center; }
.nav-button { border: 0; background: none; color: #7f858e; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px; cursor: pointer; }
.nav-button.active { color: var(--lime); }
.nav-scan { width: 58px; height: 58px; border: 5px solid var(--bg); border-radius: 18px; background: var(--lime); color: #101214; display: grid; place-items: center; transform: translateY(-17px); cursor: pointer; box-shadow: 0 10px 25px rgba(0,0,0,.35); }

.upload-stage { min-height: calc(100vh - 190px); min-height: calc(100dvh - 190px); display: flex; flex-direction: column; }
.upload-intro { text-align: center; padding: 25px 12px 20px; }
.upload-intro h1 { font-size: 27px; letter-spacing: -.035em; margin: 17px 0 9px; }
.upload-intro p { color: var(--muted); margin: 0 auto; max-width: 370px; font-size: 14px; line-height: 1.55; }
.viewfinder { position: relative; margin: 14px 0 22px; min-height: 275px; border-radius: 24px; border: 1px solid var(--border); background: linear-gradient(145deg, #20252a, #181b1f); overflow: hidden; display: grid; place-items: center; }
.viewfinder.has-image { background-size: cover; background-position: center; }
.viewfinder.has-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.5)); }
.corner { position: absolute; width: 38px; height: 38px; border-color: var(--lime); border-style: solid; z-index: 2; }
.corner.tl { top: 18px; left: 18px; border-width: 2px 0 0 2px; border-radius: 9px 0 0; }
.corner.tr { top: 18px; right: 18px; border-width: 2px 2px 0 0; border-radius: 0 9px 0 0; }
.corner.bl { bottom: 18px; left: 18px; border-width: 0 0 2px 2px; border-radius: 0 0 0 9px; }
.corner.br { bottom: 18px; right: 18px; border-width: 0 2px 2px 0; border-radius: 0 0 9px; }
.viewfinder-copy { position: relative; z-index: 3; text-align: center; color: var(--muted); font-size: 12px; }
.viewfinder-copy .view-icon { width: 55px; height: 55px; border-radius: 17px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--surface); color: var(--lime); }
.image-badge { position: absolute; z-index: 4; left: 16px; bottom: 16px; max-width: calc(100% - 32px); display: flex; align-items: center; gap: 8px; background: rgba(18,20,23,.82); border: 1px solid rgba(255,255,255,.12); border-radius: 11px; padding: 8px 11px; font-size: 11px; backdrop-filter: blur(10px); }
.selected-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: -10px 0 18px; }
.selected-image { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.selected-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.selected-image > span { position: absolute; left: 6px; bottom: 6px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 7px; background: rgba(18,20,23,.85); color: var(--lime); font-size: 10px; font-weight: 850; }
.selected-image button { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; display: grid; place-items: center; padding: 0 0 2px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(18,20,23,.88); color: var(--text); font-size: 17px; line-height: 1; cursor: pointer; }
.upload-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.upload-actions label { width: 100%; }
.scan-meta-card { display: grid; gap: 14px; margin-top: 18px; padding: 15px; border: 1px solid var(--border); border-radius: 17px; background: var(--card); }
.scan-meta-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.scan-meta-heading h2 { margin: 0 0 4px; font-size: 14px; }
.scan-meta-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.scan-meta-heading > span { flex: 0 0 auto; padding: 5px 7px; border-radius: 8px; background: rgba(183,255,60,.08); color: var(--lime); font-size: 10px; font-weight: 800; }
.scan-meta-fields { display: grid; gap: 10px; }
.scan-meta-fields label > span { display: block; margin: 0 0 6px 2px; color: var(--muted); font-size: 10px; }
.scan-meta-fields .text-input { height: 44px; font-size: 11px; }
.scan-meta-fields textarea { width: 100%; min-height: 70px; resize: vertical; padding: 11px 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); color: var(--text); font: inherit; font-size: 11px; line-height: 1.45; }
.scan-meta-fields textarea::placeholder { color: #6f7680; }
.restaurant-note { display: grid; gap: 4px; margin: 10px 0 0; padding: 11px 13px; border: 1px solid rgba(183,255,60,.17); border-radius: 13px; background: rgba(183,255,60,.05); }
.restaurant-note strong { color: var(--lime); font-size: 10px; }
.restaurant-note span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 10px; margin: 16px 0 0; }
.history-list { display: grid; gap: 10px; }
.history-note { margin: 14px 4px 0; color: var(--muted); font-size: 10px; line-height: 1.5; text-align: center; }
.config-warning { display: grid; gap: 4px; margin-top: 14px; padding: 12px 13px; border-radius: 13px; background: rgba(255,184,77,.07); border: 1px solid rgba(255,184,77,.22); }
.config-warning strong { color: var(--orange); font-size: 11px; }
.config-warning span { color: var(--muted); font-size: 10px; line-height: 1.5; }

.analyzing { min-height: calc(100vh - 100px); min-height: calc(100dvh - 100px); display: grid; place-items: center; text-align: center; }
.scanner-animation { width: 190px; height: 245px; position: relative; margin: 0 auto 35px; border: 1px solid var(--border); background: linear-gradient(150deg,#2d333a,#1b1f24); border-radius: 20px; overflow: hidden; transform: rotate(2deg); }
.scanner-lines { position: absolute; inset: 25px 22px; background: repeating-linear-gradient(180deg, transparent 0 13px, rgba(166,171,179,.17) 14px 16px); }
.scan-line { position: absolute; z-index: 2; left: 0; right: 0; height: 2px; background: var(--lime); box-shadow: 0 0 18px var(--lime), 0 0 40px rgba(183,255,60,.35); animation: scan 1.8s ease-in-out infinite alternate; }
@keyframes scan { from { top: 12%; } to { top: 88%; } }
.analyzing h1 { font-size: 26px; margin: 0 0 9px; }
.analyzing p { color: var(--muted); font-size: 13px; margin: 0; }
.steps { width: min(100%, 330px); margin: 26px auto 0; display: grid; gap: 10px; text-align: left; }
.step { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.step-dot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border); color: transparent; }
.step.done { color: var(--text); }
.step.done .step-dot { color: #121417; background: var(--lime); border-color: var(--lime); }

.result-summary { background: linear-gradient(135deg, rgba(183,255,60,.12), rgba(98,230,167,.04)); border: 1px solid rgba(183,255,60,.2); border-radius: 20px; padding: 17px; display: flex; gap: 14px; align-items: center; margin: 8px 0 19px; }
.summary-icon { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 13px; display: grid; place-items: center; color: var(--lime); background: rgba(183,255,60,.1); }
.result-summary strong { font-size: 14px; display: block; margin-bottom: 5px; }
.result-summary span { font-size: 11px; color: var(--muted); }
.filter-row { display: flex; overflow-x: auto; gap: 8px; padding: 1px 0 13px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { white-space: nowrap; border: 1px solid var(--border); background: var(--card); color: var(--muted); border-radius: 999px; padding: 9px 13px; font-size: 11px; font-weight: 700; cursor: pointer; }
.filter-chip.active { color: #121417; background: var(--lime); border-color: var(--lime); }
.dish-list { display: grid; gap: 12px; }
.dish-card { position: relative; width: 100%; text-align: left; border: 1px solid var(--border); background: var(--card); color: inherit; border-radius: 20px; padding: 17px; cursor: pointer; overflow: hidden; transition: border-color 120ms, transform 120ms; }
.dish-card:hover { border-color: #4a535e; }
.dish-card:active { transform: scale(.99); }
.dish-card.top-pick { border-color: var(--score-border); background: linear-gradient(135deg, var(--score-tint), var(--card) 58%); }
.dish-card.excluded { border-color: rgba(255,100,100,.25); opacity: .78; }
.dish-card.excluded .score-circle { background: conic-gradient(var(--coral) 100%, var(--surface) 0); }
.rank { position: absolute; right: 15px; top: 15px; color: #707680; font-weight: 900; font-size: 21px; line-height: 1; opacity: .28; }
.top-label { display: inline-flex; align-items: center; gap: 5px; color: var(--score-color, var(--lime)); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 9px; }
.top-label.exclusion-label { color: var(--coral); }
.dish-head { display: flex; align-items: flex-start; gap: 12px; padding-right: 30px; }
.score-circle { --score: 80; width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--score-color, var(--lime)) calc(var(--score) * 1%), var(--surface) 0); }
.score-circle::before { content: ""; grid-area: 1/1; width: 39px; height: 39px; border-radius: 50%; background: var(--card); }
.score-circle b { grid-area: 1/1; z-index: 1; font-size: 12px; color: var(--score-color, var(--lime)); }
.dish-title { min-width: 0; }
.dish-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.dish-title h3 { font-size: 15px; margin: 2px 0 5px; }
.dish-price { flex: 0 0 auto; color: var(--lime); font-size: 12px; font-weight: 850; white-space: nowrap; }
.dish-title p { color: var(--muted); font-size: 10px; margin: 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nutrition-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 15px; padding-top: 13px; border-top: 1px solid rgba(52,59,68,.7); }
.nutrition-cell { min-width: 0; }
.nutrition-cell strong { display: block; font-size: 12px; white-space: nowrap; }
.nutrition-cell span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }
.confidence-mini { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; margin-top: 12px; }
.confidence-mini i { width: 6px; height: 6px; background: var(--mint); border-radius: 50%; }
.confidence-mini.warning { color: var(--coral); }
.confidence-mini.warning i { background: var(--coral); }
.allergen-mini { display: block; margin-top: 12px; padding: 8px 9px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); background: rgba(166,171,179,.04); font-size: 10px; line-height: 1.4; }
.allergen-mini b { color: var(--text); }
.allergen-mini.caution { border-color: rgba(255,184,77,.24); background: rgba(255,184,77,.06); }
.allergen-mini.caution b { color: var(--orange); }
.allergen-mini.danger { border-color: rgba(255,100,100,.3); background: rgba(255,100,100,.07); }
.allergen-mini.danger b { color: var(--coral); }

.detail-hero { padding: 10px 0 18px; }
.detail-hero h1 { margin: 10px 0 8px; font-size: 30px; line-height: 1.08; letter-spacing: -.04em; }
.detail-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.detail-title-row h1 { min-width: 0; }
.detail-price { flex: 0 0 auto; margin-bottom: 10px; color: var(--lime); font-size: 18px; white-space: nowrap; }
.detail-hero > p { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.tag { border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 6px 9px; font-size: 10px; }
.fit-card { display: flex; align-items: center; gap: 18px; padding: 18px; border-radius: 21px; background: linear-gradient(135deg, var(--score-tint), var(--card) 55%); border: 1px solid var(--score-border); }
.fit-card .score-circle { width: 68px; height: 68px; }
.fit-card .score-circle::before { width: 56px; height: 56px; }
.fit-card .score-circle b { font-size: 18px; }
.fit-copy strong { display: block; font-size: 16px; margin-bottom: 5px; }
.fit-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.fit-reasons { display: grid; gap: 3px; }
.fit-reasons p::before { content: "✓"; color: var(--score-color, var(--lime)); margin-right: 6px; }
.fit-card.excluded-fit { border-color: rgba(255,100,100,.3); background: linear-gradient(135deg, rgba(255,100,100,.09), var(--card) 55%); }
.fit-card.excluded-fit .score-circle { background: conic-gradient(var(--coral) 100%, var(--surface) 0); }
.fit-card.excluded-fit .fit-reasons p::before { content: "!"; color: var(--coral); }
.allergen-card { padding: 16px; border: 1px solid var(--border); border-radius: 17px; background: var(--card); }
.allergen-card strong { display: block; margin-bottom: 6px; font-size: 13px; }
.allergen-card p { margin: 0 0 8px; color: var(--muted); font-size: 11px; }
.allergen-card small { display: block; color: #777e87; font-size: 10px; line-height: 1.5; }
.allergen-card.caution { border-color: rgba(255,184,77,.3); background: rgba(255,184,77,.06); }
.allergen-card.caution strong { color: var(--orange); }
.allergen-card.danger { border-color: rgba(255,100,100,.35); background: rgba(255,100,100,.07); }
.allergen-card.danger strong { color: var(--coral); }
.nutrition-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.nutrition-tile { background: var(--card); border: 1px solid var(--border); border-radius: 17px; padding: 15px; }
.nutrition-tile.featured { grid-column: span 2; display: flex; align-items: center; justify-content: space-between; }
.nutrition-tile span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 7px; }
.nutrition-tile strong { font-size: 23px; letter-spacing: -.03em; }
.nutrition-tile strong small { color: var(--muted); font-size: 11px; font-weight: 600; }
.range { font-size: 11px; color: var(--muted); }
.ingredient-list { border: 1px solid var(--border); background: var(--card); border-radius: 19px; overflow: hidden; }
.ingredient { padding: 14px 15px; display: grid; grid-template-columns: 1fr auto; gap: 8px; border-bottom: 1px solid rgba(52,59,68,.65); }
.ingredient:last-child { border-bottom: 0; }
.ingredient strong { font-size: 12px; }
.ingredient span { color: var(--muted); font-size: 10px; }
.ingredient-source { grid-column: 1/-1; display: flex; align-items: center; gap: 5px; color: #737a83; font-size: 10px; }
.confidence-card { border-radius: 19px; padding: 17px; background: var(--card); border: 1px solid var(--border); }
.confidence-head { display: flex; justify-content: space-between; align-items: center; }
.confidence-head strong { font-size: 13px; }
.confidence-value { color: var(--mint); font-size: 12px; font-weight: 800; }
.confidence-bar { height: 7px; background: var(--surface); border-radius: 999px; margin: 13px 0 10px; overflow: hidden; }
.confidence-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--mint)); }
.source-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.source { padding: 7px 9px; border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 10px; }

.goal-form { display: grid; gap: 18px; }
.profile-intro { display: flex; align-items: center; gap: 12px; padding: 3px 2px 0; }
.profile-avatar { width: 52px; height: 52px; flex: 0 0 52px; font-size: 14px; }
.profile-photo-control { position: relative; flex: 0 0 56px; cursor: pointer; }
.profile-photo-edit { position: absolute; right: 0; bottom: -1px; width: 22px; height: 22px; display: grid; place-items: center; border: 2px solid var(--bg); border-radius: 50%; background: var(--lime); color: var(--bg); }
.profile-photo-edit svg { width: 12px; height: 12px; }
.profile-identity-field { flex: 1; min-width: 0; }
.profile-identity-field > label { display: block; margin: 0 0 6px 2px; color: var(--muted); font-size: 10px; }
.profile-identity-field .text-input { height: 42px; font-size: 13px; }
.profile-identity-field > span { display: block; margin: 5px 0 0 2px; color: var(--muted); font-size: 10px; }
.form-card { border: 1px solid var(--border); background: var(--card); border-radius: 21px; padding: 18px; }
.form-card h2 { margin: 0 0 4px; font-size: 15px; }
.form-card > p { margin: 0 0 18px; font-size: 11px; color: var(--muted); line-height: 1.45; }
.language-setting { margin: 0 0 14px; }
.cloud-status { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.cloud-status > i { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(166,171,179,.08); }
.cloud-status.connected > i { background: var(--lime); box-shadow: 0 0 0 4px rgba(183,255,60,.1); }
.cloud-status.action-required > i { background: var(--orange); box-shadow: 0 0 0 4px rgba(255,184,77,.1); }
.cloud-status.offline > i { background: var(--coral); box-shadow: 0 0 0 4px rgba(255,100,100,.1); }
.cloud-status span { min-width: 0; }
.cloud-status strong, .cloud-status small { display: block; }
.cloud-status strong { margin-bottom: 3px; font-size: 10px; }
.cloud-status small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.focus-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.objective-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.focus-option { position: relative; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 15px; min-height: 67px; padding: 11px; text-align: left; cursor: pointer; }
.focus-option.active { border-color: var(--lime); background: rgba(183,255,60,.08); color: var(--text); }
.focus-option strong { display: block; font-size: 11px; margin-bottom: 4px; }
.focus-option span { font-size: 10px; line-height: 1.4; display: block; }
.suggestion-preview { margin-top: 14px; padding: 13px; border: 1px solid rgba(183,255,60,.24); background: rgba(183,255,60,.06); border-radius: 15px; }
.suggestion-preview > span { display: block; margin-bottom: 9px; color: var(--lime); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.suggestion-preview div { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.suggestion-preview strong { color: var(--text); font-size: 10px; font-weight: 650; }
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.field label { display: block; color: var(--muted); font-size: 10px; margin: 0 0 7px 2px; }
.input-wrap { position: relative; }
.input-wrap input { width: 100%; height: 49px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 13px; padding: 0 43px 0 13px; font-weight: 750; }
.input-wrap span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 10px; }
.field select, .text-input { width: 100%; height: 49px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 13px; padding: 0 12px; font-weight: 650; font-size: 11px; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 21px, calc(100% - 11px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.full-field { grid-column: 1 / -1; }
.text-input::placeholder { color: #6f7680; }
.compact-header { align-items: flex-start; margin-bottom: 15px; }
.compact-header p { margin: 5px 0 0; font-size: 10px; color: var(--muted); }
.budget-preview { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding: 11px 12px; border-radius: 12px; background: rgba(183,255,60,.06); border: 1px solid rgba(183,255,60,.15); }
.budget-preview span { color: var(--muted); font-size: 10px; }
.budget-preview strong { color: var(--lime); font-size: 12px; }
.budget-link { width: 100%; cursor: pointer; }
.budget-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 4px; border-radius: 14px; background: var(--surface); }
.budget-mode-switch button { min-height: 42px; padding: 8px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 750; cursor: pointer; }
.budget-mode-switch button.active { border-color: rgba(183,255,60,.35); background: rgba(183,255,60,.1); color: var(--lime); }
.daily-preview { margin-top: 15px; padding: 13px; border: 1px solid rgba(98,230,167,.2); border-radius: 14px; background: rgba(98,230,167,.06); }
.daily-preview > span { display: block; margin-bottom: 9px; color: var(--mint); font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.daily-preview div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.daily-preview strong { font-size: 10px; }
.daily-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px; }
.daily-actions .primary-button, .daily-actions .secondary-button { width: 100%; min-height: 50px; padding: 10px; font-size: 10px; }
.disclaimer { padding: 13px; border-radius: 13px; background: rgba(93,169,255,.06); border: 1px solid rgba(93,169,255,.16); color: var(--muted); font-size: 10px; line-height: 1.5; }

.empty-page { min-height: calc(100vh - 180px); min-height: calc(100dvh - 180px); display: grid; place-items: center; text-align: center; }
.empty-page h1 { font-size: 24px; margin: 16px 0 8px; }
.empty-page p { color: var(--muted); font-size: 13px; max-width: 300px; line-height: 1.5; margin: 0; }
.empty-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 20px; display: grid; place-items: center; color: var(--lime); background: rgba(183,255,60,.08); border: 1px solid rgba(183,255,60,.18); }

.toast-region { position: fixed; z-index: 100; left: 50%; bottom: calc(88px + var(--safe-bottom)); transform: translateX(-50%); width: min(calc(100% - 32px), 430px); pointer-events: none; }
.toast { color: var(--text); background: #2a3037; border: 1px solid #444c57; padding: 12px 15px; border-radius: 13px; box-shadow: 0 15px 40px rgba(0,0,0,.4); font-size: 12px; text-align: center; animation: toast-in 180ms ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.loading-dots span { animation: blink 1.2s infinite; opacity: .2; }
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: 1; } }

@media (min-width: 700px) {
  body { background: radial-gradient(circle at 50% -20%, #22282d 0%, var(--bg) 42%); }
  .app-shell { border-left: 1px solid rgba(52,59,68,.35); border-right: 1px solid rgba(52,59,68,.35); width: min(100%, 980px); margin: 0 auto; background: var(--bg); }
  .page { padding-left: 30px; padding-right: 30px; }
  .bottom-nav { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  .wide-page .dish-list { grid-template-columns: 1fr 1fr; }
  .wide-page .dish-card.top-pick { grid-column: span 2; }
}

@media (max-width: 359px) {
  .hero h1 { font-size: 24px; }
  .hero-avatar { width: 72px; height: 72px; flex-basis: 72px; font-size: 22px; }
  .brand { gap: 6px; }
  .brand-mark { width: 38px; height: 21px; flex-basis: 38px; }
  .brand-mark img { width: 72px; height: 72px; transform: translate(-17px, -25.5px); }
  .brand-copy { gap: 5px; }
  .brand-word { width: 72px; height: 18px; flex-basis: 72px; }
  .brand-word img { width: 104px; height: 47px; transform: translate(-18px, -14px); }
  .brand-tagline { padding-left: 5px; font-size: 10px; }
  .onboarding-brand .brand-tagline { display: none; }
}

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