/* @rozgor-part 8/10 — OVQAT REJASI (0031) — oylik reja
   BO'LINDI (5d-blok): ilgari bitta `style.css` (3058 qator) edi. TARTIB MUHIM —
   keyingi qoida oldingisini bosadi, shuning uchun public/index.html dagi <link>
   teglari AYNAN shu raqamlar tartibida turishi SHART. */
/* --- "🍲 Ovqat" bo'limi — OYLIK REJA (0031) --------------------------------
   Uch qavat: qimirlamaydigan tepa (oy + jamlanma) · suriluvchi kunlar ro'yxati ·
   qimirlamaydigan pastki tugma. Ro'yxat bo'limidagi bilan AYNAN bir xil qoida:
   flex ustun + `overflow-y:auto` (position: sticky YO'Q — Telegram iOS'da sticky
   TG'ning o'z skrolli bilan urishadi). */
.meal-view {
  display: flex;
  flex-direction: column;
  /* `.tab-view` ning skrolli va to'ldirmasi bu yerda KERAK EMAS — skroll ichkarida
     (.meal-body), to'ldirmalarni har qavat o'zi beradi. */
  overflow: hidden;
  padding: 0;
}

.meal-top {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: calc(10px + max(env(safe-area-inset-top), var(--tg-content-safe-top, 0px))) 14px 10px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}

.meal-month-row {
  display: flex;
  align-items: center;
}

/* Oy tanlagich — "Yanvar 2027 ▾" ko'rinishida: chegarasiz, katta va qalin, o'z
   chevroni bilan (native o'q o'chirilgan). font-size 16px — iOS zumlashiga qarshi. */
.meal-month {
  -webkit-appearance: none;
  appearance: none;
  max-width: 100%;
  padding: 2px 22px 2px 0;
  border: none;
  background: transparent
    url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238a8a8e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right center / 11px 8px;
  color: var(--tg-text);
  font-family: inherit;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.meal-month:focus {
  outline: none;
}

/* "18 kun rejalashtirilgan · 13 kun bo'sh" */
.meal-summary {
  color: var(--tg-hint);
  font-size: 13px;
  line-height: 1.35;
}

.meal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 14px 10px;
}

/* Hafta sarlavhasi ("1-HAFTA") — filtr bo'limi sarlavhalari uslubida. */
.meal-week {
  padding: 14px 0 6px;
  color: var(--tg-hint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.meal-day {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 8px 0;
  border: none;
  border-top: 1px solid rgba(128, 128, 128, 0.15);
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.meal-day:active {
  opacity: 0.6;
}

/* Chapdagi ustun: kun raqami (katta) + hafta kuni qisqartmasi (kichik, xira) */
.meal-day-date {
  flex: 0 0 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.meal-day-num {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
}

.meal-day-wd {
  color: var(--tg-hint);
  font-size: 11px;
  line-height: 1.1;
}

/* BUGUN — kun raqami ko'k doira ichida (foydalanuvchi o'rnini darhol topsin). */
.meal-day.today .meal-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  background: var(--tg-link);
  color: #fff;
  font-size: 14px;
}

.meal-day-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meal-day-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bo'sh kun — xira "Bo'sh" (mokabdagidek kulrang) */
.meal-day.empty .meal-day-name {
  color: var(--tg-hint);
  font-weight: 500;
}

/* "7 mahsulot · 4 tasi ro'yxatda yo'q" */
.meal-day-sub {
  color: var(--tg-hint);
  font-size: 12.5px;
  line-height: 1.3;
}

/* Yetishmaganlar soni — sariq urg'u (ro'yxatga qo'shish kerakligi belgisi) */
.meal-day-miss {
  color: var(--warn);
}

/* O'ngdagi belgi: rejalashtirilgan kunda "›", bo'sh kunda "+" */
.meal-day-chev {
  flex: 0 0 auto;
  color: var(--tg-hint);
  font-size: 20px;
  line-height: 1;
}

.meal-day.empty .meal-day-chev {
  color: var(--tg-link);
  font-size: 22px;
  font-weight: 600;
}

/* Oy bo'sh bo'lsa (hech qanday reja yo'q) — ro'yxat ostidagi maslahat */
.meal-hint {
  padding: 16px 0 0;
  color: var(--tg-hint);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.meal-foot {
  flex: 0 0 auto;
  padding: 10px 14px calc(10px + var(--tabbar-h) + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(128, 128, 128, 0.15);
}

/* Ko'k tugma — "Yetishmagan mahsulotlarni ro'yxatga qo'shish" */
.meal-cta {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--tg-button);
  color: var(--tg-button-text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.meal-cta:active {
  opacity: 0.85;
}

/* Yetishmagan mahsulot bo'lmasa — o'chgan (bosilmaydigan) holat */
.meal-cta[disabled] {
  opacity: 0.45;
  cursor: default;
}

