/* ============================================================
   Fat to Fit — Design System
   Palette: neon green · black · white
   ============================================================ */

:root {
  --bg:          #060707;
  --bg-soft:     #0A0C0C;
  --surface:     #0E1111;
  --surface-2:   #141818;
  --surface-3:   #1B2121;
  --border:      rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.05);
  --neon:        #00FF85;
  --neon-dim:    #00C866;
  --neon-glow:   rgba(0, 255, 133, 0.28);
  --text:        #F4F7F5;
  --text-soft:   #C2CBC6;
  --muted:       #7C8681;
  --danger:      #FF4D6D;
  --amber:       #FFC24B;
  --blue:        #4BB8FF;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;

  --shadow-1: 0 2px 10px rgba(0,0,0,.4);
  --shadow-2: 0 10px 30px rgba(0,0,0,.55);
  --shadow-neon: 0 0 0 1px rgba(0,255,133,.35), 0 8px 30px rgba(0,255,133,.18);

  --nav-h: 74px;
  --sidebar-w: 254px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(720px 480px at 12% -8%, rgba(0,255,133,.10), transparent 60%),
    radial-gradient(620px 520px at 100% 0%, rgba(0,255,133,.06), transparent 62%),
    radial-gradient(900px 700px at 50% 120%, rgba(0,255,133,.05), transparent 60%);
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { margin: 0; line-height: 1.18; letter-spacing: -.02em; font-weight: 800; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #232a2a; border-radius: 20px; border: 3px solid var(--bg); }
::selection { background: var(--neon); color: #04120a; }

.app-root { position: relative; z-index: 1; min-height: 100%; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--neon);
}
.muted { color: var(--muted); }
.soft { color: var(--text-soft); }
.center { text-align: center; }
.tabnum { font-variant-numeric: tabular-nums; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 14.5px; letter-spacing: .01em;
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .2s, opacity .2s;
  border: 1px solid transparent; white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--neon) 0%, var(--neon-dim) 100%);
  color: #04140b; box-shadow: 0 6px 22px rgba(0,255,133,.24);
}
.btn-primary:hover { box-shadow: 0 10px 34px rgba(0,255,133,.38); transform: translateY(-1px); }
.btn-ghost { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); border-color: rgba(0,255,133,.35); }
.btn-outline { background: transparent; border-color: rgba(0,255,133,.45); color: var(--neon); }
.btn-outline:hover { background: rgba(0,255,133,.10); }
.btn-danger { background: rgba(255,77,109,.12); border-color: rgba(255,77,109,.4); color: var(--danger); }
.btn-danger:hover { background: rgba(255,77,109,.2); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 30px; font-size: 16px; }
.btn-sm { padding: 9px 15px; font-size: 13px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-icon { padding: 10px; border-radius: 50%; width: 40px; height: 40px; }

/* ============================================================
   Cards / surfaces
   ============================================================ */
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-1);
}
.card-tight { padding: 15px; border-radius: var(--r-md); }
.card-glow { border-color: rgba(0,255,133,.28); box-shadow: var(--shadow-neon); }
.card-hover { transition: transform .22s var(--ease), border-color .22s, box-shadow .25s; }
.card-hover:hover { transform: translateY(-3px); border-color: rgba(0,255,133,.32); box-shadow: var(--shadow-2); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  background: var(--surface-3); color: var(--text-soft); border: 1px solid var(--border);
}
.badge-neon { background: rgba(0,255,133,.12); color: var(--neon); border-color: rgba(0,255,133,.32); }
.badge-amber { background: rgba(255,194,75,.12); color: var(--amber); border-color: rgba(255,194,75,.3); }
.badge-blue { background: rgba(75,184,255,.12); color: var(--blue); border-color: rgba(75,184,255,.3); }
.badge-danger { background: rgba(255,77,109,.12); color: var(--danger); border-color: rgba(255,77,109,.3); }

/* ============================================================
   Layout
   ============================================================ */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  position: sticky; top: 0; height: 100vh;
  padding: 26px 18px; display: flex; flex-direction: column; gap: 8px;
  border-right: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(14,17,17,.9), rgba(6,7,7,.6));
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 14px 22px; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand-name span { color: var(--neon); }

.nav-item {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px; border-radius: var(--r-md);
  color: var(--text-soft); font-weight: 600; font-size: 14.5px;
  transition: background .18s, color .18s; position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: rgba(0,255,133,.10); color: var(--neon); }
.nav-item.active::before {
  content: ""; position: absolute; left: -18px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--neon);
}
.nav-ico { width: 20px; height: 20px; flex: none; }

.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-soft); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 26px; border-bottom: 1px solid var(--border-soft);
  background: rgba(6,7,7,.72); backdrop-filter: blur(16px);
}
.topbar-title { font-weight: 800; font-size: 18px; }
.topbar-sub { font-size: 12.5px; }
.topbar-spacer { flex: 1; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #1d2a24, #10201a);
  border: 1px solid rgba(0,255,133,.35);
  display: grid; place-items: center; font-weight: 800; color: var(--neon); font-size: 14px;
}
.content { padding: 26px; max-width: 1220px; width: 100%; margin: 0 auto; padding-bottom: 40px; }

/* Bottom nav (mobile) */
.bottomnav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(8,10,10,.94); backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
}
.bottomnav-inner { display: flex; height: var(--nav-h); }
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600;
  transition: color .18s; position: relative;
}
.bn-item.active { color: var(--neon); }
.bn-item.active::after {
  content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 4px 4px;
  background: var(--neon); box-shadow: 0 0 14px var(--neon);
}
.bn-ico { width: 22px; height: 22px; }

/* ============================================================
   Onboarding
   ============================================================ */
.onb {
  min-height: 100vh; display: grid; place-items: center;
  padding: 30px 20px; position: relative;
}
.onb-card {
  width: 100%; max-width: 620px;
  background: linear-gradient(180deg, rgba(20,24,24,.96), rgba(10,12,12,.98));
  border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 34px; box-shadow: var(--shadow-2); position: relative; overflow: hidden;
}
.onb-card::after {
  content: ""; position: absolute; top: -140px; right: -120px; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(0,255,133,.18), transparent 70%); pointer-events: none;
}
.onb-progress { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-bottom: 26px; }
.onb-progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--neon), var(--neon-dim)); transition: width .45s var(--ease); }
.onb-step { animation: fade-up .4s var(--ease) both; }
.onb-q { font-size: 26px; margin-bottom: 8px; }
.onb-hint { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.onb-actions { display: flex; gap: 12px; margin-top: 30px; }
.onb-actions .btn { flex: 1; }

@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Option grid */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.opt {
  text-align: left; padding: 16px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1.5px solid var(--border);
  transition: border-color .18s, background .18s, transform .18s var(--ease);
}
.opt:hover { border-color: rgba(0,255,133,.4); transform: translateY(-2px); }
.opt.selected { border-color: var(--neon); background: rgba(0,255,133,.10); box-shadow: 0 0 0 1px rgba(0,255,133,.25) inset; }
.opt-title { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.opt-desc { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.opt-emoji { font-size: 20px; }

/* Inputs */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 8px; }
.input, select.input, textarea.input {
  width: 100%; padding: 13px 15px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1.5px solid var(--border);
  transition: border-color .18s, box-shadow .18s; outline: none; font-size: 15px;
}
.input:focus { border-color: var(--neon); box-shadow: 0 0 0 4px rgba(0,255,133,.12); }
.input::placeholder { color: #5b6560; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237C8681' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; padding-right: 40px; }

.input-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.seg { display: flex; gap: 6px; background: var(--surface-2); padding: 5px; border-radius: var(--r-pill); border: 1px solid var(--border); }
.seg button { flex: 1; padding: 9px 14px; border-radius: var(--r-pill); font-weight: 600; font-size: 13.5px; color: var(--muted); transition: all .18s; }
.seg button.active { background: var(--neon); color: #04140b; }

.slider { width: 100%; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 99px; background: var(--surface-3); outline: none; margin: 14px 0 6px; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--neon); border: 4px solid #06120c; box-shadow: 0 0 0 1px rgba(0,255,133,.5), 0 0 16px rgba(0,255,133,.5); cursor: pointer; }
.slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--neon); border: 4px solid #06120c; cursor: pointer; }
.slider-val { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.slider-val small { font-size: 15px; color: var(--muted); font-weight: 600; }

/* ============================================================
   Auth
   ============================================================ */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-side {
  position: relative; padding: 54px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, #0a1410 0%, #060707 62%);
  border-right: 1px solid var(--border-soft); overflow: hidden;
}
.auth-side::before {
  content: ""; position: absolute; top: -160px; left: -120px; width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(0,255,133,.16), transparent 68%);
}
.auth-side::after {
  content: ""; position: absolute; bottom: -180px; right: -140px; width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(0,255,133,.10), transparent 70%);
}
.auth-hero { position: relative; z-index: 2; }
.auth-hero h1 { font-size: 46px; line-height: 1.06; margin-bottom: 16px; }
.auth-hero h1 em { font-style: normal; color: var(--neon); }
.auth-hero p { color: var(--text-soft); font-size: 16px; max-width: 430px; }
.auth-points { position: relative; z-index: 2; display: grid; gap: 14px; margin-top: 34px; }
.auth-point { display: flex; gap: 12px; align-items: flex-start; }
.auth-point .dot { width: 26px; height: 26px; border-radius: 8px; background: rgba(0,255,133,.13); color: var(--neon); display: grid; place-items: center; flex: none; margin-top: 1px; }
.auth-point b { display: block; font-size: 14px; }
.auth-point span { color: var(--muted); font-size: 13px; }
.auth-stats { position: relative; z-index: 2; display: flex; gap: 34px; }
.auth-stat b { font-size: 26px; display: block; }
.auth-stat span { color: var(--muted); font-size: 12.5px; }

.auth-main { display: grid; place-items: center; padding: 40px 26px; }
.auth-form { width: 100%; max-width: 400px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 26px; background: var(--surface-2); padding: 5px; border-radius: var(--r-pill); border: 1px solid var(--border); }
.auth-tabs button { flex: 1; padding: 11px; border-radius: var(--r-pill); font-weight: 700; font-size: 14px; color: var(--muted); transition: all .2s; }
.auth-tabs button.active { background: var(--surface-3); color: var(--neon); box-shadow: var(--shadow-1); }
.divider { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.btn-google { background: #fff; color: #1c1c1c; border: none; font-weight: 700; }
.btn-google:hover { background: #eef1f0; }
.g-ico { width: 19px; height: 19px; }
.form-err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 4px; font-weight: 600; }

/* ============================================================
   Dashboard
   ============================================================ */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl);
  padding: 34px; margin-bottom: 22px;
  background: linear-gradient(120deg, #0c1a14 0%, #0a0f0d 55%, #080a0a 100%);
  border: 1px solid rgba(0,255,133,.2);
}
.hero::before {
  content: ""; position: absolute; right: -80px; top: -110px; width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(0,255,133,.20), transparent 66%);
}
.hero::after {
  content: ""; position: absolute; left: -60px; bottom: -140px; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(0,255,133,.10), transparent 70%);
}
.hero > * { position: relative; z-index: 2; }
.hero h1 { font-size: 38px; margin: 12px 0 10px; max-width: 620px; }
.hero h1 em { font-style: normal; color: var(--neon); }
.hero p { color: var(--text-soft); max-width: 560px; font-size: 15.5px; }
.hero-cta { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.span-2 { grid-column: span 2; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 26px 0 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 21px; }
.section-head .muted { font-size: 13px; }

.stat {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px;
}
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.stat-value { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.stat-delta { font-size: 12.5px; margin-top: 4px; font-weight: 600; }
.delta-up { color: var(--neon); }
.delta-down { color: var(--amber); }

.ring-wrap { display: grid; place-items: center; position: relative; }
.ring-label { position: absolute; text-align: center; }
.ring-label b { display: block; font-size: 26px; font-weight: 800; }
.ring-label span { font-size: 11.5px; color: var(--muted); }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.quick {
  padding: 18px 14px; border-radius: var(--r-lg); text-align: center;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: transform .2s var(--ease), border-color .2s;
}
.quick:hover { transform: translateY(-3px); border-color: rgba(0,255,133,.35); }
.quick .q-ico { font-size: 26px; margin-bottom: 9px; }
.quick b { font-size: 13.5px; display: block; }
.quick span { font-size: 11.5px; color: var(--muted); }

/* lists */
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.list-row:last-child { border-bottom: none; }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-title { font-weight: 700; font-size: 14.5px; }
.list-row .lr-sub { color: var(--muted); font-size: 12.5px; }

/* Day tabs */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 10px 17px; border-radius: var(--r-pill); white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--border);
  font-weight: 600; font-size: 13.5px; color: var(--text-soft); transition: all .18s;
}
.tab:hover { border-color: rgba(0,255,133,.35); }
.tab.active { background: rgba(0,255,133,.12); border-color: var(--neon); color: var(--neon); }

/* Exercise rows */
.ex { display: flex; gap: 14px; padding: 15px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); align-items: center; transition: border-color .18s, background .18s; }
.ex + .ex { margin-top: 10px; }
.ex.done { border-color: rgba(0,255,133,.4); background: rgba(0,255,133,.07); }
.ex-check {
  width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--border); color: var(--muted); transition: all .18s;
}
.ex.done .ex-check { background: var(--neon); border-color: var(--neon); color: #04140b; }
.ex-body { flex: 1; min-width: 0; }
.ex-name { font-weight: 700; font-size: 14.5px; }
.ex-meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.ex-sets { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.set-chip {
  min-width: 40px; padding: 6px 9px; border-radius: 9px; text-align: center;
  background: var(--surface-3); border: 1px solid var(--border); font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; transition: all .15s;
}
.set-chip:hover { border-color: rgba(0,255,133,.4); }
.set-chip.on { background: var(--neon); color: #04140b; border-color: var(--neon); }

/* Meal cards */
.meal { border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); padding: 16px; }
.meal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.meal-title { font-weight: 700; font-size: 15px; }
.macro-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.macro { text-align: center; padding: 10px 6px; border-radius: var(--r-sm); background: var(--surface-3); }
.macro b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.macro span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.food-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.food-item:last-child { border-bottom: none; }
.food-item b { color: var(--neon); font-variant-numeric: tabular-nums; font-weight: 700; }

/* Macro bar */
.mbar { height: 10px; border-radius: 99px; overflow: hidden; display: flex; background: var(--surface-3); }
.mbar > i { height: 100%; transition: width .5s var(--ease); }
.mbar-p { background: var(--neon); }
.mbar-c { background: var(--blue); }
.mbar-f { background: var(--amber); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--text-soft); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Recipe cards */
.recipe-img {
  height: 152px; border-radius: var(--r-md); margin-bottom: 13px; position: relative; overflow: hidden;
  background: linear-gradient(140deg, #10201a, #0c1210 70%); border: 1px solid var(--border);
  display: grid; place-items: center;
}
.recipe-img .r-emoji { font-size: 52px; filter: drop-shadow(0 6px 16px rgba(0,0,0,.5)); }
.recipe-img .r-cal { position: absolute; top: 10px; left: 10px; }
.recipe-name { font-weight: 700; font-size: 15.5px; margin-bottom: 5px; }
.recipe-macros { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 11px; font-size: 12.5px; color: var(--text-soft); }
.recipe-macros b { color: var(--neon); }

/* Sleep */
.sleep-hero { text-align: center; padding: 26px; }
.sleep-big { font-size: 56px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.quality-dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.qdot { width: 30px; height: 8px; border-radius: 99px; background: var(--surface-3); }
.qdot.on { background: var(--neon); box-shadow: 0 0 12px rgba(0,255,133,.5); }
.tip { display: flex; gap: 13px; padding: 15px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.tip + .tip { margin-top: 10px; }
.tip-ico { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; font-size: 19px; background: rgba(0,255,133,.1); }

/* Achievements */
.ach { display: flex; gap: 13px; align-items: center; padding: 15px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); }
.ach.locked { opacity: .42; }
.ach-medal { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--surface-3); flex: none; }
.ach.unlocked .ach-medal { background: linear-gradient(135deg, rgba(0,255,133,.22), rgba(0,255,133,.06)); box-shadow: 0 0 0 1px rgba(0,255,133,.35); }

/* Charts */
.chart-box { width: 100%; }
canvas { display: block; width: 100%; }

/* Table */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 700; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--border-soft); }
.tbl tr:last-child td { border-bottom: none; }

/* Modal */
#modal-root { position: relative; z-index: 100; }
.modal-back {
  position: fixed; inset: 0; background: rgba(2,4,3,.76); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 22px; animation: fade-in .2s both;
}
.modal {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--r-xl); padding: 26px;
  box-shadow: var(--shadow-2); animation: pop .28s var(--ease) both;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.98) } to { opacity: 1; transform: none } }

/* Toast */
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto; min-width: 240px; max-width: 340px;
  padding: 13px 16px; border-radius: var(--r-md);
  background: rgba(20,24,24,.97); border: 1px solid rgba(0,255,133,.32);
  box-shadow: var(--shadow-2); font-size: 13.5px; font-weight: 600;
  display: flex; gap: 10px; align-items: center;
  animation: slide-in .28s var(--ease) both;
}
.toast.out { animation: slide-out .28s var(--ease) both; }
.toast-ico { color: var(--neon); flex: none; }
@keyframes slide-in { from { opacity: 0; transform: translateX(30px) } to { opacity: 1; transform: none } }
@keyframes slide-out { to { opacity: 0; transform: translateX(30px) } }

/* Empty / loading */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .e-ico { font-size: 40px; margin-bottom: 12px; opacity: .6; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r-md); }
@keyframes shimmer { 0% { background-position: 100% 0 } 100% { background-position: -100% 0 } }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(0,0,0,.25); border-top-color: #04140b; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

.ai-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: var(--r-pill); background: rgba(0,255,133,.10); border: 1px solid rgba(0,255,133,.3); color: var(--neon); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ai-chip .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--neon); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,255,133,.6) } 50% { opacity: .6; box-shadow: 0 0 0 6px rgba(0,255,133,0) } }

.spark { display: flex; align-items: flex-end; gap: 4px; height: 46px; }
.spark i { flex: 1; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--neon), rgba(0,255,133,.25)); min-height: 4px; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv b { font-variant-numeric: tabular-nums; }

.fab {
  position: fixed; right: 22px; bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); z-index: 45;
  padding: 15px 22px; border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--neon), var(--neon-dim)); color: #04140b;
  font-weight: 800; box-shadow: 0 10px 30px rgba(0,255,133,.36);
  display: none; align-items: center; gap: 9px;
}

.mobile-only { display: none; }
.desktop-only { display: block; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .bottomnav { display: block; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px; padding-bottom: calc(var(--nav-h) + 26px + env(safe-area-inset-bottom)); }
  .hero { padding: 24px 20px; border-radius: var(--r-lg); }
  .hero h1 { font-size: 27px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .onb-card { padding: 24px 20px; border-radius: var(--r-lg); }
  .onb-q { font-size: 22px; }
  .desktop-only { display: none; }
  .mobile-only { display: block; }
  .fab { display: inline-flex; }
  .stat-value { font-size: 25px; }
  .auth-hero h1 { font-size: 34px; }
}
@media (max-width: 480px) {
  .opt-grid { grid-template-columns: 1fr 1fr; }
  .macro-row { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .btn { padding: 12px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
