/* ===== Hồ sơ số 7 – giao diện ===== */
:root {
  --cream: #FBF6EA; --card: #F6EDDB; --line: #E2D8C0; --forest: #3A4A32; --olive: #5F6D45;
  --ink: #3A382E; --mute: #625E51; --orange: #B25D2A; --orange-d: #964B1E; --glacier: #86A3BB; --glacier-d: #2F4A62;
  --paper: #FFFDF6; --good: #46633A; --bad: #A33A2B; --mark: rgba(244, 196, 76, .5);
  --f-ui: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-ti: "Lora", Georgia, "Times New Roman", serif;
  --sh: 0 1px 0 rgba(255,255,255,.7) inset, 0 8px 22px rgba(58, 74, 50, .12);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--cream); color: var(--ink);
  font: 500 16px/1.55 var(--f-ui); overflow-x: hidden; -webkit-tap-highlight-color: transparent;
}
body[data-view="play"] { background: #C98F52 url("assets/ho-so/ban.webp") center / cover fixed no-repeat; overflow: hidden; }
body[data-view="play"]::before { content: ""; position: fixed; inset: 0; background: rgba(251, 246, 234, .22); pointer-events: none; }
h1, h2, h3 { font-family: var(--f-ti); color: var(--forest); margin: 0; line-height: 1.2; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--glacier-d); outline-offset: 2px; border-radius: 6px; }
.ic { width: 22px; height: 22px; flex: none; }
.hs-loading { padding: 40vh 24px 0; text-align: center; color: var(--mute); }
.enter { animation: enter .45s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* nút */
.btn { min-height: 48px; padding: 10px 20px; border-radius: 12px; border: 2px solid var(--forest); background: transparent; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s, background .15s, box-shadow .15s; }
.btn.go { background: var(--orange); border-color: var(--orange-d); color: #fff; box-shadow: 0 3px 0 var(--orange-d); }
.btn.go:hover:not(:disabled) { background: #a2531f; }
.btn.go:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--orange-d); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: rgba(255, 253, 246, .6); color: var(--forest); }
.btn.ghost:hover { background: #fff; }
.btn.light { color: var(--forest); background: rgba(255, 253, 246, .92); border-color: var(--forest); }
.btn.big { min-height: 54px; font-size: 17px; padding: 12px 26px; }
.ib { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: rgba(255, 253, 246, .9); display: inline-grid; place-items: center; color: var(--forest); position: relative; padding: 0; }
.ib:hover { border-color: var(--olive); background: #fff; }
.ib.sm { width: 40px; height: 40px; }
.frow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--olive); margin: 0 0 6px; }

/* ---------------- màn chọn vụ ---------------- */
.sel { max-width: 1140px; margin: 0 auto; padding: calc(12px + var(--safe-t)) 16px calc(32px + var(--safe-b)); }
.sel-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.home { font-family: var(--f-ti); font-weight: 700; color: var(--forest); text-decoration: none; font-size: 18px; }
.tools { display: flex; gap: 8px; }
.hero { border-radius: 22px; overflow: hidden; border: 2px solid var(--forest); background: url("assets/ho-so/tu-ho-so.webp") center right / cover no-repeat; min-height: 330px; display: flex; box-shadow: var(--sh); }
.hero-in { width: min(640px, 100%); padding: 34px 32px; background: linear-gradient(90deg, var(--cream) 0%, var(--cream) 80%, rgba(251, 246, 234, 0) 100%); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.hero h1 { font-size: clamp(38px, 6vw, 58px); letter-spacing: -.01em; margin-bottom: 10px; }
.lede { margin: 0 0 16px; color: var(--ink); max-width: 46ch; font-size: 17px; }
.cab { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 30px; }
.folder { position: relative; padding-top: 30px; animation: enter .5s calc(var(--i) * 90ms + 100ms) cubic-bezier(.2, .8, .3, 1) both; }
.ftab { position: absolute; top: 0; left: 18px; height: 32px; padding: 0 16px; border-radius: 12px 12px 0 0; background: var(--olive); color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; display: flex; align-items: center; z-index: 1; }
.folder.lv2 .ftab { background: var(--glacier-d); }
.folder.lv3 .ftab { background: var(--orange-d); }
.fbody { position: relative; background: var(--card); border: 2px solid var(--forest); border-radius: 6px 18px 18px 18px; padding: 20px 20px 18px; min-height: 360px; display: flex; flex-direction: column; box-shadow: var(--sh); transition: transform .2s; }
.folder:not(.locked):hover .fbody { transform: translateY(-4px) rotate(-.4deg); }
.fbody h2 { font-size: 24px; margin: 2px 0 2px; }
.fen { font-family: var(--f-ti); font-style: italic; color: var(--mute); margin: 0 0 10px; }
.ftopic { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; color: var(--mute); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--olive); }
.pips i.on { background: var(--olive); }
.fbrief { margin: 4px 0 12px; font-size: 15.5px; line-height: 1.55; flex: 1; }
.fmeta { margin: 0; font-size: 13.5px; color: var(--mute); }
.folder.locked .fbody { background: #EEE6D2; }
.folder.locked h2, .folder.locked .fbrief { filter: blur(3.5px); opacity: .55; user-select: none; }
.lockv { position: absolute; inset: 56px 16px 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--forest); font-weight: 700; text-align: center; }
.lockv .ic { width: 44px; height: 44px; }
.seal { position: absolute; top: -18px; right: 14px; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font: 700 30px var(--f-ti); color: #fff; transform: rotate(8deg); border: 3px double rgba(255, 255, 255, .85); box-shadow: 0 3px 8px rgba(0, 0, 0, .25); }
.g-S { background: #B25D2A; } .g-A { background: #46633A; } .g-B { background: #2F4A62; } .g-C { background: #6B6657; }
.sel-foot { margin-top: 28px; text-align: center; font-size: 13.5px; color: var(--mute); }

/* hộp thoại */
.modal { position: fixed; inset: 0; background: rgba(40, 46, 34, .55); display: grid; place-items: center; padding: 16px; z-index: 50; opacity: 0; transition: opacity .2s; }
.modal.on { opacity: 1; }
.modal-card { background: var(--cream); border: 2px solid var(--forest); border-radius: 18px; padding: 24px; max-width: 520px; width: 100%; max-height: 90dvh; overflow: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); transform: translateY(8px); transition: transform .2s; }
.modal.on .modal-card { transform: none; }
.modal h2 { font-size: 26px; margin-bottom: 12px; }
.how { padding-left: 22px; margin: 0 0 12px; display: grid; gap: 10px; }
.how-n { font-size: 14px; color: var(--mute); margin: 8px 0 14px; }

/* ---------------- thư giao việc ---------------- */
.memo-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 20px 16px calc(20px + var(--safe-b)); background: radial-gradient(circle at 50% 30%, #fff7e3, var(--cream) 70%); }
.memo { background: var(--paper); border: 2px solid var(--forest); border-radius: 6px; max-width: 620px; width: 100%; padding: 26px 28px 28px; box-shadow: 0 18px 40px rgba(58, 74, 50, .18); position: relative; }
.memo::before { content: ""; position: absolute; top: -10px; left: 50%; width: 90px; height: 22px; transform: translateX(-50%) rotate(-2deg); background: rgba(134, 163, 187, .65); border-radius: 3px; }
.memo-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--olive); border-bottom: 2px dashed var(--line); padding-bottom: 10px; margin-bottom: 12px; }
.memo-st { color: var(--orange); }
.memo-from { font-size: 14px; color: var(--mute); margin: 0 0 8px; }
.memo h1 { font-size: clamp(28px, 5vw, 38px); }
.memo-t { font-size: 17px; margin: 12px 0; }
.memo-ul { margin: 0 0 6px; padding-left: 20px; color: var(--mute); font-size: 15.5px; }

/* ---------------- màn chơi ---------------- */
.play { position: relative; height: 100dvh; display: flex; flex-direction: column; z-index: 1; padding-top: var(--safe-t); }
.bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: rgba(251, 246, 234, .94); border-bottom: 2px solid var(--forest); flex: none; }
.bt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.bt b { font-family: var(--f-ti); color: var(--forest); font-size: 15px; }
.bt span { font-size: 13.5px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--forest); background: var(--card); border: 2px solid var(--line); border-radius: 10px; min-width: 66px; text-align: center; padding: 8px 6px; }
.hintb em { position: absolute; top: -7px; right: -6px; font-style: normal; font-size: 12px; font-weight: 700; background: var(--orange); color: #fff; border-radius: 10px; min-width: 20px; height: 20px; line-height: 20px; text-align: center; padding: 0 4px; }
.hintb em:empty { display: none; }
.main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(360px, 1fr); gap: 16px; padding: 14px 16px 16px; }
.docs { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 0; scroll-snap-type: x proximity; scrollbar-width: thin; flex: none; }
.dtab { flex: none; scroll-snap-align: start; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; background: #EFE4CB; border: 2px solid var(--forest); border-bottom: 0; border-radius: 12px 12px 0 0; font-weight: 600; font-size: 14.5px; color: var(--forest); position: relative; }
.dtab .n { width: 26px; height: 26px; border-radius: 50%; background: var(--card); border: 2px solid var(--olive); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.dtab .n .ic { width: 14px; height: 14px; }
.dtab.cur { background: var(--paper); box-shadow: 0 2px 0 var(--paper); z-index: 1; }
.dtab.cur .n { background: var(--olive); color: #fff; }
.dtab.lock { padding: 6px 8px; } .dtab.lock .t { display: none; }
.dtab.lock { opacity: .7; border-style: dashed; cursor: not-allowed; background: rgba(239, 228, 203, .7); }
.dtab.fresh::after { content: "Mới"; position: absolute; top: -9px; right: 4px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 8px; line-height: 18px; animation: pop .5s both; }
.dtab.hn { box-shadow: 0 0 0 3px rgba(178, 93, 42, .55); }
@keyframes pop { from { transform: scale(.3); } 60% { transform: scale(1.2); } to { transform: none; } }
.stage { flex: 1; min-height: 0; overflow: auto; background: var(--paper); border: 2px solid var(--forest); border-radius: 0 14px 14px 14px; padding: 18px; box-shadow: var(--sh); -webkit-overflow-scrolling: touch; }
.swipe { display: none; margin: 6px 0 0; font-size: 12.5px; color: #fff; text-align: center; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.pw { display: none; }
.pw.on { display: block; }
.pw.in-r { animation: inr .32s cubic-bezier(.2, .8, .3, 1); }
.pw.in-l { animation: inl .32s cubic-bezier(.2, .8, .3, 1); }
@keyframes inr { from { opacity: 0; transform: translateX(34px) rotate(.6deg); } to { opacity: 1; transform: none; } }
@keyframes inl { from { opacity: 0; transform: translateX(-34px) rotate(-.6deg); } to { opacity: 1; transform: none; } }

/* giấy tờ */
.paper { font-size: 17px; line-height: 1.65; color: #2E2D26; max-width: 740px; margin: 0 auto; outline: 0; }
.ph { display: flex; flex-direction: column; gap: 4px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 2px solid var(--line); }
.ph h3 { font-family: var(--f-ui); font-size: 15px; letter-spacing: .06em; font-weight: 700; color: var(--forest); text-transform: uppercase; }
.pk { font-size: 12px; font-weight: 700; color: var(--mute); letter-spacing: .1em; text-transform: uppercase; }
.pm { margin: 0 0 14px; display: grid; gap: 4px; font-size: 15.5px; background: #F8F2E2; border-radius: 10px; padding: 10px 14px; }
.pm > div { display: grid; grid-template-columns: 112px 1fr; gap: 10px; }
.pm dt { color: var(--mute); font-weight: 600; font-size: 14px; }
.pm dd { margin: 0; font-weight: 600; word-break: break-word; }
.pl p { margin: 0 0 12px; }
.k-slip { font-variant-numeric: tabular-nums; }
.k-slip .ph, .k-form .ph { border-bottom-style: dashed; }
.k-slip .pm { background: transparent; border: 2px dashed var(--line); }
.k-report .ph { border-bottom: 4px double var(--forest); }
.k-notice { border: 3px solid var(--olive); border-radius: 10px; padding: 14px 16px; background: linear-gradient(#FFFDF6, #FBF4DF); }
.k-notice .ph h3 { color: var(--orange-d); }
.k-email .ph { border-bottom-color: var(--glacier); }
.k-form .ph h3 { color: var(--glacier-d); }
.tbl { overflow-x: auto; margin: 0 0 14px; border: 2px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
th { text-align: left; background: #EDE3C8; color: var(--forest); font-size: 13.5px; padding: 8px 10px; white-space: nowrap; }
td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.pmsg { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.pmsg li { display: flex; }
.pmsg li.s1 { justify-content: flex-end; }
.bub { max-width: 88%; background: #EFE9D6; border-radius: 14px 14px 14px 4px; padding: 9px 14px 10px; }
.s1 .bub { background: #DDE8EF; border-radius: 14px 14px 4px 14px; }
.bm { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; font-size: 13.5px; }
.bm b { color: var(--forest); }
.bm time { color: var(--mute); }
.bub p { margin: 2px 0 0; }
.k-email .bub { max-width: 100%; width: 100%; border-radius: 10px; background: #F8F2E2; }
.k-email .s1 .bub { background: #E8F0F4; }

/* từ và manh mối */
.w { cursor: pointer; border-radius: 3px; transition: background .12s; }
@media (hover: hover) { .w:hover { background: rgba(134, 163, 187, .35); } }
.cl { border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: background .25s, box-shadow .25s; cursor: pointer; }
.cl.got { background: var(--mark); box-shadow: 0 2px 0 var(--orange); }
.cl.dcs { text-decoration: line-through; text-decoration-color: rgba(98, 94, 81, .55); text-decoration-thickness: 1.5px; }
.cl.hn { animation: hn 1.1s ease-in-out infinite; background: rgba(134, 163, 187, .35); box-shadow: 0 0 0 2px rgba(47, 74, 98, .7); }
@keyframes hn { 50% { background: rgba(134, 163, 187, .7); } }
.cl.proof { background: rgba(244, 196, 76, .7); box-shadow: 0 0 0 3px rgba(178, 93, 42, .6); }
.cl.got:not(.proof) { animation: gotp .6s; }
@keyframes gotp { 30% { background: rgba(244, 196, 76, .95); } }
.pop { position: fixed; z-index: 40; background: var(--forest); color: #fff; border-radius: 12px; padding: 8px 8px 8px 14px; display: flex; align-items: center; gap: 10px; max-width: min(320px, calc(100vw - 16px)); box-shadow: 0 8px 22px rgba(0, 0, 0, .3); font-size: 15px; line-height: 1.35; }
.pop[hidden] { display: none; }
.pop.pin { animation: popin .18s ease-out; }
@keyframes popin { from { opacity: 0; transform: translateY(5px) scale(.96); } }
.pop b { color: #F4D58A; white-space: nowrap; }
.say { flex: none; width: 40px; height: 40px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .16); color: #fff; display: grid; place-items: center; padding: 0; }
.say .ic { width: 20px; height: 20px; }
.toast { position: fixed; left: 0; right: 0; margin: 0 auto; width: fit-content; bottom: 20px; transform: translateY(30px); background: #2E3B27; color: #fff; padding: 11px 18px; border-radius: 14px; max-width: min(560px, calc(100vw - 24px)); font-size: 15px; line-height: 1.4; box-shadow: 0 10px 28px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s; z-index: 45; text-align: center; }
.toast.on { opacity: 1; transform: none; }
.toast.good { background: #3A4A32; border-left: 5px solid #F4C44C; }
.toast.soft { background: #4D4A3E; }
.fly { position: fixed; z-index: 60; pointer-events: none; background: var(--orange); color: #fff; font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 12px; white-space: nowrap; }

/* khung phải */
.side { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: rgba(251, 246, 234, .96); border: 2px solid var(--forest); border-radius: 16px; box-shadow: var(--sh); overflow: hidden; }
.stabs { display: flex; flex: none; border-bottom: 2px solid var(--forest); }
.stabs button { flex: 1; min-height: 48px; border: 0; background: #EFE4CB; font-weight: 700; color: var(--forest); display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 15px; }
.stabs button + button { border-left: 2px solid var(--forest); }
.stabs button.on { background: var(--cream); box-shadow: inset 0 -4px 0 var(--orange); }
.stabs b, .mnav b { background: var(--orange); color: #fff; border-radius: 10px; min-width: 22px; height: 22px; font-size: 12.5px; line-height: 22px; text-align: center; padding: 0 5px; }
.qp, .nb { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px 18px; -webkit-overflow-scrolling: touch; }
.side[data-s="q"] .nb, .side[data-s="nb"] .qp { display: none; }
.qdots { display: flex; gap: 5px; margin-bottom: 8px; }
.qdots i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.qdots i.done { background: var(--olive); }
.qdots i.now { background: var(--orange); }
.qno { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--olive); }
.qno.fin { color: var(--orange-d); }
.qt { font: 600 19px/1.4 var(--f-ti); color: var(--forest); margin: 0 0 14px; }
.qt.sm { font-size: 16.5px; color: var(--mute); margin-bottom: 8px; }
.qt.sm2 { font-size: 18px; }
.opts { display: grid; gap: 9px; margin-bottom: 14px; }
.opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; min-height: 52px; padding: 10px 14px; background: var(--paper); border: 2px solid var(--line); border-radius: 12px; font-size: 16.5px; line-height: 1.45; transition: transform .12s, border-color .15s, background .15s; }
.opt b { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--card); border: 2px solid var(--olive); display: grid; place-items: center; font-size: 13.5px; margin-top: 1px; }
.opt:hover:not(:disabled) { border-color: var(--olive); transform: translateX(2px); }
.opt.sel { border-color: var(--forest); background: #EAF0E0; box-shadow: 0 0 0 2px var(--forest); }
.opt.sel b { background: var(--forest); color: #fff; }
.opt.no { opacity: .55; text-decoration: line-through; text-decoration-color: var(--bad); background: #F3E3DC; }
.ev h4 { margin: 4px 0 8px; font-size: 14.5px; color: var(--forest); display: flex; justify-content: space-between; gap: 8px; }
.ev h4 span { color: var(--orange-d); }
.evn { margin: 0; font-size: 15px; color: var(--mute); background: var(--card); border-radius: 10px; padding: 10px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chips.col { flex-direction: column; }
.chip { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 22px; border: 2px solid var(--line); background: #fff; font-size: 14.5px; text-align: left; line-height: 1.3; max-width: 100%; }
.chips.col .chip { border-radius: 12px; }
.chip .ic { width: 18px; height: 18px; color: var(--olive); }
.chip.on { background: #EAF0E0; border-color: var(--forest); font-weight: 600; }
.chip:disabled { opacity: .45; text-decoration: line-through; }
.fb { min-height: 22px; margin: 0 0 8px; font-size: 14.5px; color: var(--mute); }
.fb.bad { color: var(--bad); font-weight: 600; }
.note { font-size: 15px; background: var(--card); padding: 10px 12px; border-radius: 10px; margin: 0 0 12px; }
.okc { animation: enter .35s both; }
.okc h3 { display: flex; align-items: center; gap: 8px; color: var(--good); font-size: 24px; margin-bottom: 8px; }
.okc h3 .ic { width: 28px; height: 28px; background: var(--good); color: #fff; border-radius: 50%; padding: 5px; }
.ans { font-weight: 700; background: #EAF0E0; border-left: 5px solid var(--good); padding: 8px 12px; border-radius: 8px; margin: 0 0 10px; }
.why { margin: 0 0 12px; font-size: 16px; }
.proofs { display: grid; gap: 8px; margin-bottom: 12px; }
.pr { text-align: left; background: #FFF4D2; border: 2px solid #E7C873; border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.pr q { font-style: italic; line-height: 1.4; }
.pr span { font-size: 12.5px; color: var(--mute); font-weight: 600; }
.evr { font-size: 14.5px; margin: 0 0 14px; padding: 8px 12px; border-radius: 8px; }
.evr.good { background: #E6EFDB; color: #2F4A25; }
.evr.warn { background: #F9E8D6; color: #7A3E15; }
.shake { animation: shake .4s; }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* sổ manh mối */
.nbh { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.nbh h3 { font-size: 21px; flex: 1; }
.nbh > span { font-weight: 700; color: var(--orange-d); }
.nbx { display: none; }
.cnl { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.cn { background: #FFF9E6; border: 2px solid #E7D9A8; border-radius: 12px; padding: 10px 14px; animation: enter .4s calc(var(--k) * 30ms) both; background-image: repeating-linear-gradient(transparent 0 27px, rgba(134, 163, 187, .18) 27px 28px); }
.cn q { display: block; font: italic 600 16px/1.4 var(--f-ti); color: var(--forest); }
.cn p { margin: 6px 0 8px; font-size: 15.5px; }
.src { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px; border-radius: 18px; border: 2px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; color: var(--glacier-d); }
.src .ic { width: 15px; height: 15px; }
.empty { text-align: center; color: var(--mute); padding: 6px 0 14px; }
.empty img { max-width: 70%; height: auto; opacity: .95; border-radius: 12px; }
.nb h4 { margin: 8px 0; color: var(--forest); font-size: 15px; }
.wl { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 15px; }
.wl b { color: var(--orange-d); }

/* thanh điều hướng điện thoại */
.mnav { display: none; }
.nbbk { display: none; }

/* ---------------- kết quả ---------------- */
.res { min-height: 100dvh; display: grid; place-items: center; padding: 20px 16px calc(24px + var(--safe-b)); background: radial-gradient(circle at 50% 0, #fff7e3, var(--cream) 65%); }
.res-card { background: var(--paper); border: 2px solid var(--forest); border-radius: 8px 20px 20px 20px; max-width: 700px; width: 100%; padding: 28px; box-shadow: 0 18px 44px rgba(58, 74, 50, .18); position: relative; overflow: hidden; }
.stampw { position: absolute; top: 16px; right: 12px; }
.stamp { font: 700 21px var(--f-ti); color: var(--orange); border: 4px double var(--orange); padding: 6px 14px; border-radius: 8px; transform: rotate(-9deg); letter-spacing: .06em; animation: stampin .5s .3s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stampin { from { opacity: 0; transform: rotate(-9deg) scale(2.6); } to { opacity: .94; transform: rotate(-9deg) scale(1); } }
.gradeb { display: flex; align-items: center; gap: 16px; margin: 6px 0 16px; }
.gcirc { flex: none; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 700 46px var(--f-ti); border: 4px double rgba(255, 255, 255, .8); box-shadow: 0 4px 12px rgba(0, 0, 0, .25); animation: pop .6s .5s both; }
.gradeb h1 { font-size: clamp(24px, 4.4vw, 32px); }
.sc { margin: 4px 0 0; color: var(--mute); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 16px; }
.stats > div { background: var(--card); border-radius: 12px; padding: 10px 12px; text-align: center; }
.stats dt { font-size: 12.5px; color: var(--mute); font-weight: 600; }
.stats dd { margin: 2px 0 0; font: 700 24px var(--f-ti); color: var(--forest); font-variant-numeric: tabular-nums; }
.sum, .twist { border-radius: 12px; padding: 12px 16px; margin-bottom: 12px; }
.sum { background: #EAF0E0; }
.twist { background: #FFF1D6; border-left: 6px solid var(--orange); }
.sum h3, .twist h3 { font-size: 17px; margin-bottom: 4px; }
.sum p, .twist p { margin: 0; }
.pen { font-size: 13.5px; color: var(--mute); margin: 0 0 4px; }
.wrap { flex-wrap: wrap; }

/* ---------------- bài học ---------------- */
.les { max-width: 860px; margin: 0 auto; padding: calc(14px + var(--safe-t)) 16px calc(36px + var(--safe-b)); }
.les-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.les h1 { font-size: clamp(26px, 5vw, 36px); }
.les h2 { font-size: 24px; margin: 26px 0 8px; }
.lede2 { margin: 0 0 14px; color: var(--mute); }
.pairs { display: grid; gap: 14px; }
.pair { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; grid-template-columns: 1fr 34px 1fr; gap: 6px; align-items: stretch; }
.pair .pa, .pair .pb { background: var(--paper); border-radius: 10px; padding: 8px 12px; border: 2px solid var(--line); }
.pair .pa { border-left: 5px solid var(--orange); }
.pair .pb { border-left: 5px solid var(--glacier-d); }
.pair span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); margin-bottom: 2px; }
.pair q { font: italic 600 16px/1.4 var(--f-ti); color: var(--forest); }
.pm2 { display: grid; place-items: center; font: 700 22px var(--f-ti); color: var(--olive); }
.ptip { grid-column: 1 / -1; margin: 6px 0 0; font-size: 15.5px; }
.tips { padding-left: 20px; display: grid; gap: 8px; }
.vgrid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.vgrid li { background: var(--card); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; border: 2px solid var(--line); }
.vgrid b { color: var(--forest); font-size: 17px; }
.vgrid span { font-size: 15px; color: var(--ink); }

/* ================== màn hình hẹp ================== */
@media (max-width: 899px) {
  .cab { grid-template-columns: 1fr; gap: 18px; }
  .fbody { min-height: 0; }
  .main { display: block; position: relative; padding: 10px 10px 0; }
  .docs, .side { height: 100%; }
  .side { display: contents; }
  .stabs { display: none; }
  .play[data-m="docs"] .qp, .play[data-m="q"] .docs { display: none; }
  .qp { display: block; height: 100%; background: rgba(251, 246, 234, .97); border: 2px solid var(--forest); border-radius: 16px; padding-bottom: 24px; }
  .side[data-s] .qp, .side[data-s="nb"] .qp { display: block; }
  .play[data-m="docs"] .side .qp { display: none; }
  .swipe { display: block; }
  .stage { padding: 14px; border-radius: 0 12px 12px 12px; }
  .paper { font-size: 16.5px; }
  .nb { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: min(74dvh, 560px); background: var(--cream); border: 2px solid var(--forest); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 14px 16px calc(24px + var(--safe-b)); transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .8, .3, 1); box-shadow: 0 -10px 30px rgba(0, 0, 0, .25); display: block !important; }
  .nb::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: -4px auto 8px; }
  .play.nbopen .nb { transform: none; }
  .nbx { display: inline-grid; }
  .nbbk { display: block; position: fixed; inset: 0; background: rgba(30, 36, 26, .45); z-index: 29; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .play.nbopen .nbbk { opacity: 1; pointer-events: auto; }
  .mnav { display: grid; grid-template-columns: repeat(3, 1fr); flex: none; background: rgba(251, 246, 234, .97); border-top: 2px solid var(--forest); padding-bottom: var(--safe-b); position: relative; z-index: 31; }
  .mnav button { min-height: 56px; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 12.5px; font-weight: 700; color: var(--mute); position: relative; }
  .mnav button.on { color: var(--forest); box-shadow: inset 0 3px 0 var(--orange); }
  .mnav b { position: absolute; top: 5px; left: calc(50% + 8px); }
  .mnav .dot { position: absolute; top: 8px; left: calc(50% + 8px); width: 10px; height: 10px; border-radius: 50%; background: var(--orange); display: none; }
  .mnav .dot.on { display: block; animation: pop .5s; }
  .toast { bottom: auto; top: calc(66px + var(--safe-t)); transform: translateY(-20px); }
  .tm { min-width: 58px; padding: 8px 4px; font-size: 14.5px; }
  .bar { gap: 6px; padding: 6px 10px; }
  .pm > div { grid-template-columns: 96px 1fr; gap: 8px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero { min-height: 0; flex-direction: column; background-position: center top; background-size: 100% auto; background-repeat: no-repeat; background-color: var(--cream); padding-top: 190px; }
  .hero-in { width: 100%; background: var(--cream); padding: 20px 18px; }
  .lede { font-size: 16px; }
  .pair { grid-template-columns: 1fr; }
  .pm2 { height: 20px; transform: rotate(90deg); }
  .vgrid { grid-template-columns: 1fr; }
  .stampw { position: static; margin: 4px 0 20px; }
  .memo { padding: 22px 18px 22px; }
}
@media (max-width: 600px) {
  table, thead, tbody, tr, td { display: block; }
  thead { display: none; }
  .tbl { border: 0; }
  tr { border: 2px solid var(--line); border-radius: 10px; margin-bottom: 8px; padding: 4px 0; background: #FBF6E8; }
  td { border: 0; padding: 3px 12px; display: grid; grid-template-columns: 94px 1fr; gap: 8px; }
  td::before { content: attr(data-l); font-size: 13px; color: var(--mute); font-weight: 600; }
  .bub { max-width: 94%; }
}
@media (min-width: 900px) and (max-height: 800px) {
  .qt { font-size: 18px; margin-bottom: 10px; }
  .opt { min-height: 46px; padding: 7px 12px; font-size: 16px; }
  .paper { font-size: 16.5px; line-height: 1.6; }
  .qp, .nb { padding: 12px 16px 14px; }
}
@media (min-width: 900px) { .mnav { display: none; } }

/* ================== chất giấy (hs2) ================== */
:root { --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace; --sheet: #FFFDF7; }
.stage { background: #E7DCC3 radial-gradient(rgba(58, 74, 50, .09) 1px, transparent 1.5px) 0 0 / 14px 14px; padding: 20px 22px 26px; }
.paper { position: relative; background: var(--sheet) linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(236, 224, 196, .28)); padding: 22px 26px 24px; border: 1px solid #D8CBAA; border-radius: 3px; box-shadow: 0 1px 0 #fff inset, 0 2px 0 -1px #EFE6D0, 0 3px 0 -1px #D8CBAA, 0 12px 24px rgba(58, 74, 50, .16); }
/* giấy kẹp: email và báo cáo */
.k-email::before, .k-report::before { content: ""; position: absolute; top: -13px; left: 26px; width: 15px; height: 44px; border: 3px solid #8A9097; border-radius: 9px; border-bottom-color: #9AA0A6; box-shadow: 1px 1px 0 rgba(0, 0, 0, .12); transform: rotate(4deg); z-index: 1; background: transparent; }
.k-email::after, .k-report::after { content: ""; position: absolute; top: -6px; left: 30px; width: 7px; height: 30px; border: 3px solid #8A9097; border-top: 0; border-radius: 0 0 6px 6px; transform: rotate(4deg); z-index: 1; }
.k-email { border-top: 5px solid var(--glacier); }
.k-report { background-image: linear-gradient(90deg, transparent 0 46px, rgba(178, 93, 42, .18) 46px 47px, transparent 47px); }
/* phiếu, biểu mẫu: chữ đơn cách như máy in */
.k-slip .pm dd, .k-form .pm dd, .k-form td, .k-slip td { font-family: var(--f-mono); font-weight: 500; letter-spacing: -.01em; }
.k-slip .ph h3, .k-form .ph h3 { font-family: var(--f-mono); letter-spacing: .02em; }
.k-slip { background: #FFFEF9; border-left: 0; border-right: 0; border-radius: 0; margin-bottom: 12px; }
.k-slip::after { content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 10px; background: linear-gradient(-45deg, transparent 6px, #FFFEF9 6px) 0 0 / 12px 10px repeat-x, linear-gradient(45deg, transparent 6px, #FFFEF9 6px) 0 0 / 12px 10px repeat-x; filter: drop-shadow(0 2px 1px rgba(58, 74, 50, .12)); }
.k-slip::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; border-top: 2px dashed #D8CBAA; }
.k-form .tbl { border-color: #CFC2A2; }
.k-form th { font-family: var(--f-ui); background: #E9E3D2; }
tr.tot td { font-weight: 700; border-top: 2px solid var(--ink); }
.k-chat { background: #F5F2EA; }
.k-notice { border: 3px double var(--olive); border-radius: 4px; }
/* dấu mộc */
.ink { position: absolute; top: 16px; right: 16px; z-index: 2; pointer-events: none; font: 700 14px/1 var(--f-mono); letter-spacing: .14em; color: #A33A2B; border: 3px solid currentColor; border-radius: 6px; padding: 6px 9px 5px; transform: rotate(-9deg); opacity: .62; mix-blend-mode: multiply; box-shadow: 0 0 0 2px rgba(255, 253, 247, .4) inset; white-space: nowrap; }
.k-form .ink, .k-slip .ink { color: #2F4A62; }
.paper.has-ink .ph { padding-right: 118px; }
/* thư giao việc, đang dở */
.memo-live { margin: 12px 0 0; padding: 10px 14px; background: #FFF1D6; border-left: 5px solid var(--orange); border-radius: 8px; font-weight: 600; }
.memo-live.soft { background: var(--card); border-left-color: var(--olive); font-weight: 500; }
.flive { margin: 8px 0 0; font-size: 14px; font-weight: 700; color: var(--orange-d); }
.coach li { line-height: 1.5; }
.stats { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 899px) {
  .stage { padding: 12px 8px 22px; }
  .paper { padding: 18px 14px 20px; }
  .pm { font-size: 16px; padding: 10px 12px; }
  .pm dt { font-size: 14.5px; }
  table { font-size: 16px; }
  .paper.has-ink .ph { padding-right: 0; padding-top: 34px; }
  .ink { top: 12px; right: 12px; font-size: 12.5px; }
  .k-email::before, .k-report::before { left: 18px; }
  .k-email::after, .k-report::after { left: 22px; }
  .k-report { background-image: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div:last-child { grid-column: 1 / -1; }
}
/* chỉnh sau lượt chơi kiểm tra (hs2) */
.k-email, .k-report { padding-top: 36px; }
.k-report { background-image: none; }
.pm, table { font-size: 16px; }
.home { display: inline-flex; align-items: center; min-height: 44px; }
.ib.sm { width: 44px; height: 44px; }
.src { min-height: 44px; }
.les-top .ib { flex: none; }
.stats > div { padding: 10px 6px; }
.stamp { display: inline-block; }
.toast { bottom: auto; top: calc(70px + var(--safe-t)); transform: translateY(-20px); }
.toast.on { transform: none; }
@media (max-width: 899px) { .k-email, .k-report { padding-top: 30px; } .paper.has-ink.k-report .ph, .paper.has-ink.k-email .ph { padding-top: 22px; } }
/* sổ manh mối trượt ra từ đáy: không cho nó kéo dài trang (trang bị cuộn lệch trên điện thoại) */
.play { contain: paint; }
html:has(body[data-view="play"]) { overflow: hidden; }
@media (max-width: 600px) { td::before { font-family: var(--f-ui); } tr.tot td:empty { display: none; } tr.tot td:first-child::before { content: ""; } }

/* sửa sau lượt chơi thử độc lập (hs3) */
/* thẻ bằng chứng: có tên tài liệu, xuống dòng thay vì cắt */
.chip { align-items: flex-start; border-radius: 14px; }
.chip .ic { flex: none; margin-top: 2px; }
.chip .cb { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.chip .cb small { font-size: 12px; font-weight: 700; color: var(--olive); letter-spacing: .02em; }
.chip .ct { overflow-wrap: anywhere; white-space: normal; }
.chip.hn { animation: chipHn 1s ease-in-out 4; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240, 138, 36, .35); }
@keyframes chipHn { 50% { background: #FFE9B8; } }
.ev .chips { max-height: 30vh; overflow: auto; padding: 2px 2px 4px; }
.chips.col { max-height: 34vh; overflow: auto; padding: 2px 2px 4px; }
/* nút trả lời luôn thấy, dính đáy khung câu hỏi */
.subbar { position: sticky; bottom: 0; margin: 6px -18px -18px; padding: 10px 18px 14px; background: linear-gradient(to bottom, rgba(251, 246, 234, 0), var(--cream) 22%); z-index: 3; }
.subbar .btn { width: 100%; }
.fhint { border-left: 5px solid var(--orange); }
.evr.stray q { font-style: italic; }
.penl { list-style: none; margin: 10px 0 18px; padding: 10px 14px; background: var(--card); border-radius: 10px; display: grid; gap: 4px; font-size: 14.5px; }
.penl li { display: flex; justify-content: space-between; gap: 12px; }
.penl b { color: var(--bad); }
@media (min-width: 900px) and (max-height: 800px) {
  .subbar { margin: 4px -16px -14px; padding: 8px 16px 12px; }
  .ev .chips { max-height: 26vh; }
}
@media (max-width: 899px) {
  .subbar { margin: 6px -18px -24px; padding-bottom: 20px; }
  .toast { top: auto; bottom: calc(76px + var(--safe-b)); transform: translateY(20px); max-width: calc(100vw - 24px); font-size: 14px; padding: 8px 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .toast.on { transform: none; }
}
.subbar .fb { margin: 0 0 8px; }
.subbar .fb:empty { display: none; }
.chips.col { flex-wrap: nowrap; }
.chips.col .chip { flex: none; }

/* ===== làm đẹp chuyển động (hs4): chỉ transform/opacity, mỗi hiệu ứng ≤ 0,6 giây, không chặn thao tác ===== */
.part7 { margin: -4px 0 14px; max-width: 46ch; font-size: 14.5px; line-height: 1.5; color: var(--olive); font-weight: 600; }
/* nhặt manh mối: câu được gạch nét bút tô vàng, sổ nảy, số đếm nhích */
.cl.got.fresh:not(.proof) { animation: ink .42s ease-out both; background-color: transparent; background-image: linear-gradient(var(--mark), var(--mark)); background-repeat: no-repeat; background-position: left center; }
@keyframes ink { from { background-size: 0 100%; box-shadow: 0 0 0 transparent; } to { background-size: 100% 100%; } }
.fly { box-shadow: 0 3px 10px rgba(58, 74, 50, .35); border: 2px solid #fff3; }
.bump { animation: bump .42s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.14) rotate(-2deg); } 100% { transform: scale(1); } }
.tick { display: inline-block; animation: tick .4s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes tick { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }
/* lật tài liệu: tờ giấy trượt vào, có đổ bóng */
.pw { position: relative; }
.pw.in-r { animation: inr2 .3s cubic-bezier(.2, .8, .3, 1); }
.pw.in-l { animation: inl2 .3s cubic-bezier(.2, .8, .3, 1); }
@keyframes inr2 { from { opacity: 0; transform: translateX(46px) rotate(.9deg) scale(.985); filter: drop-shadow(-10px 6px 8px rgba(58, 74, 50, .25)); } to { opacity: 1; transform: none; filter: none; } }
@keyframes inl2 { from { opacity: 0; transform: translateX(-46px) rotate(-.9deg) scale(.985); filter: drop-shadow(10px 6px 8px rgba(58, 74, 50, .25)); } to { opacity: 1; transform: none; filter: none; } }
/* bóc niêm phong: nắp giấy lật lên, dấu sáp co lại */
.unseal { position: absolute; inset: 0; z-index: 4; pointer-events: none; perspective: 700px; overflow: hidden; border-radius: 4px; }
.unseal .flap { position: absolute; left: 0; right: 0; top: 0; height: 100%; background: linear-gradient(#E9D8AF, #D9C48F); clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%); transform-origin: top center; animation: flapUp .52s cubic-bezier(.5, 0, .3, 1) both; box-shadow: inset 0 -6px 12px rgba(120, 90, 40, .25); }
.unseal .wax { position: absolute; left: calc(50% - 20px); top: 52%; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #D9843F, #A94A1A 70%); box-shadow: 0 3px 8px rgba(0, 0, 0, .3); animation: waxOff .34s ease-in both; }
@keyframes flapUp { 0% { transform: rotateX(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: rotateX(-105deg); opacity: 0; } }
@keyframes waxOff { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(.2) translateY(-18px); opacity: 0; } }
/* đúng: dấu tích được vẽ, vòng tròn nảy; câu chứng minh được gạch bút */
.okc h3 .ic { animation: pop .42s cubic-bezier(.3, 1.6, .5, 1) both; }
.okc h3 .ic path { stroke-dasharray: 26; stroke-dashoffset: 26; animation: draw .34s .1s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.cl.proof.inkp { animation: inkp .5s .15s ease-out both; background-color: transparent; background-image: linear-gradient(rgba(244, 196, 76, .7), rgba(244, 196, 76, .7)); background-repeat: no-repeat; background-position: left center; }
@keyframes inkp { from { background-size: 0 100%; } to { background-size: 100% 100%; } }
.pr { animation: enter .3s both; } .pr:nth-child(2) { animation-delay: .08s; }
/* sai: đáp án vừa chọn đỏ lên rồi lắng xuống (kèm rung nhẹ có sẵn) */
.opt.nono { animation: nono .45s ease-out; }
@keyframes nono { 0% { background: #F2C9BF; border-color: var(--bad); } 100% { background: var(--paper); } }
/* lật ngược cuối vụ */
.qp.tw-on .qno.fin { animation: slam .34s cubic-bezier(.2, 1.6, .4, 1) both; }
.qp.tw-on .qt { animation: flipIn .5s cubic-bezier(.2, .8, .3, 1) .08s both; transform-origin: top center; }
.qp.tw-on .note b { animation: noteHi .6s .3s ease-out both; }
@keyframes slam { from { opacity: 0; transform: scale(2) rotate(-4deg); } to { opacity: 1; transform: none; } }
@keyframes flipIn { from { opacity: 0; transform: translateY(-10px) scaleY(.3); } to { opacity: 1; transform: none; } }
@keyframes noteHi { 0%, 100% { background: transparent; } 40% { background: rgba(244, 196, 76, .6); } }
.twflash { position: fixed; inset: 0; z-index: 55; pointer-events: none; box-shadow: inset 0 0 90px 10px rgba(178, 93, 42, .5); animation: twflash .55s ease-out both; }
@keyframes twflash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
/* màn kết quả: dấu đóng, hạng bật ra, bảng điểm hiện lần lượt */
.gcirc { animation: gradeIn .5s .3s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes gradeIn { from { opacity: 0; transform: scale(.2) rotate(-40deg); } to { opacity: 1; transform: none; } }
.gradeb h1, .gradeb .sc { animation: enter .4s .4s both; }
.stats > div { animation: enter .35s both; }
.stats > div:nth-child(1) { animation-delay: .4s; } .stats > div:nth-child(2) { animation-delay: .46s; } .stats > div:nth-child(3) { animation-delay: .52s; } .stats > div:nth-child(4) { animation-delay: .58s; } .stats > div:nth-child(5) { animation-delay: .64s; }
.sum, .twist { animation: enter .4s .6s both; } .twist { animation-delay: .7s; }
.penl li { animation: penIn .3s both; }
.penl li:nth-child(1) { animation-delay: .8s; } .penl li:nth-child(2) { animation-delay: .9s; } .penl li:nth-child(3) { animation-delay: 1s; } .penl li:nth-child(4) { animation-delay: 1.1s; } .penl li:nth-child(5) { animation-delay: 1.2s; } .penl li:nth-child(6) { animation-delay: 1.3s; }
@keyframes penIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
/* bài học: từng khối hiện lần lượt */
.les-top { animation: enter .4s both; }
.les > section { animation: enter .45s both; }
.les > section:nth-of-type(1) { animation-delay: .1s; } .les > section:nth-of-type(2) { animation-delay: .22s; } .les > section:nth-of-type(3) { animation-delay: .34s; }
.pair { animation: enter .4s both; } .pair:nth-child(1) { animation-delay: .18s; } .pair:nth-child(2) { animation-delay: .26s; } .pair:nth-child(3) { animation-delay: .34s; } .pair:nth-child(4) { animation-delay: .42s; }
.tips li { animation: enter .35s both; } .tips li:nth-child(1) { animation-delay: .3s; } .tips li:nth-child(2) { animation-delay: .38s; } .tips li:nth-child(3) { animation-delay: .46s; } .tips li:nth-child(4) { animation-delay: .54s; }
.vgrid li { animation: enter .3s both; } .vgrid li:nth-child(n+1) { animation-delay: .4s; } .vgrid li:nth-child(n+3) { animation-delay: .46s; } .vgrid li:nth-child(n+5) { animation-delay: .52s; } .vgrid li:nth-child(n+7) { animation-delay: .58s; }
@media (prefers-reduced-motion: reduce) { .unseal, .twflash, .fly { display: none !important; } .okc h3 .ic path { stroke-dasharray: none; stroke-dashoffset: 0; } .penl li, .stats > div, .sum, .twist, .gcirc, .les > section, .les-top, .pair, .tips li, .vgrid li, .pr { animation: none !important; opacity: 1; } }

/* ---------- điện thoại 20261118dt1: vùng chạm cho từ và câu trong văn bản (giữ chữ inline) ---------- */
@media (pointer: coarse) {
  .paper { line-height: 1.95; }
  .paper .tbl, .paper table { line-height: 1.6; }
  .w, .cl { padding-block: 6px; background-clip: content-box; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  .cl.got { box-shadow: none; text-decoration: underline var(--orange) 2px; text-underline-offset: 4px; }
  .cl.proof { box-shadow: none; outline: 3px solid rgba(178, 93, 42, .6); }
  .cl.hn { box-shadow: none; }
}

/* ---------- điện thoại xoay ngang 20261118dt1: tài liệu bên trái, câu hỏi bên phải ---------- */
@media (orientation: landscape) and (max-height: 480px) and (max-width: 899px) {
  .bar { padding: 3px 12px; }
  .mnav, .swipe { display: none; }
  .main { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 8px; padding: 6px 8px; }
  .play[data-m] .docs { display: flex; height: auto; }
  .side { display: flex; height: auto; }
  .stabs { display: flex; }
  .stabs button { min-height: 44px; font-size: 13px; gap: 4px; white-space: nowrap; }
  .play[data-m] .side[data-s="q"] .qp, .play[data-m] .side[data-s="nb"] .nb { display: block !important; }
  .play[data-m] .side[data-s="q"] .nb, .play[data-m] .side[data-s="nb"] .qp { display: none !important; }
  .qp { height: auto; border: 0; border-radius: 0; background: none; padding: 10px 12px 14px; }
  .nb { position: static; z-index: auto; height: auto; transform: none; border: 0; border-radius: 0; background: none; padding: 10px 12px 14px; transition: none; }
  .nb::before, .nbx, .nbbk { display: none; }
  .tabs { padding-top: 2px; }
  .stage { padding: 10px 12px 14px; }
}

/* ---------- soát độc lập 20261118dt1: chữ bớt loãng, thông báo không che dòng đang đọc, nút Trả lời có nền đặc ---------- */
@media (pointer: coarse) {
  .paper { line-height: 1.8; }
  .paper .pm { line-height: 1.5; }
  .w, .cl { padding-block: 6px; }
}
@media (max-width: 899px) {
  .toast { top: calc(60px + var(--safe-t)); bottom: auto; transform: translateY(-12px); padding: 6px 14px; font-size: 14px; line-height: 1.35; border-radius: 10px; pointer-events: none; }
  .toast.on { transform: none; }
  .subbar .btn:disabled { opacity: 1; background: #E3C9B4; border-color: #E3C9B4; color: #6E4F3A; box-shadow: none; }
}
@media (orientation: landscape) and (max-height: 480px) and (max-width: 899px) {
  .toast { top: calc(54px + var(--safe-t)); -webkit-line-clamp: 1; white-space: nowrap; text-overflow: ellipsis; display: block; max-width: calc(100vw - 32px); }
  .qp { padding-bottom: 0; }
  .subbar { margin: 8px -12px 0; padding: 8px 12px calc(10px + var(--safe-b)); background: var(--cream); border-top: 1px solid var(--line); }
}

/* ---------- 20261118ux1: dẫn bước đầu, đoạn tương tác, thông báo không che hàng tab ---------- */
.folder.locked h2, .folder.locked .fen, .folder.locked .ftopic { filter: none; opacity: 1; color: var(--forest); }
.folder.locked .fbrief { filter: blur(3px); opacity: .5; }
.lockv { position: static; inset: auto; flex-direction: row; justify-content: flex-start; gap: 8px; margin: 0 0 10px; color: #2E3B27; font-size: 14px; }
.lockv .ic { width: 22px; height: 22px; }
.hsg { position: sticky; top: -18px; z-index: 3; margin: -18px -18px 14px; padding: 9px 18px; background: #F3EBD4; border-bottom: 1.5px dashed #B9AD8E; color: #35432D; font-size: 14px; font-weight: 600; line-height: 1.4; }
.cl:not(.got):not(.dcs):not(.proof) { text-decoration: underline dotted rgba(47, 74, 98, .75) 2px; text-underline-offset: 4px; }
.cl.saved::after { content: "Đã lưu vào sổ"; display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 6px; background: #DCEBCB; color: #1F4A18; border: 1.5px solid #4C8A3A; font: 700 12.5px/20px var(--f-ui); font-style: normal; text-decoration: none; white-space: nowrap; vertical-align: middle; }
.xemcau { display: none; }
.toast, .toast.on { top: auto; bottom: 20px; }
.toast { transform: translateY(20px); }
.toast.on { transform: none; }
@media (max-width: 899px) {
  .hsg { top: -14px; margin: -14px -14px 12px; padding: 9px 14px; }
  .xemcau { display: flex; align-items: center; justify-content: center; gap: 8px; flex: none; width: 100%; min-height: 48px; margin-top: 8px; border: 2px solid #26321F; border-radius: 12px; background: var(--forest); color: #fff; font-weight: 700; font-size: 15.5px; box-shadow: 0 3px 0 #26321F; }
  .xemcau .ic { width: 20px; height: 20px; }
  .play[data-m="q"] .xemcau { display: none; }
  .toast, .toast.on { top: auto; bottom: calc(140px + var(--safe-b)); }
}
@media (orientation: landscape) and (max-height: 480px) and (max-width: 899px) {
  .xemcau { display: none; }
  .toast, .toast.on { bottom: 12px; top: auto; }
}
.subbar { padding-top: 16px; background: linear-gradient(to bottom, rgba(251, 246, 234, 0), var(--cream) 14px); }
@media (max-width: 899px) { .xemcau { margin-bottom: 8px; } }
/* k12: điện thoại xoay ngang – dòng hướng dẫn không dính trên tài liệu (khung thấp), cuộn đi cùng nội dung */
@media (orientation: landscape) and (max-height: 480px) and (max-width: 899px) {
  .hsg { position: static; font-size: 13px; padding: 6px 14px; }
}
/* k12: viền đáp án đạt 3:1 trên nền kem */
.opt { border-color: #978C6D; }
.opt { border-color: #8C8164; }

/* ---------- 20261118ux2: phản hồi đúng/sai rõ tại chỗ, nút trạng thái rõ, câu hỏi luôn thấy ---------- */
.opt.no { opacity: 1; text-decoration: none; background: #F6DDD3; border-color: #8A2A14; border-width: 3px; color: #4A1A0E; flex-wrap: wrap; position: relative; }
.opt.no b { background: #8A2A14; border-color: #8A2A14; color: #fff; }
.opt.no span { flex: 1 1 0; min-width: 0; }
.opt .tagno { flex: 0 0 100%; margin: 2px 0 0 40px; font-style: normal; font-weight: 700; font-size: 13.5px; color: #8A2A14; }
.opt .tagno::before { content: "✕ "; }
.opfb { margin: 0 0 10px; padding: 10px 14px; border: 2px solid #8A2A14; border-left-width: 6px; border-radius: 10px; background: #FBE9E1; color: #4A1A0E; font-size: 15.5px; line-height: 1.45; animation: enter .3s both; }
.opfb b { color: #8A2A14; font-size: 16.5px; }
.ev h4 { flex-wrap: wrap; align-items: baseline; }
.ev h4 span { background: #FFF1D6; border: 1.5px solid #B25D2A; border-radius: 999px; padding: 1px 10px; color: #7A3E15; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
/* nút Trả lời: chưa đủ điều kiện = viền + chữ nói rõ việc còn thiếu; đủ = màu nhấn */
.btn.go:disabled { opacity: 1; background: var(--paper); border-color: #6F664C; color: #3A382E; box-shadow: none; border-style: dashed; cursor: not-allowed; }
.btn.go.ready { background: var(--orange); border-color: var(--orange-d); color: #fff; box-shadow: 0 3px 0 var(--orange-d); border-style: solid; }
/* đúng: khối xác nhận lớn */
.okc { background: #E6F0DA; border: 2px solid var(--good); border-left-width: 8px; border-radius: 12px; padding: 12px 14px 4px; }
.okc h3 { font-size: 26px; margin-bottom: 6px; }
.okc .ans { font-weight: 700; font-size: 17px; margin: 0 0 6px; }
.okc .why { font-size: 16px; }
.okc .subbar { margin-left: -14px; margin-right: -14px; margin-bottom: 0; }
/* câu hỏi dính đầu khung, luôn thấy khi cuộn phương án */
.play .qp .qt:not(.sm) { position: sticky; top: -16px; z-index: 4; background: #FBF6EA; margin: -4px -18px 10px; padding: 8px 18px 8px; border-bottom: 1.5px dashed #B9AD8E; }
@media (max-width: 899px) {
  .qp .qt:not(.sm) { top: -12px; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; font-size: 17px; line-height: 1.35; }
  .opfb { font-size: 15px; padding: 8px 12px; }
}
/* k14: màn đầu có nút chính vào hồ sơ, Cách chơi là nút phụ cạnh bên */
.hero-act { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero-act .btn.go.big { min-height: 50px; }
@media (max-width: 899px) {
  .hero-act { width: 100%; }
  .hero-act .btn.go.big { flex: 1 1 100%; justify-content: center; }
  .hero-act #how2 { flex: 1 1 100%; justify-content: center; }
}

/* ---------- 20261118ux3: thẻ khoá nói rõ điều kiện ngay dưới tên; điện thoại – dải hướng dẫn tự ẩn, nút Xem câu nổi trên tài liệu; phản hồi Đúng tách bạch ---------- */
.folder.locked .lockv { display: inline-flex; align-self: flex-start; align-items: center; margin: 8px 0 8px; padding: 6px 12px 6px 8px; border: 2px solid #2E3B27; border-radius: 999px; background: #FBF6EA; color: #2E3B27; font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.folder.locked .lockv .ic { width: 20px; height: 20px; flex: none; }
.okc { background: #FFFDF6; border: 2px solid var(--good); border-left-width: 2px; border-radius: 12px; padding: 0 16px 4px; overflow: hidden; }
.okc h3 { margin: 0 -16px 14px; padding: 9px 16px; background: var(--good); color: #fff; font-size: 22px; letter-spacing: .01em; }
.okc h3 .ic { background: #fff; color: var(--good); }
.okc .qt.sm { margin-bottom: 10px; }
.okc .ans { margin: 0 0 12px; padding: 9px 12px; background: #EEF4E6; border: 1.5px solid #9DB98C; border-left: 5px solid var(--good); border-radius: 8px; color: #1F3318; }
.okc .why { margin: 0 0 12px; line-height: 1.55; }
.okc .subbar { margin-left: -16px; margin-right: -16px; }
@media (max-width: 899px) {
  .play:has(.cl.got) .hsg { display: none; }
}
@media (max-width: 899px) and (orientation: portrait) {
  .docs { position: relative; }
  .xemcau { position: absolute; left: 10px; right: 10px; bottom: 10px; width: auto; margin: 0; z-index: 5; }
  .play[data-m="docs"] .stage { padding-bottom: 76px; }
}
