:root {
  --phong: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --nen: #f4f7fb; --mat: #fff; --chu: #16283d; --nhat: #52667d; --vien: #d8e2ee;
  --xanh: #1b4f8a; --tren-xanh: #fff; --nhe: #e6eef8;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --nen: #111a27; --mat: #1a2536; --chu: #e6edf6; --nhat: #a3b3c8; --vien: #2c3b52; --xanh: #8fc0f5; --tren-xanh: #0d1a2b; --nhe: #243349; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 16px/1.5 var(--phong); background: var(--nen); color: var(--chu); }
a { color: var(--xanh); }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 24px 0 4px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 960px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.hieu { display: flex; align-items: center; gap: 8px; font-size: 1.3rem; text-decoration: none; color: var(--chu); }
nav { display: flex; gap: 4px; }
nav a { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 12px; text-decoration: none; color: var(--nhat); font-weight: 600; }
nav a[aria-current="page"] { background: var(--nhe); color: var(--xanh); }
main { max-width: 960px; margin: 0 auto; padding: 8px 16px 40px; }
.dan { margin: 0 0 16px; color: var(--nhat); }
#bao:empty { display: none; }
.luoi { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.the { display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto auto 1fr auto auto; column-gap: 12px; row-gap: 8px; padding: 16px; background: var(--mat); border: 1px solid var(--vien); border-radius: 18px; }
.the img { border-radius: 14px; }
.the .chu { align-self: center; min-width: 0; }
.the h2 { margin: 0; font-size: 1.1rem; }
.the p { margin: 0; }
.the .loai { color: var(--nhat); font-size: .875rem; }
.the .mo-ta, .the .dang-nhap, .the .ngoai-tuyen, .the .nut { grid-column: 1 / -1; }
.the .dang-nhap { color: var(--nhat); font-size: .8125rem; align-self: end; }
.nut { display: flex; gap: 8px; }
.chinh, .ghim { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 12px; font: 600 1rem var(--phong); cursor: pointer; text-decoration: none; }
.chinh { background: var(--xanh); color: var(--tren-xanh); border: 0; }
.ghim { background: transparent; color: var(--xanh); border: 1px solid var(--vien); }
.nut > * { flex: 1; }
#moi-cai { margin: 0 0 16px; }
li { margin-bottom: 6px; }
.o-tk { max-width: 360px; }
.phu { color: var(--nhat); font-size: .875rem; }
label { display: block; margin-bottom: 10px; font-weight: 600; font-size: .9375rem; }
input { display: block; width: 100%; min-height: 44px; margin-top: 4px; padding: 8px 12px; font: 1rem var(--phong); color: var(--chu); background: var(--mat); border: 1px solid var(--vien); border-radius: 12px; }
.o-tk .chinh, .o-tk .ghim { width: 100%; margin-bottom: 8px; }
#tk-google:not(:empty) { margin-bottom: 16px; }
.hop { padding: 12px 16px; margin-bottom: 16px; background: var(--nhe); border-radius: 14px; }
code { font-size: 1.05rem; overflow-wrap: anywhere; user-select: all; }
details { margin: 8px 0; }
summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--xanh); }
#tk-bao { color: #c0392b; }
@media (prefers-color-scheme: dark) { #tk-bao { color: #ff9d8f; } }
:focus-visible { outline: 3px solid var(--xanh); outline-offset: 2px; }
/* Điện thoại: thanh mục nằm dưới đáy, vừa tầm ngón cái. */
@media (max-width: 599px) {
  nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--mat); border-top: 1px solid var(--vien); }
  nav a { flex: 1; padding: 0 4px; }
  main { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}
#tk-bao { scroll-margin-bottom: 96px; }
.tk-dau { display: flex; gap: 12px; align-items: center; }
.tk-dau p { margin: 0; }
.anh { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: #1b4f8a; color: #fff; font-weight: 700; font-size: 1.3rem; }
#tk-lich-su { padding-left: 1.2em; }
.ngoai-tuyen { font-size: .9rem; margin: 0; }
