/* tastemaker stamp: app shell (khong phai trang marketing) · mood warm/light · seed 1311 · contrast: moi cap chu >= 4.5 (do 13/11/2026)
   font: Fraunces (ten mon, tieu de) + Be Vietnam Pro (giao dien), ca hai da do du dau tieng Viet · motion: tu viet CSS, khong GSAP */
:root {
  --bg: #fffaf9; --surface: #f9efec; --text: #221815; --muted: #6f5d57;
  --primary: #af523f; --primary-dam: #8a4031; --on-primary: #fff;
  --secondary: #fad4cc; --border: #e9dedc; --vien-dam: #cdbdb9;
  --ok: #2f6b4c; --ok-nen: #e3efe7;
  --f-chu: 'Be Vietnam Pro', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --f-mon: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  --r: 20px; --r-nho: 14px;
  --em: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 18px/1.5 var(--f-chu); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
main {
  max-width: 600px; margin: 0 auto;
  padding: calc(var(--s6) + env(safe-area-inset-top)) var(--s5) calc(var(--s10) + env(safe-area-inset-bottom));
}
body[data-vai="me"] main { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
h1, h2, h3, p, ul, ol, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
svg { flex: none; display: block; }
.an { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
em { font-style: normal; }

/* ----- dau trang ----- */
.dau { margin-bottom: var(--s6); }
.dau .nhan { font-size: 15px; font-weight: 600; color: var(--primary); letter-spacing: .02em; }
.dau h1 { font: 600 52px/1.05 var(--f-mon); letter-spacing: -.01em; margin-top: 2px; }
.dau .ngay { font-size: 20px; color: var(--muted); margin-top: 4px; }
.bang { background: var(--secondary); color: var(--text); border-radius: var(--r-nho); padding: var(--s3) var(--s4); font-size: 16px; margin-bottom: var(--s5); }

/* ----- khoi ----- */
main > section, .cot > section, details.gap > section { margin-top: var(--s8); }
.the { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: var(--s6); }
.muc { font: 600 20px/1.3 var(--f-chu); display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.muc .dem { font-weight: 500; font-size: 17px; color: var(--muted); font-variant-numeric: tabular-nums; }
.phu { color: var(--muted); font-size: 16px; margin-top: var(--s4); }
.nho { font: 600 16px/1.3 var(--f-chu); color: var(--muted); margin: var(--s5) 0 var(--s2); }
.rong h2 { font: 600 26px/1.2 var(--f-mon); margin-bottom: var(--s2); }
.rong .chot { margin-top: var(--s5); }

/* ----- thuc don ----- */
.td .muc { margin-bottom: 0; }
.bua { margin-top: var(--s5); }
.bua h3 { display: flex; align-items: center; gap: var(--s3); font: italic 500 21px/1 var(--f-mon); color: var(--primary-dam); }
.bua h3::after { content: ""; flex: 1; height: 1px; background: var(--vien-dam); }
.mon li { display: flex; align-items: center; gap: var(--s2); min-height: 56px; padding: 6px 0; border-bottom: 1px dashed var(--vien-dam); }
.mon li:last-child { border-bottom: 0; }
.mon .ten { flex: 1; font: 500 26px/1.22 var(--f-mon); padding: 6px 0; min-width: 0; }
.mon button.ten { text-decoration: underline; text-decoration-color: var(--vien-dam); text-decoration-thickness: 1px; text-underline-offset: 5px; }
.mon .trong, .sua .trong { color: var(--muted); font-size: 17px; }
.nut-mon { display: flex; gap: var(--s2); }
.mai .mon .ten { font-size: 22px; }
.mai .mon li { min-height: 44px; }

.tron { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--vien-dam); background: var(--bg); display: grid; place-items: center; color: var(--text); flex: none; }
.tron.dam { background: var(--primary); border-color: var(--primary); color: var(--on-primary); width: 54px; height: 54px; }
.them { display: flex; align-items: center; justify-content: center; gap: var(--s2); width: 100%; min-height: 52px; margin-top: var(--s2); border: 1.5px dashed var(--vien-dam); border-radius: var(--r-nho); color: var(--primary-dam); font-weight: 500; }

/* ----- danh sach tick (co Xuan, ca nha) ----- */
.tick li + li { margin-top: var(--s2); }
.o { display: flex; align-items: center; gap: var(--s4); width: 100%; min-height: 64px; padding: var(--s2) var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-nho); }
.o .hop { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--primary); display: grid; place-items: center; flex: none; font-weight: 600; font-size: 17px; color: var(--primary-dam); background: var(--bg); }
.o .chu { font-size: 21px; line-height: 1.3; font-weight: 500; overflow-wrap: anywhere; }
.o.xong { background: var(--ok-nen); border-color: transparent; }
.o.xong .hop { background: var(--ok); border-color: var(--ok); color: #fff; }
.o.xong .chu { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--vien-dam); }

/* ----- danh sach me sua ----- */
.sua li { display: flex; align-items: center; gap: var(--s3); min-height: 58px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.sua .chu { flex: 1; font-size: 20px; font-weight: 500; overflow-wrap: anywhere; }
.sua .chu em { font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.sua li.xong .chu { color: var(--ok); }
.sua.so { counter-reset: so; }
.sua.so li:not(.trong)::before { counter-increment: so; content: counter(so); width: 32px; height: 32px; border-radius: 50%; background: var(--secondary); display: grid; place-items: center; font-weight: 600; font-size: 16px; flex: none; }
.chip-hang { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 var(--s4) 0 var(--s3); border: 1px solid var(--vien-dam); border-radius: 999px; background: var(--bg); font-size: 17px; }
.chip svg { width: 18px; height: 18px; color: var(--primary-dam); }

.o-them { display: flex; gap: var(--s2); margin-top: var(--s4); }
input[type="text"], textarea { width: 100%; min-height: 54px; padding: var(--s3) var(--s4); background: #fff; border: 1.5px solid var(--vien-dam); border-radius: var(--r-nho); font-size: 18px; }
textarea { display: block; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, textarea:focus { outline: 3px solid var(--primary); outline-offset: 1px; border-color: transparent; }
.dan p { font-size: 20px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ----- me: doi ngay, thanh chot ----- */
.doi-ngay { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.doi-ngay button { min-height: 48px; border-radius: 999px; text-align: center; font-weight: 500; color: var(--muted); }
.doi-ngay button[aria-pressed="true"] { background: var(--text); color: var(--bg); font-weight: 600; }
.luoi { display: grid; gap: 0; }
.luoi > .the { margin-top: var(--s5); }
.thanh { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: var(--s3) var(--s5) calc(var(--s3) + env(safe-area-inset-bottom)); background: rgba(255, 250, 249, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
.thanh > * { max-width: 560px; margin-left: auto; margin-right: auto; }
.chot { display: block; width: 100%; min-height: 60px; border-radius: var(--r-nho); background: var(--primary); color: var(--on-primary); font-size: 20px; font-weight: 600; text-align: center; }
.da-chot { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 0 var(--s4); border-radius: var(--r-nho); background: var(--ok-nen); color: var(--ok); font-weight: 600; font-size: 18px; line-height: 1.3; }
.thanh-phu { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-top: 6px; min-height: 28px; }
.tt { font-size: 15px; color: var(--muted); }
.tt.loi { color: var(--primary-dam); font-weight: 600; }
.chu-nut { font-size: 15px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 6px 0 6px var(--s3); }

/* ----- gui link ----- */
.link li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.link li:last-child { border-bottom: 0; }
.link strong { display: block; font-weight: 600; font-size: 19px; }
.link span { font-size: 16px; color: var(--muted); }
.nut-phu { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; padding: 0 var(--s4); border: 1px solid var(--vien-dam); border-radius: var(--r-nho); background: var(--bg); font-weight: 500; flex: none; }
.nut-phu span { color: var(--text); font-size: 17px; }
details.gap { margin-top: var(--s5); }
details.gap > summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 500; color: var(--primary-dam); list-style: none; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0 2px; }
details.gap > summary::-webkit-details-marker { display: none; }
details.gap > summary::after { content: "+"; font-size: 26px; line-height: 1; font-weight: 400; }
details.gap[open] > summary::after { content: "–"; }
.buoc { list-style: decimal; padding-left: 26px; font-size: 17px; }
.buoc li { padding: 3px 0 3px 4px; }
.hai-nut { display: grid; gap: var(--s2); margin-top: var(--s4); }

/* ----- to chon mon ----- */
dialog { border: 0; padding: 0; background: var(--bg); color: var(--text); width: 100%; max-width: 600px; max-height: 88dvh; margin: auto auto 0; border-radius: var(--r) var(--r) 0 0; overflow: auto; overscroll-behavior: contain; }
dialog::backdrop { background: rgba(34, 24, 21, .45); }
.to-dau { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); background: var(--bg); border-bottom: 1px solid var(--border); }
.to-dau h2 { font: 600 24px/1.2 var(--f-mon); }
.to-than { padding: 0 var(--s5) calc(var(--s8) + env(safe-area-inset-bottom)); }
.chon li { border-bottom: 1px solid var(--border); }
.chon button { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); width: 100%; min-height: 56px; font-size: 20px; font-weight: 500; }
.chon button em { font-size: 15px; font-weight: 400; color: var(--muted); flex: none; }
.chon button:disabled { color: var(--muted); cursor: default; }
.mon-moi { margin-top: var(--s8); padding: var(--s5); background: var(--surface); border-radius: var(--r); }
.mon-moi .nho { margin-top: 0; }
.mon-moi label, .mon-moi legend { display: block; font-weight: 500; font-size: 17px; margin: var(--s4) 0 6px; }
.mon-moi .phu { font-weight: 400; font-size: 15px; margin: 0; }
.mon-moi fieldset { display: flex; flex-wrap: wrap; gap: var(--s2); }
.mon-moi legend { width: 100%; float: left; }
.chon-loai { margin: 0 !important; position: relative; }
.chon-loai input { position: absolute; opacity: 0; inset: 0; }
.chon-loai span { display: inline-flex; align-items: center; min-height: 46px; padding: 0 var(--s4); border: 1px solid var(--vien-dam); border-radius: 999px; background: var(--bg); font-weight: 400; }
.chon-loai input:checked + span { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.chon-loai input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.mon-moi .chot { margin-top: var(--s5); }

/* ----- bao nhanh ----- */
#bao { position: fixed; left: 50%; bottom: calc(170px + env(safe-area-inset-bottom)); z-index: 20; width: max-content; max-width: calc(100vw - 32px); padding: var(--s3) var(--s5); border-radius: var(--r-nho); background: var(--text); color: var(--bg); font-size: 17px; text-align: center; opacity: 0; transform: translate(-50%, 8px); pointer-events: none; }
#bao.hien { opacity: 1; transform: translate(-50%, 0); }
body:not([data-vai="me"]) #bao { bottom: calc(32px + env(safe-area-inset-bottom)); }

/* ----- dang tai ----- */
.cho { padding-top: var(--s4); }
.xuong { background: var(--surface); border-radius: var(--r-nho); margin-bottom: var(--s4); }
.x1 { width: 30%; height: 18px; } .x2 { width: 62%; height: 52px; } .x3 { height: 150px; border-radius: var(--r); }

/* ----- chuyen dong: ngan, chi o cho vua doi ----- */
@media (prefers-reduced-motion: no-preference) {
  #bao { transition: opacity .18s var(--em), transform .18s var(--em); }
  .mon li.moi .ten { animation: vao .22s var(--em); }
  .o .hop { transition: background-color .15s var(--em), border-color .15s var(--em); }
  .tron:active, .chot:active, .chip:active, .nut-phu:active, .o:active { transform: scale(.97); }
}
@keyframes vao { from { opacity: 0; transform: translateY(6px); } }
@media (hover: hover) {
  .tron:hover, .chip:hover, .nut-phu:hover { border-color: var(--text); }
  .chot:hover { background: var(--primary-dam); }
  .chon button:not(:disabled):hover span { text-decoration: underline; text-underline-offset: 4px; }
}

/* ----- may tinh: me co hai cot, thanh chot khong trai het man ----- */
@media (min-width: 960px) {
  body[data-vai="me"] main { max-width: 1080px; }
  .luoi { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s10); align-items: start; }
  .luoi > .the { margin-top: var(--s6); position: sticky; top: var(--s5); }
  .cot > section:first-child { margin-top: var(--s6); }
  .doi-ngay { max-width: 360px; }
  .gui { max-width: 600px; }
  dialog { margin: auto; border-radius: var(--r); max-height: 80dvh; }
}

@media (max-width: 420px) { .mon .ten { font-size: 24px; } .dau h1 { font-size: 46px; } }
