/* ============================================================
   gc.onimine.com — kế hoạch giảm cân
   Viết tay, không dùng framework: trang này đọc trên điện thoại 4G nên
   một file CSS ~10 KB tải thẳng vẫn nhanh hơn kéo cả Tailwind từ CDN.
   Ưu tiên mobile trước, màn rộng chỉ nới bề ngang.
   ============================================================ */

:root {
  --nen: #f4f6fa;
  --nen-mo: #eaeef5;
  --the: #ffffff;
  --the-2: #f7f9fc;
  --vien: #e3e9f2;
  --chu: #0d1626;
  --chu-2: #5a6a82;
  --chu-3: #8b98ab;
  --luc: #059669;
  --luc-nen: #d9f6ea;
  --lam: #2563eb;
  --lam-nen: #dceafe;
  --cam: #d97706;
  --cam-nen: #fdeed3;
  --hong: #e11d48;
  --hong-nen: #ffe0e6;
  --tim: #7c3aed;
  --tim-nen: #ece2fe;
  --bong: 0 1px 2px rgba(13, 22, 38, .05), 0 8px 24px -12px rgba(13, 22, 38, .18);
  --bong-noi: 0 2px 8px rgba(13, 22, 38, .07), 0 18px 40px -22px rgba(13, 22, 38, .35);
  --cong: 18px;
  --day: 1100ms;
}

html[data-mau="toi"] {
  --nen: #080d17;
  --nen-mo: #0e1523;
  --the: #121b2c;
  --the-2: #172236;
  --vien: #22314c;
  --chu: #e9eff8;
  --chu-2: #9dabc2;
  --chu-3: #6d7d95;
  --luc: #34d399;
  --luc-nen: #0d3b30;
  --lam: #60a5fa;
  --lam-nen: #12294c;
  --cam: #fbbf24;
  --cam-nen: #3d2c0b;
  --hong: #fb7185;
  --hong-nen: #431323;
  --tim: #c084fc;
  --tim-nen: #2c1a4d;
  --bong: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -16px rgba(0, 0, 0, .8);
  --bong-noi: 0 2px 10px rgba(0, 0, 0, .5), 0 20px 44px -24px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--nen);
  color: var(--chu);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", "Noto Sans", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* chừa chỗ cho thanh điều hướng dưới + vạch home của iPhone */
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

/* Bỏ ánh chớp xám khi chạm trên iOS */
* { -webkit-tap-highlight-color: transparent; }

h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
p { margin: 0; }
b, strong { font-weight: 700; }

/* ───────────────────────────────── thanh trên ───────────────────────────── */
.dinh {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--nen) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.dinh.troi { border-bottom-color: var(--vien); }

.dinh-trong {
  max-width: 680px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dinh-cham {
  width: 9px; height: 9px; flex: none;
  border-radius: 50%;
  background: var(--luc);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--luc) 22%, transparent);
}
.dinh-chu { flex: 1; min-width: 0; }
.dinh-chu strong { display: block; font-size: 15px; letter-spacing: -.02em; }
.dinh-chu small {
  display: block; font-size: 11.5px; color: var(--chu-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nut-tron {
  flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--vien);
  background: var(--the);
  color: var(--chu-2);
  cursor: pointer;
  transition: transform .15s, background .2s;
}
.nut-tron:active { transform: scale(.92); }
.nut-tron svg { fill: none; stroke: currentColor; stroke-width: 1.9;
                stroke-linecap: round; stroke-linejoin: round; }
.i-toi { display: none; }
html[data-mau="toi"] .i-trang, html[data-mau="toi"] .i-trang-o { display: none; }
html[data-mau="toi"] .i-toi { display: block; }

/* ───────────────────────────────── khung ────────────────────────────────── */
main { max-width: 680px; margin: 0 auto; padding: 14px 16px 8px; }
.tab { display: flex; flex-direction: column; gap: 14px; }
.tab.an { display: none; }
.tab { animation: hien .28s ease both; }
@keyframes hien { from { opacity: 0; transform: translateY(6px); } }

.the {
  background: var(--the);
  border: 1px solid var(--vien);
  border-radius: var(--cong);
  box-shadow: var(--bong);
}

.tieu-de-muc { padding: 6px 2px 0; }
.tieu-de-muc h2 { font-size: 18px; font-weight: 800; }
.tieu-de-muc p { font-size: 12.5px; color: var(--chu-3); margin-top: 2px; }

.chu-nho {
  font-size: 11.5px; color: var(--chu-3); text-align: center;
  padding: 4px 12px 0; line-height: 1.5;
}

.nhan {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800;
  letter-spacing: .02em; text-transform: uppercase;
}
.nhan-luc { background: var(--luc-nen); color: var(--luc); }
.nhan-lam { background: var(--lam-nen); color: var(--lam); }
.nhan-cam { background: var(--cam-nen); color: var(--cam); }
.nhan-tim { background: var(--tim-nen); color: var(--tim); }
.nhan-hong { background: var(--hong-nen); color: var(--hong); }

/* ───────────────────────────────── hero ─────────────────────────────────── */
.anh-hung {
  padding: 18px;
  background:
    radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--luc) 16%, transparent), transparent 55%),
    var(--the);
  overflow: hidden;
}
.ah-tren { display: flex; align-items: flex-start; gap: 12px; }
.ah-tren h1 { font-size: 21px; font-weight: 850; margin-top: 8px; }
.ah-dich {
  flex: none; text-align: center; padding: 10px 14px;
  border-radius: 14px; color: #fff;
  background: linear-gradient(145deg, #10b981, #0d9488);
  box-shadow: 0 10px 24px -12px rgba(13, 148, 136, .9);
}
.ah-dich small { display: block; font-size: 9.5px; text-transform: uppercase;
                 letter-spacing: .08em; opacity: .85; }
.ah-dich b { font-size: 30px; font-weight: 850; line-height: 1.05; display: block; }
.ah-dich i { font-size: 13px; font-style: normal; font-weight: 600; opacity: .9; }

.thanh-can { margin-top: 16px; }
/* Cân hiện tại đúng bằng mốc xuất phát nên thanh này KHÔNG phải thanh tiến độ
   (0% trông như hỏng). Nó là một dải "từ đây tới kia" với một chấm đánh dấu
   chỗ đang đứng — đọc ra ngay là còn nguyên 16 kg phía trước. */
.tc-day {
  display: block; position: relative;
  height: 8px; border-radius: 999px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--hong) 55%, transparent),
    color-mix(in srgb, var(--cam) 45%, transparent) 45%,
    color-mix(in srgb, var(--luc) 60%, transparent));
}
.tc-diem {
  position: absolute; left: 0; top: 50%;
  width: 16px; height: 16px; margin-top: -8px; margin-left: -2px;
  border-radius: 50%; background: var(--hong);
  border: 3px solid var(--the);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.tc-moc {
  display: flex; justify-content: space-between;
  font-size: 10.5px; color: var(--chu-3); margin-top: 7px; font-weight: 600;
}

/* ───────────────────────────────── chỉ số ───────────────────────────────── */
.luoi-chiso { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chiso { padding: 12px 13px; position: relative; overflow: hidden; }
.chiso::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--sac, var(--lam));
}
.chiso small { display: block; font-size: 10.5px; font-weight: 800;
               text-transform: uppercase; letter-spacing: .05em; color: var(--chu-3); }
.chiso b { display: block; font-size: 19px; font-weight: 850; color: var(--sac);
           letter-spacing: -.02em; margin-top: 1px; }
.chiso b i { font-size: 11px; font-style: normal; font-weight: 700; margin-left: 2px; }
.chiso span { display: block; font-size: 10.5px; color: var(--chu-3); margin-top: 2px; line-height: 1.4; }
.m-lam { --sac: var(--lam); } .m-cam { --sac: var(--cam); }
.m-luc { --sac: var(--luc); } .m-hong { --sac: var(--hong); }
.m-tim { --sac: var(--tim); }

/* ───────────────────────────────── chip ngày ────────────────────────────── */
.chip-ngay {
  display: flex; gap: 8px;
  overflow-x: auto; padding: 2px 2px 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chip-ngay::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: center;
  min-width: 58px; padding: 9px 6px 8px;
  border-radius: 14px; border: 1px solid var(--vien);
  background: var(--the); color: var(--chu-2);
  font: inherit; cursor: pointer; text-align: center;
  transition: transform .16s, background .2s, color .2s, border-color .2s;
}
.chip:active { transform: scale(.94); }
.chip b { display: block; font-size: 13px; font-weight: 800; }
.chip small { display: block; font-size: 9px; color: var(--chu-3);
              text-transform: uppercase; letter-spacing: .05em; margin-top: 1px; }
.chip.hoat {
  background: linear-gradient(145deg, #10b981, #0d9488);
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px -10px rgba(13, 148, 136, .95);
}
.chip.hoat small { color: rgba(255, 255, 255, .82); }
.chip.hom-nay::after {
  content: ""; display: block; width: 4px; height: 4px; border-radius: 50%;
  background: var(--cam); margin: 3px auto 0;
}
.chip.hoat.hom-nay::after { background: #fff; }

/* ───────────────────────────────── đầu ngày ─────────────────────────────── */
.ngay-dau { padding: 14px; display: flex; align-items: center; gap: 14px; }
.vong { flex: none; width: 58px; height: 58px; position: relative; }
.vong svg { transform: rotate(-90deg); display: block; }
.vong circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.vong .v-nen { stroke: var(--nen-mo); }
.vong .v-chay { stroke: var(--luc); transition: stroke-dashoffset .45s cubic-bezier(.4, 0, .2, 1); }
.vong span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 13px; font-weight: 850; letter-spacing: -.03em;
}
.nd-chu { flex: 1; min-width: 0; }
.nd-chu b { display: block; font-size: 16px; font-weight: 850; }
.nd-chu .nhan { margin-top: 4px; }
.nd-so { display: flex; gap: 12px; margin-top: 7px; font-size: 11.5px; color: var(--chu-2); }
.nd-so em { font-style: normal; font-weight: 800; color: var(--chu); }

/* ───────────────────────────────── bữa ăn ──────────────────────────────── */
.ds-bua { display: flex; flex-direction: column; gap: 9px; }
.bua {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 14px;
  background: var(--the); border: 1px solid var(--vien);
  border-radius: var(--cong); box-shadow: var(--bong);
  cursor: pointer; user-select: none;
  transition: transform .15s, border-color .2s, opacity .25s;
}
.bua:active { transform: scale(.985); }
.bua.xong { opacity: .55; border-color: color-mix(in srgb, var(--luc) 45%, var(--vien)); }
.bua.xong .b-mon { text-decoration: line-through; text-decoration-thickness: 1.5px; }

.o-tick {
  flex: none; width: 22px; height: 22px; margin-top: 2px;
  border-radius: 8px; border: 2px solid var(--vien);
  background: var(--the-2);
  display: grid; place-items: center;
  transition: background .2s, border-color .2s, transform .18s;
}
.o-tick svg { width: 13px; height: 13px; fill: none; stroke: #fff;
              stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round;
              opacity: 0; transform: scale(.5); transition: opacity .18s, transform .18s; }
.bua.xong .o-tick { background: var(--luc); border-color: var(--luc); }
.bua.xong .o-tick svg { opacity: 1; transform: scale(1); }

.b-than { flex: 1; min-width: 0; }
.b-dinh { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.b-gio { font-size: 11px; font-weight: 800; color: var(--chu-2);
         display: flex; align-items: center; gap: 5px; }
.b-cal { flex: none; font-size: 10.5px; font-weight: 800; color: var(--chu-2);
         background: var(--nen-mo); padding: 2px 7px; border-radius: 7px; }
.b-mon { font-size: 14px; font-weight: 650; margin-top: 4px; letter-spacing: -.005em; }
.b-ghi { font-size: 11.5px; color: var(--chu-3); margin-top: 4px; line-height: 1.5; }

/* ───────────────────────────────── lộ trình ────────────────────────────── */
.canh-bao {
  padding: 15px 16px;
  border-color: color-mix(in srgb, var(--cam) 40%, var(--vien));
  background: linear-gradient(180deg, color-mix(in srgb, var(--cam-nen) 70%, var(--the)), var(--the) 60%);
}
.canh-bao h2 { font-size: 14.5px; font-weight: 800; display: flex; gap: 8px; align-items: flex-start; }
.canh-bao ul { margin: 10px 0 0; padding: 0; list-style: none;
               display: flex; flex-direction: column; gap: 9px; }
.canh-bao li { font-size: 12.5px; color: var(--chu-2); line-height: 1.55;
               padding-left: 13px; position: relative; }
.canh-bao li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--cam);
}
.canh-bao li b { color: var(--chu); }

.gd { padding: 15px 16px; }
.gd::before { content: ""; }
.gd-dinh { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gd-dinh b { display: block; font-size: 14.5px; font-weight: 800; color: var(--sac); }
.gd-dinh small { display: block; font-size: 11px; color: var(--chu-3); margin-top: 1px; }
.gd dl { margin: 12px 0 0; display: flex; flex-direction: column; gap: 9px; }
.gd dt { font-size: 10.5px; font-weight: 800; text-transform: uppercase;
         letter-spacing: .05em; color: var(--sac); }
.gd dd { margin: 2px 0 0; font-size: 12.5px; color: var(--chu-2); line-height: 1.55; }

/* ───────────────────────── thực phẩm + mẹo (gập mở) ────────────────────── */
#ds-thucpham, #ds-meo { display: flex; flex-direction: column; gap: 10px; }

.gap { padding: 0; overflow: hidden; }
.gap-dinh {
  width: 100%; display: flex; align-items: center; gap: 11px;
  padding: 14px; background: none; border: 0; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.gap-icon {
  flex: none; width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; font-size: 19px;
  background: color-mix(in srgb, var(--sac, var(--luc)) 14%, var(--the-2));
}
.gap-chu { flex: 1; min-width: 0; }
.gap-chu b { display: block; font-size: 14px; font-weight: 750; }
.gap-chu .nhan { margin-top: 3px; }
.gap-chu p { font-size: 11.5px; color: var(--chu-3); margin-top: 2px; }
.gap-mui {
  flex: none; width: 20px; height: 20px; color: var(--chu-3);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}
.gap-mui svg { width: 100%; height: 100%; fill: none; stroke: currentColor;
               stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.gap.mo .gap-mui { transform: rotate(180deg); }

.gap-than {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .3s cubic-bezier(.4, 0, .2, 1);
}
.gap.mo .gap-than { grid-template-rows: 1fr; }
.gap-trong { overflow: hidden; }
.gap-trong > div { padding: 0 14px 14px 63px; }
.gap dl { margin: 0; display: flex; flex-direction: column; gap: 9px; }
.gap dt { font-size: 10.5px; font-weight: 800; text-transform: uppercase;
          letter-spacing: .05em; color: var(--sac, var(--luc)); }
.gap dd { margin: 2px 0 0; font-size: 12.5px; color: var(--chu-2); line-height: 1.55; }
.gap-trong p { font-size: 12.5px; color: var(--chu-2); line-height: 1.6; }

/* ───────────────────────────────── thanh dưới ──────────────────────────── */
.thanh-duoi {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 2px; padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--the) 88%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--vien);
}
.td-nut {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; border: 0; background: none; cursor: pointer;
  color: var(--chu-3); font: inherit; border-radius: 12px;
  transition: color .2s, transform .15s;
}
.td-nut:active { transform: scale(.9); }
.td-nut svg { width: 21px; height: 21px; fill: none; stroke: currentColor;
              stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.td-nut span { font-size: 10px; font-weight: 700; letter-spacing: -.01em; }
.td-nut.hoat { color: var(--luc); }
.td-nut.hoat svg { stroke-width: 2.1; }

/* ───────────────────────────────── màn rộng ────────────────────────────── */
@media (min-width: 640px) {
  body { font-size: 15.5px; padding-bottom: 116px; }
  main { padding: 20px 20px 24px; }
  .ah-tren h1 { font-size: 25px; }
  .luoi-chiso { grid-template-columns: repeat(4, 1fr); }
  /* Màn rộng thì thanh dưới thu thành một viên nổi giữa màn, không kéo dài
     hết bề ngang trông như thanh app điện thoại bị phóng to. */
  .thanh-duoi {
    left: 50%; right: auto; transform: translateX(-50%);
    bottom: 20px; width: min(420px, calc(100% - 40px));
    border: 1px solid var(--vien); border-radius: 18px; padding: 6px;
    box-shadow: var(--bong-noi);
  }
  .td-nut:active { transform: scale(.9); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
