:root {
  --bg: #F6F3EE;
  --card: #FFFFFF;
  --line: #ECE8E0;
  --soft: #F6F4EF;
  --green: #0E7C66;
  --green-d: #0A6152;
  --green-soft: #DDF0EA;
  --text: #23211E;
  --muted: #8E897F;
  --blue: #7FB2E5;
  --yellow: #F4CB4C;
  --orange: #F2A54A;
  --red: #E06464;
  --gold: #E5B63A;
  --gold-soft: #FFF5D9;
  --accent: #FF7A59; /* marjon: Qomat urg'u rangi */
  --r: 22px;
  /* Telefon panellari: Capacitor eski WebView uchun --safe-area-inset-* ni o'zi qo'yadi, env() u yerda 0 bo'lib qoladi */
  --sat: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --sab: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.4;
  padding-bottom: calc(150px + var(--sab));
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
/* soat va batareya ostiga kontent kirib ketmasin */
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: var(--sat); background: var(--bg); z-index: 30; }
#screen { max-width: 520px; margin: 0 auto; padding: calc(14px + var(--sat)) 16px 24px; }

/* Sarlavha */
.head { display: flex; align-items: flex-start; justify-content: space-between; margin: 6px 2px 16px; gap: 12px; }
.head h1 { font-size: 26px; margin: 0; font-weight: 800; letter-spacing: -.3px; }
.head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.date-chip { background: var(--card); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 13px; white-space: nowrap; }

/* Kartochka */
.card { background: var(--card); border-radius: var(--r); padding: 18px; margin-bottom: 14px; border: 1px solid var(--line); }
.cap { font-size: 12px; font-weight: 800; letter-spacing: .9px; color: var(--muted); text-transform: uppercase; margin: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.muted { color: var(--muted); }
.icon-btn { width: 36px; height: 36px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--green-soft); color: var(--green-d); border-radius: 12px; padding: 7px 12px; font-weight: 700; font-size: 13px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border-radius: 16px; padding: 15px; font-weight: 800; font-size: 15px; background: var(--green); color: #fff; }
.btn:active { background: var(--green-d); }
.btn.soft { background: var(--green-soft); color: var(--green-d); }
.btn.ghost { background: var(--soft); color: var(--text); }
.btn.danger { background: #FBE9E9; color: var(--red); }
.btn[disabled] { opacity: .5; }

/* Kun bali */
.life { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.mascot { width: 150px; height: 150px; margin: 4px auto 0; display: block; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.battery { display: flex; align-items: center; gap: 14px; }
.bat { width: 46px; height: 120px; border: 3px solid #D9D4CA; border-radius: 12px; position: relative; padding: 4px; }
.bat::before { content: ""; position: absolute; top: -9px; left: 12px; width: 16px; height: 6px; border-radius: 3px 3px 0 0; background: #D9D4CA; }
.bat i { position: absolute; left: 4px; right: 4px; bottom: 4px; border-radius: 7px; background: var(--yellow); transition: height .6s; }
.big { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.score-up { color: var(--green-d); font-weight: 700; font-size: 13px; }

/* Kaloriya */
.kcal { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
.ring { position: relative; width: 150px; height: 150px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring b { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.ring span { font-size: 12px; color: var(--muted); }
.legend > div { padding: 7px 0; border-bottom: 1px solid var(--line); }
.legend > div:last-child { border: 0; }
.legend small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.legend small::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, #ccc); }
.legend b { font-size: 17px; }
.weekly { background: var(--soft); border-radius: 14px; padding: 10px; text-align: center; margin-top: 12px; font-size: 13px; }
.weekly b { color: var(--green-d); }

/* Makrolar */
.macro { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; padding: 8px 0; }
.macro .ic { width: 40px; height: 40px; border-radius: 13px; background: var(--green-soft); display: grid; place-items: center; font-size: 18px; }
.bar { height: 7px; border-radius: 9px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; border-radius: 9px; background: var(--green); transition: width .5s; }

/* Vazn */
.weight { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: center; }
.gauge { position: relative; width: 170px; }
.gauge svg { width: 100%; display: block; }
.gauge .val { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; }
.gauge .val b { font-size: 38px; font-weight: 800; letter-spacing: -1px; }
.gauge .val span { color: var(--muted); font-weight: 700; margin-left: 2px; }
.wstat > div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.wstat > div:last-child { border: 0; }
.wstat small { color: var(--muted); font-size: 13px; }
.wstat b { font-size: 20px; display: block; }
.bmi-scale { position: relative; margin-top: 30px; }
.bmi-scale .seg { display: flex; gap: 3px; }
.bmi-scale .seg i { height: 9px; border-radius: 5px; }
.bmi-scale .nums { position: absolute; top: -20px; left: 0; right: 0; height: 16px; font-size: 11px; color: var(--muted); }
.bmi-scale .nums span { position: absolute; transform: translateX(-50%); }
.bmi-scale .mark { position: absolute; top: 13px; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 9px solid #8F6BD6; transform: translateX(-50%); transition: left .5s; }
.badge { white-space: nowrap; border-radius: 10px; padding: 6px 10px; font-weight: 700; font-size: 13px; background: var(--green-soft); color: var(--green-d); }

/* Suv */
.glasses { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.glass { width: 34px; height: 42px; border-radius: 4px 4px 10px 10px; border: 2px solid #CFE2F5; position: relative; overflow: hidden; }
.glass.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 78%; background: var(--blue); }

/* Faollik ro'yxati */
.item { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border: 0; }
.item .th { width: 48px; height: 48px; border-radius: 14px; background: var(--green-soft) center/cover; display: grid; place-items: center; font-size: 22px; }
.item b { display: block; font-size: 15px; }
.item small { color: var(--muted); font-size: 12px; }
.item .kc { font-weight: 800; color: var(--green-d); text-align: right; }
.item .kc.burn { color: var(--orange); }
.empty { text-align: center; padding: 18px 10px 6px; }
.empty .ill { width: 76px; height: 76px; border-radius: 24px; background: var(--green-soft); display: grid; place-items: center; margin: 0 auto 12px; font-size: 34px; }
.empty b { font-size: 17px; }
.empty p { color: var(--muted); margin: 6px 0 0; font-size: 14px; }

/* Grafik */
.seg-toggle { display: inline-flex; background: var(--soft); border-radius: 12px; padding: 3px; }
.seg-toggle button { padding: 6px 12px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg-toggle button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.chart { width: 100%; display: block; margin-top: 12px; }

/* Pastki menyu */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + var(--sab));
}
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tabs .ico { width: 46px; height: 30px; border-radius: 15px; display: grid; place-items: center; }
.tabs button.on { color: var(--green-d); font-weight: 800; }
.tabs button.on .ico { background: var(--green-soft); }
.fab {
  position: fixed; z-index: 21; left: 50%; transform: translateX(-50%);
  bottom: calc(86px + var(--sab));
  width: 60px; height: 60px; border-radius: 20px; background: var(--green);
  display: grid; place-items: center; box-shadow: 0 8px 20px rgba(14,124,102,.35);
}
.fab:active { transform: translateX(-50%) scale(.95); }
.fab.hide { display: none; }

/* Pastdan chiqadigan oyna */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(30,28,24,.4); opacity: 0; transition: opacity .25s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto;
  background: var(--card); border-radius: 28px 28px 0 0;
  padding: 10px 18px calc(18px + var(--sab));
  max-height: 92vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.sheet-wrap.open { pointer-events: auto; }
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
/* Ilova ichidagi kamera (Telegram'da) */
.cam { position: fixed; inset: 0; z-index: 100; background: #000; }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam-x { position: absolute; top: calc(14px + var(--sat)); right: 14px; width: 44px; height: 44px;
  border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-size: 20px; border: 0; }
.cam-shot { position: absolute; left: 50%; bottom: calc(32px + var(--sab)); transform: translateX(-50%);
  width: 76px; height: 76px; border-radius: 50%; background: #fff; border: 6px solid rgba(255,255,255,.4);
  background-clip: padding-box; }
.cam-shot:active { transform: translateX(-50%) scale(.92); }
.grip { width: 40px; height: 5px; border-radius: 3px; background: #D8D3CA; margin: 0 auto 14px; }
.sheet h2 { text-align: center; font-size: 20px; margin: 0 0 16px; font-weight: 800; }
.sheet .sub { text-align: center; color: var(--muted); margin: -10px 0 16px; font-size: 14px; }
.opts { display: grid; gap: 10px; }
.opt { display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: center; text-align: left; background: var(--soft); border-radius: 18px; padding: 12px; }
.opt .ic { width: 46px; height: 46px; border-radius: 14px; background: var(--card); display: grid; place-items: center; font-size: 22px; }
.opt b { display: block; }
.opt small { color: var(--muted); }
.unit-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.unit-toggle button { border: 1.5px solid var(--line); border-radius: 16px; padding: 13px; font-weight: 700; }
.unit-toggle button.on { background: var(--green); border-color: var(--green); color: #fff; }

/* Chizg'ich */
.ruler { background: var(--soft); border-radius: 20px; padding: 18px 0 10px; margin-bottom: 14px; position: relative; border: 1px solid var(--line); }
.ruler .rv { text-align: center; }
.ruler .rv b { font-size: 54px; font-weight: 800; letter-spacing: -1.5px; }
.ruler .rv span { font-size: 22px; font-weight: 700; color: #666; margin-left: 4px; }
.ruler .rs { overflow-x: auto; scrollbar-width: none; display: flex; margin-top: 6px; cursor: grab; }
.ruler .rs::-webkit-scrollbar { display: none; }
.ruler .sp { flex: none; }
.ruler .rt { flex: none; height: 64px; position: relative; background-repeat: repeat-x; }
.ruler .rt span { position: absolute; top: 44px; width: 40px; margin-left: -20px; text-align: center; font-size: 12px; color: var(--muted); }
.ruler .rc { position: absolute; left: 50%; bottom: 34px; width: 4px; height: 44px; margin-left: -2px; border-radius: 2px; background: var(--green); pointer-events: none; }
.ruler::after { content: ""; position: absolute; inset: 0; border-radius: 20px; pointer-events: none;
  background: linear-gradient(to right, var(--soft), transparent 22%, transparent 78%, var(--soft)); }

/* Formalar */
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; border: 1.5px solid var(--line); background: var(--soft); border-radius: 14px; padding: 13px 14px; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--green); background: #fff; }
.f4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.choice { display: grid; gap: 8px; margin-bottom: 14px; }
.choice button { text-align: left; border: 1.5px solid var(--line); border-radius: 16px; padding: 13px 14px; }
.choice button small { display: block; color: var(--muted); }
.choice button.on { border-color: var(--green); background: var(--green-soft); }

/* Ovqat natijasi */
.food-res .photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 18px; margin-bottom: 12px; }
.food-res .tot { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.food-res .tot div { background: var(--soft); border-radius: 14px; padding: 10px 4px; text-align: center; }
.food-res .tot b { display: block; font-size: 18px; }
.food-res .tot small { color: var(--muted); font-size: 11px; }
.food-res ul { list-style: none; padding: 0; margin: 0 0 12px; }
.food-res li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.tip { background: var(--gold-soft); border-radius: 14px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.loader { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--green-soft); border-top-color: var(--green); animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 80px; }
.msg { max-width: 84%; padding: 11px 14px; border-radius: 20px; font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 6px; }
.msg.ai { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg img { display: block; width: 180px; max-width: 100%; border-radius: 14px; margin-bottom: 6px; }
.msg .act { margin-top: 10px; }
.typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin: 0 2px; animation: dot 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 30% { transform: translateY(-5px); opacity: .5; } }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest button { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; font-size: 13px; font-weight: 600; text-align: left; }
.composer {
  position: fixed; left: 0; right: 0; z-index: 19; bottom: calc(66px + var(--sab));
  padding: 8px 12px; background: var(--bg);
}
.composer .in { max-width: 520px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 6px; }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; padding: 9px 6px; max-height: 120px; background: none; }
.composer button { width: 40px; height: 40px; border-radius: 15px; display: grid; place-items: center; flex: none; }
.composer .send { background: var(--green); }

/* Profil */
.hello { display: flex; align-items: center; gap: 14px; }
.avatar { width: 60px; height: 60px; border-radius: 20px; background: var(--green-soft); display: grid; place-items: center; }
.list .li { display: grid; grid-template-columns: 42px 1fr 16px; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list .li:last-child { border: 0; }
.list .li .ic { width: 42px; height: 42px; border-radius: 13px; background: var(--green-soft); display: grid; place-items: center; font-size: 18px; }
.list .li b { display: block; font-weight: 700; }
.list .li small { color: var(--muted); }

/* Boshlash ekrani */
.onb { min-height: 80vh; display: flex; flex-direction: column; }
.onb .steps { display: flex; gap: 6px; margin: 4px 0 22px; }
.onb .steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.onb .steps i.on { background: var(--green); }
.onb h1 { font-size: 26px; margin: 0 0 6px; font-weight: 800; }
.onb p.lead { color: var(--muted); margin: 0 0 22px; }
.onb .grow { flex: 1; }
.onb .nav { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 18px; }
.onb .nav .btn.ghost { width: 56px; }
body.onboarding .tabs, body.onboarding .fab { display: none; }
body.onboarding { padding-bottom: 20px; }

.toast {
  position: fixed; left: 50%; bottom: calc(160px + var(--sab)); z-index: 60;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: transform .25s, opacity .25s;
  background: var(--text); color: #fff; padding: 11px 18px; border-radius: 14px; font-weight: 600; font-size: 14px;
  max-width: 90vw; width: max-content; text-align: center; box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
body.onboarding .toast { bottom: calc(24px + var(--sab)); }
/* pastki oyna ochiq bo'lsa, uning tugmalarini yopmasin: tepadagi xira fon ustida chiqadi */
.sheet-wrap.open ~ .toast { bottom: auto; top: calc(max(var(--sat), 24px) + 12px); transform: translate(-50%, -12px); }
.sheet-wrap.open ~ .toast.show { transform: translate(-50%, 0); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* AI limiti, maslahatchi, qancha yeyildi */
.lim { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; margin: -4px 0 12px; font-size: 13px; }
.lim .bar { margin-top: 6px; }
.lim small { display: block; margin-top: 6px; }
.advice { background: linear-gradient(135deg, #EEF8F0, #FFF8E6); }
.advice .tip { margin: 10px 0 0; font-size: 15px; }
.advice ul { margin: 10px 0 0; padding: 0; list-style: none; }
.advice li { font-size: 13px; padding: 8px 0 0; border-top: 1px dashed var(--line); margin-top: 8px; }
.pct4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.pct4 button { background: var(--soft); border-radius: 14px; padding: 12px 0; font-weight: 800; }
.pct4 button.on { background: var(--green); color: #fff; }
input[type=range] { width: 100%; accent-color: var(--green); }
.half { display: inline-block; background: var(--gold-soft); color: #9A7410; border-radius: 8px; padding: 0 6px; font-size: 11px; font-weight: 800; margin-left: 4px; }
/* Uyqu */
.q5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.q5 button { background: var(--soft); border-radius: 14px; padding: 10px 0; font-size: 26px; line-height: 1; }
.q5 button.on { background: var(--green-soft); outline: 2px solid var(--green); }
.sl-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.sl-stats div { background: var(--soft); border-radius: 14px; padding: 10px 12px; }
.sl-stats small { display: block; color: var(--muted); font-size: 12px; }
.sl-stats b { font-size: 14px; }
.seg-toggle button { padding: 6px 10px; }
/* Ovqat: baho, tarkib, izoh bilan qayta hisoblash */
.apples { letter-spacing: 1px; font-size: 13px; white-space: nowrap; }
.apples i { font-style: normal; filter: grayscale(1); opacity: .3; }
.fmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--muted); }
.xe { background: var(--soft); border-radius: 8px; padding: 1px 6px; font-weight: 700; }
.warn { background: #FBE9E9; color: #A53B3B; border-radius: 14px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.food { padding: 10px 0; border-bottom: 1px solid var(--line); }
.food:last-child { border: 0; }
.food .item { border: 0; padding: 0; }
.food .fx { margin: 10px 0 0 60px; font-size: 13px; }
.food .fx ul { list-style: none; padding: 0; margin: 0 0 8px; }
.food .fx li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.food .fx .tip, .food .fx .warn { margin: 8px 0 0; }
.food .tools { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.food .tools button { background: var(--soft); border-radius: 10px; padding: 6px 10px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.redo { background: var(--soft); border-radius: 16px; padding: 12px; margin-bottom: 12px; }
.redo textarea { width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; outline: none; resize: none; margin: 6px 0 8px; }
.redo textarea:focus { border-color: var(--green); }
.redo b { font-size: 13px; }
.redo .btn { padding: 11px; font-size: 14px; }
.eat-photo { width: 100%; max-height: 220px; object-fit: cover; border-radius: 18px; margin-bottom: 12px; display: block; }
/* Allergiya va cheklovlar */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tags button { border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 600; background: var(--card); }
.tags button.on { border-color: var(--green); background: var(--green-soft); color: var(--green-d); }
.tgroup { font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); margin: 4px 0 8px; }
/* Eslatmalar sahifasi */
.sw { width: 48px; height: 28px; border-radius: 14px; background: #D9D4CA; position: relative; flex: none; transition: background .2s; }
.sw i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.sw.on { background: var(--green); }
.sw.on i { transform: translateX(20px); }
.dim { opacity: .45; pointer-events: none; }
.hint { display: block; color: var(--muted); font-size: 13px; margin: 6px 0 4px; }
.rrow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rrow:last-of-type { border: 0; }
input[type=time] { border: 0; background: var(--soft); border-radius: 12px; padding: 8px 10px; font-weight: 800; outline: none; min-width: 84px; }
.mini { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mini button { background: var(--soft); border-radius: 10px; padding: 7px 10px; font-size: 13px; font-weight: 700; }
.mini button.on { background: var(--green); color: #fff; }
.cust { background: var(--soft); border-radius: 16px; padding: 10px; margin: 10px 0; }
.cust .ctext { flex: 1; min-width: 0; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 10px; outline: none; }
.cust input[type=time] { background: #fff; min-width: 76px; }
.cust .days { display: flex; gap: 4px; margin-top: 8px; align-items: center; }
.cust .days button { flex: 1; background: #fff; border-radius: 9px; padding: 6px 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.cust .days button.on { background: var(--green-soft); color: var(--green-d); }
.cust .del { flex: none; width: 36px; height: 36px; border-radius: 10px; background: #fff; display: grid; place-items: center; color: var(--red); }
button.date-chip { border: 0; }
/* Mening bog'im */
.garden { position: relative; overflow: hidden; padding: 14px; background: linear-gradient(var(--sky) 0 52%, var(--grass) 52%); }
.garden .g-m .mascot { width: 92px; height: 92px; margin: 0 auto; }
.plots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 4px; }
.plot { text-align: center; background: rgba(255,255,255,.35); border-radius: 14px; padding: 6px 2px; }
.plot .pl { display: block; font-size: 30px; line-height: 1.2; position: relative; }
.plot .pl b { position: absolute; font-size: 15px; left: 50%; top: 2px; margin-left: 2px; }
.plot small { display: block; font-size: 10px; font-weight: 700; color: #4D5A3F; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.gl:last-child { border: 0; }
.gl .ic { width: 40px; height: 40px; border-radius: 13px; background: var(--green-soft); display: grid; place-items: center; font-size: 18px; }
.outfits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.outfits button { background: var(--soft); border-radius: 16px; padding: 8px 4px; border: 2px solid transparent; }
.outfits button.on { border-color: var(--green); background: var(--green-soft); }
.outfits button[disabled] { opacity: .5; }
.outfits b { display: block; font-size: 12px; }
.outfits small { color: var(--muted); font-size: 11px; }
.mini-m { width: 56px; height: 56px; display: block; margin: 0 auto; }
.celebrate { text-align: center; font-size: 64px; margin: 6px 0 10px; position: relative; }
.celebrate b { font-size: 30px; }
/* Tarkib muharriri: gramm o'zgarsa kaloriya o'zi hisoblanadi */
.it { display: grid; grid-template-columns: 1fr auto 44px 30px; gap: 8px; align-items: center; padding: 9px 6px; margin: 0 -6px; border-bottom: 1px dashed var(--line); border-radius: 12px; }
.it > div:first-child { min-width: 0; }
.it b { font-size: 14px; }
.it small { display: block; color: var(--muted); font-size: 11px; }
.it .ik { text-align: right; font-size: 15px; }
.it.changed { background: #FFF8E1; }
.it.gone { opacity: .45; }
.it.gone b:not(.ik) { text-decoration: line-through; }
.step { display: flex; align-items: center; background: var(--soft); border-radius: 12px; }
.step button { width: 30px; height: 34px; font-size: 19px; font-weight: 800; color: var(--green-d); }
.step input { width: 40px; border: 0; background: none; text-align: center; font-weight: 800; font-size: 14px; outline: none; padding: 0; }
.step span { font-size: 11px; color: var(--muted); }
.it .x { width: 30px; height: 30px; border-radius: 9px; background: #FBE9E9; color: var(--red); font-weight: 800; font-size: 16px; }
.addp { background: var(--soft); border-radius: 14px; padding: 10px; margin-top: 10px; }
.addp input { width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; outline: none; min-width: 0; }
.addp .row { margin-top: 8px; }
.addp .btn { width: auto; padding: 10px 16px; font-size: 14px; flex: none; }
.tot2 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 8px; }
.tot2 div { background: var(--soft); border-radius: 12px; padding: 8px 2px; text-align: center; }
.tot2 b { display: block; font-size: 17px; }
.tot2 small { font-size: 11px; color: var(--muted); }
.tot2 s { display: block; font-size: 11px; color: var(--muted); }

/* Kundalik: sana paneli, o'tgan kun belgisi, ovqat vaqtlari, kalendar */
.daybar { display: flex; align-items: center; gap: 6px; background: var(--card); border-radius: 18px; padding: 6px; margin: -4px 0 14px; }
.daybar > button:first-child, .daybar > button:last-child { width: 42px; height: 42px; border-radius: 14px; background: var(--soft); font-size: 24px; font-weight: 700; line-height: 1; }
.daybar > button:disabled { opacity: .3; }
#dPick { flex: 1; padding: 10px 6px; font-size: 15px; text-align: center; }
.pastbar { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; text-align: left; background: var(--gold-soft); color: var(--text); border-radius: 16px; padding: 11px 14px; margin: -4px 0 14px; font-size: 13px; }
.pastbar b { color: var(--green-d); white-space: nowrap; font-size: 14px; }
.meals { padding: 4px 16px; }
.meal { padding: 12px 0; border-bottom: 1px solid var(--line); }
.meal:last-child { border: 0; }
.mhead { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; }
.mhead .th { width: 40px; height: 40px; border-radius: 12px; background: var(--green-soft); display: grid; place-items: center; font-size: 19px; }
.mhead b { display: block; font-size: 15px; }
.mhead small { color: var(--muted); font-size: 12px; }
.madd { background: var(--green-soft); color: var(--green-d); border-radius: 12px; padding: 8px 12px; font-size: 13px; font-weight: 800; }
.meal > .bar { margin: 10px 0 2px 50px; height: 6px; }
.meal .food:last-child { border: 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal.wd { margin-bottom: 6px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.cal button { position: relative; aspect-ratio: 1; border-radius: 12px; font-weight: 700; font-size: 15px; }
.cal button.today { box-shadow: inset 0 0 0 2px var(--green); }
.cal button.sel { background: var(--green); color: #fff; }
.cal button:disabled { opacity: .28; }
.cal button i { position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--green); }
.cal button.sel i { background: #fff; }
.hday { cursor: pointer; }
.hrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hedit { background: var(--green-soft); color: var(--green-d); border-radius: 10px; padding: 5px 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
#hOther { margin-top: 4px; }

/* Saqlanganlar */
.fav-tabs { display: flex; margin: -4px 0 12px; }
.fav-tabs button { flex: 1; }
.again { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--green-soft); }
.again b { display: block; }
.again small { color: var(--muted); font-size: 12px; }
.again .btn { width: auto; padding: 10px 16px; flex: none; }
.fav-row { cursor: pointer; }
.star { width: 38px; height: 38px; border-radius: 12px; background: var(--soft); color: #C9C3B8; font-size: 20px; line-height: 1; }
.star.on, .food .tools button.on { color: var(--gold); }
.fadd { width: 38px; height: 38px; border-radius: 12px; background: var(--green-soft); color: var(--green-d); font-size: 22px; font-weight: 800; line-height: 1; }
.plist { list-style: none; padding: 0; margin: 4px 0 14px; }
.plist li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }

/* Ovqatlar ro'yxati */
.fcats { display: flex; gap: 6px; overflow-x: auto; margin: -4px -16px 12px; padding: 0 16px 2px; scrollbar-width: none; }
.fcats::-webkit-scrollbar { display: none; }
.fcats button { flex: none; padding: 8px 13px; border-radius: 999px; background: var(--card); font-size: 13px; font-weight: 700; white-space: nowrap; }
.fcats button.on { background: var(--green); color: #fff; }
.fdb { cursor: pointer; }
.gstep { background: var(--soft); border-radius: 14px; padding: 8px 8px 8px 14px; margin: 4px 0 4px; }
.gstep .step { background: var(--card); }

/* Ilova ichidagi kamera (Qomat ko'rinishi: yashil ramka, olma belgisi) */
.cam .cam-top { position: absolute; top: 0; left: 0; right: 0; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px;
  padding: calc(12px + var(--sat)) 12px 24px; background: linear-gradient(#000a, #0000); color: #fff; }
.cam .cam-x, .cam .cam-fl { position: static; width: 44px; height: 44px; border-radius: 14px; background: #ffffff22; color: #fff; display: grid; place-items: center; font-size: 20px; }
.cam .cam-fl.on { background: var(--yellow); }
.cam-t { text-align: center; }
.cam-t b { display: block; font-size: 17px; }
.cam-t span { display: inline-block; margin-top: 5px; padding: 3px 10px; border-radius: 999px; background: #0E7C66; font-size: 12px; font-weight: 700; }
.cam-frame { position: absolute; left: 9%; right: 9%; top: 22%; aspect-ratio: 1; max-height: 46%; margin: 0 auto; pointer-events: none; }
.cam-frame i { position: absolute; width: 38px; height: 38px; border: 4px solid var(--green); }
.cam-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 18px; }
.cam-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 18px; }
.cam-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 18px; }
.cam-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 18px; }
.cam-hint { position: absolute; left: 16px; right: 16px; bottom: calc(190px + var(--sab)); margin: 0; text-align: center; color: #fff; font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px #000a; }
.cam-chips { position: absolute; left: 0; right: 0; bottom: calc(126px + var(--sab)); display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 0 12px; }
.cam-chips button { padding: 9px 14px; border-radius: 999px; background: #ffffffe6; color: var(--text); font-size: 13px; font-weight: 800; }
.cam .cam-shot { box-shadow: 0 0 0 5px var(--green), 0 0 0 9px #ffffff55; }
.cam .cam-fl[hidden] { visibility: hidden; }
.cam-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
.cam-chips::-webkit-scrollbar { display: none; }
.cam-chips button { flex: none; padding: 9px 11px; font-size: 12.5px; }
.cam-chips button:first-child { margin-left: auto; }
.cam-chips button:last-child { margin-right: auto; }
.cam-chips { gap: 6px; padding: 0 10px; }
.cam-chips button { padding: 9px 10px; font-size: 12px; }

/* Tarix: kunni tahrirlash oynasi */
.de-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--soft); border-radius: 14px; padding: 8px 8px 8px 14px; margin-bottom: 8px; font-size: 14px; }
.de-b { min-width: 38px; height: 36px; border-radius: 11px; background: var(--card); color: var(--green-d); font-size: 18px; font-weight: 800; }
.de-b.wide { padding: 0 12px; font-size: 13px; }
.sheet .meals { background: var(--soft); }
.sheet .meals .th, .sheet .meals .mhead .th { background: var(--card); }

/* Yozib kiritish */
.tw { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.tw button { padding: 7px 11px; border-radius: 999px; background: var(--green-soft); color: var(--green-d); font-size: 13px; font-weight: 700; }
.tsug { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: var(--soft); border-radius: 14px; padding: 11px 14px; margin-bottom: 6px; font-size: 14px; }
.tsug small { color: var(--green-d); font-weight: 700; white-space: nowrap; }
.thint { background: var(--gold-soft); border-radius: 16px; padding: 12px 14px; margin: 8px 0 14px; font-size: 13px; }
.thint b { display: block; margin-bottom: 6px; }
.thint span { display: block; padding: 3px 0; }
.thint .no { color: #B4544F; }
.thint .ok { color: var(--green-d); font-weight: 700; }
.msg .st { display: block; font-size: 11px; opacity: .7; margin-top: 4px; }
/* Nima yesam? */
.nima-card { background: linear-gradient(135deg, #FFF8E1, #EFF8E8); border-color: #F0E3B5; }
.nima-card .hint { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.nima-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nima-chips button { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; }
.nima-meals { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; }
.nima-meals button { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 7px 12px; font-weight: 600; font-size: 13px; }
.nima-meals button.on { background: var(--green); color: #fff; border-color: var(--green); }
.nima-sum { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 6px; }
.nima-sum small { display: block; color: var(--muted); font-size: 12px; }
.nima-sum b { font-size: 18px; }
.nima-opt { position: relative; }
.nima-opt.best { border: 2px solid var(--green); }
.nima-best { display: inline-block; background: var(--green); color: #fff; font-size: 11px; font-weight: 800; border-radius: 8px; padding: 2px 8px; margin-bottom: 8px; }
.nima-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nima-tags span:not(.apples) { background: var(--soft); border-radius: 10px; padding: 3px 8px; font-size: 12px; font-weight: 600; }
.nima-macro { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0; text-align: center; }
.nima-macro div { background: var(--soft); border-radius: 12px; padding: 8px 4px; }
.nima-macro b { display: block; font-size: 18px; }
.nima-macro small { color: var(--muted); font-size: 11px; }
.nima-items > div { padding: 8px 0; border-bottom: 1px dashed var(--line); gap: 8px; }
.nima-items > div:last-child { border-bottom: 0; }
.nima-why { background: #FFF6DC; border-radius: 14px; padding: 10px 12px; font-size: 13.5px; margin: 10px 0 0; }

/* Kundalik: «Batafsil» bo'limi (kun bali, energiya, uyqu, qadam, vazn) */
details.more { margin: 4px 0 14px; }
details.more > summary { list-style: none; cursor: pointer; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "⌄"; color: var(--muted); font-size: 20px; line-height: 1; transition: transform .2s; }
details.more[open] > summary::after { transform: rotate(180deg); }
/* Birinchi kun: hali ovqat yozilmagan */
.card.first { background: var(--green-soft); border-color: transparent; border-left: 4px solid var(--accent); }