/* Hallmark · pre-emit critique: P4 H4 E4 S4 R4 V3
 * UI2 (22/10/2026) — vỏ điều hướng mới: thanh đáy + chip nhóm trên điện thoại, thanh bên trên máy tính,
 * bảng lệnh Ctrl K, trang chủ "Hôm nay" và lớp da dùng chung cho các màn cũ.
 * Chỉ THÊM, không sửa app.css. Màu và font chỉ khai trong khối token --u2-*.
 * Đã kiểm: 320 / 375 / 414 / 768 không tràn ngang (overflow-x: clip), :focus-visible, giảm chuyển động. */

:root{
  --u2-font:"Be Vietnam Pro","Segoe UI",system-ui,-apple-system,sans-serif;
  --u2-bg:#FBF6F9; --u2-surface:#FFFFFF; --u2-surface-2:#F8EEF4; --u2-line:#EBD9E3;
  --u2-ink:#2B1B25; --u2-muted:#76606D;
  --u2-accent:#D4106F; --u2-accent-strong:#B50A5C; --u2-accent-soft:#FFE8F2; --u2-on-accent:#FFFFFF;
  --u2-plum:#8A1458; --u2-on-plum:#FFFFFF;
  --u2-gold:#E8A100; --u2-gold-soft:#FFEFC2;
  --u2-ok:#0E8A47; --u2-ok-soft:#DDF6E8;
  --u2-hero-a:#D4106F; --u2-hero-b:#8A1458;
  --u2-scrim:rgba(30,10,22,.5);
  --u2-sh:0 1px 2px rgba(60,16,40,.06),0 6px 20px rgba(60,16,40,.07);
  --u2-sh-pop:0 24px 60px rgba(30,10,22,.32);
  --u2-r:16px; --u2-r-sm:10px;
  --u2-top-h:56px; --u2-sub-h:48px; --u2-bar-h:62px; --u2-side-w:248px;
  --u2-ease:cubic-bezier(.2,.7,.2,1);
}
html[data-theme="dark"]{
  --u2-bg:#150F13; --u2-surface:#211820; --u2-surface-2:#2C2029; --u2-line:#44303D;
  --u2-ink:#F5EBF1; --u2-muted:#BDA5B2;
  --u2-accent:#FF5DAA; --u2-accent-strong:#FF86BF; --u2-accent-soft:#3B2030; --u2-on-accent:#2A0A1A;
  --u2-plum:#E58BBE; --u2-on-plum:#2A0A1A;
  --u2-gold-soft:#4A3A12;
  --u2-ok:#4CD18A; --u2-ok-soft:#173626;
  --u2-hero-a:#8A1458; --u2-hero-b:#4E0B33;
  --u2-scrim:rgba(0,0,0,.62);
  --u2-sh:0 1px 2px rgba(0,0,0,.4),0 6px 20px rgba(0,0,0,.35);
}

html{overflow-x:clip}
html.u2-lock{overflow:hidden}

/* ---------- Vỏ chung ---------- */
body.u2{
  font-family:var(--u2-font);background:var(--u2-bg);color:var(--u2-ink);overflow-x:clip;
  padding-top:calc(var(--u2-top-h) + env(safe-area-inset-top));
  padding-bottom:calc(var(--u2-bar-h) + env(safe-area-inset-bottom) + 8px);
}
body.u2.u2-has-sub{padding-top:calc(var(--u2-top-h) + var(--u2-sub-h) + env(safe-area-inset-top))}
body.u2 > header:not([id^="u2-"]),
body.u2 > nav:not([id^="u2-"]){display:none}
body.u2 #lsBack{display:none!important}
body.u2 #csFab{bottom:calc(var(--u2-bar-h) + env(safe-area-inset-bottom) + 14px)!important}
body.u2 main{max-width:1100px;margin:0 auto;padding:16px 14px 24px}
body.u2 footer{
  position:static;background:none;color:var(--u2-muted);border-top:1px solid var(--u2-line);
  max-width:1100px;margin:0 auto;padding:16px 14px;font-size:.78rem;font-weight:500;letter-spacing:0;line-height:1.6;
}
body.u2 footer b{color:var(--u2-ink)}

#u2-top [hidden],#u2-sub[hidden]{display:none!important}
.u2-i{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}

.u2-skip{
  position:fixed;left:12px;top:-64px;z-index:5001;background:var(--u2-accent);color:var(--u2-on-accent);
  padding:10px 16px;border-radius:12px;font-weight:700;text-decoration:none;white-space:nowrap;
}
.u2-skip:focus{top:calc(12px + env(safe-area-inset-top))}

body.u2 :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible{outline:2px solid var(--u2-accent);outline-offset:2px}

/* ---------- Thanh trên ---------- */
#u2-top{
  position:fixed;inset:0 0 auto 0;z-index:55;display:flex;align-items:center;gap:6px;
  height:calc(var(--u2-top-h) + env(safe-area-inset-top));padding:env(safe-area-inset-top) 10px 0;
  background:var(--u2-surface);border-bottom:1px solid var(--u2-line);
}
.u2-ib{
  display:grid;place-items:center;width:44px;height:44px;flex:none;border:0;border-radius:12px;
  background:none;color:var(--u2-ink);cursor:pointer;
  transition:background .15s var(--u2-ease);-webkit-tap-highlight-color:transparent;
}
.u2-ib:hover{background:var(--u2-surface-2)}
.u2-ib:active{background:var(--u2-accent-soft)}
.u2-logo{width:34px;height:34px;flex:none;border-radius:9px;margin:0 2px 0 4px;background:var(--u2-surface)}
.u2-title{
  flex:1;min-width:0;font-size:1.06rem;font-weight:700;font-style:normal;letter-spacing:0;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.u2-search{display:grid;place-items:center;width:44px;height:44px;flex:none;border:0;border-radius:12px;background:none;color:var(--u2-ink);cursor:pointer}
.u2-search:hover{background:var(--u2-surface-2)}
.u2-search .u2-st,.u2-search kbd{display:none}
.u2-me{
  display:grid;place-items:center;width:36px;height:36px;flex:none;margin:0 2px 0 2px;border:0;border-radius:50%;
  background:var(--u2-accent-soft);color:var(--u2-accent-strong);font:inherit;font-size:.95rem;font-weight:800;cursor:pointer;
}
.u2-me .u2-i{width:20px;height:20px}

/* ---------- Chip nhóm (điện thoại) ---------- */
#u2-sub{
  position:fixed;inset:calc(var(--u2-top-h) + env(safe-area-inset-top)) 0 auto 0;z-index:54;
  display:flex;align-items:center;gap:8px;height:var(--u2-sub-h);padding:0 12px;overflow-x:auto;
  background:var(--u2-bg);border-bottom:1px solid var(--u2-line);scrollbar-width:none;overscroll-behavior-x:contain;
}
#u2-sub::-webkit-scrollbar{display:none}
.u2-chip{
  display:inline-flex;align-items:center;gap:6px;flex:none;height:36px;padding:0 14px;border-radius:999px;
  border:1px solid var(--u2-line);background:var(--u2-surface);color:var(--u2-ink);font:inherit;font-size:.88rem;font-weight:600;
  white-space:nowrap;cursor:pointer;transition:background .15s var(--u2-ease);-webkit-tap-highlight-color:transparent;
}
.u2-chip .u2-i{width:16px;height:16px}
.u2-chip[aria-current="page"],.u2-chip.on{background:var(--u2-accent);border-color:var(--u2-accent);color:var(--u2-on-accent)}

/* ---------- Thanh đáy (điện thoại) ---------- */
#u2-bar{
  position:fixed;inset:auto 0 0 0;z-index:56;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));
  height:calc(var(--u2-bar-h) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);
  background:var(--u2-surface);border-top:1px solid var(--u2-line);
}
.u2-tab{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:6px 2px;border:0;background:none;
  color:var(--u2-muted);font:inherit;font-size:.75rem;font-weight:600;white-space:nowrap;cursor:pointer;-webkit-tap-highlight-color:transparent;
}
.u2-tab-i{display:grid;place-items:center;width:56px;height:30px;border-radius:999px;transition:background .18s var(--u2-ease)}
.u2-tab-i .u2-i{width:24px;height:24px}
.u2-tab[aria-current="page"]{color:var(--u2-accent-strong)}
.u2-tab[aria-current="page"] .u2-tab-i{background:var(--u2-accent-soft)}

/* ---------- Thanh bên (máy tính) ---------- */
#u2-side{
  position:fixed;inset:0 auto 0 0;z-index:55;display:none;flex-direction:column;gap:2px;width:var(--u2-side-w);
  padding:14px 12px;overflow-x:hidden;overflow-y:auto;background:var(--u2-surface);border-right:1px solid var(--u2-line);
  scrollbar-width:thin;scrollbar-color:var(--u2-line) transparent;
}
.u2-sbrand{display:flex;align-items:center;gap:10px;padding:2px 8px 8px}
.u2-sbrand img{width:40px;height:40px;border-radius:11px}
.u2-sbrand>div{min-width:0}
.u2-sbrand b{display:block;font-size:.95rem;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.u2-sbrand small{display:block;color:var(--u2-muted);font-size:.78rem;font-weight:600}
.u2-sgl{padding:10px 10px 4px;color:var(--u2-muted);font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.u2-sitem{
  display:flex;align-items:center;gap:12px;width:100%;height:38px;padding:0 10px;border:0;border-radius:10px;
  background:none;color:var(--u2-ink);font:inherit;font-size:.92rem;font-weight:600;white-space:nowrap;cursor:pointer;text-align:left;
  transition:background .15s var(--u2-ease);
}
.u2-sitem:hover{background:var(--u2-surface-2)}
.u2-sitem[aria-current="page"]{background:var(--u2-accent-soft);color:var(--u2-accent-strong);box-shadow:inset 3px 0 0 var(--u2-accent)}
.u2-sfoot{margin-top:auto;padding-top:10px}
.u2-sfoot .u2-sitem{border:1px dashed var(--u2-line)}

/* ---------- Bảng lệnh ---------- */
#u2-pal{
  position:fixed;inset:0;z-index:5000;display:none;align-items:flex-start;justify-content:center;
  padding:calc(env(safe-area-inset-top) + 8vh) 12px 12px;background:var(--u2-scrim);
}
#u2-pal.open{display:flex}
.u2-pal-box{
  display:flex;flex-direction:column;width:100%;max-width:580px;max-height:min(72vh,580px);overflow:hidden;
  background:var(--u2-surface);color:var(--u2-ink);border:1px solid var(--u2-line);border-radius:18px;box-shadow:var(--u2-sh-pop);
  animation:u2-pop .16s var(--u2-ease);
}
.u2-pal-in{display:flex;align-items:center;gap:10px;height:58px;padding:0 8px 0 16px;border-bottom:1px solid var(--u2-line);color:var(--u2-muted)}
.u2-pal-in:focus-within{box-shadow:inset 0 -2px 0 var(--u2-accent)}
.u2-pal-in input{flex:1;min-width:0;border:0;outline:0;background:none;color:var(--u2-ink);font:inherit;font-size:1rem}
.u2-pal-in input::placeholder{color:var(--u2-muted)}
.u2-pal-list{list-style:none;margin:0;padding:6px;overflow-y:auto}
.u2-pal-h{padding:10px 10px 4px;color:var(--u2-muted);font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.u2-pal-opt{display:flex;align-items:center;gap:12px;min-height:46px;padding:0 10px;border-radius:10px;color:var(--u2-ink);font-weight:600;white-space:nowrap;cursor:pointer}
.u2-pal-opt .u2-t{min-width:0;overflow:hidden;text-overflow:ellipsis}
.u2-pal-opt .u2-n{margin-left:auto;padding-left:10px;color:var(--u2-muted);font-size:.8rem;font-weight:500}
.u2-pal-opt[aria-selected="true"]{background:var(--u2-accent-soft);color:var(--u2-accent-strong)}
.u2-pal-opt[aria-selected="true"] .u2-n{color:var(--u2-accent-strong)}
.u2-pal-foot{display:none;gap:16px;padding:10px 16px;border-top:1px solid var(--u2-line);color:var(--u2-muted);font-size:.78rem}
kbd{
  display:inline-block;padding:1px 6px;border:1px solid var(--u2-line);border-bottom-width:2px;border-radius:6px;
  background:var(--u2-surface-2);color:var(--u2-muted);font:inherit;font-size:.74rem;font-weight:700;
}
@keyframes u2-pop{from{opacity:0;transform:translateY(-6px) scale(.98)}to{opacity:1;transform:none}}

/* ---------- Trang chủ "Hôm nay" ---------- */
.u2-home{display:flex;flex-direction:column;gap:16px}
.u2-col{display:contents}
.u2-home > *,.u2-col > *{min-width:0}
.u2-hello{order:0}
.u2-hello h2{font-size:1.45rem;font-weight:800;font-style:normal;line-height:1.25;overflow-wrap:anywhere}
.u2-hello p{margin-top:4px;color:var(--u2-muted);font-size:.9rem}
.u2-hello .u2-link{display:inline-flex;align-items:center;gap:6px;margin-top:8px;min-height:36px;padding:0;border:0;background:none;color:var(--u2-accent-strong);font:inherit;font-size:.9rem;font-weight:700;cursor:pointer;white-space:nowrap}
.u2-find{
  order:1;display:flex;align-items:center;gap:10px;width:100%;min-height:50px;padding:0 14px;border:1px solid var(--u2-line);border-radius:14px;
  background:var(--u2-surface);color:var(--u2-muted);font:inherit;font-size:.95rem;white-space:nowrap;overflow:hidden;cursor:pointer;text-align:left;
}
.u2-find span{min-width:0;overflow:hidden;text-overflow:ellipsis}
.u2-find:hover{border-color:var(--u2-accent)}
.u2-card{background:var(--u2-surface);border:1px solid var(--u2-line);border-radius:var(--u2-r);box-shadow:var(--u2-sh);padding:16px}
.u2-card h2{font-size:1.02rem;font-weight:700;font-style:normal;margin-bottom:10px}
.u2-mission{order:2}
.u2-mission h2{margin-bottom:2px}
.u2-mission p{color:var(--u2-muted);font-size:.88rem}
.u2-mrow{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.u2-mico{display:grid;place-items:center;width:44px;height:44px;flex:none;border-radius:12px;background:var(--u2-accent-soft);color:var(--u2-accent-strong)}
.u2-prog{height:10px;border-radius:999px;background:var(--u2-surface-2);overflow:hidden;margin-bottom:14px}
.u2-prog i{display:block;height:100%;border-radius:999px;background:var(--u2-accent);transition:width .4s var(--u2-ease)}
.u2-prog.ok i{background:var(--u2-ok)}
.u2-cta{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 20px;border:0;border-radius:12px;
  background:var(--u2-accent);color:var(--u2-on-accent);font:inherit;font-weight:700;white-space:nowrap;cursor:pointer;
  transition:background .15s var(--u2-ease);
}
.u2-cta:hover{background:var(--u2-accent-strong)}
.u2-cta:active{transform:translateY(1px)}
.u2-cta.alt{background:var(--u2-ok-soft);color:var(--u2-ok)}
.u2-tt{order:3}
.u2-tt:empty,.u2-dnt:empty{display:none}
.u2-dnt{order:4}
.u2-tiles-w{order:5}
.u2-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.u2-tile{
  display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:14px 12px;border:1px solid var(--u2-line);border-radius:var(--u2-r);
  background:var(--u2-surface);color:var(--u2-ink);font:inherit;text-align:left;cursor:pointer;min-width:0;
  transition:border-color .15s var(--u2-ease),transform .15s var(--u2-ease);
}
.u2-tile:hover{border-color:var(--u2-accent);transform:translateY(-1px)}
.u2-tile-i{display:grid;place-items:center;width:40px;height:40px;border-radius:11px;background:var(--u2-accent-soft);color:var(--u2-accent-strong)}
.u2-tile b{display:block;font-size:.98rem;line-height:1.2;white-space:nowrap}
.u2-tile small{display:block;max-width:100%;margin-top:2px;color:var(--u2-muted);font-size:.8rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.u2-lop-w{order:6}
.u2-lops{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.u2-lops::-webkit-scrollbar{display:none}
.u2-stats-w{order:7}
.u2-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.u2-stat{padding:12px 14px;border:1px solid var(--u2-line);border-radius:14px;background:var(--u2-surface)}
.u2-stat b{display:block;font-size:1.3rem;font-weight:800;line-height:1.2;color:var(--u2-accent-strong);overflow-wrap:anywhere}
.u2-stat span{display:block;margin-top:2px;color:var(--u2-muted);font-size:.8rem;font-weight:600}
.u2-more{order:9;border:1px solid var(--u2-line);border-radius:var(--u2-r);background:var(--u2-surface)}
.u2-more > summary{
  display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:52px;padding:0 16px;list-style:none;
  font-weight:700;cursor:pointer;
}
.u2-more > summary::-webkit-details-marker{display:none}
.u2-more > summary .u2-i{width:18px;height:18px;transition:transform .2s var(--u2-ease)}
.u2-more[open] > summary .u2-i{transform:rotate(90deg)}
#u2-more-body{padding:0 12px 4px;border-top:1px solid var(--u2-line);padding-top:14px}

/* Băng đếm ngược kỳ thi (dem_nguoc_thi.js) — đè style nội tuyến bằng token để khớp sáng/tối */
body.u2 #dnt-bang{margin:0;padding:14px 16px;border:1px solid var(--u2-line)!important;background:var(--u2-surface)!important;border-radius:var(--u2-r);box-shadow:var(--u2-sh)}
body.u2 #dnt-bang h2{font-size:1.02rem;line-height:1.35}
body.u2 #dnt-bang [style*="min-width:54px"]{background:var(--u2-surface-2)!important;box-shadow:none!important}
body.u2 #dnt-bang [style*="font-size:26px"]{color:var(--u2-accent-strong)!important}
body.u2 #dnt-bang [style*="font-size:11px"]{color:var(--u2-muted)!important}

/* ---------- Lớp da dùng chung cho màn cũ ---------- */
body.u2{
  --red:var(--u2-accent); --red-dark:var(--u2-accent-strong); --navy:var(--u2-plum); --navy-dark:var(--u2-plum);
  --cream:var(--u2-bg); --paper:var(--u2-surface); --ink:var(--u2-ink); --muted:var(--u2-muted); --line:var(--u2-line);
  --gold:var(--u2-gold); --gold-light:var(--u2-gold-soft); --green:var(--u2-ok);
  --radius:var(--u2-r); --shadow:var(--u2-sh);
}
body.u2 .card{background:var(--u2-surface);border:1px solid var(--u2-line);border-radius:var(--u2-r);box-shadow:var(--u2-sh)}
body.u2 .card h2{color:var(--u2-ink);font-size:1.06rem}
body.u2 .card h2::before{width:4px;background:var(--u2-accent)}
body.u2 .btn{border-radius:12px;min-height:44px;box-shadow:none}
body.u2 .btn.red{background:var(--u2-accent);color:var(--u2-on-accent)}
body.u2 .btn.red:hover{background:var(--u2-accent-strong)}
body.u2 .btn.navy{background:var(--u2-plum);color:var(--u2-on-plum)}
body.u2 .btn.gold{background:var(--u2-gold-soft);color:var(--u2-ink);border:1px solid var(--u2-gold)}
body.u2 .btn.ghost{background:transparent;color:var(--u2-accent-strong);border:1.5px solid var(--u2-accent)}
body.u2 .chip{background:var(--u2-surface);border-color:var(--u2-line);color:var(--u2-ink)}
body.u2 .chip.on{background:var(--u2-accent);border-color:var(--u2-accent);color:var(--u2-on-accent)}
body.u2 .stat{background:var(--u2-surface);border:1px solid var(--u2-line);border-top:3px solid var(--u2-accent);box-shadow:none}
body.u2 .stat b{color:var(--u2-accent-strong)}
body.u2 .hero{background:linear-gradient(120deg,var(--u2-hero-a),var(--u2-hero-b));box-shadow:none}
body.u2 .pill{background:var(--u2-gold-soft);color:var(--u2-ink)}
body.u2 .v-search{min-height:48px;border:1px solid var(--u2-line);border-radius:14px;background:var(--u2-surface);color:var(--u2-ink)}
body.u2 .toast{background:var(--u2-plum);color:var(--u2-on-plum)}

/* ---------- Khổ ≥ 600: lưới rộng hơn ---------- */
@media (min-width:600px){
  .u2-tiles{grid-template-columns:repeat(4,minmax(0,1fr))}
  .u2-stats{grid-template-columns:repeat(4,minmax(0,1fr))}
  body.u2 main{padding:20px 20px 28px}
}

/* ---------- Khổ ≥ 900: thanh bên, bỏ thanh đáy và chip ---------- */
@media (min-width:900px){
  body.u2,body.u2.u2-has-sub{padding:calc(var(--u2-top-h) + env(safe-area-inset-top)) 0 0 var(--u2-side-w)}
  #u2-side{display:flex}
  #u2-bar,#u2-sub{display:none!important}
  #u2-top{left:var(--u2-side-w);padding-left:20px;padding-right:20px;gap:10px}
  .u2-logo{display:none}
  .u2-search{
    width:auto;min-width:300px;height:42px;padding:0 12px;grid-auto-flow:column;gap:10px;align-items:center;justify-content:start;
    border:1px solid var(--u2-line);background:var(--u2-surface);color:var(--u2-muted);font:inherit;font-size:.9rem;
  }
  .u2-search .u2-st{display:block;flex:1;text-align:left;white-space:nowrap}
  .u2-search kbd{display:inline-block}
  body.u2 main{padding:28px 32px 36px}
  body.u2 footer{padding:16px 32px 24px}
  body.u2 #csFab{bottom:20px!important}
  .u2-find{display:none}
  .u2-home{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);column-gap:20px;row-gap:16px;align-items:start}
  .u2-col{display:flex;flex-direction:column;gap:16px}
  .u2-hello,.u2-more{grid-column:1 / -1}
  .u2-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .u2-pal-foot{display:flex}
  #u2-pal{padding-top:calc(env(safe-area-inset-top) + 14vh)}
}
@media (min-width:900px) and (max-height:860px){
  .u2-sitem{height:34px}
  .u2-sgl{padding-top:8px}
}

/* ---------- Chế độ thi: ẩn vỏ để phòng thi nguyên vẹn ---------- */
body.u2.u2-focus,body.u2.u2-focus.u2-has-sub{padding:0}
body.u2.u2-focus :is(#u2-top,#u2-side,#u2-bar,#u2-sub){display:none!important}

@media (prefers-reduced-motion:reduce){
  #u2-top *,#u2-side *,#u2-bar *,#u2-sub *,#u2-pal *,.u2-home *{transition:none!important;animation:none!important}
  .u2-pal-box{animation:none}
}
@media print{
  #u2-top,#u2-side,#u2-bar,#u2-sub,#u2-pal,.u2-skip{display:none!important}
  body.u2{padding:0}
}

/* Nút cũ .th-b2 (Xếp hạng…) nền trắng cứng khi tối -> đổi sang nền tối cho đọc được */
html[data-theme="dark"] .u2-more .th-b2:not(:hover){background:var(--u2-surface-2);color:var(--u2-ink)}
