/* =====================================================================
   style.css — Sổ Sức Khỏe (phiên bản 2): tông kem ấm, xanh đậm, thẻ mềm.
   Chữ to, nút lớn cho người già. Cỡ chữ gốc đổi theo html[data-co].
   ===================================================================== */
:root {
  color-scheme: light;
  --nen: #F4ECDF;
  --the: #FFFBF4;
  --the-2: #FBF5EA;
  --vien: #EADFCC;
  --muc: #2B2520;
  --muc-nhe: #6B6257;
  --navy: #2E4B6B;
  --navy-dam: #1F3550;
  --navy-nhat: #E4EAF1;
  --tim: #B8563F;
  --xanh: #2F7A45; --xanh-nen: #E4F1E3;
  --vang: #8A5D00; --vang-nen: #FBF0D2;
  --do: #A8321F;   --do-nen: #F9E3DC;
  --bong: 0 1px 2px rgba(60, 40, 20, .06), 0 8px 24px rgba(60, 40, 20, .07);
  --bo: 20px;
  --chu-dep: 'Lora', Georgia, 'Times New Roman', serif;
}
html { font-size: 19px; -webkit-text-size-adjust: 100%; }
html[data-co="rat-to"] { font-size: 22px; }
html[data-co="khong-lo"] { font-size: 25px; }
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--muc); line-height: 1.45; min-height: 100vh;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(120% 40rem at 100% 0%, #FBF4E8 0%, rgba(251,244,232,0) 70%) no-repeat, var(--nen);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, .diem:focus-visible { outline: 4px solid #E0A526; outline-offset: 2px; }
h1, h2 { font-family: var(--chu-dep); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; line-height: 1.25; margin: .4rem 0 .4rem; }
h2 { font-size: 1.15rem; margin: 1.3rem 0 .5rem; }
p { margin: .4rem 0; }
small { font-size: .8rem; }
.tieu-de { margin-top: .6rem; }

/* ---------- Khung: cột bên (máy tính) + cột chính ---------- */
.khung-app { display: flex; min-height: 100vh; }
.thanh-ben { display: none; }
.cot-chinh { flex: 1; min-width: 0; }
.man { width: 100%; max-width: 620px; margin: 0 auto; padding: .2rem 16px 2rem; outline: none; }
body.co-menu .man { padding-bottom: calc(6.8rem + env(safe-area-inset-bottom)); }

/* ---------- Thanh trên ---------- */
.thanh-tren {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: .45rem;
  max-width: 620px; margin: 0 auto; padding: .55rem 16px;
  padding-top: calc(.55rem + env(safe-area-inset-top));
  background: rgba(244, 236, 223, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ten-app { display: flex; align-items: center; gap: .45rem; font-family: var(--chu-dep); font-weight: 700; font-size: 1.15rem; margin-right: auto; white-space: nowrap; }
.ten-app svg { width: 1.6rem; height: 1.6rem; fill: var(--tim); }
.ngay-vien { display: none; background: var(--the); border: 1px solid var(--vien); border-radius: 999px; padding: .25rem .8rem; font-size: .75rem; font-weight: 700; color: var(--muc-nhe); }
.nut-tron {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  min-width: 2.7rem; height: 2.7rem; padding: 0 .55rem; border-radius: 999px;
  background: var(--the); border: 1px solid var(--vien); box-shadow: var(--bong);
  font-size: 1.25rem; text-decoration: none; color: var(--muc);
}
.nut-tron .ten-nho { font-size: .8rem; font-weight: 700; max-width: 4.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nut-tron.do { background: #C43A26; border-color: #C43A26; color: #fff; font-size: .85rem; font-weight: 800; }

/* ---------- Menu dưới (điện thoại) ---------- */
.menu-duoi {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 15;
  display: none; justify-content: space-around; gap: .2rem;
  max-width: 600px; margin: 0 auto; padding: .4rem;
  background: rgba(255, 251, 244, .96); border: 1px solid var(--vien); border-radius: 26px;
  box-shadow: 0 10px 30px rgba(60, 40, 20, .16); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
body.co-menu .menu-duoi { display: flex; }
.muc-menu {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem;
  background: none; border: 0; border-radius: 18px; padding: .45rem .1rem; min-height: 3.6rem;
  font-size: .64rem; font-weight: 700; color: var(--muc-nhe); white-space: nowrap;
}
.muc-menu svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muc-menu.dang { background: var(--navy); color: #fff; box-shadow: 0 4px 12px rgba(46, 75, 107, .35); }

/* ---------- Thẻ, chữ chung ---------- */
.the { background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo); padding: 1rem; box-shadow: var(--bong); margin: .8rem 0; }
.the h2:first-child { margin-top: 0; }
.lon { font-size: 1.1rem; }
.nho { font-size: .85rem; color: var(--muc-nhe); }
.goi-y { color: var(--muc-nhe); }
.mien-tru { background: rgba(234, 223, 204, .45); border-radius: 16px; padding: .8rem 1rem; font-size: .8rem; color: var(--muc-nhe); margin: 1rem 0; }
.lien-ket { background: none; border: 0; color: var(--navy); font-weight: 800; padding: .4rem 0; font-size: .9rem; min-height: 2.6rem; }
.mui { margin-left: auto; font-size: 1.5rem; line-height: 1; color: inherit; opacity: .7; }
.o-bieu {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 2.8rem; height: 2.8rem; border-radius: 14px; font-size: 1.35rem;
}
.o-bieu.xanh-duong { background: #E3EAF4; } .o-bieu.hong { background: #F4E2DA; }
.o-bieu.xanh-la { background: #E3EEDB; } .o-bieu.xanh-nuoc { background: #DDEEF2; }
.o-bieu.toi { background: rgba(255,255,255,.14); }

/* ---------- Nút chung ---------- */
.nut {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  width: 100%; min-height: 3.3rem; margin: .6rem 0; padding: .6rem 1rem;
  border-radius: 16px; border: 1.5px solid transparent; font-weight: 800; font-size: 1.02rem;
  text-decoration: none; text-align: center;
}
.nut.chinh { background: linear-gradient(180deg, #3A5A7E, var(--navy)); color: #fff; box-shadow: 0 6px 16px rgba(46, 75, 107, .3); }
.nut.chinh:active { transform: translateY(1px); }
.nut.phu { background: var(--the); color: var(--navy-dam); border-color: #CBD5E1; box-shadow: var(--bong); }
.nut.nguy { background: var(--the); color: var(--do); border-color: #E3B1A6; }
.nut-goi { background: #C43A26; color: #fff; border-color: #C43A26; box-shadow: 0 6px 16px rgba(196, 58, 38, .3); }
.nut-goi.to { font-size: 1.45rem; min-height: 4.2rem; }
.nut-ve {
  display: inline-flex; align-items: center; background: var(--the); border: 1px solid var(--vien); border-radius: 999px;
  color: var(--navy-dam); font-weight: 800; font-size: .9rem; padding: .35rem 1rem; min-height: 2.7rem; margin: .5rem 0 .2rem; box-shadow: var(--bong);
}
.hang-nut { display: flex; gap: .6rem; }
.hang-nut .nut { flex: 1; }
.cho-xac-nhan { background: var(--do) !important; color: #fff !important; border-color: var(--do) !important; }
.nut-xoa, .nut-nho {
  background: var(--the); border: 1.5px solid var(--vien); border-radius: 12px;
  min-height: 2.7rem; padding: 0 .8rem; font-weight: 700; font-size: .85rem; color: var(--muc-nhe); flex-shrink: 0;
}
.nut-xoa { color: var(--do); border-color: #E7B7AC; }
.nut-nghe {
  background: var(--navy-nhat); color: var(--navy-dam); border: 0; border-radius: 999px;
  font-weight: 800; padding: 0 .9rem; min-height: 2.7rem; flex-shrink: 0; font-size: .9rem;
}

/* ---------- Đồng ý lần đầu ---------- */
.dong-y { text-align: center; margin-top: 1rem; padding: 1.4rem 1.1rem; }
.hinh-nho { width: 7rem; margin: 0 auto; }
.hinh-nho svg { width: 100%; height: auto; }
.dong-y h1 { font-size: 1.9rem; margin: .2rem 0; }
.ds-y { list-style: none; padding: 0; margin: 1rem 0; text-align: left; }
.ds-y li { display: flex; gap: .7rem; padding: .65rem 0; border-top: 1px solid var(--vien); }
.ds-y li i { font-size: 1.3rem; font-style: normal; }

/* ---------- Form ---------- */
.nhan { display: block; font-weight: 800; margin: 1rem 0 .4rem; }
.the > .nhan:first-child { margin-top: 0; }
.nhan small { font-weight: 400; color: var(--muc-nhe); }
.o-nhap {
  width: 100%; min-height: 3.3rem; padding: .5rem .9rem; font-size: 1.1rem;
  border: 1.5px solid var(--vien); border-radius: 14px; background: #fff;
}
.o-nhap:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 4px var(--navy-nhat); }
.o-nhap.ngan { max-width: 10rem; }
.hang-nhap { display: flex; gap: .6rem; }
.loi-nhap { color: var(--do); font-weight: 800; min-height: 1.2rem; margin: .4rem 0; }
.hang-anh { display: flex; gap: .5rem; flex-wrap: wrap; }
.chon-anh { font-size: 2rem; width: 3.9rem; height: 3.9rem; border-radius: 16px; border: 2px solid var(--vien); background: #fff; }
.chon-anh.chu { font-size: .92rem; width: auto; height: auto; min-height: 3.3rem; padding: .3rem .6rem; font-weight: 700; }
.chon-anh[aria-pressed="true"], .chon[aria-pressed="true"], .o-bep[aria-pressed="true"] {
  border-color: var(--navy); background: var(--navy-nhat); color: var(--navy-dam); box-shadow: 0 0 0 2px var(--navy) inset;
}
.luoi-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.luoi-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.chon {
  display: flex; align-items: center; gap: .5rem; text-align: left;
  min-height: 3.5rem; padding: .5rem .7rem; border-radius: 16px;
  border: 2px solid var(--vien); background: #fff; font-weight: 700; font-size: .92rem;
}
.chon span { font-size: 1.35rem; }
.chon[aria-pressed="true"]::after { content: '✓'; margin-left: auto; font-weight: 800; }

/* ---------- Chọn người ---------- */
.ds-nguoi { display: grid; gap: .7rem; }
.the-nguoi {
  display: flex; align-items: center; gap: .8rem; text-align: left; width: 100%;
  background: var(--the); border: 2px solid var(--vien); border-radius: var(--bo); padding: .8rem 1rem; min-height: 5rem; box-shadow: var(--bong);
}
.the-nguoi[aria-pressed="true"] { border-color: var(--navy); background: var(--navy-nhat); }
.the-nguoi .anh-to { font-size: 2.6rem; }
.the-nguoi b { display: block; font-size: 1.2rem; font-family: var(--chu-dep); }
.the-nguoi small { color: var(--muc-nhe); }

/* ---------- Hôm nay ---------- */
.bang-mau {
  background: var(--vang-nen); border: 1.5px dashed #DDBA5F; color: var(--vang); border-radius: 16px;
  padding: .5rem .8rem; margin-top: .4rem; font-size: .85rem;
}
.bang-mau button { background: #fff; border: 1.5px solid var(--vang); color: var(--vang); border-radius: 10px; font-weight: 800; padding: .2rem .6rem; margin-left: .3rem; min-height: 2.3rem; }
.chao-hoi { display: flex; align-items: center; gap: .9rem; margin: .8rem 0 .6rem; }
.chao-hoi h1 { font-size: 1.45rem; margin: 0 0 .2rem; }
.chao-hoi p { color: var(--muc-nhe); margin: 0; }
.tim-nho { flex-shrink: 0; width: 6.2rem; background: none; border: 0; padding: 0; text-align: center; }
.tim-nho svg { width: 100%; height: auto; display: block; }
.tim-nho small { display: block; font-size: .68rem; font-weight: 700; color: var(--muc-nhe); line-height: 1.25; }
.bang-dot-quy {
  display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left;
  background: linear-gradient(90deg, #F9E1D8, #F6E7E0); border: 1.5px solid #E4A493; border-radius: 18px;
  padding: .6rem .9rem; color: #97351F; font-weight: 800; font-size: .98rem; min-height: 3.8rem;
}
.bang-dot-quy .coi { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: #B8513C; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.hang-so-gan { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .6rem; margin: .8rem 0 0; }
.so-gan {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left; width: 100%;
  border-radius: 18px; border: 1.5px solid; padding: .55rem .85rem; background: var(--the);
}
.so-gan .lb { font-size: .8rem; font-weight: 700; color: var(--muc-nhe); }
.so-gan b { font-size: 1.7rem; line-height: 1.15; font-family: var(--chu-dep); }
.so-gan em { font-style: normal; font-weight: 800; font-size: .85rem; }
.so-gan small { color: var(--muc-nhe); font-size: .72rem; }
.muc-xanh.so-gan { border-color: #B6D8B8; } .muc-xanh em { color: var(--xanh); }
.muc-vang.so-gan { border-color: #E8CC7C; background: #FFF8E6; } .muc-vang em { color: var(--vang); }
.muc-do.so-gan   { border-color: #E4A493; background: #FDF0EB; }   .muc-do em   { color: var(--do); }

.dau-muc { display: flex; align-items: center; justify-content: space-between; margin: 1.2rem 0 .5rem; }
.dau-muc h2 { margin: 0; }
.dem {
  min-width: 2.6rem; height: 2.6rem; padding: 0 .5rem; border-radius: 999px; background: var(--the);
  border: 3px solid var(--vien); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .8rem;
}
.dem.du { border-color: #9CCB9F; color: var(--xanh); }
.ds-viec { display: grid; gap: .6rem; }
.viec {
  display: flex; align-items: center; gap: .4rem; background: var(--the); border: 1px solid var(--vien);
  border-radius: 18px; box-shadow: var(--bong); padding: .3rem .7rem .3rem .3rem; transition: background .2s;
}
.viec.bay-gio { border: 2px solid var(--navy); }
.viec.xong { background: #F3F7EF; }
.viec.xong .chu-viec b { color: var(--muc-nhe); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(47, 122, 69, .5); }
.noi-viec { flex: 1; min-width: 0; display: flex; align-items: center; gap: .75rem; background: none; border: 0; text-align: left; padding: .45rem; min-height: 4rem; }
.chu-viec { min-width: 0; }
.chu-viec b { display: block; font-size: 1.02rem; }
.chu-viec small { display: block; color: var(--muc-nhe); font-size: .8rem; line-height: 1.3; }
.nhan-bay-gio { font-style: normal; display: inline-block; background: var(--navy); color: #fff; border-radius: 999px; font-size: .65rem; padding: .08rem .5rem; vertical-align: middle; margin-left: .3rem; }
.vong-tick {
  width: 2.6rem; height: 2.6rem; flex-shrink: 0; border-radius: 50%;
  border: 2.5px solid #D8CDB9; background: #fff; font-size: 1.2rem; font-weight: 800; color: #fff;
}
.vong-tick[aria-pressed="true"] { background: var(--xanh); border-color: var(--xanh); }
.khen { text-align: center; font-weight: 800; color: var(--xanh); }
.dong-gui, .dong-bai {
  display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left; margin: .8rem 0;
  background: var(--the); border: 1px solid var(--vien); border-radius: 18px; box-shadow: var(--bong); padding: .7rem .9rem; min-height: 4.2rem;
}
.dong-gui b, .dong-bai b { display: block; }
.dong-gui small, .dong-bai small { color: var(--muc-nhe); }
.the-bai-chinh {
  display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left;
  background: linear-gradient(135deg, #34547A, #243E5C); color: #fff; border: 0; border-radius: 20px;
  padding: .9rem 1rem; box-shadow: 0 10px 24px rgba(36, 62, 92, .3); min-height: 5rem;
}
.the-bai-chinh small { display: block; font-size: .68rem; letter-spacing: .08em; font-weight: 800; opacity: .8; }
.the-bai-chinh b { display: block; font-family: var(--chu-dep); font-size: 1.08rem; }
.meo-ngay {
  display: flex; gap: .7rem; align-items: flex-start; background: #FBF1D3; border: 1.5px solid #E8D39A;
  border-radius: 18px; padding: .8rem 1rem; margin: .9rem 0;
}
.meo-ngay > span { font-size: 1.2rem; }
.meo-ngay small { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .08em; color: #8A6A10; }
.meo-ngay p { margin: .1rem 0 0; }

/* ---------- Khám phá ---------- */
.tab-hinh { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin: .8rem 0; }
.tab-hinh button {
  display: flex; flex-direction: column; align-items: center; gap: .1rem;
  background: var(--the); border: 1.5px solid var(--vien); border-radius: 18px; padding: .45rem .3rem .5rem; box-shadow: var(--bong);
  font-weight: 700; font-size: .85rem;
}
.tab-hinh svg { width: 3.4rem; height: 3.4rem; }
.tab-hinh button[aria-pressed="true"] { border: 2px solid var(--navy); background: var(--navy-nhat); }
.san-khau {
  position: relative; background: radial-gradient(circle at 50% 45%, #FFFDF8 0%, #F7EFE2 70%);
  border: 1px solid var(--vien); border-radius: 26px; box-shadow: var(--bong); padding: .6rem;
}
.san-khau .hinh { width: 100%; height: auto; display: block; max-height: 60vh; }
.cong-tac {
  position: absolute; right: .7rem; bottom: .7rem; display: flex; align-items: center; gap: .4rem;
  background: var(--the); border: 1px solid var(--vien); border-radius: 999px; padding: .3rem .7rem .3rem .35rem;
  font-size: .75rem; font-weight: 700; box-shadow: var(--bong); min-height: 2.5rem;
}
.nut-gat { width: 2.3rem; height: 1.3rem; border-radius: 999px; background: #CFC6B6; position: relative; transition: background .2s; }
.nut-gat::after { content: ''; position: absolute; top: .15rem; left: .15rem; width: 1rem; height: 1rem; border-radius: 50%; background: #fff; transition: left .2s; }
.cong-tac[aria-pressed="true"] .nut-gat { background: var(--navy); }
.cong-tac[aria-pressed="true"] .nut-gat::after { left: 1.15rem; }
/* Video 3D (khi đã có file trong thư mục video/) */
.san-khau.co-video { padding: 0; overflow: hidden; background: #F7EFE2; }
.video-3d { display: block; width: 100%; max-height: 62vh; aspect-ratio: 1 / 1; object-fit: contain; background: transparent; }
.video-yt { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.video-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-bai { margin: -.2rem -.2rem .8rem; border-radius: 16px; overflow: hidden; background: #000; }
.video-bai .video-3d { aspect-ratio: auto; max-height: 50vh; }
.chip-diem { display: flex; flex-wrap: wrap; gap: .45rem; margin: .7rem 0; }
.chip-diem button {
  min-height: 2.8rem; padding: 0 .9rem; border-radius: 999px; border: 1.5px solid var(--vien);
  background: var(--the); font-weight: 700; font-size: .9rem; box-shadow: var(--bong);
}
.chip-diem button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.huong-dan { font-size: .82rem; color: var(--muc-nhe); text-align: center; }
.giai-thich { border-left: 5px solid var(--navy); }
.diem { cursor: pointer; }
.diem .vong { fill: rgba(46, 75, 107, .18); transform-box: fill-box; transform-origin: center; animation: nhip-diem 2s ease-out infinite; }
.diem .nen { fill: #fff; stroke: var(--navy); stroke-width: 3.5; }
.diem .tam { fill: var(--navy); }
.diem.dang-chon .nen { fill: var(--navy); stroke: #fff; }
.diem.dang-chon .tam { fill: #fff; }
@keyframes nhip-diem { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.hinh .dap { transform-origin: 160px 200px; }
.hinh.dong .dap { animation: dap 1s ease-in-out infinite; }
@keyframes dap { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.045); } 24% { transform: scale(.99); } 36% { transform: scale(1.025); } }
.hinh .hc { animation: troi 4.2s linear infinite; animation-play-state: paused; }
.hinh.dong .hc { animation-play-state: running; }
@keyframes troi { from { transform: translateX(10px); } to { transform: translateX(320px); } }
.hinh.dong .nhap-nhay { animation: nhap-nhay 1.6s ease-in-out infinite; }
@keyframes nhap-nhay { 50% { opacity: .45; } }

/* ---------- Ghi số đo ---------- */
.ds-loai { display: grid; gap: .7rem; }
.nut-loai {
  display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left;
  min-height: 4.6rem; padding: .6rem 1rem; border-radius: var(--bo);
  border: 1px solid var(--vien); background: var(--the); box-shadow: var(--bong); font-weight: 800; font-size: 1.2rem; font-family: var(--chu-dep);
}
.the-ghi { padding: 1.1rem; }
.ba-o { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.ba-o.mot { grid-template-columns: 1fr; max-width: 16rem; margin: 0 auto; }
.o-so { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.nhan-o { font-size: .72rem; font-weight: 800; letter-spacing: .06em; color: var(--muc-nhe); }
.o-so input {
  width: 100%; min-height: 4.6rem; text-align: center; font-size: 2.3rem; font-weight: 700; font-family: var(--chu-dep);
  border: 2px solid var(--vien); border-radius: 18px; background: #fff; color: var(--muc); padding: 0 .2rem;
  font-variant-numeric: tabular-nums;
}
.o-so input::placeholder { color: #CFC5B4; }
.o-so input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px var(--navy-nhat); }
.o-so small { font-size: .72rem; color: var(--muc-nhe); text-align: center; }
.the-ghi .nut.chinh { margin-top: .4rem; min-height: 3.6rem; font-size: 1.1rem; }
#dh-luc { margin-top: 0; }

.ket-qua { text-align: center; border-width: 2px; }
.ket-qua .lb { color: var(--muc-nhe); font-weight: 700; font-size: .9rem; }
.ket-qua .so-to { font-size: 3.8rem; font-weight: 700; font-family: var(--chu-dep); line-height: 1.1; margin-top: .3rem; font-variant-numeric: tabular-nums; }
.ket-qua .phu { color: var(--muc-nhe); }
.ket-qua .nhan-muc { display: inline-block; font-size: 1.4rem; font-weight: 800; border-radius: 999px; padding: .2rem 1.1rem; margin: .6rem 0; }
.ket-qua p { font-size: 1.02rem; }
.ket-qua.muc-xanh { border-color: #B6D8B8; } .ket-qua.muc-xanh .nhan-muc { background: var(--xanh-nen); color: var(--xanh); }
.ket-qua.muc-vang { border-color: #E8CC7C; } .ket-qua.muc-vang .nhan-muc { background: var(--vang-nen); color: var(--vang); }
.ket-qua.muc-do   { border-color: #E4A493; } .ket-qua.muc-do .nhan-muc   { background: var(--do-nen); color: var(--do); }
.khan { background: var(--do-nen); border: 2px solid var(--do); border-radius: var(--bo); padding: 1rem; margin: .8rem 0; }
.khan h2 { color: var(--do); margin-top: 0; }

/* ---------- Số đo ---------- */
.hang-ghi { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 .2rem; }
.nut-ghi {
  flex: 1 1 auto; min-height: 3rem; border-radius: 14px; border: 1.5px solid #CBD5E1; background: var(--the);
  color: var(--navy-dam); font-weight: 800; font-size: .9rem; padding: 0 .8rem; box-shadow: var(--bong);
}
.nut-ghi.chinh { background: var(--navy); border-color: var(--navy); color: #fff; }
.tab { display: flex; gap: .4rem; margin: .6rem 0; flex-wrap: wrap; }
.tab button {
  flex: 1; min-height: 3rem; border-radius: 14px; border: 1.5px solid var(--vien); background: var(--the);
  font-weight: 800; font-size: .9rem; padding: .2rem .5rem;
}
.tab.nho button { min-height: 2.7rem; font-size: .85rem; }
.tab button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.hang-tb { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .6rem; }
.tb { border-radius: 18px; border: 1.5px solid; padding: .55rem .85rem; background: var(--the); display: flex; flex-direction: column; }
.tb b { font-size: 1.9rem; line-height: 1.15; font-family: var(--chu-dep); }
.tb em { font-style: normal; font-weight: 800; }
.tb small { color: var(--muc-nhe); }
.tb.muc-xanh { border-color: #B6D8B8; } .tb.muc-vang { border-color: #E8CC7C; background: #FFF8E6; } .tb.muc-do { border-color: #E4A493; background: #FDF0EB; }
.khung-bieu-do { padding: .5rem; }
.bieu-do { width: 100%; height: auto; display: block; }
.bieu-do .dai-xanh { fill: #E7F2E4; } .bieu-do .dai-vang { fill: #FCF3D9; } .bieu-do .dai-do { fill: #FAE8E2; }
.bieu-do .luoi { stroke: #DDD2BF; stroke-width: 1; stroke-dasharray: 3 5; }
.bieu-do .nhan-truc { fill: #6B6257; font-size: 17px; font-family: inherit; }
.bieu-do .trong { fill: #6B6257; font-size: 22px; font-weight: 700; }
.bieu-do .duong { fill: none; stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.bieu-do .duong.d1 { stroke: #2E4B6B; } .bieu-do .duong.d2 { stroke: #B8563F; stroke-dasharray: 8 6; }
.bieu-do .cham { stroke: #fff; stroke-width: 2.5; }
.bieu-do .cham.d1 { fill: #2E4B6B; } .bieu-do .cham.d2 { fill: #B8563F; }
.chu-giai { display: flex; gap: 1.2rem; justify-content: center; font-size: .82rem; font-weight: 700; padding-top: .3rem; }
.chu-giai .mau { display: inline-block; width: 1.4rem; height: .35rem; border-radius: 3px; vertical-align: middle; margin-right: .35rem; }
.chu-giai .mau.d1 { background: #2E4B6B; } .chu-giai .mau.d2 { background: #B8563F; }
.ds-so { list-style: none; padding: .2rem 1rem; margin: 0; }
.ds-so li { display: flex; align-items: center; gap: .7rem; padding: .7rem 0; border-bottom: 1px solid var(--vien); }
.ds-so li:last-child { border-bottom: 0; }
.ds-so .cham-mau { width: .9rem; height: .9rem; border-radius: 50%; flex-shrink: 0; }
.ds-so .muc-xanh .cham-mau { background: var(--xanh); } .ds-so .muc-vang .cham-mau { background: #D89A00; } .ds-so .muc-do .cham-mau { background: var(--do); }
.ds-so .noi-dung { flex: 1; min-width: 0; }
.ds-so b { font-size: 1.25rem; font-family: var(--chu-dep); }
.ds-so em { font-style: normal; font-weight: 800; font-size: .85rem; }
.ds-so small { display: block; color: var(--muc-nhe); }

/* ---------- Thuốc ---------- */
.khung { background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo); padding: .2rem 1rem .8rem; margin: .8rem 0; box-shadow: var(--bong); }
.khung.bay-gio { border: 2px solid var(--navy); }
.khung h2 { display: flex; align-items: baseline; gap: .5rem; margin: .7rem 0 .3rem; }
.khung h2 small { font-weight: 400; color: var(--muc-nhe); font-family: 'Be Vietnam Pro', sans-serif; }
.khung .nhan-bay-gio { margin-left: auto; font-size: .7rem; font-family: 'Be Vietnam Pro', sans-serif; }
.thuoc { border-top: 1px solid var(--vien); padding: .7rem 0 .2rem; }
.thuoc .tt b { display: block; font-size: 1.15rem; }
.thuoc .tt span { color: var(--muc-nhe); }
.nut.uong { background: linear-gradient(180deg, #3A5A7E, var(--navy)); color: #fff; min-height: 3.6rem; font-size: 1.15rem; }
.thuoc.da .tt b { color: var(--xanh); }
.da-uong { background: var(--xanh-nen); color: var(--xanh); font-weight: 800; border-radius: 12px; padding: .6rem .8rem; margin: .5rem 0 .4rem; }
.ds-sua { list-style: none; padding: 0; margin: .4rem 0; }
.ds-sua li { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--vien); border-radius: 14px; padding: .6rem .8rem; margin-bottom: .5rem; }
.ds-sua li div { flex: 1; min-width: 0; }
.ds-sua small { display: block; color: var(--muc-nhe); }
.the.trong { text-align: center; }

/* ---------- Mâm cơm ---------- */
.luoi-bep { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin: .7rem 0 .3rem; }
.o-bep {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  min-height: 5rem; border-radius: 18px; border: 1px solid var(--vien); background: var(--the); box-shadow: var(--bong);
  font-weight: 700; font-size: .85rem; line-height: 1.2; padding: .4rem .2rem; text-align: center;
}
.o-bep span { font-size: 1.7rem; }
.meo { background: #FBF1D3; border: 1.5px solid #E8D39A; border-radius: 16px; padding: .3rem .9rem; margin: .8rem 0; }
.mam ul, .khan-muc ul { margin: .3rem 0 0; padding-left: 1.3rem; }
.mam li, .khan-muc li { padding: .15rem 0; }
.dau-mam { display: flex; align-items: center; gap: .6rem; }
.dau-mam h2 { flex: 1; margin: 0; font-size: 1.1rem; }

/* ---------- Bài học, khẩn cấp, bản tin ---------- */
.ds-bai { display: grid; gap: .1rem; }
.bai h1 { margin-top: 0; }
.bai ol { padding-left: 1.4rem; font-size: 1.08rem; }
.bai li { padding: .4rem 0; }
.nguon { font-size: .82rem; color: var(--muc-nhe); border-top: 1px solid var(--vien); padding-top: .6rem; }
.khan-muc .lam { background: var(--do-nen); border-radius: 12px; padding: .5rem .8rem; font-weight: 700; }
.ban-tin {
  white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 1rem;
  background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo); padding: 1rem; margin: .6rem 0; box-shadow: var(--bong);
}

/* ---------- Thông báo nhỏ ---------- */
.thong-bao {
  position: fixed; left: 50%; bottom: calc(6.5rem + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--navy-dam); color: #fff; border-radius: 16px; padding: .8rem 1.1rem; font-weight: 700;
  max-width: calc(100% - 32px); width: max-content; transition: transform .25s, opacity .25s; z-index: 20;
}
.thong-bao.hien { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Máy tính bảng dọc ---------- */
@media (min-width: 640px) {
  .ngay-vien { display: inline-block; }
  .luoi-bep { grid-template-columns: repeat(4, 1fr); }
  .ds-loai { grid-template-columns: repeat(3, 1fr); }
}
/* ---------- Máy tính / máy tính bảng ngang: menu cột trái ---------- */
@media (min-width: 900px) {
  body.co-menu .thanh-ben {
    display: flex; flex-direction: column; gap: .3rem; position: sticky; top: 0; height: 100vh; flex-shrink: 0;
    width: 13rem; padding: 1.4rem .9rem; background: var(--the-2); border-right: 1px solid var(--vien);
    border-radius: 0 28px 28px 0; box-shadow: 4px 0 24px rgba(60, 40, 20, .05);
  }
  .ten-app-ben { font-family: var(--chu-dep); font-weight: 700; font-size: 1.35rem; text-align: center; margin: 0 0 1.4rem; }
  .menu-ben { display: flex; flex-direction: column; gap: .35rem; }
  .menu-ben .muc-menu { flex-direction: row; justify-content: flex-start; gap: .7rem; font-size: .92rem; padding: .7rem .9rem; flex: none; min-height: 3rem; }
  body.co-menu .menu-duoi { display: none; }
  body.co-menu .man { padding-bottom: 2rem; }
  .thanh-tren .ten-app { visibility: visible; }
}
/* Màn hẹp */
@media (max-width: 380px) {
  .ten-app { font-size: 1rem; }
  .nut-tron .ten-nho { display: none; }
  .luoi-3 { grid-template-columns: 1fr; }
  .o-so input { font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, .hinh.dong .dap, .hinh.dong .hc, .diem .vong { animation: none !important; transition: none !important; }
}
