:root {
  --nen: #fffaf6; --the: #ffffff; --chu: #2d2326; --phu: #6f5f64; --vien: #eadcd6;
  --chinh: #c2577a; --chinh-dam: #9e3c5e; --tren-chinh: #ffffff; --mem: #fbe9ef;
  --xanh: #2f7d5b; --vang: #a86a00; --do: #b3261e; --bong: 0 1px 3px rgba(60,30,40,.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --nen: #1c1719; --the: #262022; --chu: #f3eaec; --phu: #bfaeb3; --vien: #3d3236;
    --chinh: #e389a7; --chinh-dam: #f0a6be; --tren-chinh: #2a0f19; --mem: #3a2630;
    --xanh: #6fcf9f; --vang: #e7b45a; --do: #ff8a80; --bong: none;
  }
}
:root[data-theme="dark"] {
  --nen: #1c1719; --the: #262022; --chu: #f3eaec; --phu: #bfaeb3; --vien: #3d3236;
  --chinh: #e389a7; --chinh-dam: #f0a6be; --tren-chinh: #2a0f19; --mem: #3a2630;
  --xanh: #6fcf9f; --vang: #e7b45a; --do: #ff8a80; --bong: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--nen); color: var(--chu); }
body { font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: var(--chinh-dam); }
.dau { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--nen); border-bottom: 1px solid var(--vien); }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--chu); font-weight: 700; }
.logo img { width: 32px; height: 32px; border-radius: 8px; }
.dau-phai { display: flex; gap: 6px; }
main { max-width: 560px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 8px 0 12px; }
h2 { font-size: 1.15rem; margin: 20px 0 8px; }
p { margin: 6px 0 10px; }
.phu { color: var(--phu); font-size: .92rem; }
.the { background: var(--the); border: 1px solid var(--vien); border-radius: 14px; padding: 14px; margin: 10px 0; box-shadow: var(--bong); }
.the.mem { background: var(--mem); border-color: transparent; }
.nut { display: block; width: 100%; min-height: 48px; border: 0; border-radius: 12px; padding: 12px 16px; font: inherit; font-weight: 650;
  background: var(--chinh); color: var(--tren-chinh); cursor: pointer; text-align: center; text-decoration: none; margin: 8px 0; }
.nut.phu2 { background: var(--the); color: var(--chu); border: 1px solid var(--vien); }
.nut.do { background: var(--do); color: #fff; }
.nut:disabled { opacity: .5; cursor: not-allowed; }
.nut-nho { border: 1px solid var(--vien); background: var(--the); color: var(--chu); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .88rem; cursor: pointer; min-height: 36px; }
.hang-nut { display: flex; gap: 8px; flex-wrap: wrap; }
.hang-nut .nut { flex: 1 1 140px; width: auto; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--vien); background: var(--the); color: var(--chu); min-height: 46px; }
textarea { min-height: 80px; resize: vertical; }
.o-dong-y { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--vien); font-weight: 400; margin: 0; }
.o-dong-y input { width: 22px; height: 22px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--chinh); }
.o-dong-y b { display: block; }
.bat-buoc { color: var(--do); font-size: .8rem; font-weight: 600; }
.tab { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; background: var(--the); border-top: 1px solid var(--vien); padding-bottom: env(safe-area-inset-bottom); }
.tab a { flex: 1; text-align: center; padding: 8px 2px 10px; text-decoration: none; color: var(--phu); font-size: .78rem; }
.tab a span { display: block; font-size: 1.35rem; line-height: 1.2; }
.tab a.dang { color: var(--chinh-dam); font-weight: 700; }
.dv-luoi { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dv { border: 1.5px solid var(--vien); border-radius: 12px; padding: 10px; background: var(--the); cursor: pointer; font: inherit; color: var(--chu); text-align: left; min-height: 64px; }
.dv.chon { border-color: var(--chinh); background: var(--mem); }
.dv .ic { font-size: 1.5rem; }
.nhan { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 650; background: var(--mem); color: var(--chinh-dam); }
.nhan.xanh { background: color-mix(in srgb, var(--xanh) 15%, transparent); color: var(--xanh); }
.nhan.vang { background: color-mix(in srgb, var(--vang) 15%, transparent); color: var(--vang); }
.nhan.xam { background: var(--vien); color: var(--phu); }
.dong { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.khoa { background: var(--mem); border-radius: 10px; padding: 10px 12px; font-size: .92rem; }
.hop-nen { position: fixed; inset: 0; background: rgba(20,10,14,.55); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.hop { background: var(--the); color: var(--chu); width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.hop h3 { margin: 0 0 8px; }
.bao { position: fixed; left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 30; background: var(--chu); color: var(--nen); padding: 12px 14px; border-radius: 12px; text-align: center; max-width: 520px; margin: 0 auto; }
.sao { font-size: 1.6rem; background: none; border: 0; cursor: pointer; color: var(--vang); padding: 0 2px; min-height: 44px; }
ol, ul { padding-left: 20px; }
.hoc-the h3 { margin: 4px 0; font-size: 1.2rem; }
.chan { text-align: center; font-size: .85rem; color: var(--phu); margin: 24px 0 8px; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
td, th { border-bottom: 1px solid var(--vien); padding: 6px 4px; text-align: left; vertical-align: top; }
.cuon-ngang { overflow-x: auto; }
