/* Lịch VN 4G — giao diện theo layout/ (docs/giao-dien-app.md) */
:root {
    --gold: #E0A526; --gold-ink: #8A6410;
    --red: #A8231C; --red-dark: #7E1913; --red-soft: #F6E1DE; --cream: #FFF8EE;
    --bg: #F7F2EA; --card: #FFFDF9; --line: #E7DDCF; --ink: #221C18; --muted: #6B5F55; --chip: #F1EADF;
    --good: #1F6B4A; --good-soft: #E3EFE8; --good-ink: #164E36; --gold: #9A6B12; --event: #C98A0B;
    --lv-rattot: #0B4A30; --lv-tot: #1F6B4A; --lv-kha: #8A6410; --lv-tb: #B0832A; --lv-kem: #6B5F55; --lv-ky: #A8231C;
    --verdict: #FBF3E3; --warn: #F6E9E6;
    --kim: #455A64; --moc: #2E7D32; --thuy: #0277BD; --hoa: #D32F2F; --tho: #795548;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #17130F; --card: #221C17; --line: #3A322A; --ink: #F2EBE0; --muted: #B5A897; --chip: #2E2620;
        --red-soft: #3F1D1A; --good-soft: #1D3328; --good-ink: #A8DCC0; --verdict: #2D2617; --warn: #3A211E;
        --kim: #9FB3BD; --moc: #7FC787; --thuy: #6CB8E6; --hoa: #F07A72; --tho: #C9A28D;
    }
}
:root[data-theme="dark"] {
    --bg: #17130F; --card: #221C17; --line: #3A322A; --ink: #F2EBE0; --muted: #B5A897; --chip: #2E2620;
    --red-soft: #3F1D1A; --good-soft: #1D3328; --good-ink: #A8DCC0; --verdict: #2D2617; --warn: #3A211E;
    --kim: #9FB3BD; --moc: #7FC787; --thuy: #6CB8E6; --hoa: #F07A72; --tho: #C9A28D;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.4; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--red); }
.serif { font-family: 'Noto Serif', Georgia, serif; }
#app { max-width: 560px; margin: 0 auto; padding-bottom: 96px; min-height: 100vh; }
#app.no-tabs { padding-bottom: 24px; }

/* Đầu trang */
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 16px 8px; }
.top .kicker { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .4px; }
.top h1 { margin: 0; font-size: 20px; font-weight: 700; }
.top .sub { font-size: 12px; color: var(--muted); }
.top .center { display: flex; flex-direction: column; align-items: center; text-align: center; flex: 1; }
.top .center h1 { font-family: 'Noto Serif', Georgia, serif; font-size: 21px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; color: var(--ink); text-decoration: none; }
.icon-btn.ghost { border: 0; background: transparent; }
.icon-btn svg { width: 20px; height: 20px; }
.row { display: flex; gap: 8px; align-items: center; }
.bar { display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar .title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bar .title b { font-size: 16px; }
.bar .title span { font-size: 12px; color: var(--muted); }

/* Thẻ */
.wrap { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.card h3 { margin: 0 0 8px; font-size: 14px; }
.card h3 small { font-weight: 500; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.good { color: var(--good); } .bad { color: var(--red); }

/* Ô ngày lớn */
.hero { background: var(--red); color: var(--cream); border-radius: 24px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.hero .nav { display: flex; align-items: center; justify-content: space-between; }
.hero .nav button { width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(255,248,238,.15); color: var(--cream); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.hero .nav span { font-size: 15px; font-weight: 600; }
.hero .main { display: flex; align-items: flex-end; justify-content: space-between; }
.hero .big { font-family: 'Noto Serif', Georgia, serif; font-size: 92px; font-weight: 700; line-height: .9; }
.hero .lunar { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 2px; min-width: 0; }
.hero .lunar b { white-space: nowrap; } .hero .lunar b small { font-weight: 500; opacity: .85; font-size: 12px; } .hero .nw { white-space: nowrap; }
.hero .lunar .l-big { font-family: 'Noto Serif', Georgia, serif; font-size: 42px; font-weight: 700; line-height: 1; }
.hero .today-btn { border: 1px solid rgba(255,248,238,.5); background: transparent; color: var(--cream); border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; }

/* Can Chi theo ngũ hành */
.canchi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px 4px; }
.canchi > div { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.canchi > div + div { border-left: 1px solid var(--line); }
.canchi .lbl { font-size: 11px; color: var(--muted); }
.canchi .val { font-size: 15px; font-weight: 700; }
.canchi .na { font-size: 11px; }
.h-kim { color: var(--kim); } .h-moc { color: var(--moc); } .h-thuy { color: var(--thuy); } .h-hoa { color: var(--hoa); } .h-tho { color: var(--tho); }
.canchi svg { width: 18px; height: 18px; }

/* Đánh giá chung */
.verdict { background: var(--verdict); border-radius: 16px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
.verdict.lv-tot, .verdict.lv-rattot { background: var(--good-soft); } .verdict.lv-rattot { box-shadow: inset 4px 0 0 var(--lv-rattot); } .verdict.lv-kem, .verdict.lv-ky { background: var(--warn); }
.verdict .txt { display: flex; flex-direction: column; gap: 3px; }
.who { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; font-weight: 600; color: var(--good); margin: 0 4px -6px; }
.who .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; } .who .muted { white-space: nowrap; flex: none; }
.who .muted { font-weight: 500; }
.pdesc { margin-top: -4px; }
.ycard h3 small { font-weight: 500; color: var(--muted); }
.ygrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.yi { display: flex; flex-direction: column; font-size: 12px; min-width: 0; } .yi .k { color: var(--muted); } .yi b { font-size: 13px; font-weight: 600; }
.warnc { color: var(--lv-kha); }
.ynav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ynav > div { display: flex; flex-direction: column; align-items: center; text-align: center; }
.vrows { padding-top: 4px; padding-bottom: 4px; }
.vrow { display: grid; grid-template-columns: 7.5em 1fr; gap: 2px 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.vrow:last-child { border-bottom: 0; }
.vrow .k { color: var(--muted); } .vrow b { font-weight: 600; text-align: right; } .vrow .n { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.li.prof { justify-content: flex-start; } .li.prof .t { flex: 1; }
.radio-btn { background: none; border: 0; padding: 0; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: flex-start; cursor: pointer; }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong, var(--muted)); display: inline-flex; align-items: center; justify-content: center; color: var(--red); font-size: 14px; line-height: 1; flex: none; }
.score { flex-shrink: 0; color: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.lv-bg-rattot { background: var(--lv-rattot); } .lv-bg-tot { background: var(--lv-tot); } .lv-bg-kha { background: var(--lv-kha); } .lv-bg-tb { background: var(--lv-tb); } .lv-bg-kem { background: var(--lv-kem); } .lv-bg-ky { background: var(--lv-ky); }

/* Nhãn */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; background: var(--good); }
.chip.bad { background: var(--red); color: #fff; }
.chip.neutral { background: #0F5C8A; }
.chip.gold { background: #F6E9C8; color: var(--gold-ink); }
.chip.soft { background: var(--good-soft); color: var(--good-ink); }
.chip.soft-bad { background: var(--red-soft); color: var(--red-dark); }
:root[data-theme="dark"] .chip.soft-bad { color: #F4B3AC; }
.pill { min-height: 36px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13px; cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
.pill.green[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: #fff; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--chip); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 700; }

/* Giờ */
.hours6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.hours6 > div { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 44px; border-radius: 10px; background: var(--chip); color: var(--muted); }
.hours6 > div.hd { background: var(--good); color: #fff; }
.hours6 > div.now { outline: 2px solid var(--gold); outline-offset: 1px; }
.hours6 b { font-size: 13px; } .hours6 span { font-size: 10px; }
.hrow { display: grid; grid-template-columns: 40px 54px 1fr auto; gap: 6px; align-items: center; padding: 7px 8px; font-size: 12px; border-radius: 8px; }
.hrow.hd { background: var(--good-soft); }

/* Nút */
.btn { min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--ink); padding: 0 14px; }
.btn.outline { border-color: var(--red); color: var(--red); }
.btn.primary { background: var(--red); border-color: var(--red); color: var(--cream); }
.btn.link { border: 0; background: transparent; color: var(--red); }
.btn.dashed { border-style: dashed; color: var(--muted); }
.btn svg { width: 16px; height: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sgrid { grid-template-columns: minmax(0, 1.45fr) minmax(0, .8fr) minmax(0, 1fr); align-items: end; }
.sgrid .f { white-space: nowrap; }
.pickrow { display: flex; flex-direction: column; gap: 6px; } .pill.sm { min-height: 34px; padding: 4px 12px; font-size: 13px; }
input:disabled { opacity: .75; }
.mini { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.mini .k { font-size: 11px; color: var(--muted); } .mini .v { font-size: 14px; font-weight: 700; } .mini .s { font-size: 11px; font-weight: 600; } .mini .s.gold { color: var(--gold-ink); }

/* Ô nhập */
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.f input, label.f select, label.f textarea { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); padding: 0 10px; font-size: 15px; font-weight: 600; text-align: center; width: 100%; }
label.f textarea { text-align: left; padding: 10px; font-weight: 400; min-height: 64px; resize: none; }
label.f input.left { text-align: left; }
label.ck { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 40px; }
label.ck input { width: 20px; height: 20px; margin: 0; accent-color: var(--red); }

/* Lịch tháng */
.wdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 6px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 0 10px; }
.cell { height: 60px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 0; color: var(--ink); }
.cell.out { opacity: .42; } .cell.sun .n { color: var(--red); }
.cell.today { background: var(--red); border-color: var(--red); color: var(--cream); } .cell.today .n, .cell.today .l { color: var(--cream) !important; }
.cell.sel:not(.today) { outline: 2px solid var(--red); }
.cell .n { font-size: 17px; font-weight: 700; } .cell .l { font-size: 10.5px; color: var(--muted); }
.cell .l.sp { color: var(--red); font-weight: 700; }
.cell .dots { display: flex; gap: 3px; height: 8px; align-items: center; }
.dot { width: 6px; height: 6px; border-radius: 3px; display: inline-block; box-sizing: border-box; }
.dot.ban { background: var(--gold); } .dot.hd { background: var(--good); } .dot.hk { border: 1.5px solid var(--red); }
.ev { width: 7px; height: 7px; border-radius: 2px; background: var(--event); display: inline-block; }
.ev.off { background: var(--red); }
.legend { display: flex; gap: 12px; padding: 10px 16px 0; font-size: 11px; color: var(--muted); flex-wrap: wrap; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.lrow { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); cursor: pointer; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; color: var(--ink); }
.lrow b { font-size: 14px; } .lrow .r { font-size: 12px; color: var(--muted); text-align: right; }

/* Tìm ngày */
.yc { border-radius: 12px; padding: 10px 12px; font-size: 12px; line-height: 1.55; background: var(--good-soft); }
.yc.warn { background: var(--warn); }
.pick { display: grid; grid-template-columns: 60px 1fr; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; cursor: pointer; text-align: left; width: 100%; color: var(--ink); }
.pick.out { opacity: .6; }
.pick .dt b { font-family: 'Noto Serif', Georgia, serif; font-size: 21px; line-height: 1; display: block; }
.pick .dt span { font-size: 11px; color: var(--muted); display: block; }
.pick .hd { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; font-weight: 600; }
.pick .rs { font-size: 11px; line-height: 1.55; margin: 4px 0 2px; }
.pick .rs span { margin-right: 6px; }
details.low > summary { list-style: none; cursor: pointer; min-height: 44px; border-radius: 12px; border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--muted); }
details.low[open] > summary { margin-bottom: 8px; }
details.low > div { display: flex; flex-direction: column; gap: 8px; }

/* Sự kiện */
.evrow { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; text-align: left; width: 100%; color: var(--ink); }
.evtag { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 11px; font-weight: 700; }
.evtag.sn { background: var(--good-soft); color: var(--good-ink); } .evtag.gio { background: var(--chip); color: var(--tho); }
.evtag.khac { background: var(--chip); color: var(--muted); }
.evrow .left { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; }
.evrow .left b { font-family: 'Noto Serif', Georgia, serif; font-size: 20px; line-height: 1; color: var(--red); }
.fab { width: 48px; height: 48px; border-radius: 24px; background: var(--red); border: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--cream); }

/* Cài đặt */
.sec { padding: 14px 20px 6px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .4px; text-transform: uppercase; }
.list { margin: 0 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 0 14px; }
.li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; color: var(--ink); cursor: pointer; padding: 6px 0; }
.li:last-child { border-bottom: 0; }
.li .t { display: flex; flex-direction: column; } .li .t b { font-size: 14px; font-weight: 600; } .li .t span { font-size: 12px; color: var(--muted); }
.sw { flex-shrink: 0; width: 50px; height: 30px; border-radius: 15px; border: 0; background: #CDBFAA; position: relative; cursor: pointer; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 12px; background: #fff; transition: left .15s; }
.sw[aria-checked="true"] { background: var(--good); } .sw[aria-checked="true"]::after { left: 23px; }
.kv { display: flex; justify-content: space-between; min-height: 40px; align-items: center; font-size: 13px; border-bottom: 1px solid var(--line); }
input[type="time"].tm { border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); min-height: 38px; padding: 0 8px; font-weight: 600; }

/* Thanh tab */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 4px calc(10px + env(safe-area-inset-bottom)); z-index: 10; }
.tabs[hidden] { display: none; }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; font-size: 11px; min-height: 56px; border-radius: 12px; color: var(--muted); font-weight: 500; }
.tabs a.on { color: var(--red); font-weight: 700; background: var(--red-soft); }
.tabs svg { width: 22px; height: 22px; }

/* Thông báo nổi */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 13px; z-index: 20; max-width: 90%; text-align: center; }
.err-box { margin: 40px 16px; padding: 16px; border-radius: 14px; background: var(--warn); }

/* Hộp thoại xác nhận trong app */
.modal-back { position: fixed; inset: 0; background: rgba(20, 14, 10, .45); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.modal { background: var(--card); color: var(--ink); border-radius: 18px; padding: 18px 16px 14px; width: 100%; max-width: 360px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.modal p { margin: 0 0 14px; font-size: 15px; line-height: 1.45; }
.modal .row { display: flex; justify-content: flex-end; gap: 8px; }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }

/* 1.4.7: biểu đồ ngày tới, Chốt ngày */
.evtag.chot { background: #F6E9C8; color: var(--gold-ink); }
.chart .seg.mini { display: inline-grid; padding: 2px; gap: 2px; border-radius: 9px; }
.chart .seg.mini button { min-height: 26px; min-width: 32px; font-size: 12px; border-radius: 7px; }
.cpur { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; margin-bottom: 6px; }
.cpur .pill { flex-shrink: 0; }
.cplot { position: relative; margin-top: 6px; }
.cplot .thr { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--muted); opacity: .55; height: 0; pointer-events: none; }
.cplot .thr em { position: absolute; right: 0; top: -14px; font-style: normal; font-size: 10px; color: var(--muted); }
.cbars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; align-items: end; }
.cbars.n14 { gap: 1px; }
.cb { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; border: 0; background: transparent; color: var(--ink); padding: 0; cursor: pointer; min-width: 0; }
.cb .cv { font-size: 10px; font-weight: 700; height: 14px; line-height: 14px; color: var(--muted); }
.cb .cbar { width: 78%; max-width: 30px; border-radius: 6px 6px 3px 3px; display: block; position: relative; }
.cb .cbar.ky { background: repeating-linear-gradient(45deg, var(--lv-ky), var(--lv-ky) 3px, #E9A9A4 3px, #E9A9A4 6px); }
.cb .cbar i { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) rotate(-90deg); font-style: normal; font-size: 9px; font-weight: 700; color: #fff; text-shadow: 0 0 2px #000; }
.cb .cd { font-size: 12px; font-weight: 700; margin-top: 2px; }
.cb .cw { font-size: 9px; color: var(--muted); }
.cb .cm { height: 12px; font-size: 10px; display: flex; gap: 1px; align-items: center; color: var(--gold-ink); }
.cb .cm .h { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
.cb .cm .h.off { background: var(--lv-ky); }
.cb .cm .f { font-style: normal; }
.cb.today .cbar { outline: 2px solid var(--ink); outline-offset: 1px; }
.cb.sel .cd { text-decoration: underline; }
.ctip { margin-top: 8px; }
.pick .chotb { display: table; align-self: flex-start; margin-top: 6px; border: 1.5px solid var(--good); color: var(--good); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.pick .chotb.done { background: var(--good-soft); border-color: transparent; }
.pick .chotb.dis { border-color: var(--line); color: var(--muted); cursor: default; font-weight: 500; }
.modal-back.sheet { align-items: flex-end; }
.modal-back.sheet .modal { max-width: 480px; display: flex; flex-direction: column; gap: 10px; border-radius: 18px 18px 0 0; }
.modal-back.sheet .modal p { margin: 0; }
.toast.undo { display: flex; gap: 12px; align-items: center; }
.toast.undo button { border: 0; background: transparent; color: var(--gold); font-weight: 700; font-size: 13px; cursor: pointer; }

/* 1.4.8: nhãn Tài (chỉ hiển thị) */
.tai { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; border: 1.5px solid #C9962B; color: var(--gold-ink); background: transparent; }
.tai.vuong { background: #F6E9C8; border-color: var(--gold); }
.tai.vuong::before { content: "◆"; font-size: 9px; color: #C9962B; }
.taiw { display: block; margin: 3px 0 0; }
.tairow { background: #FBF3DC; border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: #5C4510; }
.tairow .h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.tairow .d { line-height: 1.5; } .tairow .n { color: #7A6A55; font-size: 11px; }
:root[data-theme="dark"] .tairow { background: #2D2617; color: #E8D9B0; } :root[data-theme="dark"] .tairow .n { color: #B9A98A; }
:root[data-theme="dark"] .tai { color: #E0B84F; } :root[data-theme="dark"] .tai.vuong { background: #3A2F14; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tairow { background: #2D2617; color: #E8D9B0; } :root:not([data-theme="light"]) .tairow .n { color: #B9A98A; } :root:not([data-theme="light"]) .tai { color: #E0B84F; } :root:not([data-theme="light"]) .tai.vuong { background: #3A2F14; } }
.chart .seg.mini { background: var(--chip); }
.chart .seg.mini button[aria-pressed="true"] { background: var(--ink); color: var(--bg); font-weight: 700; }
.ctip { min-height: 20px; }
.cb { min-height: calc(var(--H, 80px) + 66px); }

/* 1.4.14: ô hôm nay nền đỏ, hàng chấm nằm trên viên thuốc trắng để giữ nguyên màu xanh/vàng/đỏ */
.cell.today .dots { background: #FFF9EF; border-radius: 999px; padding: 0 6px; height: 12px; }

/* 1.4.15: Tìm ngày nhiều người, ẩn số cộng/trừ, nút "Vì sao" */
.people { display: flex; flex-direction: column; gap: 6px; }
.people .ph { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 10px; min-height: 46px; }
.prow.on { border-color: var(--good); }
.pchk { display: flex; align-items: center; gap: 8px; font-size: 14px; flex: 1; min-width: 0; cursor: pointer; }
.pchk input { width: 20px; height: 20px; accent-color: var(--good); flex: none; }
.pchk b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rsel { min-height: 34px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); padding: 0 8px; font-size: 13px; max-width: 46%; }
.myr { width: 84px; min-height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); padding: 0 8px; font-size: 14px; text-align: center; }
.pacts { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.pick .pacts .chotb { margin-top: 0; display: inline-block; }
.pick .chotb.alt { border-color: var(--line); color: var(--ink); font-weight: 600; }
.why { display: none; margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; flex-direction: column; gap: 5px; }
.why.open { display: flex; }
.pws { border-top: 1px solid var(--line); padding-top: 4px; }
.pw { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 3px 0; }
.pw > span:last-child { text-align: right; }
.pick { text-align: left; }
