:root, :root[data-theme="light"] {
  --bg: #f6f3ee; --card: #ffffff; --ink: #1d1d1f; --muted: #6e6e73; --line: #e5e1da; --chip: #ece8e1;
  --feed: #e07a4a; --diaper: #4a7bbf; --sleep: #4f9a6b; --pump: #9a6fb0; --other: #8a8f99;
  --accent: #c0567f; --toast: #1d1d1f; --toast-ink: #ffffff; color-scheme: light;
}
/* tối: theo máy (khi chưa chọn) hoặc chọn "Tối" trong ⚙︎ */
:root[data-theme="dark"] {
  --bg: #121212; --card: #1e1e1e; --ink: #f2f2f2; --muted: #a1a1a6; --line: #2c2c2e; --chip: #2c2c2e;
  --feed: #c8693f; --diaper: #3f6aa6; --sleep: #3f8559; --pump: #8a5ea0; --other: #5f636b; --accent: #e07aa3;
  --toast: #f2f2f2; --toast-ink: #121212; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --card: #1e1e1e; --ink: #f2f2f2; --muted: #a1a1a6; --line: #2c2c2e; --chip: #2c2c2e;
    --feed: #c8693f; --diaper: #3f6aa6; --sleep: #3f8559; --pump: #8a5ea0; --other: #5f636b; --accent: #e07aa3;
    --toast: #f2f2f2; --toast-ink: #121212; color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { padding: env(safe-area-inset-top) 14px calc(env(safe-area-inset-bottom) + 20px); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 15px; }

header { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px 4px; }
.bname { font-size: 22px; font-weight: 700; }
.icon { font-size: 22px; width: 44px; height: 44px; border-radius: 22px; background: var(--card); }
.last { padding: 2px 2px 12px; color: var(--muted); font-size: 15px; min-height: 20px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { min-height: 96px; border-radius: 18px; color: #fff; text-align: left; padding: 12px 14px;
  display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.tile .ic { font-size: 28px; line-height: 1; }
.tile .lb { font-size: 18px; font-weight: 650; }
.tile .sub { font-size: 13px; opacity: .9; min-height: 16px; }
.tile:active { transform: scale(.97); }
.tile.run { outline: 3px solid var(--ink); outline-offset: -3px; }
.t-feed { background: var(--feed); } .t-diaper { background: var(--diaper); } .t-sleep { background: var(--sleep); }
.t-pump { background: var(--pump); } .t-other { background: var(--other); }

.today { margin-top: 16px; }
.sum { background: var(--card); border-radius: 14px; padding: 12px 14px; font-size: 15px; }
.sum b { font-size: 17px; }
.wide { width: 100%; margin: 10px 0; padding: 12px; border-radius: 12px; background: var(--card); color: var(--accent); font-weight: 600; }
.day { margin: 14px 2px 6px; font-size: 14px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.ev { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: var(--card);
  padding: 11px 12px; border-radius: 12px; margin-bottom: 6px; }
.ev .tm { font-variant-numeric: tabular-nums; width: 46px; color: var(--muted); font-size: 15px; }
.ev .tx { flex: 1; }
.ev .dot { width: 10px; height: 10px; border-radius: 5px; }

.toast { position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 14px);
  background: var(--toast); color: var(--toast-ink); border-radius: 16px; padding: 12px 14px; z-index: 20;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.toast { z-index: 40; }
.toast.top { bottom: auto; top: calc(env(safe-area-inset-top) + 10px); }
.toast .row { margin-top: 8px; }


.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 14px; }
.row button, .chip { padding: 10px 14px; border-radius: 12px; background: var(--chip); color: var(--ink); font-size: 16px; min-height: 44px; }
.chip.on { background: var(--accent); color: #fff; }
.primary { background: var(--accent) !important; color: #fff !important; font-weight: 600; }
.danger { color: #d64545 !important; }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 30; display: flex; align-items: flex-end; }
.panel { background: var(--bg); width: 100%; border-radius: 20px 20px 0 0; padding: 18px 16px calc(env(safe-area-inset-bottom) + 18px);
  max-height: 92vh; max-height: 92dvh; overflow: auto; }
.panel h2 { margin: 0 0 12px; font-size: 20px; }
.field { margin: 12px 0; }
.field > label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
input, textarea, select { font: inherit; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); }
textarea { min-height: 70px; }

.screen { min-height: 90vh; min-height: 90dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.pindots { display: flex; gap: 12px; margin: 10px 0; }
.pindots span { width: 14px; height: 14px; border-radius: 7px; border: 2px solid var(--muted); }
.pindots span.on { background: var(--ink); border-color: var(--ink); }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; margin-top: 10px; }
.pad button { height: 76px; border-radius: 38px; background: var(--card); font-size: 26px; }
.pad .ghost { background: none; font-size: 17px; color: var(--accent); }

.hbtns { display: flex; gap: 8px; }
.card { background: var(--card); border-radius: 14px; padding: 12px 14px; margin: 8px 0; }
.vrow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--card); padding: 11px 12px; border-radius: 12px; margin-bottom: 6px; }
.vrow .tx { flex: 1; }
.vrow .st { font-size: 13px; }
.st.due { color: #c98a00; } .st.over { color: #d64545; } .st.ok { color: var(--sleep); }
.mini { padding: 8px 10px !important; min-height: 36px !important; font-size: 14px !important; }
.sec { margin: 16px 2px 6px; font-size: 14px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.chart { width: 100%; height: auto; background: var(--card); border-radius: 14px; }
.chart text { fill: var(--muted); font-size: 10px; }
.tabs { display: flex; gap: 6px; margin: 8px 0; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

/* ---- màn chính v2 (D18) ---- */
.dash { background: var(--card); border-radius: 18px; padding: 12px 14px 6px; margin-bottom: 12px; }
.dhead { font-weight: 700; font-size: 15px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .3px; }
.drow { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.drow:first-of-type { border-top: 0; }
.dic { font-size: 22px; }
.dv { font-size: 17px; }
.dv b { font-size: 22px; }
.dn { text-align: right; font-size: 14px; color: var(--muted); line-height: 1.3; }
.c-feed .dv b { color: var(--feed); } .c-sleep .dv b { color: var(--sleep); } .c-diaper .dv b { color: var(--diaper); }
.late { color: #d64545; }
.big3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.big { min-height: 118px; border-radius: 20px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.big .ic { font-size: 34px; line-height: 1; } .big .lb { font-size: 21px; font-weight: 700; } .big .sub { font-size: 12px; opacity: .92; min-height: 15px; }
.big:active, .bigaction:active, .ml:active { transform: scale(.97); }
.big.run { box-shadow: inset 0 0 0 4px rgba(255,255,255,.75); }
.b-feed { background: var(--feed); } .b-sleep { background: var(--sleep); } .b-diaper { background: var(--diaper); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.when { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; }
.when input { width: auto; flex: 0 0 auto; }
.when input[type=number], .when input#openCode { flex: 1; }
.mlgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chip.ml { min-height: 58px; font-size: 21px; font-weight: 650; background: var(--card); border: 2px solid var(--feed); color: var(--ink); }
.chip.ml.on { background: var(--feed); color: #fff; }
.bigaction { width: 100%; min-height: 70px; border-radius: 16px; color: #fff; font-size: 19px; font-weight: 650; margin: 6px 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .two .bigaction { margin: 0; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; } .three .bigaction { margin: 0; min-height: 90px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wk { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 14px; overflow: hidden; font-size: 15px; font-variant-numeric: tabular-nums; }
.wk th, .wk td { padding: 8px 10px; text-align: right; border-top: 1px solid var(--line); }
.wk th { color: var(--muted); font-weight: 600; font-size: 13px; border-top: 0; }
.wk td:first-child, .wk th:first-child { text-align: left; }
.wk td:nth-child(2) b { color: var(--feed); }
.foot { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 8px; }
.foot button { padding: 9px 12px; border-radius: 12px; background: var(--card); font-size: 14px; color: var(--muted); }
#pending { margin: 8px 2px; }
.homewrap { max-width: 520px; margin: 0 auto; padding-top: 20px; }
.homewrap h1 { margin-bottom: 4px; }
.primary { background: var(--accent); color: #fff; }

/* nút trong thanh thông báo: luôn tương phản với nền thanh */
.toast .chip, .toast .row button { background: rgba(128,128,128,.35); color: var(--toast-ink); }
@supports (background: color-mix(in srgb, red 50%, blue)) { .toast .chip, .toast .row button { background: color-mix(in srgb, var(--toast-ink) 18%, transparent); } }
.chip.on { background: var(--accent); color: #fff; }
.chip.primary, .row button.primary { background: var(--accent); color: #fff; }
input, textarea, select { color: var(--ink); background: var(--card); }
.b-pump { background: var(--pump); }
.c-pump .dv b { color: var(--pump); }
.chip.ml.pump { border-color: var(--pump); } .chip.ml.pump.on { background: var(--pump); }
.more { margin-top: 14px; }
.more > summary { list-style: none; text-align: center; padding: 12px; border-radius: 14px; background: var(--card); color: var(--muted); font-weight: 600; }
.more > summary::-webkit-details-marker { display: none; }
.more[open] > summary { margin-bottom: 8px; }
.morebtns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.morebtns button { min-height: 64px; border-radius: 14px; background: var(--card); color: var(--ink); font-size: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.morebtns button span { font-size: 22px; }
.theme { display: flex; gap: 6px; }

/* chống phóng to trên iPhone: chữ ô nhập ≥ 16px, không chạm đúp phóng to, không tràn ngang */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
body { overflow-x: hidden; }
button, a, input, select, textarea, summary { touch-action: manipulation; }
input, select, textarea { font-size: 16px !important; min-width: 0; max-width: 100%; }
input[type="date"], input[type="time"], input[type="datetime-local"] { -webkit-appearance: none; appearance: none; min-height: 44px; display: block; width: 100%; }
.when input[type="time"] { width: auto; min-width: 110px; flex: 0 0 auto; }
.when { flex-wrap: wrap; }
.panel, .dash, .card, .wk { max-width: 100%; }

/* nút Xem thêm: nền màu như 3 nút chính, chữ trắng */
.morebtns button { color: #fff; font-weight: 600; }
.morebtns button:active { transform: scale(.97); }
.morebtns [data-go="diaper"]   { background: var(--diaper); }
.morebtns [data-go="other"]    { background: var(--other); }
.morebtns [data-go="backfill"] { background: var(--accent); }
.morebtns [data-go="grow"]     { background: #2f8f9d; }
.morebtns [data-go="vax"]      { background: #c2564b; }
.morebtns [data-go="guide"]    { background: #b0862f; }
:root[data-theme="dark"] .morebtns [data-go="grow"] { background: #27737e; }
:root[data-theme="dark"] .morebtns [data-go="vax"] { background: #a14840; }
:root[data-theme="dark"] .morebtns [data-go="guide"] { background: #8f6d26; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .morebtns [data-go="grow"] { background: #27737e; }
  :root:not([data-theme="light"]) .morebtns [data-go="vax"] { background: #a14840; }
  :root:not([data-theme="light"]) .morebtns [data-go="guide"] { background: #8f6d26; }
}

/* Thống kê (28/11) */
.morebtns .span { grid-column: 1 / -1; flex-direction: row; gap: 8px; min-height: 52px; }
.morebtns [data-go="stats"] { background: #5b6cc4; }
:root[data-theme="dark"] .morebtns [data-go="stats"] { background: #4a589f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .morebtns [data-go="stats"] { background: #4a589f; } }
.panel.full { max-height: 100vh; max-height: 100dvh; height: 100dvh; border-radius: 0; padding-top: calc(env(safe-area-inset-top) + 14px); }
.sttabs { display: flex; background: var(--chip); border-radius: 12px; padding: 3px; gap: 2px; }
.sttabs button { flex: 1; padding: 8px 2px; border-radius: 10px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.sttabs button.on { background: var(--card); color: var(--accent); font-weight: 650; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.stnav { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 6px; }
.stnav button { width: 44px; height: 44px; border-radius: 22px; background: var(--card); font-size: 24px; color: var(--accent); }
.stnav button:disabled { opacity: .3; }
.stc { padding: 10px 10px 6px; margin-bottom: 10px; }
.sth { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.sth > span:not(.stic):not(.stu) { display: flex; flex-direction: column; line-height: 1.1; }
.sth small { font-size: 11px; color: var(--muted); }
.sth b { font-size: 20px; font-variant-numeric: tabular-nums; }
.stic { font-size: 24px; }
.stu { margin-left: auto; text-align: right; font-size: 14px; color: var(--muted); line-height: 1.15; }
.stt { font-size: 17px; }
.stsvg { width: 100%; height: auto; display: block; }
.stsvg .gl { stroke: var(--line); stroke-width: 1; }
.stsvg .gv { opacity: .6; }
.stsvg .ax { fill: var(--muted); font-size: 10px; }
.stsvg .vl { fill: var(--ink); font-size: 10px; font-weight: 600; }
.stleg { margin-left: auto; display: flex; gap: 6px; }
.stleg button { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; background: var(--chip); opacity: .35; border: 2px solid transparent; }
.stleg button.on { opacity: 1; border-color: var(--c); }
.stsum { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 14px; margin-bottom: 10px; font-size: 15px; }
.stsvg .lnl { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.stsvg .lnd { fill: var(--card); stroke: var(--ink); stroke-width: 2; }
.stsvg .lnp { fill: var(--ink); }
.stsvg .lnt { fill: var(--ink); font-size: 10px; font-weight: 700; }
.lgb { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 3px; }
.lgl { display: inline-block; width: 12px; height: 2px; background: var(--ink); vertical-align: middle; margin: 0 3px 0 4px; }
.stsvg .vin { fill: #fff; }
/* khoảng thời gian dính ở trên khi cuộn trang Thống kê; bóng đổ lên che phần nội dung chạy dưới tai thỏ */
.sthead { position: sticky; top: 0; top: env(safe-area-inset-top); z-index: 2; background: var(--bg); padding: 4px 0 2px; box-shadow: 0 -80px 0 var(--bg), 0 6px 8px -6px rgba(0,0,0,.18); }
.sthead .stnav { margin-bottom: 4px; }
/* trang Thống kê: tiêu đề + nút Về nằm trong thanh dính, bỏ tiêu đề chung của sheet */
.panel.full > h2 { display: none; }
.sttop { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 8px; }
.sttop b { font-size: 18px; }
.sttop button { justify-self: start; padding: 8px 14px 8px 10px; border-radius: 20px; background: var(--card); color: var(--accent); font-weight: 600; font-size: 16px; }
.isteps { padding-left: 22px; margin: 8px 0; }
.isteps li { margin: 8px 0; line-height: 1.4; }
/* phiên bản + có gì mới */
.verrow { display: flex; width: 100%; justify-content: space-between; align-items: center; text-align: left; color: var(--ink); }
.newtag { background: #d64545; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; vertical-align: 2px; }
#btnSettings { position: relative; }
#btnSettings.news::after { content: ""; position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 5px; background: #d64545; border: 2px solid var(--card); }
/* hướng dẫn người mới, gợi ý ô nhập, góp ý */
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.intro { font-size: 15px; line-height: 1.45; }
.sheet.top { align-items: flex-start; }
.sheet.top .panel { border-radius: 0 0 20px 20px; padding-top: calc(env(safe-area-inset-top) + 16px); }
.tourhl { position: relative; z-index: 31; box-shadow: 0 0 0 4px var(--accent), 0 0 0 9999px rgba(0,0,0,0) !important; border-radius: 16px; }
.tourtx { font-size: 17px; line-height: 1.5; margin: 0 0 10px; }
.tourdots { display: flex; gap: 6px; justify-content: center; margin: 6px 0 2px; }
.tourdots span { width: 7px; height: 7px; border-radius: 4px; background: var(--line); }
.tourdots span.on { background: var(--accent); width: 18px; }
.fb .fbh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.fb .fbst { font-size: 14px; font-weight: 600; }
.fb.done .fbst { color: var(--sleep); }
.fb .fbt { white-space: pre-wrap; word-break: break-word; }
.fb .fbr { margin-top: 6px; font-size: 14px; color: var(--muted); }
/* điều hướng (Q24 A): nút "‹ màn trước" chữ màu, không nền; hỏi lại khi rời màn có chữ chưa lưu */
#shBtns button.back { background: none; color: var(--accent); font-weight: 600; padding-left: 4px; margin-right: auto; }
#shBtns .askleave { flex: 1 1 100%; font-weight: 600; text-align: left; padding: 2px 2px 4px; }
button.wide.subtle { background: none; color: var(--muted); border: 1px solid var(--line); }
/* khung Quản trị trong Cài đặt: chỉ gia đình chủ app */
.card.admin { border: 2px solid var(--accent); display: grid; gap: 2px; }
.adminh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.admintag { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.adminrow { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 44px; padding: 8px 0; background: none; color: var(--ink); font-size: 16px; text-align: left; border-top: 1px solid var(--line); border-radius: 0; }
.adminrow:first-of-type { border-top: 0; }
.pill { font-size: 13px; font-weight: 700; border-radius: 10px; padding: 2px 9px; color: #fff; background: var(--feed); font-variant-numeric: tabular-nums; }
.pill.grey { background: var(--chip); color: var(--muted); }
.fb .row { margin-top: 8px; }
.fb textarea { margin-top: 8px; }
.admtbl { overflow-x: auto; }
.admtbl table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.admtbl th, .admtbl td { text-align: left; padding: 7px 4px; border-top: 1px solid var(--line); }
.admtbl th { color: var(--muted); font-weight: 600; border-top: 0; }
/* tab các bé (gia đình nhiều bé) */
.babytabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 2px 2px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.babytabs::-webkit-scrollbar { display: none; }
.babytabs a { flex: none; padding: 8px 16px; border-radius: 20px; background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.babytabs a.on { background: var(--accent); color: #fff; }
.babytabs a.add { background: none; color: var(--accent); border: 1.5px dashed var(--accent); font-weight: 500; }
/* gia đình nhiều bé (D24–D26) */
.bcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 6px; }
.bcol { background: var(--bg); border-radius: 12px; padding: 8px 9px; display: flex; flex-direction: column; gap: 2px; }
.bct { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.bct b { font-size: 18px; } .bct .muted { font-size: 12px; text-align: right; }
.bcs { font-size: 14px; line-height: 1.3; } .bcs.c-feed b { color: var(--feed); } .bcs.c-sleep b { color: var(--sleep); }
.bcs.muted { font-size: 13px; min-height: 17px; }
.bcb { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.mini { min-height: 52px; border-radius: 12px; color: #fff; font-weight: 650; font-size: 16px; }
.mini.b-feed { background: var(--feed); } .mini.b-sleep { background: var(--sleep); } .mini.run { outline: 3px solid var(--ink); outline-offset: -3px; }
.mini:active, .multibar .big:active { transform: scale(.97); }
.multibar { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 4px; }
.multibar .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.multibar .wide1 { width: 100%; min-height: 76px; flex-direction: row; gap: 10px; justify-content: center; }
.who { font-size: 15px; margin: -4px 0 8px; color: var(--muted); } .who b { color: var(--ink); }
.pickb { display: grid; gap: 10px; } .pickb .bigaction { font-size: 20px; }
.stbabies { display: flex; gap: 6px; margin-bottom: 8px; overflow-x: auto; }
.pickb .bigaction { background: var(--accent); }
.bcol .bcb { margin-top: auto; padding-top: 6px; }
/* theo lứa tuổi (D27) */
:root { --health: #c2564b; --grow: #2f8f9d; --solid: #c98a2e; }
:root[data-theme="dark"] { --health: #a14840; --grow: #27737e; --solid: #a8731f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --health: #a14840; --grow: #27737e; --solid: #a8731f; } }
.b-solid { background: var(--solid); } .b-grow { background: var(--grow); } .b-health { background: var(--health); } .b-vax { background: #c2564b; }
.mini.b-solid { background: var(--solid); } .mini.b-grow { background: var(--grow); } .mini.b-health { background: var(--health); } .mini.b-vax { background: #c2564b; }
.dvw { flex: 1; font-size: 15px; line-height: 1.4; } .okv { color: var(--sleep); font-size: 14px; } .dvw .late { font-size: 14px; }
.mlgrid.two { grid-template-columns: 1fr 1fr; }
.bcs .muted, .bcs .okv, .bcs .late { font-size: 12px; }
/* tiêm chủng: nhãn miễn phí / dịch vụ, nút đã tiêm, chọn nơi tiêm (28/11) */
.vmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; }
.vtag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.vtag.free { background: rgba(79,154,107,.15); color: var(--sleep); }
.vtag.dv { background: rgba(201,138,46,.16); color: var(--solid); }
.vdone { flex: none; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--sleep); color: var(--sleep); background: transparent; font-weight: 600; font-size: 15px; white-space: nowrap; }
.vplace { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vpl { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 2px solid var(--line); color: var(--ink); text-align: left; }
.vpl span { font-weight: 600; } .vpl small { color: var(--muted); font-size: 13px; }
.vpl.tcmr.on { border-color: var(--sleep); background: rgba(79,154,107,.1); } .vpl.dv.on { border-color: var(--solid); background: rgba(201,138,46,.1); }
/* nút ghim (28/11) */
.b-diaper { background: var(--diaper); } .b-stats { background: #5b6cc4; } .b-guide { background: #b0862f; } .b-backfill { background: var(--accent); } .b-other { background: var(--other); }
.mini.b-diaper { background: var(--diaper); } .mini.b-stats { background: #5b6cc4; } .mini.b-guide { background: #b0862f; } .mini.b-backfill { background: var(--accent); } .mini.b-other { background: var(--other); } .mini.b-pump { background: var(--pump); }
.big3.small .big { min-height: 92px; } .big3.small .big .ic { font-size: 28px; } .big3.small .big .lb { font-size: 17px; }
.warnv { color: var(--solid); font-size: 14px; } .bcs .warnv { font-size: 12px; }
.morebtns [data-go="health"] { background: var(--health); }
.hrow { padding: 6px 0; border-top: 1px solid var(--line); font-size: 15px; }
/* nhà nhiều bé: mỗi bé một dòng (28/11) */
.bcols { grid-template-columns: 1fr; }
.bcol { padding: 10px 12px; gap: 3px; }
.bct { justify-content: flex-start; } .bct .muted { font-size: 14px; }
.bcol .bcb { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; padding-top: 0; }
.bcol .bcb .mini { flex: 0 0 auto; padding: 8px 14px; min-height: 40px; font-size: 15px; }
.bcs { font-size: 15px; } .bcs .muted { font-size: 14px; } .bcs .nx { font-size: 14px; }
/* màu riêng từng bé (28/11): vạch trái + tên màu, nhãn tên bé cùng màu */
.bcol { border-left: 6px solid var(--bc); }
.bcol .bct b { color: var(--bc); }
.btag { color: var(--bc); font-weight: 700; white-space: nowrap; }
.btag::before { content: "●"; margin-right: 3px; }
.chip.bchip { color: var(--bc); font-weight: 600; }
.chip.bchip.on { background: var(--bc); color: #fff; }
.bigaction.bpick { background: var(--card); border: 2px solid var(--line); border-left: 8px solid var(--bc); color: var(--bc); font-weight: 700; } .bigaction.bpick small { color: var(--muted); font-weight: 400; }
#toastMsg .btag::before { color: var(--bc); }
#toastMsg .btag { color: inherit; text-decoration: underline; text-decoration-color: var(--bc); text-decoration-thickness: 3px; }
/* lịch sử: nhãn loại bằng chữ (28/11) */
.ev .kind { flex: none; font-size: 13px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); padding: 3px 8px; border-radius: 8px; white-space: nowrap; }
.ev .tx .btag::before { content: none; }
.wk .wkf b { color: var(--feed); } .wk td small { font-size: 13px; }
.wk.mb td, .wk.mb th { font-size: 13px; padding-left: 4px; padding-right: 4px; vertical-align: top; }
.wk.mb td:first-child { white-space: nowrap; font-size: 14px; }
.wk.mb td span, .wk.mb td small { white-space: nowrap; font-size: 13px; }
.wktabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.wk td:first-child { white-space: nowrap; } .wk th { white-space: nowrap; font-size: 13px; } .wk th small { font-weight: 400; }
/* icon Phosphor Duotone thay emoji (28/11): cỡ theo chữ xung quanh, màu theo chữ */
.ico { width: 1.2em; height: 1.2em; vertical-align: -0.22em; fill: currentColor; flex: none; }
.icw { display: contents; }
.big .ic .ico { width: 1.15em; height: 1.15em; vertical-align: 0; }
.morebtns button span .ico { width: 1.1em; height: 1.1em; }
.chip .ico, .mini .ico { margin-right: 2px; }
/* Fluent Emoji (nhiều màu): không tô theo màu chữ; trên nút màu đặt nền tròn sáng cho rõ */
.ico { fill: initial; }
.big .ic .ico { filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
