/* ============================================================
   FitBot Coach — fitbot.coach marketing + content hub
   Design system. Brand color #ec7e4a (pulled from app settings).
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --brand: #ec7e4a;
  --brand-600: #e06a33;
  --brand-700: #c5571f;
  --brand-100: #fde9dd;
  --brand-50: #fef6f0;

  --ink: #16181d;
  --ink-700: #2b2f38;
  --ink-500: #4a5160;
  --muted: #6b7280;
  --line: #ececf1;
  --line-strong: #dcdce4;

  --bg: #ffffff;
  --bg-soft: #faf8f6;
  --bg-dark: #15171d;
  --bg-dark-2: #1d2027;

  --white: #ffffff;
  --success: #2e9e6b;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(16, 18, 29, .06), 0 1px 3px rgba(16, 18, 29, .08);
  --shadow: 0 10px 30px -12px rgba(20, 23, 33, .25);
  --shadow-lg: 0 30px 60px -20px rgba(20, 23, 33, .35);
  --shadow-brand: 0 16px 40px -12px rgba(236, 126, 74, .55);

  --container: 1180px;
  --header-h: 72px;

  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
ul { list-style: none; padding: 0; }
h1, h2, h3, h4 { line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.25rem; }
p { color: var(--ink-500); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 22px; }
.section { padding: clamp(56px, 9vw, 110px) 0; }
.section--soft { background: var(--bg-soft); }
.section--dark { background: var(--bg-dark); color: #e8e9ee; }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--dark p { color: #aab0c0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand-700); background: var(--brand-50);
  padding: 7px 14px; border-radius: var(--radius-pill); border: 1px solid var(--brand-100);
}
.section--dark .eyebrow { color: var(--brand); background: rgba(236,126,74,.12); border-color: rgba(236,126,74,.25); }
.section-head { max-width: 720px; margin: 0 auto 52px; text-align: center; }
.section-head .eyebrow { margin-bottom: 18px; }
.section-head p { font-size: 1.1rem; margin-top: 14px; }
.lead { font-size: 1.18rem; color: var(--ink-500); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; font-size: 1rem; line-height: 1;
  padding: 15px 26px; border-radius: var(--radius-pill);
  transition: transform .16s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap; border: 2px solid transparent;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn--primary:hover { background: var(--brand-600); transform: translateY(-2px); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand-700); transform: translateY(-2px); }
.btn--light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.btn--light:hover { background: rgba(255,255,255,.2); transform: translateY(-2px); }
.btn--block { width: 100%; }
.btn--sm { padding: 11px 18px; font-size: .92rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.18rem; letter-spacing: -.02em; }
.brand__mark {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand), #f4a06a);
  display: grid; place-items: center; box-shadow: var(--shadow-brand);
}
.brand__mark svg { width: 22px; height: 22px; }
.brand span b { color: var(--brand-700); }
.nav__links { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav__links a {
  padding: 9px 14px; border-radius: var(--radius-pill); font-weight: 600; font-size: .98rem; color: var(--ink-700);
  transition: background .15s ease, color .15s ease;
}
.nav__links a:hover { background: var(--brand-50); color: var(--brand-700); }
.nav__links a.is-active { color: var(--brand-700); background: var(--brand-50); }
.nav__cta { margin-left: 10px; }
.nav__toggle { display: none; width: 44px; height: 44px; border-radius: 12px; margin-left: auto; align-items: center; justify-content: center; }
.nav__toggle span, .nav__toggle span::before, .nav__toggle span::after {
  content: ""; display: block; width: 22px; height: 2.4px; background: var(--ink); border-radius: 2px; position: relative; transition: .2s;
}
.nav__toggle span::before { position: absolute; top: -7px; }
.nav__toggle span::after { position: absolute; top: 7px; }
body.nav-open .nav__toggle span { background: transparent; }
body.nav-open .nav__toggle span::before { top: 0; transform: rotate(45deg); }
body.nav-open .nav__toggle span::after { top: 0; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--bg-dark); color: #fff; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(236,126,74,.34), transparent 60%),
    radial-gradient(700px 500px at 0% 110%, rgba(236,126,74,.14), transparent 55%);
}
.hero__inner { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; padding: clamp(56px, 8vw, 96px) 0; }
.hero h1 { color: #fff; }
.hero h1 .grad { background: linear-gradient(120deg, #ec7e4a, #f7b07f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: #c2c7d4; font-size: 1.18rem; margin-top: 20px; max-width: 540px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero__badge { display: inline-flex; align-items: center; gap: 9px; font-size: .85rem; font-weight: 600; color: #d7dbe6;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); padding: 8px 15px; border-radius: var(--radius-pill); margin-bottom: 24px; }
.hero__badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(236,126,74,.25); }
.hero__stats { display: flex; gap: 34px; margin-top: 40px; flex-wrap: wrap; }
.hero__stats .num { font-size: 1.9rem; font-weight: 800; color: #fff; }
.hero__stats .lbl { font-size: .88rem; color: #99a0b2; }

/* phone mockup */
.phone {
  position: relative; width: 290px; margin: 0 auto; aspect-ratio: 290/600;
  background: #0e0f14; border-radius: 42px; padding: 12px;
  box-shadow: var(--shadow-lg), 0 0 0 2px rgba(255,255,255,.06) inset;
  border: 1px solid rgba(255,255,255,.08);
}
.phone__notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 120px; height: 26px; background: #0e0f14; border-radius: 0 0 16px 16px; z-index: 3; }
.phone__screen { width: 100%; height: 100%; border-radius: 32px; overflow: hidden; background: linear-gradient(180deg, #20232b, #15171d); position: relative; display: flex; flex-direction: column; }
.phone__top { padding: 38px 20px 14px; background: linear-gradient(135deg, var(--brand), #f0996a); color: #fff; }
.phone__top small { opacity: .9; font-size: .72rem; font-weight: 600; letter-spacing: .04em; }
.phone__top h4 { color: #fff; font-size: 1.32rem; margin-top: 2px; }
.phone__ring { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.phone__ring .ring { width: 58px; height: 58px; border-radius: 50%; background: conic-gradient(#fff 72%, rgba(255,255,255,.32) 0); display: grid; place-items: center; }
.phone__ring .ring i { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-600); display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: .9rem; }
.phone__ring .meta b { display: block; font-size: 1.05rem; }
.phone__ring .meta span { font-size: .76rem; opacity: .9; }
.phone__body { padding: 16px; display: grid; gap: 11px; }
.phone__card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 12px 13px; display: flex; align-items: center; gap: 12px; }
.phone__card .ic { width: 38px; height: 38px; border-radius: 11px; background: rgba(236,126,74,.18); color: var(--brand); display: grid; place-items: center; flex: 0 0 auto; }
.phone__card .ic svg { width: 20px; height: 20px; }
.phone__card .tx b { display: block; color: #fff; font-size: .9rem; }
.phone__card .tx span { font-size: .76rem; color: #99a0b2; }
.phone__chat { margin-top: 2px; }
.phone__bubble { background: var(--brand); color: #fff; font-size: .8rem; padding: 9px 12px; border-radius: 14px 14px 14px 4px; max-width: 82%; }
.phone__bubble.me { background: rgba(255,255,255,.1); color: #e8e9ee; margin-left: auto; border-radius: 14px 14px 4px 14px; margin-top: 8px; }
.float-card {
  position: absolute; background: #fff; color: var(--ink); border-radius: 16px; padding: 13px 16px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: .9rem; animation: floaty 5s ease-in-out infinite;
}
.float-card .fi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); }
.float-card.one { top: 14%; left: -28px; }
.float-card.two { bottom: 12%; right: -26px; animation-delay: 1.4s; }
.float-card small { display: block; font-weight: 600; color: var(--muted); font-size: .74rem; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---------- Logos / trust strip ---------- */
.trust { padding: 28px 0; border-bottom: 1px solid var(--line); }
.trust__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 38px; color: var(--muted); font-weight: 600; font-size: .92rem; }
.trust__row .pill { display: inline-flex; align-items: center; gap: 9px; }
.trust__row .pill svg { width: 18px; height: 18px; color: var(--brand); }

/* ---------- Feature grid ---------- */
.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px 26px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.feature:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--brand-100); }
.feature__ic { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100)); color: var(--brand-700); }
.feature__ic svg { width: 27px; height: 27px; }
.feature h3 { margin-bottom: 9px; }
.feature p { font-size: .98rem; }

/* ---------- Split / showcase ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split--rev .split__media { order: 2; }
.checklist { display: grid; gap: 14px; margin-top: 26px; }
.checklist li { display: flex; gap: 13px; align-items: flex-start; font-weight: 600; color: var(--ink-700); }
.checklist .ck { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); display: grid; place-items: center; margin-top: 1px; }
.checklist .ck svg { width: 15px; height: 15px; }
.checklist small { display: block; font-weight: 500; color: var(--muted); }
.media-card { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); background: #fff; }
.media-collage { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.media-collage img { border-radius: var(--radius); aspect-ratio: 1; object-fit: cover; width: 100%; box-shadow: var(--shadow-sm); background: var(--bg-soft); }
.media-collage img:nth-child(1) { aspect-ratio: 1/1.3; }
.media-collage img:nth-child(4) { aspect-ratio: 1/1.3; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.step { position: relative; padding: 30px 26px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.step__n { counter-increment: step; width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; margin-bottom: 16px; }
.step__n::before { content: counter(step); }

/* ---------- CTA band / email capture ---------- */
.cta-band { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: clamp(40px, 6vw, 68px); background: var(--bg-dark); color: #fff; text-align: center; }
.cta-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(700px 360px at 50% -30%, rgba(236,126,74,.4), transparent 60%); }
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #c2c7d4; max-width: 560px; margin: 14px auto 0; }
.capture { display: flex; gap: 10px; max-width: 520px; margin: 30px auto 0; flex-wrap: wrap; }
.capture input { flex: 1 1 240px; min-width: 0; padding: 15px 18px; border-radius: var(--radius-pill); border: 2px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; }
.capture input::placeholder { color: #aab0c0; }
.capture input:focus { outline: none; border-color: var(--brand); background: rgba(255,255,255,.13); }
.capture .btn { flex: 0 0 auto; }
.capture__note { font-size: .82rem; color: #99a0b2; margin-top: 14px; }
.capture__ok { display: none; margin-top: 18px; font-weight: 700; color: #ffd9c4; align-items: center; gap: 9px; justify-content: center; }
.capture__ok svg { width: 20px; height: 20px; }
.is-sent .capture { display: none; }
.is-sent .capture__ok { display: flex; }

/* store buttons */
.stores { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }
.store-btn { display: inline-flex; align-items: center; gap: 12px; padding: 12px 20px; border-radius: 14px; background: #fff; color: var(--ink); border: 1px solid var(--line-strong); position: relative; text-decoration: none; transition: transform .15s ease, border-color .15s ease; }
.store-btn:hover { transform: translateY(-2px); border-color: var(--brand); }
.section--dark .store-btn, .cta-band .store-btn { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.18); }
.store-btn svg { width: 26px; height: 26px; }
.store-btn .st small { display: block; font-size: .66rem; opacity: .7; line-height: 1; letter-spacing: .04em; text-transform: uppercase; }
.store-btn .st b { font-size: 1.05rem; line-height: 1.1; }
.store-btn[aria-disabled="true"] { cursor: default; opacity: .92; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-dark); color: #aab0c0; padding: 64px 0 30px; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; }
.site-footer .brand { color: #fff; }
.site-footer p { color: #99a0b2; font-size: .95rem; margin-top: 16px; max-width: 320px; }
.footer__col h4 { color: #fff; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px; }
.footer__col a { display: block; padding: 6px 0; color: #aab0c0; font-size: .96rem; transition: color .15s; }
.footer__col a:hover { color: var(--brand); }
.footer__social { display: flex; gap: 10px; margin-top: 20px; }
.footer__social a { width: 40px; height: 40px; border-radius: 11px; background: rgba(255,255,255,.07); display: grid; place-items: center; color: #c2c7d4; }
.footer__social a:hover { background: var(--brand); color: #fff; }
.footer__social svg { width: 19px; height: 19px; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.09); margin-top: 48px; padding-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .9rem; }

/* ============================================================
   CONTENT HUB (exercises / recipes)
   ============================================================ */
.hub-hero { background: var(--bg-dark); color: #fff; position: relative; overflow: hidden; padding: clamp(48px,7vw,80px) 0 clamp(40px,6vw,64px); }
.hub-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(700px 380px at 85% -20%, rgba(236,126,74,.32), transparent 60%); }
.hub-hero__in { position: relative; max-width: 720px; }
.hub-hero h1 { color: #fff; }
.hub-hero p { color: #c2c7d4; margin-top: 14px; font-size: 1.12rem; }
.hub-hero .crumbs { font-size: .9rem; color: #99a0b2; margin-bottom: 16px; }
.hub-hero .crumbs a:hover { color: var(--brand); }

.toolbar { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 0 0 28px; }
.search-box { position: relative; flex: 1 1 320px; }
.search-box svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); }
.search-box input { width: 100%; padding: 14px 16px 14px 46px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: #fff; transition: border-color .15s, box-shadow .15s; }
.search-box input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.filter-select { padding: 13px 40px 13px 16px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 15px center; -webkit-appearance: none; appearance: none; font-weight: 600; cursor: pointer; }
.filter-select:focus { outline: none; border-color: var(--brand); }
.result-count { color: var(--muted); font-size: .95rem; margin-left: auto; font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; cursor: pointer;
  transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--brand-100); }
.card__media { position: relative; aspect-ratio: 4/3; background: var(--bg-soft); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card__media img { transform: scale(1.06); }
.card__media .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--brand); background: linear-gradient(135deg, var(--brand-50), var(--brand-100)); }
.card__media .ph svg { width: 46px; height: 46px; opacity: .55; }
.badge { position: absolute; top: 11px; left: 11px; background: rgba(21,23,29,.78); color: #fff; font-size: .72rem; font-weight: 700; padding: 5px 11px; border-radius: var(--radius-pill); backdrop-filter: blur(4px); }
.badge--pro { background: var(--brand); top: 11px; left: auto; right: 11px; }
.badge--veg { background: #2e9e6b; }
.badge--nonveg { background: #d9534f; }
.card__body { padding: 15px 16px 17px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card__title { font-weight: 700; font-size: 1.02rem; color: var(--ink); line-height: 1.3; }
.card__meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.tag { font-size: .76rem; font-weight: 600; color: var(--ink-700); background: var(--bg-soft); border: 1px solid var(--line); padding: 4px 10px; border-radius: var(--radius-pill); }
.tag svg { width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; color: var(--brand-700); }
.macros { display: flex; gap: 12px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.macros b { color: var(--ink); }

/* skeletons */
.skeleton .card__media, .skeleton-line { background: linear-gradient(100deg, #eee 30%, #f6f6f6 50%, #eee 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-line { height: 13px; border-radius: 6px; }

/* pagination */
.pager { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 44px; flex-wrap: wrap; }
.pager button { min-width: 42px; height: 42px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; font-weight: 700; color: var(--ink-700); transition: .15s; }
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-700); }
.pager button.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager .gap { color: var(--muted); padding: 0 4px; }

/* states */
.state { text-align: center; padding: 70px 20px; color: var(--muted); }
.state svg { width: 56px; height: 56px; color: var(--line-strong); margin: 0 auto 18px; }
.state h3 { color: var(--ink); margin-bottom: 8px; }
.state .btn { margin-top: 20px; }

/* ---------- Modal (detail) ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: none; }
.modal.is-open { display: block; }
.modal__overlay { position: absolute; inset: 0; background: rgba(16,18,29,.6); backdrop-filter: blur(3px); animation: fade .2s ease; }
.modal__dialog {
  position: relative; max-width: 720px; margin: 5vh auto; background: #fff; border-radius: var(--radius-lg);
  max-height: 90vh; overflow: hidden; box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: pop .24s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.modal__media { position: relative; aspect-ratio: 16/9; background: var(--bg-soft); flex: 0 0 auto; }
.modal__media img { width: 100%; height: 100%; object-fit: cover; }
.modal__media .ph { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-50), var(--brand-100)); color: var(--brand); }
.modal__media .ph svg { width: 64px; height: 64px; opacity: .5; }
.modal__close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; box-shadow: var(--shadow-sm); z-index: 4; }
.modal__close svg { width: 20px; height: 20px; }
.modal__close:hover { background: #fff; transform: rotate(90deg); transition: transform .2s; }
/* app modal body is its own bounded scroll container so long detail content scrolls
   (image scrolls with it); keeps .modal__media a block child so its 16/9 aspect-ratio
   holds. Scoped to #fbModalBody so the marketing modal (#modalBody) is unchanged. */
#fbModalBody { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 26px 30px 30px; }
.modal__scroll h2 { font-size: 1.7rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.macro-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin: 22px 0; }
.macro-grid .m { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; }
.macro-grid .m b { display: block; font-size: 1.4rem; color: var(--brand-700); }
.macro-grid .m span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.modal h4 { margin: 22px 0 10px; font-size: 1.05rem; }
.modal__scroll ol { padding-left: 22px; display: grid; gap: 10px; }
.modal__scroll ol li { color: var(--ink-700); }
.modal__scroll .instr { color: var(--ink-500); }
.modal__scroll .instr p { margin-bottom: 10px; color: var(--ink-500); }
.app-callout { margin-top: 24px; padding: 18px 20px; border-radius: var(--radius); background: var(--brand-50); border: 1px solid var(--brand-100); display: flex; gap: 14px; align-items: center; }
.app-callout .ci { width: 42px; height: 42px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.app-callout b { color: var(--ink); }
.app-callout small { color: var(--ink-500); }

/* ---------- Misc / page content ---------- */
.prose { max-width: 800px; margin: 0 auto; }
.prose h2 { margin: 38px 0 14px; font-size: 1.5rem; }
.prose h3 { margin: 26px 0 10px; }
.prose p, .prose li { color: var(--ink-500); margin-bottom: 14px; }
.prose ul { list-style: disc; padding-left: 22px; margin-bottom: 16px; }
.prose ul li { margin-bottom: 8px; }
.prose a { color: var(--brand-700); font-weight: 600; text-decoration: underline; }
.prose .updated { color: var(--muted); font-size: .92rem; margin-bottom: 30px; }
.note-box { background: var(--brand-50); border: 1px solid var(--brand-100); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 18px 20px; margin: 24px 0; }
.note-box p { color: var(--ink-700); margin: 0; font-size: .95rem; }
.page-hero { background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: clamp(44px,6vw,72px) 0; text-align: center; }
.page-hero p { margin-top: 12px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .hero__media { order: -1; }
  .split, .grid--4 { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav__links { position: fixed; inset: var(--header-h) 0 auto; flex-direction: column; align-items: stretch; gap: 4px;
    background: #fff; padding: 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); transform: translateY(-130%); transition: transform .25s ease; margin-left: 0; }
  body.nav-open .nav__links { transform: none; }
  .nav__links a { padding: 13px 14px; }
  .nav__cta { margin: 8px 0 0; }
  .nav__toggle { display: flex; }
  .grid--3, .grid--4, .grid--2, .steps, .split { grid-template-columns: 1fr; }
  .split--rev .split__media { order: 0; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .macro-grid { grid-template-columns: repeat(2,1fr); }
  .float-card { display: none; }
  .result-count { width: 100%; margin-left: 0; }
  .modal__scroll { padding: 22px; }
}
@media (max-width: 480px) {
  .footer__grid { grid-template-columns: 1fr; }
  .hero__stats { gap: 22px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   WEB APP SHELL  (app.html — auth, dashboard, member views)
   Dark sidebar + light content. Scoped under .app where needed.
   ============================================================ */
.app { display: flex; min-height: 100vh; background: var(--bg-soft); }

/* ---- sidebar ---- */
.app-side {
  flex: 0 0 252px; width: 252px; z-index: 200;
  background: #15171d; border-right: 1px solid rgba(255,255,255,.07); color: #e8e9ee;
  display: flex; flex-direction: column; gap: 8px; padding: 18px 16px;
  position: sticky; top: 0; height: 100vh;
}
.brand--side { color: #fff; padding: 6px 8px 12px; font-size: 1.16rem; }
.brand--side span b { color: var(--brand); }
.app-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; margin: 4px 0; }
.app-nav__link {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 12px;
  color: #aab0c0; font-weight: 600; font-size: .95rem; transition: background .15s ease, color .15s ease;
}
.app-nav__link svg { width: 20px; height: 20px; flex: 0 0 auto; }
.app-nav__link:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-nav__link.is-active { background: rgba(236,126,74,.16); color: #fff; }
.app-nav__link.is-active svg { color: var(--brand); }
.app-nav__soon {
  margin-left: auto; font-style: normal; font-size: .62rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: #8b91a1; background: rgba(255,255,255,.08); padding: 3px 7px; border-radius: var(--radius-pill);
}
.app-side__user { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; background: rgba(255,255,255,.05); }
.app-side__umeta { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.app-side__umeta b { color: #fff; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-side__umeta .badge { align-self: flex-start; }
.app-side__avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), #f4a06a);
}
.app-side__avatar--lg { width: 60px; height: 60px; font-size: 1.5rem; }
.app-side__logout {
  width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; display: grid; place-items: center;
  color: #aab0c0; transition: background .15s ease, color .15s ease;
}
.app-side__logout svg { width: 18px; height: 18px; }
.app-side__logout:hover { background: rgba(255,255,255,.1); color: #fff; }
.app-side__auth { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }

/* ---- main column ---- */
.app-scrim { display: none; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-top { display: none; }
.app-view { flex: 1; width: 100%; max-width: 1120px; margin-inline: auto; padding: clamp(22px, 4vw, 44px); }

/* ---- status pills (override absolute .badge from content hub) ---- */
.app .badge {
  position: static; top: auto; left: auto; right: auto; backdrop-filter: none;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill);
}
.app .badge--premium { background: linear-gradient(135deg, var(--brand), #f4a06a); color: #fff; }
.app .badge--free { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }

/* ---- auth forms ---- */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 90px); }
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: clamp(26px, 4vw, 38px);
}
.auth-card h2 { font-size: 1.55rem; }
.auth-sub { margin: 8px 0 22px; }
.auth-card .btn--block { margin-top: 8px; }
.auth-alt { margin-top: 18px; text-align: center; font-size: .95rem; }
.auth-alt a { color: var(--brand-700); font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field > span { font-size: .85rem; font-weight: 600; color: var(--ink-700); }
.field input {
  width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-err {
  background: #fff1f0; border: 1px solid #ffd2cc; color: #c0392b;
  padding: 11px 14px; border-radius: 12px; font-size: .9rem; font-weight: 600; margin-bottom: 16px;
}
.form-err[hidden] { display: none; }

/* ---- dashboard ---- */
.dash-hello { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dash-hello h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.dash-upsell {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(120deg, #1d2027, #15171d); color: #fff;
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px 26px; margin: 18px 0 4px;
}
.dash-upsell h3 { color: #fff; }
.dash-upsell p { color: #aab0c0; margin-top: 6px; max-width: 54ch; }
.dash-upsell .btn { flex: 0 0 auto; }
.dash-h { margin: 26px 0 14px; font-size: 1.15rem; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(218px, 1fr)); gap: 16px; }
.dash-tile {
  display: flex; flex-direction: column; gap: 5px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease;
}
.dash-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--brand-100); }
.dash-tile__ic {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 8px;
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100)); color: var(--brand-700);
}
.dash-tile__ic svg { width: 24px; height: 24px; }
.dash-tile b { font-size: 1.04rem; }
.dash-tile__d { font-size: .9rem; color: var(--muted); }

/* ---- account ---- */
.acct-card {
  max-width: 560px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: clamp(22px, 4vw, 32px);
}
.acct-head { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; }
.acct-head h2 { font-size: 1.4rem; }
.acct-head .badge { margin-top: 6px; }
.acct-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.acct-row:first-of-type { margin-top: 10px; }
.acct-row span { color: var(--muted); font-weight: 600; }
.acct-row b { color: var(--ink); text-align: right; word-break: break-word; }
.acct-note { color: var(--muted); font-size: .88rem; margin: 18px 0; }
.acct-card .btn--block { margin-top: 10px; }

/* ---- section placeholder (soon) ---- */
.section-ph {
  max-width: 520px; margin: clamp(20px, 6vh, 56px) auto; text-align: center; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: clamp(30px, 5vw, 48px);
}
.section-ph__ic {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100)); color: var(--brand-700);
}
.section-ph__ic svg { width: 32px; height: 32px; }
.section-ph h2 { margin-bottom: 10px; }
.section-ph p { margin-bottom: 22px; }

/* ---- progress (Stage 4c): weight + water + steps ---- */
.prog-wrap { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.prog-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.prog-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: clamp(18px, 3vw, 26px); min-width: 0;
}
.prog-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.prog-card__head h3 { font-size: 1.12rem; }
.prog-card__today {
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand-700); background: var(--brand-50); border-radius: var(--radius-pill); padding: 4px 11px;
}

/* weight */
.prog-weight { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.prog-big { font-size: clamp(2.2rem, 6vw, 2.9rem); font-weight: 800; letter-spacing: -.03em; color: var(--ink); line-height: 1; }
.prog-big small { font-size: .42em; font-weight: 700; color: var(--muted); margin-left: 4px; }
.prog-big--empty { color: var(--line-strong); }
.prog-hint { color: var(--muted); font-size: .9rem; margin: 0; }
.prog-delta { font-size: .9rem; font-weight: 700; color: #1f9d57; }
.prog-delta--flat { color: var(--muted); }

/* charts */
.prog-chart { margin-top: 16px; }
.prog-chart--bars { margin-top: 18px; }
.prog-chart-empty {
  margin-top: 16px; padding: 20px; text-align: center; color: var(--muted); font-size: .9rem;
  background: var(--bg-soft); border-radius: var(--radius); border: 1px dashed var(--line-strong);
}

/* inline value/goal forms */
.prog-form { margin-top: 16px; }
.prog-form__row { display: flex; gap: 10px; flex-wrap: wrap; }
.prog-form__row input[type="number"] { flex: 1 1 120px; }
.prog-form__row input[type="date"] { flex: 0 1 150px; }
.prog-form input, .prog-inline input {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: #fff; font: inherit; transition: border-color .15s ease, box-shadow .15s ease;
}
.prog-form input:focus, .prog-inline input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }

/* recent log list */
.prog-list { list-style: none; margin: 16px 0 0; padding: 0; }
.prog-li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.prog-li span { color: var(--muted); flex: 1 1 auto; }
.prog-li b { color: var(--ink); }
.prog-del {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: #fff; color: var(--muted); font-size: 1.05rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.prog-del:hover { color: #c0392b; border-color: #ffd2cc; background: #fff1f0; }
.prog-del:disabled { opacity: .5; cursor: default; }

/* daily (water/steps) layout */
.prog-daily { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.prog-daily__ring { flex: 0 0 auto; text-align: center; }
.prog-daily__side { flex: 1 1 200px; min-width: 0; }
.prog-daily__ctrls { display: flex; flex-direction: column; gap: 10px; }
.prog-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.prog-inline { display: flex; gap: 8px; }
.prog-inline input { flex: 1 1 auto; }
.prog-inline .btn { flex: 0 0 auto; }

/* ring (svg) */
.prog-ring { width: 120px; height: 120px; display: block; }
.prog-ring__bg { fill: none; stroke: var(--line); stroke-width: 10; }
.prog-ring__fg { fill: none; stroke: var(--brand); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.prog-ring__v { fill: var(--ink); font-size: 19px; font-weight: 800; text-anchor: middle; dominant-baseline: middle; }
.prog-ring__s { fill: var(--muted); font-size: 11px; font-weight: 600; text-anchor: middle; dominant-baseline: middle; }
.prog-ring__cap { margin-top: 6px; font-size: .8rem; font-weight: 700; color: var(--muted); }

/* line chart (svg) */
.prog-line { width: 100%; height: auto; display: block; }
.prog-line__area { fill: var(--brand); opacity: .1; }
.prog-line__path { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.prog-line__dot { fill: var(--brand); }
.prog-line__lbl, .prog-line__yl { fill: var(--muted); font-size: 10px; font-weight: 600; }

/* bar chart (svg) */
.prog-bars { width: 100%; height: auto; display: block; }
.prog-bar { fill: var(--brand-100); transition: fill .2s ease; }
.prog-bar--done { fill: var(--brand); }
.prog-bar__lbl { fill: var(--muted); font-size: 10px; font-weight: 600; text-anchor: middle; }
.prog-bar__goal { stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 4 4; }

/* skeleton + error */
.prog-skel { display: flex; flex-direction: column; }
.prog-err { text-align: center; padding: 10px 0; }
.prog-err p { color: var(--muted); margin-bottom: 12px; }

@media (max-width: 560px) {
  .prog-row { grid-template-columns: 1fr; }
}

/* ---- responsive: off-canvas sidebar ---- */
@media (max-width: 900px) {
  .app-side {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .25s ease; box-shadow: 0 0 60px rgba(0,0,0,.5);
  }
  .app.is-nav-open .app-side { transform: none; }
  .app.is-nav-open .app-scrim { display: block; position: fixed; inset: 0; z-index: 150; background: rgba(10,12,16,.5); }
  .app-top {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 100; height: 60px; padding: 0 14px;
    background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line);
  }
  .app-top__menu { width: 42px; height: 42px; margin-left: -6px; border-radius: 10px; display: grid; place-items: center; color: var(--ink); }
  .app-top__menu svg { width: 24px; height: 24px; }
  .app-top__title { font-size: 1.08rem; font-weight: 800; flex: 1; }
  .app-top__home { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
  .app-top__home svg { width: 20px; height: 20px; }
}
@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .dash-upsell { padding: 20px; }
  .dash-upsell .btn { width: 100%; }
}

/* ============================================================
   IN-APP LIBRARY (exercises, workouts, diet, recipes)
   Card overlays use dedicated classes (NOT .badge) because
   .app .badge is forced position:static for status pills.
   ============================================================ */
.card__flag {
  position: absolute; top: 11px; right: 11px; z-index: 2;
  background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700;
  padding: 5px 11px; border-radius: var(--radius-pill); letter-spacing: .02em;
}
.card__flag--veg { background: #2e9e6b; }
.card__flag--nonveg { background: #d9534f; }
.card__lock {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  background: rgba(21,23,29,.58); color: #fff; font-weight: 700; font-size: .85rem;
  backdrop-filter: blur(2px);
}
.card__lock svg { width: 26px; height: 26px; }
.card__lock b { font-weight: 700; }
.card--locked .card__title { color: var(--muted); }

/* locked detail modal */
.modal__media--lock {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), #f4a06a); color: #fff;
}
.modal__media--lock svg { width: 60px; height: 60px; }
.lock-note__btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* workout programme (day list) */
.wk-days { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.wk-day {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft);
}
.wk-day b { font-weight: 700; color: var(--ink); }
.wk-day__n {
  width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-100); color: var(--brand-700); font-weight: 700; font-size: .82rem;
}
.wk-day--rest { opacity: .68; }
.wk-day--rest .wk-day__n { background: var(--line); color: var(--muted); }

/* ============================================================
   PLANS / PRICING (buy-in-app) + ACCOUNT SUBSCRIPTION
   ============================================================ */
.plans-head { max-width: 640px; }
.plans-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.plans-head p { margin-top: 8px; }
.plans-head p b { color: var(--ink); }

.sub-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(120deg, #1d2027, #15171d); color: #fff;
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px 22px; margin: 18px 0 4px;
}
.sub-banner b { color: #fff; display: block; }
.sub-banner span { color: #aab0c0; font-size: .9rem; }
.sub-banner .btn { flex: 0 0 auto; }

.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 18px; margin-top: 22px; }
.plan {
  position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 24px 22px 22px;
}
.plan--featured { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-100), var(--shadow); }
.plan--current { border-color: var(--brand-100); background: var(--brand-50); }
.plan__ribbon {
  position: absolute; top: -11px; left: 22px; background: var(--brand); color: #fff;
  font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 12px; border-radius: var(--radius-pill); box-shadow: var(--shadow-sm);
}
.plan__name { font-size: 1.1rem; }
.plan__price { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); margin-top: 6px; }
.plan__price span { font-size: .92rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan__permo { font-size: .85rem; color: var(--brand-700); font-weight: 700; margin-top: 2px; }
.plan__desc { font-size: .92rem; color: var(--ink-500); margin-top: 12px; flex: 1 1 auto; }
.plan__cta { margin-top: 18px; }
.plan__owned {
  display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; font-weight: 700;
  color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-100);
  border-radius: var(--radius-pill); padding: 13px 16px; font-size: .95rem;
}
.plan__owned svg { width: 17px; height: 17px; }
.plan__owned--muted { color: var(--muted); background: var(--bg-soft); border-color: var(--line); }

.plans-foot { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.plans-foot p { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.plans-foot p svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--brand); }
.plans-foot__btns { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* account: stacked profile + subscription cards */
.acct-stack { max-width: 560px; display: grid; gap: 18px; }
.acct-stack .acct-card { max-width: none; }
.sub-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: clamp(22px, 4vw, 28px);
}
.sub-card--active { border-color: var(--brand-100); }
.sub-card__top { display: flex; align-items: center; gap: 12px; }
.sub-card__top b { font-size: 1.1rem; }
.sub-card .acct-row:first-of-type { margin-top: 12px; }
.sub-card__note { color: var(--muted); font-size: .9rem; margin: 16px 0; }

@media (max-width: 520px) {
  .plans-grid { grid-template-columns: 1fr; }
  .plans-foot__btns .btn { width: 100%; }
}

/* ---- account editing (Stage 4a) ---- */
.acct-stack--wide { max-width: 640px; }
.acct-card[data-acct] { display: block; }

/* selects share the input look */
.field select {
  width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  -webkit-appearance: none; appearance: none; color: var(--ink); font: inherit; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }

/* number + unit combo (height / weight) */
.field--combo .combo { display: grid; grid-template-columns: 1fr 92px; gap: 8px; }
.field--combo .combo select { padding-right: 30px; background-position: right 9px center; }

/* sub-headers inside cards */
.acct-sub { font-size: 1.05rem; margin: 24px 0 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.acct-sub--first { margin-top: 0; padding-top: 0; border-top: 0; }
.acct-note--sm { font-size: .82rem; margin: 12px 0 0; }

/* computed stats */
.acct-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin-top: 6px; }
.acct-stat {
  background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 14px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
}
.acct-stat span { color: var(--brand-700); font-weight: 600; font-size: .8rem; }
.acct-stat b { font-size: 1.2rem; color: var(--ink); }

/* avatar picker */
.acct-avatar { position: relative; cursor: pointer; flex: 0 0 auto; display: block; }
.acct-avatar__img {
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  font-weight: 800; font-size: 1.6rem; color: #fff; background: linear-gradient(135deg, var(--brand), #f4a06a);
}
.acct-avatar__img img { width: 100%; height: 100%; object-fit: cover; }
.acct-avatar__badge {
  position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line-strong); color: var(--ink-700);
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.acct-avatar__badge svg { width: 14px; height: 14px; }
.acct-avatar:hover .acct-avatar__badge { color: var(--brand-700); border-color: var(--brand); }

/* danger zone */
.acct-danger { border-color: #f3d6d2; }
.btn--danger { background: #fff; color: #c0392b; border-color: #f0c3bd; }
.btn--danger:hover { background: #fff1f0; border-color: #d9534f; transform: translateY(-2px); }
.btn--danger.is-armed { background: #d9534f; color: #fff; border-color: #d9534f; }

.btn:disabled { opacity: .6; cursor: default; transform: none !important; box-shadow: none; }

/* toast */
.fb-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: var(--ink); color: #fff; font-weight: 600; font-size: .92rem;
  padding: 13px 20px; border-radius: var(--radius-pill); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 120; max-width: 90vw;
}
.fb-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.fb-toast--ok { background: #2e9e6b; }
.fb-toast--err { background: #d9534f; }

@media (max-width: 520px) {
  .field--combo .combo { grid-template-columns: 1fr 84px; }
}

/* ============================================================
   Stage 4b — favourites (heart) + Saved hub
   ============================================================ */
/* heart button on cards (top-left, opposite the PRO/diet badge) and in detail modals */
.fav-btn {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  width: 38px; height: 38px; padding: 0; display: grid; place-items: center;
  border: none; border-radius: 50%; cursor: pointer; color: var(--ink);
  background: rgba(255, 255, 255, .92); box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.fav-btn:hover { transform: scale(1.08); }
.fav-btn:active { transform: scale(.92); }
.fav-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.fav-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; display: block; }
.fav-btn.is-on { background: var(--brand); color: #fff; }
.fav-btn.is-on svg { fill: #fff; stroke: #fff; }
.modal__media .fav-btn { top: 12px; left: 12px; width: 42px; height: 42px; }
.modal__media .fav-btn svg { width: 22px; height: 22px; }

/* Saved hub */
.saved-intro { margin: 2px 0 22px; color: var(--muted); }
.saved-sec { margin-bottom: 32px; }
.saved-sec:last-child { margin-bottom: 4px; }
.saved-sec__head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; }
.saved-sec__head h2 { font-size: 1.14rem; margin: 0; }
.saved-sec__c { color: var(--muted); font-weight: 700; font-size: .9rem; }
.saved-sec__c:empty { display: none; }
.saved-empty {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; padding: 32px 18px; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--bg-soft);
}
.saved-empty__ic { width: 42px; height: 42px; color: var(--brand); }
.saved-empty__ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; }
.saved-empty p { margin: 0; max-width: 380px; }

/* ============================================================
   Stage 4d — Meal planner + shopping list
   ============================================================ */
.is-busy { opacity: .55; pointer-events: none; }

/* ---- meal planner ---- */
.mp-wrap { display: flex; flex-direction: column; gap: 18px; max-width: 820px; }

/* date bar */
.mp-datebar { display: flex; align-items: stretch; gap: 10px; }
.mp-nav {
  flex: 0 0 auto; width: 46px; border: 1px solid var(--line); background: #fff; border-radius: 14px;
  display: grid; place-items: center; cursor: pointer; color: var(--ink-700); box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, color .15s ease, transform .1s ease;
}
.mp-nav:hover { border-color: var(--brand); color: var(--brand-700); }
.mp-nav:active { transform: scale(.95); }
.mp-nav svg { width: 20px; height: 20px; }
.mp-nav--prev svg { transform: rotate(180deg); }
.mp-date {
  flex: 1 1 auto; position: relative; display: flex; flex-direction: column; justify-content: center;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px 16px;
  box-shadow: var(--shadow-sm); cursor: pointer; min-width: 0;
}
.mp-date strong { font-size: 1.02rem; color: var(--ink); }
.mp-date input[type="date"] {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0;
}

/* summary card */
.mp-summary {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: clamp(16px, 3vw, 24px); display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.mp-summary__ring { flex: 0 0 auto; }
.mp-summary__side { flex: 1 1 220px; min-width: 0; }
.mp-summary__lbl {
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand-700); margin-bottom: 10px;
}
.mp-macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mp-macro {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 3px;
}
.mp-macro__l { font-size: .76rem; font-weight: 700; color: var(--muted); }
.mp-macro__v { font-size: 1.1rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.mp-macro__v small { font-size: .62em; font-weight: 600; color: var(--muted); margin-left: 1px; }
.mp-hint {
  margin: 14px 0 0; font-size: .86rem; color: var(--muted);
  background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 12px; padding: 10px 13px;
}
.mp-hint a { color: var(--brand-700); font-weight: 700; }

/* meal sections */
.mp-meals { display: flex; flex-direction: column; gap: 14px; }
.mp-meal {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 16px clamp(14px, 2.4vw, 20px);
}
.mp-meal__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.mp-meal__head h3 { font-size: 1.06rem; margin: 0; }
.mp-meal__cal { font-size: .85rem; font-weight: 700; color: var(--brand-700); }
.mp-items { display: flex; flex-direction: column; }

.mp-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.mp-item:first-child { border-top: 0; }
.mp-item__b { flex: 1 1 auto; min-width: 0; }
.mp-item__t { font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-item__m { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.mp-item--done .mp-item__t { color: var(--muted); text-decoration: line-through; }

.mp-thumb {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: var(--bg-soft);
}
.mp-thumb--ph { display: grid; place-items: center; color: var(--brand); border: 1px solid var(--line); }
.mp-thumb--ph svg { width: 22px; height: 22px; }

.mp-empty { color: var(--muted); font-size: .88rem; padding: 6px 0 2px; }
.mp-del, .sl-item__del {
  flex: 0 0 auto; width: 34px; height: 34px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.mp-del:hover, .sl-item__del:hover { color: #c0392b; border-color: #ffd2cc; background: #fff1f0; }
.mp-del svg, .sl-item__del svg { width: 16px; height: 16px; }

.mp-add {
  margin-top: 12px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--bg-soft);
  color: var(--ink-700); font: inherit; font-weight: 700; cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.mp-add:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); }
.mp-add svg { width: 18px; height: 18px; }

/* completion checkbox (shared look for mp + sl) */
.mp-check, .sl-check { flex: 0 0 auto; position: relative; display: inline-grid; place-items: center; cursor: pointer; }
.mp-check input, .sl-check input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.mp-check__box, .sl-check__box {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-strong); background: #fff;
  display: grid; place-items: center; color: #fff; transition: background .15s ease, border-color .15s ease;
}
.mp-check__box svg, .sl-check__box svg { width: 16px; height: 16px; opacity: 0; transition: opacity .12s ease; }
.mp-check input:checked + .mp-check__box,
.sl-check input:checked + .sl-check__box { background: var(--brand); border-color: var(--brand); }
.mp-check input:checked + .mp-check__box svg,
.sl-check input:checked + .sl-check__box svg { opacity: 1; }
.mp-check input:focus-visible + .mp-check__box,
.sl-check input:focus-visible + .sl-check__box { box-shadow: 0 0 0 4px var(--brand-50); }

/* planner footer actions */
.mp-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.mp-gen { display: inline-flex; align-items: center; gap: 8px; }
.mp-gen svg { width: 18px; height: 18px; }

/* ---- recipe picker modal ---- */
body.pick-open { overflow: hidden; }
.pick { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; padding: 18px; }
.pick[hidden] { display: none; }
.pick__backdrop { position: absolute; inset: 0; background: rgba(16, 18, 29, .55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.pick__panel {
  position: relative; z-index: 1; width: min(680px, 100%); max-height: min(86vh, 760px);
  display: flex; flex-direction: column; background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.pick__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.pick__head strong { font-size: 1.08rem; }
.pick__x {
  width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line);
  border-radius: 50%; background: #fff; color: var(--ink-700); cursor: pointer;
}
.pick__x:hover { border-color: var(--brand); color: var(--brand-700); }
.pick__x svg { width: 18px; height: 18px; transform: rotate(180deg); }
.pick__search {
  margin: 14px 18px 4px; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 12px;
  font: inherit; background: var(--bg-soft);
}
.pick__search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); background: #fff; }
.pick__grid {
  padding: 14px 18px 18px; overflow-y: auto; display: grid; min-height: 0;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: max-content; gap: 12px;
}
.pick-card {
  display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.pick-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow); }
.pick-card--busy { opacity: .5; pointer-events: none; }
.pick-card__img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg-soft); display: block; }
.pick-card__img--ph { display: grid; place-items: center; color: var(--brand); }
.pick-card__img--ph svg { width: 30px; height: 30px; }
.pick-card__b { padding: 10px 12px; }
.pick-card__t { font-weight: 700; font-size: .9rem; line-height: 1.25; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-card__m { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.pick-none { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 30px 10px; }

/* ---- shopping list ---- */
.sl-wrap { max-width: 760px; }
.sl-intro { margin: 2px 0 18px; color: var(--muted); }
.sl-list { display: flex; flex-direction: column; gap: 12px; }
.sl-card {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.sl-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow); }
.sl-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sl-card__b { flex: 1 1 auto; min-width: 0; }
.sl-card__t { font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-card__m { font-size: .84rem; color: var(--muted); margin-top: 3px; }
.sl-card__go { flex: 0 0 auto; width: 20px; height: 20px; color: var(--line-strong); }
.sl-card__del {
  flex: 0 0 auto; width: 36px; height: 36px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.sl-card__del:hover { color: #c0392b; border-color: #ffd2cc; background: #fff1f0; }
.sl-card__del svg { width: 16px; height: 16px; }

.sl-empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding: 40px 18px; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--bg-soft);
}
.sl-empty__ic { width: 44px; height: 44px; color: var(--brand); }
.sl-empty__ic svg { width: 100%; height: 100%; }
.sl-empty h3 { margin: 0; color: var(--ink); }
.sl-empty p { margin: 0; max-width: 380px; }
.sl-empty a { color: var(--brand-700); font-weight: 700; }

/* shopping detail */
.sl-detail__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sl-back__i { width: 16px; height: 16px; transform: rotate(180deg); margin-right: 2px; }
.sl-detail__del {
  width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; color: var(--muted); cursor: pointer;
}
.sl-detail__del:hover { color: #c0392b; border-color: #ffd2cc; background: #fff1f0; }
.sl-detail__del svg { width: 18px; height: 18px; }
.sl-detail__title { font-size: 1.4rem; margin: 0 0 4px; }
.sl-detail__meta { font-size: .88rem; color: var(--muted); margin-bottom: 18px; }

.sl-groups { display: flex; flex-direction: column; gap: 16px; }
.sl-group {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 6px 16px 8px;
}
.sl-group__h {
  font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-700);
  padding: 12px 0 4px;
}
.sl-items { display: flex; flex-direction: column; }
.sl-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.sl-item__b { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 8px; justify-content: space-between; }
.sl-item__n { font-weight: 600; color: var(--ink); }
.sl-item__q { font-size: .85rem; color: var(--muted); font-weight: 700; flex: 0 0 auto; }
.sl-item--done .sl-item__n { color: var(--muted); text-decoration: line-through; }

.sl-add {
  margin-top: 18px; display: grid; grid-template-columns: 1fr 90px 92px auto; gap: 10px; align-items: stretch;
}
.sl-add input, .sl-add select {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: #fff; font: inherit; min-width: 0;
}
.sl-add input:focus, .sl-add select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.sl-add .btn { padding-left: 14px; padding-right: 14px; }
.sl-add .btn svg { width: 18px; height: 18px; }

@media (max-width: 600px) {
  .mp-macros { grid-template-columns: 1fr 1fr; }
  .mp-summary { gap: 16px; }
  .sl-add { grid-template-columns: 1fr 1fr; }
  .sl-add input[name="custom_item_name"] { grid-column: 1 / -1; }
}

/* ============================================================
   STAGE 5a — Notifications inbox + Reminders editor
   ============================================================ */

/* sidebar unread badge (notifications nav item) */
.app-nav__badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill);
  background: var(--brand); color: #fff; font-size: .72rem; font-weight: 800; line-height: 20px; text-align: center;
  box-shadow: 0 0 0 3px rgba(236,126,74,.18);
}
.app-nav__badge[hidden] { display: none; }

/* mobile topbar bell */
.app-top__bell { position: relative; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-700); }
.app-top__bell svg { width: 22px; height: 22px; }
.app-top__bell:hover { background: var(--brand-50); color: var(--brand-700); }
.app-top__badge {
  position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--radius-pill);
  background: var(--brand); color: #fff; font-size: .64rem; font-weight: 800; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px #fff;
}
.app-top__badge[hidden] { display: none; }

/* notifications inbox */
.notif-wrap { max-width: 640px; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.notif-head__c { color: var(--muted); font-weight: 600; font-size: .9rem; }
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 14px; padding: 15px 16px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  position: relative; transition: border-color .15s ease, box-shadow .15s ease;
}
.notif-item--unread { cursor: pointer; border-color: var(--brand-100); background: var(--brand-50); }
.notif-item--unread:hover { border-color: var(--brand); }
.notif-item__ic, .notif-item__img { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; overflow: hidden; }
.notif-item__ic { display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-50), var(--brand-100)); color: var(--brand-700); }
.notif-item__ic svg { width: 22px; height: 22px; }
.notif-item__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.notif-item__b { flex: 1; min-width: 0; }
.notif-item__t { font-weight: 700; color: var(--ink); }
.notif-item__m { color: var(--ink-500); font-size: .92rem; margin-top: 3px; }
.notif-item__time { color: var(--muted); font-size: .8rem; margin-top: 6px; }
.notif-item__dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: 6px; }
.notif-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  max-width: 380px; margin: clamp(20px, 6vh, 56px) auto; color: var(--muted);
}
.notif-empty__ic { width: 44px; height: 44px; color: var(--brand); }
.notif-empty__ic svg { width: 100%; height: 100%; }
.notif-empty h3 { margin: 0; color: var(--ink); }
.notif-empty p { margin: 0; }

/* reminders editor */
.rem-wrap { max-width: 560px; display: grid; gap: 18px; }
.rem-intro { color: var(--ink-500); }
.rem-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: clamp(18px, 3vw, 26px); }
.rem-card__h { display: flex; align-items: center; gap: 12px; }
.rem-card__h h3 { font-size: 1.1rem; flex: 1; }
.rem-card__ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-50), var(--brand-100)); color: var(--brand-700); flex: 0 0 auto; }
.rem-card__ic svg { width: 20px; height: 20px; }
.rem-card__body { margin-top: 14px; display: grid; gap: 12px; }
.rem-card--off .rem-card__body { opacity: .45; pointer-events: none; }
.rem-window { display: grid; gap: 12px; }
.rem-window[hidden] { display: none; }
.rem-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.rem-row[hidden] { display: none; }
.rem-row > span { font-weight: 600; color: var(--ink-700); }
.rem-row select, .rem-row input[type="time"] {
  padding: 10px 13px; border-radius: 11px; border: 1px solid var(--line-strong); background: #fff;
  font: inherit; color: var(--ink); min-width: 132px;
}
.rem-row select:focus, .rem-row input[type="time"]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.rem-meals { margin-top: 6px; display: flex; flex-direction: column; }
.rem-meal { padding: 16px 0; border-top: 1px solid var(--line); }
.rem-meal:first-child { padding-top: 6px; border-top: 0; }
.rem-meal__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rem-meal__n { font-weight: 700; color: var(--ink); }
.rem-row--time { margin-top: 12px; }
.rem-meal--off .rem-row--time { opacity: .45; pointer-events: none; }
.rem-note { color: var(--muted); font-size: .84rem; text-align: center; }

/* toggle switch */
.rem-switch { position: relative; flex: 0 0 auto; width: 46px; height: 27px; cursor: pointer; }
.rem-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.rem-switch__t { position: absolute; inset: 0; border-radius: var(--radius-pill); background: var(--line-strong); transition: background .18s ease; }
.rem-switch__t::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s ease; }
.rem-switch input:checked + .rem-switch__t { background: var(--brand); }
.rem-switch input:checked + .rem-switch__t::after { transform: translateX(19px); }
.rem-switch input:focus-visible + .rem-switch__t { box-shadow: 0 0 0 4px var(--brand-50); }

/* account → reminders link card */
.acct-link { display: flex; align-items: center; gap: 14px; text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.acct-link:hover { border-color: var(--brand-100); box-shadow: var(--shadow); transform: translateY(-2px); }
.acct-link__ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-50), var(--brand-100)); color: var(--brand-700); }
.acct-link__ic svg { width: 22px; height: 22px; }
.acct-link__b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acct-link__b b { color: var(--ink); font-size: 1.02rem; }
.acct-link__b span { color: var(--muted); font-size: .88rem; }
.acct-link__go { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; }

/* ============================================================
   Stage 5b — Community (social feed)
   ============================================================ */
.comm-wrap { max-width: 640px; display: flex; flex-direction: column; gap: 16px; }

/* avatars */
.comm-av { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--bg-soft); }
.comm-av img { width: 100%; height: 100%; object-fit: cover; }
.comm-av--ph { background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: #fff; font-weight: 800; font-size: 1.05rem; }
.comm-av--sm { width: 36px; height: 36px; font-size: .92rem; }
.comm-av--xs { width: 30px; height: 30px; font-size: .8rem; }

/* composer */
.comm-composer { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.comm-composer__row { display: flex; gap: 12px; align-items: flex-start; }
.comm-composer__text { flex: 1; min-width: 0; border: 0; resize: vertical; min-height: 46px; font-size: 1rem; line-height: 1.5; padding: 9px 2px; background: none; }
.comm-composer__text:focus { outline: none; }
.comm-composer__previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.comm-composer__previews[hidden] { display: none; }
.comm-composer__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.comm-composer__media { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--brand-700); background: var(--brand-50); cursor: pointer; transition: background .15s ease; }
.comm-composer__media:hover { background: var(--brand-100); }
.comm-composer__media svg { width: 21px; height: 21px; }

/* media previews (composer + edit sheet) */
.comm-prev { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-soft); border: 1px solid var(--line); }
.comm-prev__media { width: 100%; height: 100%; }
.comm-prev__media img, .comm-prev__media video { width: 100%; height: 100%; object-fit: cover; }
.comm-prev__x { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%; background: rgba(16,18,29,.7); color: #fff; display: grid; place-items: center; transition: background .15s ease; }
.comm-prev__x:hover { background: rgba(16,18,29,.92); }
.comm-prev__x svg { width: 15px; height: 15px; }

/* tabs */
.comm-tabs { display: flex; gap: 6px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 5px; }
.comm-tab { flex: 1; padding: 9px 14px; border-radius: var(--radius-pill); font-weight: 700; font-size: .94rem; color: var(--muted); transition: background .15s ease, color .15s ease; }
.comm-tab.is-on { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm); }

/* feed list */
.comm-list { display: flex; flex-direction: column; gap: 16px; }
.comm-more { display: flex; justify-content: center; padding-top: 2px; }
.comm-more[hidden] { display: none; }

/* post card */
.comm-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 18px; }
.comm-list .comm-card { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.comm-list .comm-card:hover { border-color: var(--brand-100); box-shadow: var(--shadow); transform: translateY(-2px); }
.comm-card__head { display: flex; align-items: center; gap: 11px; }
.comm-card__who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.comm-card__who b { color: var(--ink); font-weight: 700; }
.comm-card__who span { color: var(--muted); font-size: .82rem; }
.comm-card__body { margin-top: 12px; }
.comm-card__text { color: var(--ink-700); white-space: normal; word-wrap: break-word; overflow-wrap: anywhere; }

/* media grid */
.comm-media { margin-top: 12px; display: grid; gap: 4px; border-radius: var(--radius); overflow: hidden; }
.comm-media--2 { grid-template-columns: 1fr 1fr; }
.comm-media--many { grid-template-columns: 1fr 1fr 1fr; }
.comm-media__cell { background: var(--bg-soft); aspect-ratio: 1; }
.comm-media--1 .comm-media__cell { aspect-ratio: auto; max-height: 460px; }
.comm-media__cell img, .comm-media__cell video { width: 100%; height: 100%; object-fit: cover; display: block; }
.comm-media--1 .comm-media__cell img, .comm-media--1 .comm-media__cell video { object-fit: contain; max-height: 460px; background: #000; }

/* actions row */
.comm-act { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.comm-act__btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: var(--radius-pill); color: var(--muted); font-weight: 700; font-size: .92rem; transition: background .15s ease, color .15s ease; }
.comm-act__btn:hover { background: var(--bg-soft); }
.comm-act__btn svg { width: 19px; height: 19px; }
.comm-act__btn--save { margin-left: auto; }
.comm-act__btn--like.is-on { color: #e0245e; }
.comm-act__btn--like.is-on svg { fill: #e0245e; }
.comm-act__btn--save.is-on { color: var(--brand-700); }
.comm-act__btn--save.is-on svg { fill: var(--brand); stroke: var(--brand-700); }

/* post menu (⋯) */
.comm-menu { position: relative; flex: 0 0 auto; }
.comm-menu__btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: background .15s ease, color .15s ease; }
.comm-menu__btn:hover { background: var(--bg-soft); color: var(--ink); }
.comm-menu__btn svg { width: 20px; height: 20px; }
.comm-menu__pop { position: absolute; top: 42px; right: 0; z-index: 20; min-width: 168px; background: #fff; border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; }
.comm-menu__pop[hidden] { display: none; }
.comm-menu__item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 600; color: var(--ink-700); text-align: left; transition: background .12s ease; }
.comm-menu__item:hover { background: var(--bg-soft); }
.comm-menu__item svg { width: 18px; height: 18px; flex: 0 0 auto; }
.comm-menu__item--danger { color: #c0392b; }
.comm-menu__item--danger:hover { background: #fff1f0; }

/* modal sheet */
.comm-sheet { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(16,18,29,.5); opacity: 0; transition: opacity .18s ease; }
.comm-sheet.is-on { opacity: 1; }
.comm-sheet__card { width: 100%; max-width: 460px; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 24px; transform: translateY(12px) scale(.98); transition: transform .18s ease; max-height: 86vh; overflow-y: auto; }
.comm-sheet.is-on .comm-sheet__card { transform: none; }
.comm-sheet__t { font-size: 1.2rem; margin-bottom: 6px; }
.comm-sheet__m { color: var(--ink-500); font-size: .95rem; margin-bottom: 16px; }
.comm-sheet__ta { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px; font: inherit; resize: vertical; min-height: 76px; margin-bottom: 16px; }
.comm-sheet__ta:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.comm-sheet__row { display: flex; justify-content: flex-end; gap: 10px; }
.comm-sheet__row--split { justify-content: space-between; align-items: center; }
.comm-sheet__actions { display: flex; gap: 10px; }

/* post detail */
.comm-detail { max-width: 640px; display: flex; flex-direction: column; gap: 16px; }
.comm-back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: .92rem; transition: color .15s ease; align-self: flex-start; }
.comm-back:hover { color: var(--brand-700); }
.comm-back__ic { width: 18px; height: 18px; transform: rotate(180deg); }
.comm-card--detail { cursor: default; }
.comm-card--detail .comm-card__text { font-size: 1.05rem; }

/* comments */
.comm-comments { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 18px; }
.comm-comments__h { font-size: 1.1rem; margin-bottom: 14px; }
.comm-cbox { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.comm-cbox__in { flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); padding: 11px 16px; font: inherit; background: var(--bg-soft); }
.comm-cbox__in:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-50); }
.comm-cbox__send, .comm-replybox__send { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; transition: background .15s ease, transform .15s ease; }
.comm-cbox__send:hover, .comm-replybox__send:hover { background: var(--brand-600); transform: translateY(-1px); }
.comm-cbox__send svg, .comm-replybox__send svg { width: 18px; height: 18px; }
.comm-clist { display: flex; flex-direction: column; gap: 16px; }
.comm-cnone { color: var(--muted); text-align: center; padding: 14px 0; }
.comm-cmore { display: flex; justify-content: center; margin-top: 14px; }
.comm-cmore[hidden] { display: none; }

/* one comment */
.comm-c__main { display: flex; align-items: flex-start; gap: 10px; }
.comm-c__bubble { flex: 1; min-width: 0; background: var(--bg-soft); border-radius: 4px 16px 16px 16px; padding: 10px 14px; }
.comm-c__bubble b { color: var(--ink); font-weight: 700; font-size: .94rem; }
.comm-c__time { color: var(--muted); font-size: .76rem; margin-left: 8px; }
.comm-c__text { color: var(--ink-700); margin-top: 3px; word-wrap: break-word; overflow-wrap: anywhere; }
.comm-c__del, .comm-r__del { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: background .15s ease, color .15s ease; }
.comm-c__del:hover, .comm-r__del:hover { background: #fff1f0; color: #c0392b; }
.comm-c__del svg { width: 16px; height: 16px; }
.comm-r__del svg { width: 14px; height: 14px; }
.comm-c__tools { padding-left: 46px; margin-top: 5px; }
.comm-c__reply { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; font-size: .84rem; transition: color .15s ease; }
.comm-c__reply:hover { color: var(--brand-700); }
.comm-c__rico { width: 15px; height: 15px; }
.comm-c__more { color: var(--brand-700); font-weight: 700; font-size: .84rem; padding-left: 46px; margin-top: 8px; }
.comm-c__more:hover { text-decoration: underline; }

/* replies */
.comm-replies { padding-left: 46px; margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.comm-replies:empty { display: none; }
.comm-r { display: flex; align-items: flex-start; gap: 9px; }
.comm-r__bubble { flex: 1; min-width: 0; background: var(--bg-soft); border-radius: 4px 14px 14px 14px; padding: 8px 12px; }
.comm-r__bubble b { color: var(--ink); font-weight: 700; font-size: .88rem; }
.comm-replybox { display: flex; align-items: center; gap: 9px; padding-left: 46px; margin-top: 10px; }
.comm-replybox[hidden] { display: none; }
.comm-replybox__in { flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); padding: 9px 14px; font: inherit; font-size: .92rem; background: var(--bg-soft); }
.comm-replybox__in:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-50); }
.comm-replybox__send { width: 38px; height: 38px; }

/* empty state */
.comm-empty { text-align: center; padding: 48px 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.comm-empty svg { width: 46px; height: 46px; color: var(--brand); margin-bottom: 6px; }
.comm-empty h3 { color: var(--ink); }
.comm-empty p { color: var(--muted); max-width: 320px; }

@media (max-width: 520px) {
  .comm-card, .comm-comments, .comm-composer { padding: 14px; }
  .comm-act__btn { padding: 8px 10px; }
}

/* ============================ Stage 5c — Classes ============================ */
.cls-head { margin-bottom: 16px; }
.cls-head h2 { font-size: 1.5rem; }
.cls-head p { color: var(--muted); margin-top: 4px; }

/* horizontal day picker */
.cls-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cls-strip::-webkit-scrollbar { display: none; }
.cls-day {
  flex: 0 0 auto; width: 54px; padding: 9px 0; border: 1px solid var(--line); background: #fff;
  border-radius: 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--ink-500); box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, transform .1s ease, background .15s ease, color .15s ease;
}
.cls-day:hover { border-color: var(--brand); color: var(--brand-700); }
.cls-day:active { transform: scale(.96); }
.cls-day__wd { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cls-day__n { font-size: 1.1rem; font-weight: 800; color: var(--ink); }
.cls-day.is-active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow); }
.cls-day.is-active .cls-day__n { color: #fff; }

/* search */
.cls-search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 9px 16px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.cls-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.cls-search__ic { display: grid; place-items: center; color: var(--muted); }
.cls-search__ic svg { width: 18px; height: 18px; }
.cls-search input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; background: transparent; color: var(--ink); }

/* list + cards */
.cls-list { display: flex; flex-direction: column; gap: 12px; }
.cls-card {
  display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 16px 18px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.cls-card:hover { border-color: var(--brand-100); box-shadow: var(--shadow); transform: translateY(-2px); }
.cls-card__main { flex: 1; min-width: 0; }
.cls-card__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.cls-card__name { font-size: 1.12rem; font-weight: 800; color: var(--ink); margin: 0; }

.cls-badge { flex: 0 0 auto; font-size: .76rem; font-weight: 800; padding: 4px 11px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; gap: 4px; }
.cls-badge svg { width: 13px; height: 13px; }
.cls-badge--free { background: #e8f5ee; color: #1f8a4c; }
.cls-badge--paid { background: var(--brand-100); color: var(--brand-700); }
.cls-badge--owned { background: var(--ink); color: #fff; }

.cls-card__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.cls-meta { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--ink-500); }
.cls-meta svg { width: 15px; height: 15px; color: var(--muted); flex: 0 0 auto; }

.cls-card__act { flex: 0 0 auto; }
.cls-card__act .btn svg { width: 16px; height: 16px; }
.cls-note { font-size: .82rem; color: var(--muted); font-style: italic; }

.cls-empty { text-align: center; padding: 48px 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cls-empty svg { width: 46px; height: 46px; color: var(--brand); margin-bottom: 6px; }
.cls-empty h3 { color: var(--ink); }
.cls-empty p { color: var(--muted); max-width: 320px; }

@media (max-width: 520px) {
  .cls-card { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; }
  .cls-card__act { display: flex; }
  .cls-card__act .btn { width: 100%; }
}

/* ============================ Stage 5d — Store + Articles ============================ */
.store-head, .art-head { margin-bottom: 16px; }
.store-head h2, .art-head h2 { font-size: 1.5rem; }
.store-head p, .art-head p { color: var(--muted); margin-top: 4px; max-width: 640px; }

/* shared search pill (store + articles) */
.store-search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 9px 16px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.store-search__ic { display: grid; place-items: center; color: var(--muted); }
.store-search__ic svg { width: 18px; height: 18px; }
.store-search input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; background: transparent; color: var(--ink); }

/* category chips */
.store-cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; -ms-overflow-style: none; scrollbar-width: none; }
.store-cats::-webkit-scrollbar { display: none; }
.store-cats:empty { display: none; }
.store-chip { flex: 0 0 auto; cursor: pointer; font: inherit; font-size: .88rem; font-weight: 700; color: var(--ink-500); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 8px 16px; transition: all .15s ease; white-space: nowrap; }
.store-chip:hover { border-color: var(--brand-100); color: var(--brand-700); }
.store-chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* product grid + cards */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.store-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.store-card:hover { border-color: var(--brand-100); box-shadow: var(--shadow); transform: translateY(-3px); }
.store-card__img { aspect-ratio: 1 / 1; background: #f4f4f7; display: grid; place-items: center; overflow: hidden; }
.store-card__img img { width: 100%; height: 100%; object-fit: contain; }
.store-card__ph { color: #c4c8d2; }
.store-card__ph svg { width: 42px; height: 42px; }
.store-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.store-card__title { font-size: .96rem; font-weight: 700; color: var(--ink); margin: 0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.store-card__price { font-size: 1rem; font-weight: 800; color: var(--brand-700); }

.store-empty, .art-empty { grid-column: 1 / -1; text-align: center; padding: 48px 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.store-empty svg, .art-empty svg { width: 46px; height: 46px; color: var(--brand); margin-bottom: 6px; }
.store-empty h3, .art-empty h3 { color: var(--ink); }
.store-empty p, .art-empty p { color: var(--muted); max-width: 320px; }

/* product detail */
.pd-wrap { display: flex; flex-direction: column; gap: 18px; }
.pd { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
.pd-media { background: #f4f4f7; border: 1px solid var(--line); border-radius: var(--radius-lg); aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; }
.pd-media img { width: 100%; height: 100%; object-fit: contain; }
.pd-media__ph { color: #c4c8d2; }
.pd-media__ph svg { width: 64px; height: 64px; }
.pd-info { min-width: 0; }
.pd-title { font-size: 1.55rem; font-weight: 800; color: var(--ink); margin: 0; line-height: 1.2; }
.pd-price { font-size: 1.6rem; font-weight: 800; color: var(--brand-700); margin: 10px 0 16px; }
.pd-desc { margin-bottom: 22px; }
.pd-actions { margin-bottom: 14px; }
.pd-buy svg { width: 18px; height: 18px; }
.pd-note { display: inline-block; font-size: .92rem; color: var(--muted); font-style: italic; padding: 12px 0; }
.pd-disclaim { font-size: .8rem; color: var(--muted); line-height: 1.5; }

/* articles — featured row */
.art-feat { margin-bottom: 8px; }
.art-feat[hidden] { display: none; }
.art-sec { font-size: 1.08rem; font-weight: 800; color: var(--ink); margin: 8px 0 12px; }
.art-feat__row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; -ms-overflow-style: none; scrollbar-width: none; }
.art-feat__row::-webkit-scrollbar { display: none; }
.art-feat__card { position: relative; flex: 0 0 auto; width: 290px; max-width: 80vw; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); background: #e9eaf0; display: block; transition: transform .15s ease, box-shadow .15s ease; }
.art-feat__card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.art-feat__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-feat__ph { position: absolute; inset: 0; display: grid; place-items: center; color: #b9bdc8; }
.art-feat__ph svg { width: 48px; height: 48px; }
.art-feat__shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.18) 48%, rgba(0,0,0,0) 78%); }
.art-feat__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; }
.art-feat__date { display: block; color: rgba(255,255,255,.82); font-size: .76rem; font-weight: 600; margin-bottom: 4px; }
.art-feat__title { color: #fff; font-size: 1.02rem; font-weight: 800; line-height: 1.25; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* articles — list rows */
.art-list { display: flex; flex-direction: column; gap: 12px; }
.art-row { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 12px; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.art-row:hover { border-color: var(--brand-100); box-shadow: var(--shadow); transform: translateY(-2px); }
.art-row__thumb { flex: 0 0 auto; width: 78px; height: 78px; border-radius: 14px; overflow: hidden; background: #f4f4f7; display: grid; place-items: center; }
.art-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.art-row__ph { color: #c4c8d2; }
.art-row__ph svg { width: 28px; height: 28px; }
.art-row__body { min-width: 0; flex: 1; }
.art-row__title { font-size: 1rem; font-weight: 800; color: var(--ink); margin: 0 0 8px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.art-row__date { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.art-row__date svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* article detail */
.artd-wrap { display: flex; flex-direction: column; gap: 18px; }
.artd-hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 240px; max-height: 360px; aspect-ratio: 16 / 9; background: #e9eaf0; }
.artd-hero--ph { display: grid; place-items: center; }
.artd-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.artd-hero__ph { color: #b9bdc8; }
.artd-hero__ph svg { width: 64px; height: 64px; }
.artd-hero__shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.74) 0%, rgba(0,0,0,.2) 50%, rgba(0,0,0,0) 80%); }
.artd-hero__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 24px; }
.artd-hero__date { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.85); font-size: .82rem; font-weight: 600; margin-bottom: 8px; }
.artd-hero__date svg { width: 15px; height: 15px; }
.artd-hero__title { color: #fff; font-size: 1.6rem; font-weight: 800; line-height: 1.2; margin: 0; }
.artd-info { max-width: 740px; }
.artd-cats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; }
.artd-cat { display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; color: var(--ink-500); font-weight: 600; }
.artd-cat::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.artd-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.artd-tag { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 700; color: var(--brand-700); background: var(--brand-100); border-radius: var(--radius-pill); padding: 5px 12px; }
.artd-tag svg { width: 13px; height: 13px; }

/* shared rich-text body (admin HTML: product + article) */
.rich { color: var(--ink-500); line-height: 1.7; font-size: 1rem; }
.rich > :first-child { margin-top: 0; }
.rich p { margin: 0 0 14px; }
.rich h1, .rich h2, .rich h3, .rich h4 { color: var(--ink); font-weight: 800; line-height: 1.3; margin: 22px 0 10px; }
.rich h1 { font-size: 1.35rem; } .rich h2 { font-size: 1.2rem; } .rich h3 { font-size: 1.06rem; }
.rich ul, .rich ol { margin: 0 0 14px; padding-left: 22px; }
.rich li { margin-bottom: 6px; }
.rich a { color: var(--brand-700); font-weight: 600; text-decoration: underline; }
.rich img { max-width: 100%; height: auto; border-radius: 12px; margin: 8px 0; }
.rich blockquote { margin: 0 0 14px; padding: 6px 16px; border-left: 3px solid var(--brand); color: var(--muted); background: #faf7f5; border-radius: 0 8px 8px 0; }
.rich strong, .rich b { color: var(--ink); }
.rich table { width: 100%; border-collapse: collapse; margin: 0 0 14px; }
.rich th, .rich td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }

@media (min-width: 760px) {
  .pd { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 30px; }
  .pd-media { position: sticky; top: 16px; }
}
@media (max-width: 520px) {
  .art-row { gap: 12px; padding: 10px; }
  .art-row__thumb { width: 66px; height: 66px; }
  .artd-hero__title { font-size: 1.3rem; }
  .pd-title { font-size: 1.35rem; }
}

/* Stage 5e — AI Coach */
.coach { display: flex; flex-direction: column; }
.coach-head { margin-bottom: 12px; }
.coach-head__t { font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 800; color: var(--ink); margin: 0; }
.coach-head__d { color: var(--ink-500); margin: 4px 0 0; }
.coach-body { display: flex; flex-direction: column; min-height: calc(100vh - 230px); }

/* unconfigured / coming-soon state */
.coach-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 54px 24px; box-shadow: var(--shadow-sm); }
.coach-empty__ic { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: var(--brand-100); color: var(--brand-700); }
.coach-empty__ic svg { width: 32px; height: 32px; }
.coach-empty h2 { margin: 4px 0 0; color: var(--ink); font-size: 1.2rem; }
.coach-empty p { color: var(--ink-500); max-width: 440px; margin: 0 0 8px; }

/* conversation thread */
.coach-thread { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 6px 2px 14px; }
.coach-intro { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 0; }
.coach-intro__ic { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: var(--brand-100); color: var(--brand-700); }
.coach-intro__ic svg { width: 28px; height: 28px; }
.coach-intro__t { margin: 4px 0 0; color: var(--ink); font-size: 1.15rem; }
.coach-intro__d { color: var(--ink-500); margin: 0 0 6px; }
.coach-sugg { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 460px; }
.coach-sugg__chip { text-align: left; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .05s; }
.coach-sugg__chip:hover { border-color: var(--brand); }
.coach-sugg__chip:active { transform: scale(.99); }

.coach-msg { display: flex; gap: 10px; max-width: min(760px, 92%); }
.coach-msg--user { align-self: flex-end; flex-direction: row-reverse; }
.coach-msg--bot { align-self: flex-start; }
.coach-msg__av { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; }
.coach-msg__av svg { width: 18px; height: 18px; }
.coach-msg__bubble { padding: 11px 15px; border-radius: 16px; line-height: 1.55; word-wrap: break-word; overflow-wrap: anywhere; }
.coach-msg--bot .coach-msg__bubble { background: #fff; border: 1px solid var(--line); color: var(--ink); border-top-left-radius: 5px; box-shadow: var(--shadow-sm); }
.coach-msg--user .coach-msg__bubble { background: var(--brand); color: #fff; border-top-right-radius: 5px; }
.coach-msg--err .coach-msg__bubble { background: #fef2f2; border-color: #f3c9c9; color: #9a2a2a; }

/* typing indicator */
.coach-typing { display: inline-flex; gap: 4px; align-items: center; padding: 2px 0; }
.coach-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .5; animation: coachblink 1.2s infinite ease-in-out; }
.coach-typing i:nth-child(2) { animation-delay: .2s; }
.coach-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes coachblink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: .9; transform: translateY(-3px); } }

/* sticky composer */
.coach-input { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: flex-end; padding: 12px 0 10px; background: linear-gradient(to top, var(--bg-soft) 78%, rgba(247,247,250,0)); }
.coach-input__ta { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 18px; padding: 12px 16px; font: inherit; line-height: 1.45; color: var(--ink); background: #fff; max-height: 140px; box-shadow: var(--shadow-sm); }
.coach-input__ta:focus { outline: none; border-color: var(--brand); }
.coach-input__ta:disabled { opacity: .6; }
.coach-input__send { flex: 0 0 auto; width: 46px; height: 46px; border: none; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .15s, opacity .15s; }
.coach-input__send:hover { background: var(--brand-700); }
.coach-input__send:disabled { opacity: .5; cursor: default; }
.coach-input__send svg { width: 20px; height: 20px; }
.coach-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 4px; }
.coach-clear { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; padding: 4px 0; }
.coach-clear:hover { color: #c0392b; }
.coach-clear svg { width: 15px; height: 15px; }
.coach-disclaim { color: var(--muted); font-size: .78rem; margin-left: auto; }
