:root {
  --nen: #f3f7fc; --the: #fff; --chu: #172033; --mo: #5b6b82; --vien: #dbe4f0;
  --xanh: #1d6fe0; --xanh-nhat: #e6f0fd; --do: #d93636; --do-nhat: #fdecec; --la: #1a8a4a; --la-nhat: #e6f6ec;
  --vang: #b26b00; --vang-nhat: #fff4e0;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--nen); color: var(--chu); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
a { color: var(--xanh); text-decoration: none; }
.dau { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 10px 16px; background: var(--xanh); color: #fff; }
.dau .ten { color: #fff; font-weight: 700; font-size: 18px; white-space: nowrap; }
.o-tim { flex: 1; min-width: 0; }
.o-tim input { width: 100%; border: 0; border-radius: 10px; padding: 8px 12px; font-size: 15px; }
main { max-width: 760px; margin: 0 auto; padding: 14px 16px; }
h1 { font-size: 21px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 18px 0 8px; }
.cho { color: var(--mo); text-align: center; padding: 40px 0; }
.the { background: var(--the); border: 1px solid var(--vien); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.the h3 { margin: 0 0 4px; font-size: 16px; }
.mo { color: var(--mo); font-size: 14px; }
.hang { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gian { justify-content: space-between; }
.luoi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.so { background: var(--the); border: 1px solid var(--vien); border-radius: 14px; padding: 12px; }
.so b { display: block; font-size: 24px; color: var(--xanh); }
.ds { list-style: none; margin: 0; padding: 0; }
.ds > li { background: var(--the); border: 1px solid var(--vien); border-radius: 12px; margin-bottom: 8px; }
.ds > li > a, .ds > li > div { display: block; padding: 12px 14px; color: inherit; }
.ds .tieu { font-weight: 600; }
.ds summary { list-style: none; cursor: pointer; padding: 12px 14px; }
.ds summary::-webkit-details-marker { display: none; }
.ds summary .tieu::before { content: '▸ '; color: var(--mo, #888); }
.ds details[open] .tieu::before { content: '▾ '; }
.ds .mo-bai { padding: 0 14px 12px; border-top: 1px solid var(--vien); }
.ds .mo-bai .noi-dung { margin-top: 8px; }
button, .nut { appearance: none; border: 1px solid var(--xanh); background: var(--xanh); color: #fff; border-radius: 10px; padding: 9px 14px; font-size: 15px; font-weight: 600; cursor: pointer; display: inline-block; }
button.phu, .nut.phu { background: var(--the); color: var(--xanh); }
button.nguy { background: var(--the); color: var(--do); border-color: var(--do); }
button.nho { padding: 5px 10px; font-size: 14px; }
button:disabled { opacity: .5; }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 4px; }
input, textarea, select { width: 100%; font: inherit; border: 1px solid var(--vien); border-radius: 10px; padding: 9px 11px; background: #fff; color: var(--chu); }
textarea { min-height: 120px; resize: vertical; }
textarea.dai { min-height: 260px; font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.chk { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 6px 0; }
.chk input { width: 20px; height: 20px; }
.nhan { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--xanh-nhat); color: var(--xanh); white-space: nowrap; }
.nhan.la { background: var(--la-nhat); color: var(--la); }
.nhan.do { background: var(--do-nhat); color: var(--do); }
.nhan.vang { background: var(--vang-nhat); color: var(--vang); }
.nhan.xam { background: #eef1f5; color: var(--mo); }
.thanh { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; background: var(--the); border-top: 1px solid var(--vien); padding-bottom: env(safe-area-inset-bottom); }
.thanh a { flex: 1; text-align: center; padding: 7px 0 8px; color: var(--mo); font-size: 20px; position: relative; }
.thanh a span { display: block; font-size: 11px; }
.thanh a.dang { color: var(--xanh); }
.thanh b { position: absolute; top: 4px; left: 55%; background: var(--do); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 6px; }
.bao { position: fixed; left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 9; background: #172033; color: #fff; padding: 12px 14px; border-radius: 12px; text-align: center; }
.bao.loi { background: var(--do); }
dialog { border: 0; border-radius: 16px; padding: 18px; width: min(560px, calc(100vw - 32px)); max-height: 85vh; }
dialog::backdrop { background: rgba(10, 20, 40, .45); }
pre, code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
pre { background: #f4f6fa; border: 1px solid var(--vien); border-radius: 10px; padding: 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.khoa { background: var(--vang-nhat); border: 1px solid #f0c574; border-radius: 10px; padding: 10px; word-break: break-all; font-family: ui-monospace, monospace; font-size: 14px; }
.buoc { padding-left: 20px; }
.buoc li { margin-bottom: 6px; }
.loi-txt { color: var(--do); }
.nk { font-size: 14px; border-bottom: 1px solid var(--vien); padding: 8px 0; }
.nk:last-child { border: 0; }
.nk.sai { color: var(--do); }
.tab { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; }
.tab button { white-space: nowrap; }
.an { display: none !important; }
.noi-dung { white-space: pre-wrap; word-break: break-word; }

.tro-chuyen { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.tin { background: var(--the); border: 1px solid var(--vien); border-radius: 12px; padding: 10px 12px; max-width: 88%; position: relative; }
.tin.cua-toi { align-self: flex-end; background: #e6f0fd; }
.tin .xoa-tin { margin-top: 4px; border: 0; background: none; padding: 0; min-height: 0; font-size: 12px; color: var(--mo); }
.gui-chung textarea { min-height: 70px; }

.chep-link { flex-basis: 100%; display: block; text-align: left; background: rgba(255,255,255,.16); color: #fff; border: 0; border-radius: 10px; padding: 7px 12px; font-size: 14px; min-height: 0; }
.chep-link b { font-weight: 600; }
