:root {
  --ink: #18392e;
  --ink-deep: #102a22;
  --muted: #65766f;
  --green: #2e664b;
  --green-dark: #214e3a;
  --green-soft: #dfeee5;
  --sage: #9ab3a3;
  --cream: #f7f3e9;
  --paper: #fffdf8;
  --white: #fff;
  --peach: #e99d73;
  --peach-soft: #f8e7db;
  --yellow: #f0c96b;
  --blue: #7e9fb4;
  --red: #af4e47;
  --line: rgba(33, 78, 58, .13);
  --shadow: 0 18px 60px rgba(25, 58, 45, .10);
  --shadow-sm: 0 8px 26px rgba(25, 58, 45, .08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--cream); color: var(--ink); }
body.is-locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
img { display: block; max-width: 100%; }
[hidden], .is-hidden { display: none !important; }
:focus-visible { outline: 3px solid rgba(233, 157, 115, .64); outline-offset: 3px; }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink-deep); letter-spacing: -.035em; }
h2 { font-size: clamp(1.55rem, 5vw, 2.4rem); line-height: 1.08; margin-bottom: 10px; }
h3 { line-height: 1.2; }
em { font-family: Georgia, "Times New Roman", serif; color: var(--peach); font-weight: 700; }

.network-banner { position: fixed; z-index: 1000; top: 0; left: 0; right: 0; padding: 9px 16px; text-align: center; background: #243d34; color: white; font-size: .74rem; font-weight: 700; }
.network-banner span { color: var(--yellow); margin-right: 5px; }
.network-banner:not([hidden]) ~ .app-view .topbar { top: 33px; }

.button { min-height: 46px; border: 0; border-radius: 14px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: .88rem; font-weight: 800; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:active { transform: translateY(1px) scale(.99); }
.button--primary { background: var(--green); color: white; box-shadow: 0 8px 22px rgba(46, 102, 75, .2); }
.button--primary:hover { background: var(--green-dark); box-shadow: 0 10px 30px rgba(46, 102, 75, .26); }
.button--soft { background: var(--green-soft); color: var(--green-dark); }
.button--soft:hover { background: #d1e6d9; }
.button--ghost { background: transparent; color: var(--green); border: 1px solid var(--line); }
.button--large { min-height: 54px; width: 100%; border-radius: 17px; font-size: .94rem; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.72); font-size: 1.25rem; }
.text-button { min-height: 40px; padding: 0; border: 0; background: transparent; color: var(--green); font-size: .83rem; font-weight: 800; white-space: nowrap; }
.eyebrow { margin-bottom: 8px; color: var(--green); font-size: .68rem; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.section-copy { margin-bottom: 25px; color: var(--muted); font-size: .91rem; line-height: 1.62; }
.form-error { min-height: 20px; margin: 8px 0 0; color: var(--red); font-size: .78rem; font-weight: 700; }

/* Welcome and onboarding */
.welcome-view { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; padding: 30vh 18px 24px; position: relative; overflow: hidden; background: linear-gradient(155deg, #e4eee7 0%, #f8f3e8 48%, #f8e8db 100%); }
.welcome-view::before { content: ""; position: absolute; width: 90vw; height: 90vw; max-width: 620px; max-height: 620px; top: -28vw; right: -26vw; border-radius: 50%; border: 1px solid rgba(46,102,75,.13); box-shadow: 0 0 0 28px rgba(255,255,255,.18), 0 0 0 82px rgba(255,255,255,.13); }
.welcome-art { position: absolute; top: 7%; left: 50%; width: 210px; height: 210px; transform: translateX(-50%); }
.welcome-mark { position: absolute; inset: 20px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, var(--green), #4a8567); color: white; box-shadow: 0 25px 50px rgba(46,102,75,.25); }
.welcome-mark::after { content: ""; position: absolute; inset: 15px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; }
.welcome-mark span { font-size: 4.2rem; font-weight: 500; transform: rotate(-8deg); }
.leaf { position: absolute; z-index: 2; width: 55px; height: 90px; border-radius: 100% 0 100% 0; background: #86a995; opacity: .75; }
.leaf--one { left: 0; bottom: 15px; transform: rotate(-24deg); }
.leaf--two { right: -3px; top: 16px; transform: rotate(105deg); background: var(--peach); }
.welcome-card { width: min(100%, 510px); max-width: 100%; position: relative; z-index: 2; margin: 0 auto; padding: 27px 24px 20px; border: 1px solid rgba(255,255,255,.78); border-radius: 30px; background: rgba(255,253,248,.88); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.brand-kicker { margin-bottom: 7px; color: var(--green); font-size: .66rem; font-weight: 800; letter-spacing: .2em; }
.welcome-card h1 { margin-bottom: 12px; font-size: clamp(2.2rem, 11vw, 4.1rem); line-height: .93; }
.welcome-card h1 em { display: block; font-size: .94em; }
.welcome-lead { color: var(--muted); font-size: .89rem; line-height: 1.55; }
.welcome-points { display: grid; gap: 10px; margin: 20px 0 24px; font-size: .79rem; font-weight: 700; }
.welcome-points span { display: flex; align-items: center; gap: 10px; }
.welcome-points i { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; background: var(--green-soft); color: var(--green); font-style: normal; }
.welcome-actions { display: grid; gap: 9px; }
.privacy-note { margin: 17px 0 0; color: #77857f; text-align: center; font-size: .66rem; line-height: 1.5; }

.onboarding-view { min-height: 100vh; min-height: 100dvh; padding: 18px; background: radial-gradient(circle at 80% 10%, #f5e4d8 0, transparent 32%), var(--cream); }
.onboarding-header { width: min(100%, 780px); margin: 0 auto 25px; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; }
.mini-brand { display: flex; align-items: center; justify-content: center; gap: 9px; font-size: .88rem; }
.mini-brand__mark { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 10px; background: var(--green); color: white; }
.onboarding-shell { width: min(100%, 660px); margin: 0 auto; padding: 24px; border-radius: var(--radius-xl); background: var(--paper); box-shadow: var(--shadow); }
.onboarding-shell--compact { max-width: 490px; margin-top: 8vh; }
.step-indicator { display: flex; align-items: center; justify-content: center; margin-bottom: 33px; }
.step-indicator span { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--muted); font-size: .72rem; font-weight: 800; }
.step-indicator span.is-active, .step-indicator span.is-complete { border-color: var(--green); background: var(--green); color: white; }
.step-indicator i { width: 45px; height: 1px; background: var(--line); }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > span:first-child, fieldset legend { color: var(--ink-deep); font-size: .73rem; font-weight: 800; }
.field input, .field select, .field textarea, .compact-select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 13px; background: #fff; padding: 0 13px; font-size: .88rem; outline: none; transition: border-color .2s, box-shadow .2s; }
.field textarea { min-height: 78px; padding-top: 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .compact-select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(46,102,75,.1); }
.field-hint { margin-top: -1px; color: var(--muted); font-size: .64rem; line-height: 1.45; }
.field--code input { text-align: center; text-transform: uppercase; font-size: 1.45rem; font-weight: 800; letter-spacing: .16em; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .field--wide { grid-column: 1 / -1; }
.target-preview { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 3px 0 17px; padding: 12px; border-radius: 16px; background: var(--green-soft); }
.target-preview div { min-width: 0; }
.target-preview span { display: block; color: var(--muted); font-size: .61rem; font-weight: 700; }
.target-preview strong { display: block; margin-top: 2px; color: var(--green-dark); font-size: .88rem; }
.target-warning { grid-column: 1 / -1; margin: 5px 0 0; color: #785542; font-size: .7rem; line-height: 1.45; }
.onboarding-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.consent-note, .safety-note { display: flex; gap: 12px; padding: 13px; border-radius: 15px; background: #faf1e7; color: #705546; font-size: .72rem; line-height: 1.5; }
.consent-note span, .safety-note > span { flex: 0 0 auto; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: #efd0bd; font-weight: 900; }
.consent-note p, .safety-note p { margin: 0; }

/* App shell */
.app-view { min-height: 100vh; background: var(--cream); }
.sidebar { display: none; }
.app-column { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(78px + var(--safe-bottom)); }
.topbar { position: sticky; z-index: 50; top: 0; min-height: 76px; padding: 14px 17px 10px; display: flex; align-items: center; justify-content: space-between; background: rgba(247,243,233,.88); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(33,78,58,.07); }
.topbar h1 { margin: 1px 0 0; font-size: 1.28rem; }
.topbar-date { margin: 0; color: var(--muted); font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.sync-button.is-syncing { animation: spin .9s linear infinite; }
.avatar-stack { min-width: 56px; height: 44px; padding: 0 7px; border: 0; border-radius: 14px; background: transparent; display: flex; align-items: center; }
.avatar { width: 35px; height: 35px; display: inline-grid; place-items: center; border: 3px solid var(--cream); border-radius: 50%; background: var(--peach-soft); color: #955c40; font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.avatar + .avatar { margin-left: -10px; background: var(--green-soft); color: var(--green-dark); }
.main-content { width: 100%; max-width: 1080px; margin: 0 auto; padding: 13px 14px 36px; }
.route { animation: enter .28s ease both; }
.hero-card { min-height: 260px; position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 26px 22px; border-radius: var(--radius-xl); background: linear-gradient(135deg, #264f3d 0%, #326d50 58%, #77a084 100%); color: white; box-shadow: var(--shadow); }
.hero-card::before { content: ""; position: absolute; width: 300px; height: 300px; top: -185px; right: -90px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; box-shadow: 0 0 0 35px rgba(255,255,255,.04), 0 0 0 70px rgba(255,255,255,.04); }
.hero-card__content { position: relative; z-index: 2; width: min(75%, 600px); }
.hero-card h2 { margin: 15px 0 10px; color: white; font-size: clamp(1.9rem, 8vw, 3.7rem); }
.hero-card h2 em { color: #f5c49f; }
.hero-card p { margin: 0; color: rgba(255,255,255,.76); font-size: .8rem; line-height: 1.55; }
.hero-pill { display: inline-flex; min-height: 26px; align-items: center; padding: 0 10px; border-radius: 99px; background: rgba(255,255,255,.14); color: inherit; font-size: .61rem; font-weight: 800; letter-spacing: .13em; }
.hero-orbit { position: absolute; width: 120px; height: 120px; right: -5px; bottom: 12px; border: 1px solid rgba(255,255,255,.23); border-radius: 50%; }
.hero-orbit::before, .hero-orbit::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; }
.hero-orbit::before { inset: 16px; }.hero-orbit::after { inset: 35px; }
.hero-orbit span { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; color: #f4b88e; font-size: 2.2rem; }
.hero-orbit i, .hero-orbit b { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--yellow); }
.hero-orbit i { top: 4px; left: 50%; }.hero-orbit b { bottom: 12px; right: 6px; background: white; }
.profile-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: -1px 8px 27px; }
.profile-chip { min-width: 0; padding: 14px 13px; border-radius: 0 0 18px 18px; background: var(--paper); box-shadow: var(--shadow-sm); }
.profile-chip__head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.profile-chip .avatar { width: 27px; height: 27px; border: 0; }
.profile-chip strong { overflow: hidden; text-overflow: ellipsis; font-size: .78rem; white-space: nowrap; }
.profile-chip__numbers { display: flex; justify-content: space-between; align-items: flex-end; gap: 5px; }
.profile-chip__numbers b { font-size: 1.05rem; }.profile-chip__numbers span { color: var(--muted); font-size: .59rem; text-align: right; }
.mini-progress { height: 5px; margin-top: 8px; border-radius: 99px; overflow: hidden; background: #e6e8e3; }
.mini-progress i { height: 100%; display: block; border-radius: inherit; background: var(--peach); }
.section-heading { margin: 27px 2px 13px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.section-heading h2 { margin-bottom: 0; font-size: 1.35rem; }
.section-heading p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: .79rem; line-height: 1.5; }
.section-heading--compact { margin: 0 0 16px; }
.section-heading--page { margin-top: 8px; align-items: center; }
.section-heading--page h2 { font-size: clamp(1.65rem, 6vw, 2.65rem); }

/* Meal cards */
.meal-timeline { position: relative; display: grid; gap: 11px; }
.meal-card { position: relative; min-width: 0; display: grid; grid-template-columns: 92px minmax(0,1fr); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--paper); box-shadow: var(--shadow-sm); }
.meal-photo { min-height: 128px; position: relative; overflow: hidden; background: #dfe9e2; }
.meal-photo img { width: 100%; height: 100%; object-fit: cover; }
.meal-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 45%, rgba(15,42,33,.13)); pointer-events: none; }
.meal-time { position: absolute; z-index: 2; top: 8px; left: 8px; padding: 4px 7px; border-radius: 99px; background: rgba(255,255,255,.9); color: var(--green-dark); font-size: .57rem; font-weight: 900; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.meal-content { min-width: 0; padding: 13px; }
.meal-label { margin-bottom: 4px; color: var(--peach); font-size: .58rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.meal-card h3 { margin: 0 0 7px; font-size: .95rem; }
.meal-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .62rem; }
.portion-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.portion-pill { padding: 5px 7px; border-radius: 8px; background: var(--green-soft); color: var(--green-dark); font-size: .59rem; font-weight: 800; }
.portion-pill:nth-child(2) { background: var(--peach-soft); color: #88563d; }
.meal-actions { display: flex; gap: 6px; margin-top: 11px; }
.meal-actions button { min-height: 34px; flex: 1; padding: 0 8px; border: 0; border-radius: 10px; background: #f0eee7; color: var(--green-dark); font-size: .65rem; font-weight: 800; }
.meal-actions .swap-button { background: var(--green); color: white; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow-sm); }
.quick-weight { margin-top: 28px; padding: 19px; }
.weigh-hint { color: var(--muted); font-size: .67rem; }
.quick-weight-form { display: grid; grid-template-columns: 1fr; gap: 3px; }
.unit-input { position: relative; display: block; }
.unit-input input { padding-right: 45px; }
.unit-input b { position: absolute; top: 15px; right: 14px; color: var(--muted); font-size: .72rem; }
.segmented { min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
.segmented legend { margin-bottom: 7px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.segmented legend { grid-column: 1 / -1; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { min-height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: .73rem; font-weight: 800; }
.segmented input:checked + span { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }

/* Menu */
.week-switcher { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 20px 0 14px; padding: 4px; border-radius: 15px; background: rgba(33,78,58,.08); }
.week-switcher button { min-height: 42px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: .76rem; font-weight: 800; }
.week-switcher button.is-active { background: var(--paper); color: var(--green-dark); box-shadow: 0 4px 13px rgba(33,78,58,.09); }
.day-strip { display: flex; gap: 7px; margin: 0 -14px; padding: 2px 14px 13px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.day-strip::-webkit-scrollbar { display: none; }
.day-button { flex: 0 0 55px; min-height: 67px; display: grid; place-items: center; align-content: center; gap: 2px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); color: var(--muted); scroll-snap-align: center; }
.day-button span { font-size: .61rem; font-weight: 800; text-transform: uppercase; }
.day-button strong { font-size: 1.08rem; }
.day-button.is-active { border-color: var(--green); background: var(--green); color: white; box-shadow: 0 7px 18px rgba(46,102,75,.2); }
.day-button.is-today::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--peach); }
.day-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 13px; padding: 13px 15px; border-radius: 16px; background: var(--green-soft); }
.day-summary strong { font-size: .78rem; }.day-summary span { color: var(--muted); font-size: .66rem; text-align: right; }
.menu-meals { display: grid; gap: 12px; }
.menu-meals .meal-card { grid-template-columns: 105px minmax(0,1fr); }

/* Recipe catalog */
.recipe-catalog-tools { margin: 18px 0 10px; }
.catalog-search { margin-bottom: 11px; background: var(--paper); box-shadow: var(--shadow-sm); }
.recipe-category-chips { display: flex; gap: 7px; margin: 0 -14px; padding: 2px 14px 9px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.recipe-category-chips::-webkit-scrollbar { display: none; }
.recipe-category-chips button { min-height: 40px; flex: 0 0 auto; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); color: var(--muted); font-size: .7rem; font-weight: 800; white-space: nowrap; scroll-snap-align: start; }
.recipe-category-chips button.is-active { border-color: var(--green); background: var(--green); color: white; box-shadow: 0 6px 16px rgba(46,102,75,.18); }
.recipe-catalog-status { min-height: 28px; margin: 3px 2px 9px; color: var(--muted); font-size: .69rem; font-weight: 800; }
.recipe-catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.recipe-card { min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow-sm); color: inherit; text-align: left; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.recipe-card:hover { transform: translateY(-2px); border-color: rgba(46,102,75,.28); box-shadow: 0 13px 32px rgba(25,58,45,.12); }
.recipe-card:active { transform: translateY(0); }
.recipe-card__photo { height: 155px; position: relative; display: block; overflow: hidden; background: var(--green-soft); }
.recipe-card__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.recipe-card:hover .recipe-card__photo img { transform: scale(1.025); }
.recipe-card__photo em { position: absolute; left: 10px; bottom: 10px; padding: 5px 9px; border-radius: 99px; background: rgba(255,253,248,.93); color: var(--green-dark); box-shadow: 0 3px 12px rgba(15,42,33,.12); font-family: inherit; font-size: .58rem; font-style: normal; font-weight: 900; letter-spacing: .04em; }
.recipe-card__body { min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; gap: 11px; padding: 13px 14px 14px; }
.recipe-card__body > strong { display: block; font-size: .87rem; line-height: 1.32; }
.recipe-card__body small { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 10px; color: var(--muted); font-size: .61rem; font-weight: 700; }
.catalog-state { min-height: 180px; grid-column: 1 / -1; display: grid; place-items: center; align-content: center; gap: 8px; padding: 26px; border: 1px dashed rgba(46,102,75,.23); border-radius: var(--radius-lg); background: rgba(255,253,248,.62); color: var(--muted); text-align: center; line-height: 1.5; }
.recipe-catalog-status .catalog-state { min-height: 42px; display: flex; justify-content: flex-start; padding: 0; border: 0; background: transparent; text-align: left; }
.recipe-catalog-status .catalog-state--error { min-height: 150px; display: grid; justify-items: center; justify-content: stretch; padding: 22px; border: 1px dashed rgba(175,78,71,.32); background: rgba(255,253,248,.62); text-align: center; }
.catalog-state strong { color: var(--ink-deep); font-size: .9rem; }
.catalog-state span { font-size: .72rem; }
.catalog-spinner { width: 18px; height: 18px; flex: 0 0 auto; border: 2px solid rgba(46,102,75,.16); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.recipe-card--skeleton { min-height: 247px; pointer-events: none; }
.recipe-card--skeleton i, .recipe-card--skeleton span { display: block; background: linear-gradient(100deg, rgba(46,102,75,.06) 30%, rgba(255,255,255,.75) 45%, rgba(46,102,75,.06) 60%); background-size: 260% 100%; animation: catalog-shimmer 1.35s linear infinite; }
.recipe-card--skeleton i { height: 155px; }
.recipe-card--skeleton span { width: 75%; height: 13px; margin: 14px; border-radius: 6px; }
.recipe-card--skeleton span + span { width: 48%; height: 9px; margin-top: 0; }

/* Progress */
.compact-select { width: auto; min-width: 122px; background: var(--paper); font-weight: 700; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 18px 0; }
.stat-card { padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow-sm); }
.stat-card span { color: var(--muted); font-size: .64rem; font-weight: 700; }
.stat-card strong { display: block; margin-top: 4px; font-size: 1.35rem; }
.stat-card small { display: block; margin-top: 2px; color: var(--green); font-size: .61rem; line-height: 1.35; }
.chart-panel { padding: 17px 12px 10px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 5px 13px; }
.panel-title h3 { margin: 0 0 3px; font-size: 1rem; }.panel-title p { margin: 0; color: var(--muted); font-size: .65rem; }
.trend-badge { padding: 6px 8px; border-radius: 9px; background: var(--green-soft); color: var(--green); font-size: .65rem; font-weight: 900; }
.weight-chart { width: 100%; min-height: 220px; overflow: hidden; }
.weight-chart svg { display: block; width: 100%; height: auto; }
.chart-empty, .empty-state { min-height: 180px; display: grid; place-items: center; padding: 25px; text-align: center; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.two-column { display: grid; gap: 13px; margin-top: 13px; }
.two-column > .panel { padding: 17px; }
.stack-form .button { width: 100%; }
.weight-history { display: grid; }
.weight-row { min-height: 50px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.weight-row:first-child { border-top: 0; }
.weight-row strong { font-size: .8rem; }.weight-row span { display: block; color: var(--muted); font-size: .63rem; }
.weight-row b { font-size: .91rem; }

/* Shopping */
.shopping-range { grid-template-columns: repeat(3, 1fr); }
.shopping-range button { font-size: .66rem; }
.shopping-progress { display: flex; align-items: center; gap: 12px; margin: 18px 0; padding: 13px 15px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.shopping-progress__bar { height: 8px; flex: 1; border-radius: 99px; overflow: hidden; background: #e5e8e3; }
.shopping-progress__bar i { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .3s ease; }
.shopping-progress span { color: var(--muted); font-size: .68rem; font-weight: 800; }
.shopping-list { display: grid; gap: 12px; }
.shopping-group { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--paper); box-shadow: var(--shadow-sm); }
.shopping-group h3 { margin: 0; padding: 14px 16px 9px; font-size: .81rem; }
.shopping-item { min-height: 52px; display: grid; grid-template-columns: 27px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 8px 15px; border-top: 1px solid var(--line); cursor: pointer; }
.shopping-item input { appearance: none; width: 21px; height: 21px; margin: 0; border: 1.5px solid var(--sage); border-radius: 7px; display: grid; place-items: center; }
.shopping-item input::after { content: "✓"; color: white; font-size: .72rem; font-weight: 900; transform: scale(0); transition: transform .15s; }
.shopping-item input:checked { border-color: var(--green); background: var(--green); }.shopping-item input:checked::after { transform: scale(1); }
.shopping-item span { min-width: 0; font-size: .76rem; font-weight: 700; }
.shopping-item b { color: var(--muted); font-size: .68rem; }
.shopping-item:has(input:checked) span { color: var(--muted); text-decoration: line-through; }

/* Exercises */
.exercise-hero { margin: 18px 0 13px; padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: linear-gradient(135deg, #e3efe7, #faf4e8); }
.exercise-hero h3 { margin: 10px 0 5px; font-size: 1.25rem; }.exercise-hero p { margin: 0; color: var(--muted); font-size: .7rem; }
.activity-ring { flex: 0 0 82px; height: 82px; border-radius: 50%; display: grid; place-items: center; align-content: center; background: conic-gradient(var(--green) 0 72%, rgba(46,102,75,.12) 72%); position: relative; }
.activity-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--paper); }
.activity-ring strong, .activity-ring span { position: relative; z-index: 1; }.activity-ring strong { font-size: 1.22rem; }.activity-ring span { color: var(--muted); font-size: .56rem; }
.exercise-grid { display: grid; gap: 13px; }
.routine-card { padding: 18px; }
.routine-icon { width: 40px; height: 40px; margin-bottom: 13px; display: grid; place-items: center; border-radius: 13px; background: #fae7c4; color: #9b7134; font-size: 1.2rem; }
.routine-icon--moon { background: #e2e8f1; color: #56718a; }
.routine-card h3 { margin-bottom: 12px; }
.routine-list { margin: 0 0 17px; padding: 0; list-style: none; counter-reset: routine; }
.routine-list li { min-height: 42px; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 8px; border-top: 1px solid var(--line); counter-increment: routine; font-size: .73rem; }
.routine-list li::before { content: counter(routine); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: .6rem; font-weight: 900; }
.routine-list small { color: var(--muted); }
.routine-done { width: 100%; }
.routine-done.is-done { background: var(--green); color: white; }
.safety-note { margin-top: 14px; }

/* Profiles */
.profile-cards { display: grid; gap: 12px; margin: 18px 0; }
.profile-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow-sm); }
.profile-card__head { display: flex; align-items: center; gap: 11px; }
.profile-card__head .avatar { width: 45px; height: 45px; border: 0; }
.profile-card__head h3 { margin: 0 0 2px; font-size: 1.04rem; }.profile-card__head p { margin: 0; color: var(--muted); font-size: .65rem; }
.profile-card__head button { margin-left: auto; }
.profile-card__metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 15px; }
.profile-card__metrics div { padding: 10px 7px; border-radius: 12px; background: #f4f1e9; text-align: center; }
.profile-card__metrics span { display: block; color: var(--muted); font-size: .56rem; }.profile-card__metrics strong { display: block; margin-top: 2px; font-size: .8rem; }
.profile-warning { margin: 12px 0 0; padding: 9px 10px; border-radius: 10px; background: var(--peach-soft); color: #7c503b; font-size: .65rem; line-height: 1.45; }
.pairing-panel { padding: 20px; background: linear-gradient(135deg, var(--green-dark), #376e53); color: white; }
.pairing-panel h3 { color: white; margin-bottom: 7px; }.pairing-panel p:not(.eyebrow) { color: rgba(255,255,255,.7); font-size: .72rem; line-height: 1.5; }
.pair-code-row { display: flex; align-items: center; gap: 8px; margin-top: 15px; }
.pair-code-row code { min-width: 0; flex: 1; color: #fff; font: 800 1.08rem/1.2 "Segoe UI", sans-serif; letter-spacing: .15em; }
.pair-code-row .button { background: rgba(255,255,255,.14); color: white; }
.settings-list { margin-top: 13px; overflow: hidden; }
.settings-row { width: 100%; min-height: 70px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; }
.settings-row:first-child { border-top: 0; }.settings-row:hover { background: rgba(46,102,75,.035); }
.settings-row > b { color: var(--sage); font-size: 1.3rem; }.settings-row strong { display: block; font-size: .77rem; }.settings-row small { display: block; margin-top: 3px; color: var(--muted); font-size: .61rem; line-height: 1.35; }
.settings-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--green-soft); font-weight: 900; }
.settings-row--danger strong { color: var(--red); }.settings-row--danger .settings-icon { background: #f6e2df; color: var(--red); }
.medical-disclaimer { margin: 18px 10px; color: var(--muted); text-align: center; font-size: .61rem; line-height: 1.55; }

/* Navigation */
.bottom-nav { position: fixed; z-index: 70; left: 8px; right: 8px; bottom: calc(7px + var(--safe-bottom)); height: 66px; display: flex; align-items: stretch; gap: 1px; padding: 5px 3px; border: 1px solid rgba(33,78,58,.11); border-radius: 20px; background: rgba(255,253,248,.94); box-shadow: 0 12px 40px rgba(25,58,45,.18); backdrop-filter: blur(18px); }
.nav-button { flex: 1 1 0; min-width: 0; display: grid; place-items: center; align-content: center; gap: 3px; border: 0; border-radius: 15px; background: transparent; color: #7a8982; }
.nav-button svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-button span { max-width: 100%; overflow: hidden; font-size: .52rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.nav-button.is-active { background: var(--green-soft); color: var(--green-dark); }

/* Dialogs */
.dialog { width: 100%; max-width: 690px; max-height: 94vh; margin: auto auto 0; padding: 0; border: 0; border-radius: 28px 28px 0 0; background: transparent; color: inherit; }
.dialog::backdrop { background: rgba(10, 28, 22, .55); backdrop-filter: blur(3px); }
.dialog-card { max-height: 94vh; position: relative; overflow-y: auto; padding: 21px 18px calc(22px + var(--safe-bottom)); border-radius: inherit; background: var(--paper); }
.dialog-close { position: absolute; z-index: 4; top: 12px; right: 12px; width: 39px; height: 39px; display: grid; place-items: center; border: 0; border-radius: 12px; background: rgba(255,255,255,.86); color: var(--ink); font-size: 1.4rem; box-shadow: 0 4px 14px rgba(15,42,33,.1); }
.dialog-close--inline { position: static; flex: 0 0 auto; box-shadow: none; background: #f0eee7; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 17px; }
.dialog-head h2 { font-size: 1.45rem; }.dialog-head p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: .7rem; }
.dialog-actions { position: sticky; bottom: calc(-22px - var(--safe-bottom)); display: flex; justify-content: flex-end; gap: 7px; margin: 19px -18px calc(-22px - var(--safe-bottom)); padding: 12px 18px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); background: rgba(255,253,248,.94); backdrop-filter: blur(15px); }
.recipe-cover { height: 230px; margin: -21px -18px 20px; overflow: hidden; background: var(--green-soft); }
.recipe-cover img { width: 100%; height: 100%; object-fit: cover; }
.recipe-title h2 { margin-right: 40px; }.recipe-title > p { color: var(--muted); font-size: .8rem; line-height: 1.55; }
.recipe-facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 16px 0; }
.recipe-facts div { padding: 11px 6px; border-radius: 13px; background: #f2efe7; text-align: center; }.recipe-facts strong { display: block; font-size: .84rem; }.recipe-facts span { color: var(--muted); font-size: .55rem; }
.recipe-portions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 21px; }
.recipe-portion { padding: 12px; border-radius: 14px; background: var(--green-soft); }.recipe-portion:nth-child(2) { background: var(--peach-soft); }.recipe-portion span { display: block; font-size: .61rem; }.recipe-portion strong { display: block; margin-top: 3px; font-size: .88rem; }
.recipe-section { margin-top: 22px; }.recipe-section h3 { margin-bottom: 10px; font-size: 1rem; }
.ingredient-list { padding: 0; list-style: none; }.ingredient-list li { min-height: 39px; display: flex; justify-content: space-between; gap: 10px; align-items: center; border-top: 1px solid var(--line); font-size: .72rem; }.ingredient-list li b { color: var(--muted); white-space: nowrap; }
.step-list { margin: 0; padding: 0; list-style: none; counter-reset: steps; }.step-list li { position: relative; min-height: 42px; padding: 0 0 15px 38px; color: #44564f; font-size: .75rem; line-height: 1.55; counter-increment: steps; }.step-list li::before { content: counter(steps); position: absolute; top: 0; left: 0; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; background: var(--green); color: white; font-size: .65rem; font-weight: 900; }
.search-field { min-height: 48px; display: flex; align-items: center; gap: 8px; margin-bottom: 13px; padding: 0 13px; border: 1px solid var(--line); border-radius: 14px; background: white; }.search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: .82rem; }.search-field span { color: var(--muted); }
.alternative-list { display: grid; gap: 8px; }
.alternative-option { position: relative; display: grid; grid-template-columns: 74px minmax(0,1fr) 24px; gap: 11px; align-items: center; min-height: 82px; padding: 7px 10px 7px 7px; border: 1px solid var(--line); border-radius: 16px; background: white; cursor: pointer; }.alternative-option:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 2px rgba(46,102,75,.1); }.alternative-option > img { width: 74px; height: 67px; border-radius: 11px; object-fit: cover; }.alternative-option input { appearance: none; width: 19px; height: 19px; border: 1.5px solid var(--sage); border-radius: 50%; }.alternative-option input:checked { border: 5px solid var(--green); }.alternative-option strong { display: block; font-size: .76rem; }.alternative-option small { display: block; margin-top: 5px; color: var(--muted); font-size: .61rem; }.alternative-option .selected-tag { display: inline-block; width: fit-content; margin-top: 5px; padding: 3px 6px; border-radius: 6px; background: var(--green-soft); color: var(--green); font-size: .52rem; font-weight: 900; }
.install-dialog { max-width: 430px; margin: auto; border-radius: 28px; text-align: center; }.install-dialog .dialog-card { padding: 38px 28px 28px; }.install-mark { width: 68px; height: 68px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 22px; background: var(--green); color: white; font-size: 2.1rem; }.install-dialog p:not(.eyebrow) { color: var(--muted); font-size: .79rem; line-height: 1.6; }

.loading-overlay { position: fixed; z-index: 2000; inset: 0; display: grid; place-items: center; align-content: center; gap: 15px; background: rgba(247,243,233,.91); backdrop-filter: blur(10px); }.loading-overlay p { font-size: .79rem; font-weight: 800; }.loader { width: 42px; height: 42px; border: 4px solid rgba(46,102,75,.14); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.toast { position: fixed; z-index: 3000; left: 50%; bottom: calc(91px + var(--safe-bottom)); width: max-content; max-width: calc(100% - 34px); transform: translateX(-50%); padding: 11px 15px; border-radius: 13px; background: var(--ink-deep); color: white; box-shadow: 0 12px 34px rgba(10,28,22,.25); font-size: .73rem; font-weight: 700; text-align: center; }

@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes catalog-shimmer { to { background-position: -160% 0; } }

@media (min-width: 620px) {
  .welcome-view { align-items: center; padding-top: 260px; }
  .onboarding-shell { padding: 38px; }
  .main-content { padding: 22px 28px 60px; }
  .topbar { padding-left: 30px; padding-right: 30px; }
  .hero-card { min-height: 310px; padding: 38px; }
  .hero-orbit { width: 190px; height: 190px; right: 28px; bottom: 45px; }
  .profile-summary { margin-left: 20px; margin-right: 20px; }
  .meal-timeline, .menu-meals { grid-template-columns: 1fr 1fr; }
  .recipe-catalog-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .recipe-card__photo { height: 175px; }
  .meal-card { grid-template-columns: 112px minmax(0,1fr); }
  .quick-weight-form { grid-template-columns: 1.15fr 1.5fr .8fr auto; align-items: end; gap: 10px; }
  .quick-weight-form .field, .quick-weight-form .segmented { margin-bottom: 0; }
  .stat-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .two-column, .exercise-grid, .profile-cards { grid-template-columns: 1fr 1fr; }
  .dialog { margin: auto; border-radius: 28px; }
  .dialog-card { padding: 26px; border-radius: inherit; }
  .recipe-cover { height: 290px; margin: -26px -26px 24px; }
  .dialog-actions { margin-left: -26px; margin-right: -26px; padding-left: 26px; padding-right: 26px; }
}

@media (min-width: 980px) {
  .app-view { display: grid; grid-template-columns: 235px minmax(0,1fr); }
  .sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px; border-right: 1px solid var(--line); background: #f1ede3; }
  .brand { display: flex; align-items: center; gap: 11px; padding: 0 7px 29px; }.brand__mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 13px; background: var(--green); color: white; font-size: 1.25rem; }.brand strong, .brand small { display: block; }.brand strong { font-size: .9rem; }.brand small { color: var(--peach); font-family: Georgia, serif; font-size: .82rem; font-style: italic; }
  .side-nav { display: grid; gap: 5px; }.side-nav .nav-button { min-height: 47px; grid-template-columns: 23px 1fr; justify-content: start; align-content: center; padding: 0 12px; gap: 10px; text-align: left; }.side-nav .nav-button span { font-size: .72rem; }.side-nav .nav-button svg { width: 18px; }.side-nav .nav-button.is-active { background: var(--green); color: white; }
  .sidebar-foot { margin-top: auto; padding: 14px; border-radius: 15px; background: var(--green-soft); }.sidebar-foot p { margin: 0 0 3px; color: var(--muted); font-size: .58rem; }.sidebar-foot strong { display: block; font-size: .73rem; }.sidebar-foot span { display: block; margin-top: 7px; color: var(--green); font-size: .56rem; }
  .app-column { padding-bottom: 0; }.bottom-nav { display: none; }.topbar { min-height: 85px; padding-left: 38px; padding-right: 38px; }.main-content { padding: 22px 38px 70px; }
  .hero-card { min-height: 330px; }.meal-timeline { grid-template-columns: repeat(2,1fr); }.menu-meals { grid-template-columns: repeat(2,1fr); }
  .recipe-catalog-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .recipe-category-chips { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .toast { bottom: 30px; }
}

@media (min-width: 1240px) {
  .app-view { grid-template-columns: 260px minmax(0,1fr); }
  .meal-timeline, .menu-meals { grid-template-columns: repeat(2,1fr); }
  .meal-card { grid-template-columns: 125px minmax(0,1fr); }
}

@media (max-width: 390px) {
  .welcome-card { padding-left: 19px; padding-right: 19px; }
  .form-grid { grid-template-columns: 1fr; }.form-grid .field--wide { grid-column: auto; }
  .target-preview { grid-column: auto; }.target-warning { grid-column: auto; }
  .profile-summary { grid-template-columns: 1fr; margin-top: 10px; }.profile-chip { border-radius: 16px; }
  .meal-card, .menu-meals .meal-card { grid-template-columns: 82px minmax(0,1fr); }.meal-photo { min-height: 145px; }
  .meal-actions { flex-direction: column; }
  .nav-button span { font-size: .47rem; }.bottom-nav { left: 4px; right: 4px; }
  .pair-code-row { align-items: stretch; flex-direction: column; }.pair-code-row code { text-align: center; }
}

@media (max-width: 619px) {
  .bottom-nav { justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .bottom-nav::-webkit-scrollbar { display: none; }
  .bottom-nav .nav-button { flex: 0 0 57px; }
}

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

@media (display-mode: standalone) {
  .topbar { padding-top: max(14px, env(safe-area-inset-top)); }
  #installButton { display: none; }
}
