/* ------------------------------------------------------------------
   Real app shell (full viewport PWA) + new components
------------------------------------------------------------------- */
@font-face { font-family: Lato; font-weight: 400; font-display: swap; src: url(/shared/fonts/lato-400.woff2) format('woff2'); }
@font-face { font-family: Lato; font-weight: 700; font-display: swap; src: url(/shared/fonts/lato-700.woff2) format('woff2'); }
@font-face { font-family: Lato; font-weight: 900; font-display: swap; src: url(/shared/fonts/lato-900.woff2) format('woff2'); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: linear-gradient(180deg, #EEF2F8, #E4EAF4); font-family: var(--app-font); overscroll-behavior: none; }
button, input, select, textarea { font-family: inherit; }
:root { --sat: max(12px, env(safe-area-inset-top)); --sab: env(safe-area-inset-bottom); }

#app.screen-area { width: 100%; max-width: 480px; height: 100vh; height: 100dvh; margin: 0 auto; border-radius: 0; clip-path: none; box-shadow: 0 0 60px -20px rgba(15, 26, 46, .25); }
@media (min-width: 520px) { #app.screen-area { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.screen { padding-top: var(--sat); }
.screen:not(.no-pad)::before { top: calc(-1 * var(--sat)); height: var(--sat); margin-top: calc(-1 * var(--sat)); }
.screen.has-tabs { padding-bottom: calc(86px + var(--sab)); }
#tabbar { height: calc(64px + var(--sab)); padding-bottom: var(--sab); }
.chat-input { padding-bottom: max(12px, var(--sab)); }
.skip { top: calc(var(--sat) + 8px); }

/* Inside the /demo phone frame: leave room for the drawn status bar and home indicator */
.demo-frame { --sat: 54px; --sab: 22px; }
.demo-frame body { background: var(--bg); }
.demo-frame #app.screen-area { max-width: none; box-shadow: none; border: 0; }

/* Boot / loading */
.boot { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(120% 80% at 50% 0%, #1D4ED8 0%, #0B2A6F 55%, #07163D 100%); z-index: 200; transition: opacity .4s; }
.boot.off { opacity: 0; pointer-events: none; }
.route-busy { position: absolute; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, #2DD4BF, #3B82F6); z-index: 150; transition: width .6s ease; }
.route-busy.on { width: 70%; }
.skel { background: linear-gradient(90deg, #EEF1F6 25%, #F6F8FB 50%, #EEF1F6 75%); background-size: 200% 100%; animation: skel 1.2s infinite; border-radius: 12px; }
@keyframes skel { to { background-position: -200% 0; } }

/* Forms */
.field { margin-top: 14px; }
.field label, .lbl-sm { display: block; font-size: 13px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.input { width: 100%; height: 50px; border-radius: 13px; border: 1.5px solid var(--line); background: #fff; padding: 0 14px; font: 16px var(--app-font); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: #9DB8F5; box-shadow: 0 0 0 4px rgba(29, 78, 216, .08); }
.input.err { border-color: var(--red); }
textarea.input { height: auto; min-height: 80px; padding: 12px 14px; resize: vertical; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.form-err { display: flex; gap: 8px; align-items: flex-start; background: #FFF1F1; color: #B42318; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin-top: 14px; line-height: 1.4; }
.form-err .link { color: #B42318; text-decoration: underline; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn .spin { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-bell { background: var(--bell); color: #fff; box-shadow: 0 6px 16px -6px rgba(0, 84, 154, .55); }
.btn-google { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 16px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.seg-ctl { display: flex; background: #EEF1F6; border-radius: 12px; padding: 4px; gap: 4px; }
.seg-ctl button { flex: 1; border: 0; background: none; padding: 9px 6px; border-radius: 9px; font: 600 13.5px var(--app-font); color: var(--muted); cursor: pointer; }
.seg-ctl button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16,24,40,.1); }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick .chip { padding: 9px 14px; font-size: 13.5px; }
.pick .chip.on { background: #EEF4FF; border-color: var(--primary-2); color: var(--primary); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lang-switch { display: inline-flex; gap: 2px; background: rgba(255,255,255,.14); border-radius: 99px; padding: 3px; }
.lang-switch button { border: 0; background: none; color: inherit; font: 700 12px var(--app-font); padding: 5px 10px; border-radius: 99px; cursor: pointer; opacity: .75; }
.lang-switch button.on { background: #fff; color: var(--primary); opacity: 1; }
.lang-switch.dark { background: #EEF1F6; } .lang-switch.dark button.on { background: var(--ink); color: #fff; }

/* Welcome */
.welcome-hero { position: relative; height: 46%; min-height: 300px; background: radial-gradient(120% 80% at 50% 0%, #1D4ED8 0%, #0B2A6F 60%, #07163D 100%); color: #fff; display: flex; flex-direction: column; overflow: hidden; }
.welcome-hero .wh-top { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--sat) + 6px) 20px 0; }
.slides { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 30px 20px; text-align: center; }
.slide .sl-ico { width: 74px; height: 74px; border-radius: 22px; background: rgba(255,255,255,.12); display: grid; place-items: center; margin-bottom: 16px; }
.slide h2 { font-size: 23px; font-weight: 750; letter-spacing: -.4px; line-height: 1.2; margin: 0; }
.slide p { font-size: 14.5px; line-height: 1.45; opacity: .8; margin: 8px 0 0; }
.welcome-hero .dots { padding-bottom: 16px; } .welcome-hero .dots i { background: rgba(255,255,255,.35); } .welcome-hero .dots i.on { background: #fff; }
.welcome-body { padding: 20px 20px calc(24px + var(--sab)); }
.welcome-body .btn + .btn { margin-top: 10px; }

/* Not a Bell customer */
.nb-card { border-radius: 18px; padding: 18px; margin-top: 14px; }
.nb-card.primary { background: linear-gradient(135deg, #00549A, #0B2A6F); color: #fff; }
.nb-card.secondary { background: #fff; border: 1px solid var(--line); }
.store-badges { display: flex; gap: 8px; margin-top: 12px; }
.store-badge { flex: 1; border-radius: 10px; background: #111; color: #fff; padding: 8px 10px; opacity: .35; display: flex; flex-direction: column; font-size: 10px; line-height: 1.2; }
.store-badge b { font-size: 14px; }
.soon { display: inline-block; font-size: 11px; font-weight: 700; background: #F2F4F7; color: var(--muted); padding: 3px 8px; border-radius: 99px; }

/* Onboarding */
.ob-head { display: flex; align-items: center; gap: 10px; padding: 8px 16px 0; }
.ob-progress { flex: 1; height: 6px; border-radius: 99px; background: #E9EDF5; overflow: hidden; }
.ob-progress i { display: block; height: 100%; background: var(--primary-2); border-radius: 99px; transition: width .4s cubic-bezier(.2,.8,.2,1); }
.ob-step { font-size: 12px; font-weight: 700; color: var(--muted); }
.ob-foot { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(255,255,255,0), #fff 30%); padding: 20px 20px calc(16px + var(--sab)); margin-top: 16px; }
.verified { display: flex; gap: 10px; align-items: center; background: linear-gradient(135deg, #00549A, #0B2A6F); color: #fff; border-radius: 14px; padding: 12px 14px; margin-top: 14px; font-size: 13px; }
.verified b { font-size: 14px; }

/* Home extras */
.pro-banner.warn { background: linear-gradient(90deg, #7A2E0B, #E0701B); }
.redflag { display: flex; gap: 10px; background: #FFF1F1; border: 1px solid #FFD5D5; color: #912018; border-radius: 14px; padding: 12px 14px; margin: 12px 16px 0; font-size: 13.5px; line-height: 1.45; }
.sim-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--muted); background: #F2F4F7; border-radius: 99px; padding: 2px 8px; }

/* Plan */
.meal-card { align-items: flex-start; }
.meal-card .mc-body { flex: 1; min-width: 0; }
.meal-card .mc-name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.meal-card .mc-why { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.meal-card .mc-meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.meal-card ul { margin-top: 6px; }
.tag-s { font-size: 11px; font-weight: 650; background: #F2F4F7; color: var(--ink-2); border-radius: 99px; padding: 2px 8px; }
.skel-plan .skel { margin: 12px 16px 0; }
.ai-thinking { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #7DD3FC; margin-top: 10px; }
.ai-thinking i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: ty 1s infinite; }
.ai-thinking i:nth-child(2) { animation-delay: .15s; } .ai-thinking i:nth-child(3) { animation-delay: .3s; }
.tips-card { margin: 12px 16px 0; }
.tips-card .tip-row { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.4; padding: 6px 0; }
.prec { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; cursor: pointer; box-shadow: 0 1px 2px rgba(16,24,40,.04); animation: fadeUp .35s both; transition: border-color .15s, transform .15s; }
.prec:hover { border-color: #C7D7FE; } .prec:active { transform: scale(.99); }
.prec .pr-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.prec .pr-val { font-size: 12px; font-weight: 800; border-radius: 99px; padding: 4px 10px; white-space: nowrap; }
.prec .pr-t { font-weight: 750; font-size: 16px; line-height: 1.25; margin-top: 10px; letter-spacing: -.2px; }
.prec .pr-d { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.4; }
.prec .pr-why { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--muted); background: #F7F8FB; border-radius: 10px; padding: 8px 10px; margin-top: 10px; line-height: 1.4; }
.prec .pr-why b { color: var(--ink-2); font-weight: 700; }
.prec .pr-why svg { flex-shrink: 0; margin-top: 1px; }
.prec .pr-cta { display: flex; align-items: center; gap: 2px; font-size: 13.5px; font-weight: 700; margin-top: 10px; }
.g-from { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.g-from .tag-s { font-size: 11.5px; padding: 4px 9px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.btn { text-decoration: none; }
.btn-loblaws { margin-top: 14px; background: #4A1942; color: #fff; box-shadow: 0 6px 16px -6px rgba(74, 25, 66, .55); font-size: 15px; line-height: 1.25; text-align: center; padding: 0 14px; }
.grocery-aisle { margin-top: 14px; }
.grocery-aisle h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 0 0 6px; }
.gitem { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; cursor: pointer; }
.gitem.done span { text-decoration: line-through; color: var(--muted); }
.week-day { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.week-day .wd { width: 46px; flex-shrink: 0; font-weight: 700; font-size: 13px; color: var(--primary); }
.week-day .wm { flex: 1; font-size: 13px; line-height: 1.6; color: var(--ink-2); }

/* Coach */
.msg.bot p { margin: 0 0 6px; } .msg.bot p:last-child { margin-bottom: 0; }
.msg.bot em { color: var(--muted); font-size: 12.5px; font-style: normal; }
.msg .act-card .plogo { font-size: 13px; }
.breath { display: flex; flex-direction: column; align-items: center; padding: 10px 0 4px; }
.breath-orb { width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, #5EEAD4, #3B82F6); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; transition: transform 4s ease-in-out; box-shadow: 0 20px 40px -12px rgba(59,130,246,.5); }
.breath-orb.in { transform: scale(1.25); } .breath-orb.out { transform: scale(.85); }

/* Offers */
.offer-card .oc-tag { display: inline-flex; align-items: center; gap: 4px; }
.code-box { margin-top: 16px; text-align: center; padding: 14px; border: 1px dashed #7FCBB0; background: #F1FBF5; border-radius: 16px; }
.code-box .code { font-family: ui-monospace, Menlo, monospace; font-weight: 800; letter-spacing: 2px; font-size: 20px; margin-top: 4px; }

/* Profile */
.set-row.tap { cursor: pointer; }
.danger-link { color: var(--red); font-weight: 600; }
.sub-card { margin: 0 20px; border-radius: 18px; padding: 18px; color: #fff; background: radial-gradient(120% 120% at 100% 0%, #3B82F6 0%, #1D4ED8 35%, #0B2A6F 100%); }
