:root {
  --bg: #F6EFE3;
  --paper: #FFFFFF;
  --ink: #2B2623;
  --muted: #7A6F64;
  --line: #E4D8C6;
  --leaf: #4E8F3E;
  --leaf-soft: #E7F2E1;
  --bean: #F2C94C;
  --bean-soft: #FBF1CF;
  --wrong: #C8463D;
  --wrong-soft: #F9E3E0;
  --sky: #7B95CF;
  --coral: #E97A63;
  --radius: 14px;
  --ui: "Be Vietnam Pro", system-ui, sans-serif;
  --kr-serif: "Noto Serif KR", "Batang", serif;
  --kr-sans: "Noto Sans KR", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.6 var(--ui); -webkit-font-smoothing: antialiased; padding-top: env(safe-area-inset-top); }
/* viewport-fit=cover: the page runs under the iPhone's status bar and Home bar, so the top is a plain strip, the sticky bars sit below it
   (top: env(safe-area-inset-top)) and everything fixed at the bottom or full screen adds env(safe-area-inset-bottom) */
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--bg); z-index: 50; pointer-events: none; }
/* Korean wraps between words, like the printed paper, instead of in the middle of a word */
body { word-break: keep-all; overflow-wrap: break-word; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }

.btn { border: 1px solid var(--line); background: var(--paper); padding: 9px 16px; border-radius: 10px; font-weight: 600; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.btn.primary:hover { background: var(--acc-press, #417a33); }
.btn.big { padding: 13px 22px; font-size: 16px; width: 100%; }
.btn.ghost { background: transparent; }

/* ---------- home ---------- */
.home { max-width: 560px; margin: 0 auto; padding: 40px 16px 60px; }
.hero { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hero .nep { width: 150px; height: 150px; flex: none; }
.bubble { background: var(--paper); border-radius: 18px; padding: 12px 16px; position: relative; box-shadow: 0 2px 10px rgba(80, 55, 30, .08); font-weight: 500; }
.bubble::before { content: ""; position: absolute; left: -8px; top: 50%; margin-top: -8px; border: 8px solid transparent; border-right-color: var(--paper); border-left: 0; }
.card { background: var(--paper); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 3px rgba(80, 55, 30, .06); }
.tag { display: inline-block; background: var(--bean-soft); color: var(--honey-ink, #7a5a06); font-size: 14px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.card h2 { margin: 10px 0 2px; font-size: 22px; }
.meta { color: var(--muted); margin: 0 0 14px; }
.perks { list-style: none; padding: 0; margin: 0 0 20px; }
.perks li { padding: 5px 0 5px 26px; position: relative; }
.perks li::before { content: ""; position: absolute; left: 4px; top: 12px; width: 10px; height: 6px; border-left: 2px solid var(--leaf); border-bottom: 2px solid var(--leaf); transform: rotate(-45deg); }
.stack { display: grid; gap: 10px; }
.fine { color: var(--muted); font-size: 14px; text-align: center; margin-top: 18px; }

/* ---------- exam picker ---------- */
.home.wide { max-width: 860px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--fill, #EDE3D3); padding: 5px; border-radius: 14px; margin-bottom: 14px; }
.tab { border: 0; background: none; border-radius: 10px; padding: 10px; font-weight: 700; font-size: 17px; color: var(--muted); }
.tab small { display: block; font-weight: 500; font-size: 14px; }
.tab.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(80, 55, 30, .1); }
.ex-list { display: grid; gap: 10px; }
.ex-card { display: flex; align-items: center; gap: 12px; background: var(--paper); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 1px 3px rgba(80, 55, 30, .06); }
.ex-main { flex: 1; min-width: 0; }
.ex-title { font-weight: 700; font-size: 17px; }
.ex-title span { font-weight: 500; color: var(--muted); }
.ex-meta { color: var(--muted); font-size: 14px; }
.ex-last { display: inline-block; margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--acc-ink, #2f5f24); background: var(--leaf-soft); border-radius: 6px; padding: 2px 8px; }
.ex-last.doing { color: var(--honey-ink, #7a5a06); background: var(--bean-soft); }

/* ---------- top bar ---------- */
.bar { position: sticky; top: env(safe-area-inset-top); z-index: 20; background: rgba(246, 239, 227, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.bar-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 6px; font-weight: 700; border: 0; background: none; padding: 0; }
.brand img { width: 34px; height: 34px; }
.bar .title { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; padding: 4px 10px; border-radius: 8px; background: var(--paper); }
.timer.low { background: var(--wrong-soft); color: var(--wrong); }
.count { color: var(--muted); font-size: 14px; white-space: nowrap; }

/* ---------- exam layout ---------- */
.layout { max-width: 1180px; margin: 0 auto; padding: 20px 16px 80px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.paper { background: var(--paper); border-radius: 6px; box-shadow: 0 1px 3px rgba(80, 55, 30, .08); padding: 34px 40px 40px; font-family: var(--kr-serif); font-size: 17px; line-height: 1.95; }
.paper-head { font-family: var(--kr-sans); font-weight: 700; font-size: 15px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 20px; display: flex; justify-content: space-between; gap: 10px; }
.grp { margin-bottom: 30px; }
.ins { font-family: var(--kr-sans); font-weight: 700; font-size: 15.5px; margin: 0 0 12px; line-height: 1.7; }
.box { border: 1px solid var(--ink); padding: 14px 18px; margin: 0 0 14px; }
.q { margin: 0 0 22px; scroll-margin-top: 80px; }
.qhead { display: flex; gap: 6px; }
.qno { font-weight: 600; flex: none; }
.stem { flex: 1; min-width: 0; }
.q .box { margin-top: 6px; }
.qimg { max-width: 100%; width: 492px; margin: 8px 0 8px 22px; border: 1px solid var(--line); }
.bogi { border: 1px solid var(--ink); padding: 10px 16px; margin: 10px 0 8px 22px; }
.bogi-t { display: block; text-align: center; font-family: var(--kr-sans); font-size: 14px; font-weight: 700; }
.opts { list-style: none; margin: 6px 0 0 16px; padding: 0; display: grid; gap: 2px 14px; }
.opts.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.opts.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opt { display: flex; gap: 8px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; padding: 3px 8px; border-radius: 8px; font-family: var(--kr-serif); font-size: 17px; line-height: 1.8; }
.exam-mode .opt:hover { background: var(--bg); }
.num { flex: none; width: 23px; height: 23px; margin-top: 5px; border: 1.5px solid var(--ink); border-radius: 50%; display: grid; place-items: center; font: 600 14px/1 var(--ui); }
.opt.sel .num { background: var(--ink); color: #fff; }
.blank { display: inline-block; white-space: nowrap; }
.blank i { display: inline-block; width: 4.5em; }
u { text-underline-offset: 4px; }

/* ---------- OMR ---------- */
.omr { position: sticky; top: 76px; }
.omr-card { background: var(--paper); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 3px rgba(80, 55, 30, .06); }
.omr-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-weight: 700; }
.omr-head span { font-weight: 500; color: var(--muted); font-size: 14px; }
.omr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.orow { display: flex; align-items: center; gap: 4px; padding: 2px 0; }
.ono { width: 26px; border: 0; background: none; text-align: right; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px 0 0; }
.ono:hover { color: var(--ink); }
.bub { width: 22px; height: 22px; border-radius: 50%; border: 1.3px solid var(--hair, #B9AC99); background: none; font-size: 11px; padding: 0; color: var(--ink2, #8f8272); }
.bub.sel { background: var(--ink); border-color: var(--ink); color: #fff; }
.bub.right { border-color: var(--leaf); background: var(--leaf); color: #fff; }
.bub.wrong { border-color: var(--wrong); background: var(--wrong); color: #fff; }
.bub.missed { border: 2px solid var(--leaf); color: var(--leaf); }
.omr-note { color: var(--muted); font-size: 14px; margin-top: 12px; line-height: 1.5; }
.omr-toggle { display: none; }
/* a finger on the answer sheet: bigger bubbles (two columns still fit a phone) */
@media (pointer: coarse) { .orow { gap: 3px; padding: 3px 0; } .bub { width: 30px; height: 30px; font-size: 13px; } .ono { font-size: 13px; } }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 65; background: rgba(43, 38, 35, .35); display: grid; place-items: center; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
.overlay.soft { background: rgba(246, 239, 227, .92); }
.modal { background: var(--paper); border-radius: 18px; padding: 24px; max-width: 380px; width: 100%; text-align: center; }
.modal h3 { margin: 0 0 6px; }
.modal p { margin: 0 0 18px; color: var(--muted); }
.modal .row { display: flex; gap: 10px; }
.modal .row .btn { flex: 1; }
.moment { text-align: center; }
.moment img { width: 220px; height: 220px; margin: 0 auto; }
.moment p { font-weight: 600; font-size: 18px; margin: 4px 0 0; }
/* the wait (app.js loadingHTML): Nếp hops to a tune in the middle of the screen, leaning one way then the other, a
   note floats up, "ĐANG TẢI..." small and grey under him. Nothing for the first 300 ms, so a quick load never
   flashes; only transform and opacity move. */
.ld { position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding-bottom: 6vh; background: var(--bg, #F4F1E9); animation: ld-in .2s ease-out .3s both; }
html.pop .ld.fx-push { animation: ld-in .2s ease-out .3s both; }   /* not slid in like a new screen (feel.js screenIn) */
@keyframes ld-in { from { opacity: 0; } }
.ld-nep { position: relative; width: clamp(136px, 38vw, 176px); aspect-ratio: 640 / 570; }
.ld-nep img { position: relative; display: block; width: 100%; height: 100%; transform-origin: 50% 83%; animation: ld-hop 1.4s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes ld-hop {
  0%, 50%, 100% { transform: translateY(0) scale(1.07, .93); }
  10%, 40%, 60%, 90% { transform: translateY(0) scale(1, 1); }
  25% { transform: translateY(-16%) scale(.97, 1.04) rotate(-6deg); }
  75% { transform: translateY(-16%) scale(.97, 1.04) rotate(6deg); }
}
.ld-sh { position: absolute; left: 22%; right: 22%; top: 78%; height: 11%; border-radius: 50%; background: radial-gradient(closest-side, rgba(60, 45, 25, .24), transparent);
  animation: ld-sh 1.4s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes ld-sh { 0%, 10%, 40%, 50%, 60%, 90%, 100% { transform: scaleX(1); opacity: 1; } 25%, 75% { transform: scaleX(.7); opacity: .55; } }
html[data-theme="dark"] .ld-sh { background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent); }
.ld-note { position: absolute; right: -2%; top: 2%; width: 16%; height: auto; aspect-ratio: 1; fill: var(--acc, #1FA463); opacity: 0; animation: ld-note 1.4s ease-out infinite; }
@keyframes ld-note { 0% { opacity: 0; transform: translate(0, 30%) rotate(-12deg) scale(.7); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(60%, -170%) rotate(14deg) scale(1); } }
.ld-t { margin: 0; padding-left: .14em; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3, #676D67); }
.ld-t b { font-weight: inherit; animation: ld-dot 1.2s infinite; }
.ld-t b:nth-child(2) { animation-delay: .2s; }
.ld-t b:nth-child(3) { animation-delay: .4s; }
@keyframes ld-dot { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ld-nep img, .ld-sh, .ld-t b { animation: none; } .ld-note { display: none; } }
/* the pop-in for Nếp, modals and toasts; html also carries "pop" as the name of the default look, and must not
   pop in itself: a whole page starting shrunk and see-through counts as nothing painted yet */
body .pop { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- result ---------- */
.result { max-width: 720px; margin: 0 auto; padding: 28px 16px 60px; }
.res-hero { display: grid; grid-template-columns: 170px 1fr; gap: 18px; align-items: center; background: var(--paper); border-radius: var(--radius); padding: 18px 22px; }
.res-hero img { width: 170px; height: 170px; }
.score { font-size: 46px; font-weight: 700; line-height: 1.1; }
.score small { font-size: 20px; color: var(--muted); font-weight: 600; }
.res-sub { color: var(--muted); margin: 4px 0 10px; }
.lvl { display: inline-block; background: var(--leaf-soft); color: var(--acc-ink, #2f5f24); border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.lvl small { display: block; font-weight: 400; color: var(--ink2, #4f6f47); font-size: 14px; }
.res-say { margin: 12px 0 0; font-weight: 500; }
.panel { background: var(--paper); border-radius: var(--radius); padding: 18px 22px; margin-top: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 16px; }
.brk { display: grid; grid-template-columns: minmax(0, 1fr) 120px 48px; gap: 8px 12px; align-items: center; font-size: 14px; }
.brk .range { color: var(--muted); font-size: 14px; }
.meter { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--leaf); border-radius: 99px; }
.meter.weak i { background: var(--bean); }
.brk .n { text-align: right; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 10px; margin-top: 18px; }
.actions .btn { flex: 1; padding: 12px; }

/* ---------- review ---------- */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 5px 12px; font-size: 14px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.hint { display: flex; align-items: center; gap: 10px; background: var(--bean-soft); border-radius: 10px; padding: 10px 14px; margin: 0 0 22px; font-family: var(--ui); font-size: 14px; line-height: 1.5; }
.hint img { width: 44px; height: 44px; flex: none; }
.q.hide, .grp.hide { display: none; }
.box.note { font: 14px/1.6 var(--ui); color: var(--honey-ink, #7a5a06); background: var(--bean-soft); border-color: var(--hair, #E9D59A); }
.q.off { opacity: .55; }
.q.off .mark { background: var(--bg); color: var(--muted); }
.orow.off .bub { opacity: .35; }
.alt { font-size: 14px; color: var(--muted); margin-top: 3px; }
.mark { display: inline-block; font: 600 14px/1 var(--ui); padding: 5px 8px; border-radius: 6px; margin-left: 6px; vertical-align: 3px; }
.q.ok .mark { background: var(--leaf-soft); color: var(--acc-ink, #2f5f24); }
.q.bad .mark { background: var(--wrong-soft); color: var(--wrong); }
.q.skip .mark { background: var(--bean-soft); color: var(--honey-ink, #7a5a06); }
.practice .opt.sel { background: var(--bean-soft); }
.opt.right { background: var(--leaf-soft); }
.opt.right .num { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.opt.wrong { background: var(--wrong-soft); }
.opt.wrong .num { background: var(--wrong); border-color: var(--wrong); color: #fff; }
.why { margin: 10px 0 0 16px; background: var(--bg); border-radius: 10px; padding: 10px 14px; font: 14.5px/1.65 var(--ui); }
.why b { color: var(--acc-ink, #2f5f24); }
.imgtext { margin: 4px 0 8px 22px; font-size: 15px; line-height: 1.8; color: var(--text, #4a423c); }
.imgtext span.lbl { font: 600 14px var(--ui); color: var(--muted); display: block; }
.ins-vi { margin: -8px 0 12px; font: 14px/1.5 var(--ui); color: var(--muted); }
.line-vi { display: block; font: 14px/1.55 var(--ui); color: var(--muted); }
.opts + .trans { margin: 8px 0 4px 16px; }
.weak-say { margin: 14px 0 8px; font-size: 14.5px; }
.kw-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kw { display: inline-flex; gap: 6px; align-items: baseline; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 3px 10px; font: 14px/1.4 var(--ui); }
.kw b { font: 600 14px var(--kr-sans); }
.kw.done { border-color: var(--leaf); background: var(--leaf-soft); }
.tip-box { margin: 8px 0 0 16px; background: var(--paper); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; font: 14px/1.6 var(--ui); }
.tip-box summary { cursor: pointer; padding: 10px 0; font-weight: 600; }
.tip-box p { margin: 6px 0 4px; }
.tip-box ol { margin: 0; padding-left: 20px; }
@media (max-width: 640px) { .tip-box { margin-left: 0; } }
.w { cursor: pointer; border-radius: 3px; transition: background .1s; }
.w:hover, .w.on { background: var(--bean-soft); box-shadow: 0 0 0 2px var(--bean-soft); }
.saved-w { text-decoration: underline dotted var(--leaf) 2px; text-underline-offset: 5px; }

/* ---------- tooltip ---------- */
.tip { position: fixed; z-index: 60; width: 300px; max-width: calc(100vw - 24px); background: var(--paper); border-radius: 14px; box-shadow: 0 8px 30px rgba(43, 38, 35, .18); padding: 12px 14px; font: 14px/1.5 var(--ui); }
.tip-word { font: 600 18px/1.3 var(--kr-sans); margin-bottom: 6px; }
.tip-lem { border-top: 1px solid var(--line); padding: 8px 0; }
.tip-lem:first-of-type { border-top: 0; padding-top: 2px; }
.tip-lem .top { display: flex; align-items: baseline; gap: 6px; }
.tip-lem .dict { font: 600 15px var(--kr-sans); }
.pos { color: var(--muted); font-size: 14px; }
.vi { font-weight: 500; }
.hv { display: inline-block; margin-top: 3px; font-size: 14px; color: var(--honey-ink, #7a5a06); background: var(--bean-soft); border-radius: 6px; padding: 1px 7px; }
.save { float: right; border: 1px solid var(--line); background: none; border-radius: 8px; font-size: 14px; padding: 2px 8px; margin-top: -2px; }
.save.done { border-color: var(--leaf); color: var(--leaf); }
.tip-gram { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 4px; font-size: 14px; }
.tip-gram b { font-family: var(--kr-sans); font-weight: 600; margin-right: 4px; }
.tip-pat { display: grid; gap: 4px; background: var(--bean-soft); border-radius: 10px; padding: 7px 10px; margin-bottom: 6px; font-size: 14px; }
.tip-pat b { display: block; font: 600 15px var(--kr-sans); }

/* ---------- word book ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 55; width: 360px; max-width: 100vw; background: var(--paper); box-shadow: -8px 0 30px rgba(43, 38, 35, .15); padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom)); overflow: auto; }
.drawer h3 { margin: 0; display: flex; justify-content: space-between; align-items: center; }
.drawer .empty { color: var(--muted); }
.wb-item { border-bottom: 1px solid var(--line); padding: 10px 0; }
.wb-item .dict { font: 600 17px var(--kr-sans); }
.wb-item .rm { float: right; min-width: 44px; min-height: 44px; margin: -10px -8px 0 0; border: 0; background: none; color: var(--muted); font-size: 14px; }

/* ---------- skills ---------- */
.skills { display: flex; gap: 8px; margin: -4px 0 14px; }
.skill { flex: 1; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 8px 10px; font-weight: 700; font-size: 16px; }
.skill small { display: block; font: 500 14px var(--kr-sans); color: var(--muted); }
.skill.on { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.skill.on small { color: #dcefd5; }
.btn.small { padding: 5px 12px; font-size: 14px; }

/* ---------- listening ---------- */
.player { display: flex; align-items: center; gap: 8px; }
.ptime { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; white-space: nowrap; }
.rplayer { max-width: 1180px; margin: 0 auto; padding: 0 16px 10px; display: flex; align-items: center; gap: 10px; }
.rplayer input[type=range] { flex: 1; accent-color: var(--leaf); }
.q.now { background: var(--bean-soft); box-shadow: 0 0 0 10px var(--bean-soft); border-radius: 4px; }
.orow.now .ono { color: var(--ink); background: var(--bean); border-radius: 4px; }
.opts.pics { gap: 10px 14px; }
.opts.pics .opt { align-items: center; }
.optimg { width: 100%; max-width: 230px; border: 1px solid var(--line); background: var(--card, #fff); }
/* beside its number the picture takes only the room left, so it never pokes out of a narrow column */
.opt .optimg { flex: 1 1 0; min-width: 0; }
.sample .opts { margin-left: 0; }
.sample .opt { cursor: default; }
.sample-ans .num { background: var(--ink); color: var(--bg, #fff); }   /* --ink turns light in dark: the number takes the page colour, not white on white */
.relisten { margin: 8px 0 0 16px; }
.script { margin: 10px 0 0 16px; background: var(--bg); border-radius: 10px; padding: 8px 14px; font-family: var(--kr-sans); font-size: 15.5px; line-height: 1.85; }
.grp > .script { margin: 0 0 14px; }
.script summary { cursor: pointer; font: 600 14px var(--ui); color: var(--acc-ink, #2f5f24); }
.script p { margin: 6px 0; }
.sp { display: inline-block; font: 600 14px var(--ui); color: var(--muted); background: var(--paper); border-radius: 6px; padding: 1px 7px; margin-right: 6px; vertical-align: 2px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 16px; font-weight: 500; max-width: calc(100vw - 32px); width: max-content; }   /* left: 50% alone left it half the screen to wrap in */

/* ---------- writing ---------- */
.wlayout { max-width: 860px; margin: 0 auto; padding: 20px 16px 80px; }
.paper.writing { font-size: 16px; }
.wq { margin: 0 0 30px; scroll-margin-top: 80px; }
.wq-body { display: flex; gap: 6px; align-items: flex-start; }
.wimg { max-width: 100%; width: 640px; margin: 4px 0 10px; }
.wq-body .wimg { min-width: 0; }   /* beside the "51." it shrinks to what is left, not past the paper's edge on a phone */
.w-input { font-family: var(--ui); }
.blank-in { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.blank-in span { font: 600 18px var(--kr-sans); flex: none; width: 24px; }
.blank-in input, .w-input textarea { flex: 1; width: 100%; font: 17px/1.8 var(--kr-sans); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--card2, #FFFDF8); color: var(--ink); }
.w-input textarea { resize: vertical; display: block; }
.blank-in input:focus, .w-input textarea:focus { outline: 2px solid var(--leaf); border-color: var(--leaf); }
.counter { color: var(--muted); font-size: 14px; margin-top: 4px; text-align: right; }
.fine.left { text-align: left; font-family: var(--ui); }
.cmp { font-family: var(--ui); margin-top: 6px; }
.cmp-row { display: flex; gap: 8px; margin-bottom: 6px; }
.cmp-row .k { font: 600 18px var(--kr-sans); width: 24px; flex: none; }
.cmp .lbl { font-size: 14px; color: var(--muted); font-weight: 600; margin-top: 6px; }
.mine, .model { font: 16.5px/1.85 var(--kr-sans); }
.mine { background: var(--bg); border-radius: 8px; padding: 6px 12px; }
.model { background: var(--leaf-soft); border-radius: 8px; padding: 6px 12px; margin-top: 4px; }
.essay p { margin: 0 0 8px; text-indent: 1em; }
.mine i, .model i { color: var(--muted); font-family: var(--ui); }
.marks { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px 32px; }
.rubric { font-size: 14px; color: var(--text, #4a423c); background: var(--bean-soft); border-radius: 8px; padding: 8px 12px; margin-top: 10px; }
.good { color: #2f5f24; }
.warn { color: var(--wrong); }
.selfscore { font-weight: 700; color: var(--acc-ink, #2f5f24); white-space: nowrap; }

@media (max-width: 920px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .omr { display: none; position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; padding-bottom: env(safe-area-inset-bottom); }
  .omr.open { display: block; }
  .omr-card { border-radius: 18px 18px 0 0; max-height: 62vh; overflow: auto; box-shadow: 0 -8px 30px rgba(43, 38, 35, .18); }
  .omr-toggle { display: block; position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 41; background: var(--ink); color: #fff; border: 0; border-radius: 999px; padding: 11px 20px; font-weight: 600; box-shadow: 0 6px 20px rgba(43, 38, 35, .25); }
  .omr.open + .omr-toggle { bottom: calc(62vh + 12px); }
}
.btn, .chip, .omr-toggle { white-space: nowrap; }
@media (max-width: 640px) {
  .review-bar .bar-in { flex-wrap: wrap; row-gap: 8px; }
  .review-bar .title { display: block; }
  .review-bar .filters { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .paper { padding: 22px 16px 28px; font-size: 16px; }
  .opt { font-size: 16px; }
  .opts { margin-left: 0; }
  .opts.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opts.c2 { grid-template-columns: minmax(0, 1fr); }
  .qimg, .bogi, .imgtext { margin-left: 0; }
  .why, .opts + .trans { margin-left: 0; }
  .bar .title, .count { display: none; }
  .practice-bar .count { display: block; margin-left: auto; }
  /* a bar with no buttons (cards, results) has room for its title */
  .bar-in:not(:has(.btn)) :is(.title, .count) { display: block; }
  .res-hero { grid-template-columns: 1fr; text-align: center; }
  .res-hero img { margin: 0 auto; }
  .brk { grid-template-columns: minmax(0, 1fr) 70px 40px; }
  .hero .nep { width: 110px; height: 110px; }
  .player .ptime { display: none; }
  .bar-in { gap: 8px; }
  .brand { font-size: 0; gap: 0; }
  .player .btn, .bar .btn.primary { padding: 8px 10px; font-size: 14px; }
  /* the listening controls take what the bar has left, so the bar never runs off a phone screen */
  .bar-in > .player { flex: 1 1 auto; min-width: 0; }
  .player .btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .player:has(#seek) .pl-w { display: none; }
  .timer { font-size: 16px; padding: 4px 6px; }
  .opts.pics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .relisten, .script { margin-left: 0; }
  .marks { margin-left: 0; }
  .selfscore { font-size: 14px; }
}

/* ---------- Nếp ---------- */
[data-nep] { cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-user-drag: none; }
.squish { transform-origin: 50% 90%; animation: squish .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes squish { 0% { transform: scale(1.1, .84); } 100% { transform: scale(1); } }
/* the animation frame leaves room for notes and stars around Nếp, so small spots show it a bit larger */
.brand img { width: 48px; height: 48px; margin: -8px -4px -8px -8px; }
.hint img { width: 56px; height: 56px; margin: -6px -2px -6px -6px; }
.hero .nep { width: 176px; height: 176px; margin: -10px -6px -10px -14px; }
@media (max-width: 640px) { .hero .nep { width: 130px; height: 130px; } }

/* ---------- home dashboard ---------- */
.back { border: 0; background: none; color: var(--muted); font-weight: 600; padding: 0; margin: -18px 0 8px; }
.back:hover { color: var(--ink); }
.sec { font-size: 17px; margin: 24px 0 10px; }
.feats { display: grid; gap: 10px; }
.feats.three { grid-template-columns: repeat(3, 1fr); }
.feat { position: relative; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--paper); border: 1px solid transparent; border-radius: var(--radius); padding: 14px; box-shadow: 0 1px 3px rgba(80, 55, 30, .06); }
button.feat:hover { border-color: var(--leaf); }
.feat b { display: block; font-size: 16px; }
.feat small { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; }
.feat.big { flex-direction: column; text-align: center; gap: 2px; padding: 8px 10px 14px; }
.feat.big img { width: 120px; height: 120px; margin: -6px 0 -8px; }
.feat.big b { font-size: 18px; }
.empty-note { color: var(--muted); background: var(--paper); border-radius: var(--radius); padding: 14px 16px; margin: 0; }

/* ---------- writing: typed or handwritten ---------- */
.wmode { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 18px; font-family: var(--ui); font-size: 14px; }
.wmode span { color: var(--muted); }
.pen-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 18px; font-family: var(--ui); font-size: 14px; }
.pen-tools span { color: var(--muted); flex-basis: 100%; }
.pen-sheet { position: relative; width: 100%; background: var(--card2, #FFFDF7); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.pen-sheet canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pen-ink { touch-action: none; cursor: crosshair; }
.pen-img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 6px; margin: 6px 0 12px; background: var(--card, #fff); }
.upload { font-family: var(--ui); background: var(--bean-soft); border-radius: 12px; padding: 12px 14px; margin-bottom: 20px; font-size: 14px; line-height: 1.55; }
.upload p { margin: 0 0 10px; }
.up-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.up-actions .btn { text-decoration: none; color: inherit; cursor: pointer; }
.up-actions .btn.primary { color: #fff; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumbs figure { margin: 0; width: 120px; }
.thumbs img { width: 120px; height: 160px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; background: var(--card, #fff); }
.thumbs figcaption { font-size: 14px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.thumbs figcaption button { border: 0; background: none; color: var(--wrong); font-size: 14px; padding: 0; }
.thumbs .empty-note { width: 100%; font-size: 14px; padding: 10px 12px; }
.mine-photos { margin-bottom: 16px; }
.photo-view { background: rgba(20, 18, 16, .85); flex-direction: column; gap: 8px; }
.photo-view img { max-width: 96vw; max-height: 86vh; border-radius: 6px; }
.photo-view p { color: #ddd; margin: 0; font-size: 14px; }
@media (max-width: 640px) {
  .thumbs figure, .thumbs img { width: 96px; }
  .thumbs img { height: 128px; }
}

/* ---------- flashcards ---------- */
.fc-wrap { max-width: 460px; margin: 0 auto; padding: 32px 16px 60px; }
.fcard { background: var(--paper); border-radius: 22px; box-shadow: 0 6px 24px rgba(80, 55, 30, .1); padding: 34px 22px 26px; text-align: center; min-height: 300px; display: flex; flex-direction: column; justify-content: center; gap: 6px; cursor: pointer; }
.fcard.flip { cursor: default; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.fcard .kw { font: 700 40px/1.2 var(--kr-sans); justify-content: center; }
/* the card turns over in 3D, both ways */
.fc-card { position: relative; min-height: 320px; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.3, 1.3, .5, 1); cursor: pointer; }
.fc-card.flipped { transform: rotateY(180deg); }
.fc-card .fcard { position: absolute; inset: 0; min-height: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.fc-card .fc-rear { transform: rotateY(180deg); }
.fcard .kw.sm { font-size: 26px; }
.call-next { margin: 0 0 12px; }
.call-next small { display: block; font-size: 14px; font-weight: 600; opacity: .7; }
.call-next b { display: block; font-size: 19px; line-height: 1.3; }
.fc-rear .vi { font-size: 20px; font-weight: 600; margin: 10px 0 6px; }
@media (prefers-reduced-motion: reduce) { .fc-card { transition: none; } }
.fc-hint { color: var(--muted); margin-top: 18px; font-size: 14px; }
.fc-back { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.fc-back .vi { font-size: 19px; margin-bottom: 6px; }
.fc-ex { margin-top: 14px; color: var(--muted); font-size: 14px; }
.fc-actions { display: flex; gap: 10px; margin-top: 16px; }
.fc-actions .btn { flex: 1; }

/* ---------- Nếp reviewing with you ---------- */
/* In chữa bài it sits above the answer sheet; in the writing review it floats in the corner */
.coach { display: flex; align-items: center; gap: 2px; margin-bottom: 10px; }
.coach-nep { width: 78px; height: 78px; flex: none; margin: -8px -4px -8px -10px; }
.coach-say { flex: 1; background: var(--paper); border-radius: 14px 14px 14px 4px; padding: 8px 12px; font-size: 14px; line-height: 1.45; box-shadow: 0 1px 3px rgba(80, 55, 30, .08); }
.wlayout ~ .coach { position: fixed; left: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 30; max-width: 330px; margin: 0; }
.wlayout ~ .coach .coach-say { box-shadow: 0 4px 18px rgba(43, 38, 35, .14); }

@media (max-width: 640px) {
  .feats.three { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .feat.big { padding: 4px 4px 10px; }
  .feat.big img { width: 84px; height: 84px; }
  .feat.big small { font-size: 14px; }
  .wlayout ~ .coach { left: 6px; bottom: 8px; max-width: calc(100vw - 20px); }
}
/* On phones the answer sheet is a bottom drawer: keep Nếp visible above the drawer button */
@media (max-width: 920px) {
  .review-mode .omr { display: block; pointer-events: none; padding: 0 8px 62px; }
  .review-mode .omr .omr-card { display: none; }
  .review-mode .omr.open { padding-bottom: 0; }
  .review-mode .omr.open .omr-card { display: block; pointer-events: auto; }
  .review-mode .omr .coach { pointer-events: auto; max-width: 340px; }
  .review-mode .omr .coach-say { box-shadow: 0 4px 18px rgba(43, 38, 35, .16); }
  .review-mode .omr.open .coach { display: none; }
}

/* ---------- home: Nếp's suggestion and plain lists ---------- */
.guide { display: flex; align-items: center; gap: 6px; background: var(--paper); border-radius: 18px; padding: 8px 20px 8px 4px; box-shadow: 0 1px 3px rgba(80, 55, 30, .06); }
.guide .nep { width: 176px; height: 176px; flex: none; margin: -14px -8px -14px -10px; }
.guide.small .nep { width: 120px; height: 120px; margin: -10px -6px; }
.guide-body { flex: 1; min-width: 0; }
.guide .say { font-size: 17px; font-weight: 600; line-height: 1.5; margin: 0 0 12px; }
.guide.small .say { font-size: 15px; font-weight: 500; margin: 0; }
.guide-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.guide-actions .btn.primary { padding: 11px 20px; font-size: 15.5px; }
.loop { margin: 14px 0 2px; font-size: 14px; color: var(--muted); }
.loop b { color: var(--acc-ink, #2f5f24); }
.me { margin: 0; font-size: 14px; color: var(--muted); }
.home .guide + .tabs { margin-top: 16px; }
.list { background: var(--paper); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(80, 55, 30, .06); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: none; padding: 13px 16px; }
.li + .li { border-top: 1px solid var(--line); }
.li:hover { background: var(--card2, #FBF7F0); }
.li span { flex: 1; min-width: 0; }
.li b { display: block; font-size: 15.5px; }
.li small { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; }
.li em { font-style: normal; color: var(--muted); font-size: 14px; white-space: nowrap; }
.li em.weak { color: var(--wrong); font-weight: 600; }
.paper.practice .actions { margin-top: 10px; }
.chart { width: 100%; height: auto; display: block; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .gt { font: 11px var(--ui); fill: var(--muted); text-anchor: end; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
@media (max-width: 640px) {
  .guide { flex-direction: column; text-align: center; padding: 4px 16px 16px; }
  .guide .nep { margin: -10px auto -14px; width: 150px; height: 150px; }
  .guide.small { flex-direction: row; text-align: left; padding: 6px 14px 6px 2px; }
  .guide.small .nep { width: 96px; height: 96px; margin: -8px -6px; }
  .guide-actions { justify-content: center; }
}

/* ---------- home: main tests big, side features small ---------- */
.feat.big { padding: 12px 12px 18px; }
.feat.big > span { display: block; }
.feat.big img { width: 150px; height: 150px; margin: -8px auto -10px; }
.feat.big b { font-size: 20px; }
.feat.big em { display: inline-block; margin-top: 8px; font-style: normal; font-size: 14px; font-weight: 600; color: var(--acc-ink, #2f5f24); background: var(--leaf-soft); border-radius: 6px; padding: 2px 8px; }
/* ---------- review page: today's cards, sticker stats, three ways to review, words just saved ---------- */
.c-bean { --c: var(--bean); } .c-sky { --c: var(--sky); } .c-coral { --c: var(--coral); }
.c-leaf { --c: var(--leaf); } .c-paper { --c: var(--paper); }
.c-orange { --c: var(--orange, var(--coral)); } .c-pink { --c: var(--pink, var(--coral)); }
.rv { display: grid; gap: 14px; }
.rv-how { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink2, var(--ink)); }
.rv-hero { display: flex; align-items: center; gap: 4px; text-align: left; background: var(--bean); border: 0; border-radius: var(--radius); padding: 10px 20px 10px 0; min-height: 190px; }
.rv-nep { width: 190px; height: 190px; flex: none; margin: -10px -6px -10px -8px; }
.rv-hero-body { display: grid; gap: 4px; justify-items: start; }
.rv-hero-body small { font-size: 14px; font-weight: 600; opacity: .75; }
.rv-hero-body b { font-size: 26px; line-height: 1.15; letter-spacing: -.02em; }
.rv-hero-body > span { max-width: 44ch; font-size: 14.5px; line-height: 1.5; }
.rv-hero-body .btn { margin-top: 8px; font-style: normal; }
.rv-hero-body .btn.primary { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.rv-badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 1; max-width: 132px; width: 100%; margin: 0 auto; text-align: center; }
.badge svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.badge svg * { fill: var(--c); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.badge b { position: relative; font-size: 30px; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.badge span { position: relative; font-size: 11.5px; font-weight: 600; line-height: 1.25; max-width: 10ch; }
.rv-tiles { display: grid; gap: 10px; }
.rv-tile { display: flex; align-items: center; gap: 4px; text-align: left; background: var(--c); border: 0; border-radius: var(--radius); padding: 4px 18px 4px 2px; }
.rv-tile img { width: 84px; height: 84px; flex: none; }
.rv-tile span { flex: 1; min-width: 0; }
.rv-tile b { display: block; font-size: 17px; }
.rv-tile small { display: block; font-size: 14px; line-height: 1.4; opacity: .8; }
.rv-tile i { font-style: normal; font-size: 22px; font-weight: 700; }
.rv-words { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-word { display: inline-flex; align-items: baseline; gap: 6px; background: var(--paper); border-radius: 999px; padding: 6px 14px; }
.rv-word b { font: 600 16px var(--kr-sans); }
.rv-word.looked { border: 2px dashed var(--ink) !important; background: transparent; }
.rv-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.rv-word small { color: var(--muted); font-size: 14px; }
@media (min-width: 760px) {
  .rv { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; }
  .rv-badges { align-content: center; }
  .rv-tiles { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .rv-tile { flex-direction: column; align-items: flex-start; padding: 6px 16px 16px; }
  .rv-tile img { width: 96px; height: 96px; margin-left: -10px; }
  .rv-tile i { align-self: flex-end; margin-top: -26px; }
  .rv > .sec, .rv-words { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .rv-nep { width: 140px; height: 140px; }
  .rv-hero-body b { font-size: 22px; }
}
.minis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini { display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: var(--paper); border: 1px solid transparent; border-radius: var(--radius); padding: 6px 12px 12px; box-shadow: 0 1px 3px rgba(80, 55, 30, .06); }
.mini:hover, .feat.big:hover { border-color: var(--leaf); }
.mini img { width: 64px; height: 64px; margin: 0 0 0 -10px; }
.mini b { font-size: 14px; line-height: 1.3; }
.mini small { color: var(--muted); font-size: 14px; line-height: 1.35; margin-top: 2px; }
@media (max-width: 640px) {
  .feats.three { grid-template-columns: 1fr; gap: 8px; }
  .feat.big { flex-direction: row; text-align: left; align-items: center; gap: 10px; padding: 6px 14px 6px 4px; }
  .feat.big img { width: 104px; height: 104px; margin: -6px -4px; flex: none; }
  .feat.big small { font-size: 14px; }
  .minis { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mini { padding: 4px 10px 10px; }
  .mini img { width: 54px; height: 54px; }
  .mini b { font-size: 14px; }
  .mini small { font-size: 14px; }
}

/* ---------- test modes ---------- */
.mode-pick { text-align: left; max-width: 430px; }
.mode-pick h3 { font-size: 17px; }
.mode-pick > p { margin-bottom: 12px; }
.mode-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.mode-opt:has(input[type=radio]:checked) { border-color: var(--leaf); background: var(--leaf-soft); }
.mode-opt input[type=radio] { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--leaf); }
.mode-opt b { display: block; font-size: 15.5px; }
.mode-opt small { display: block; color: var(--muted); font-size: 14px; line-height: 1.45; }
.mode-opt .timed { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; }
.mode-opt .timed { min-height: 40px; }
.mode-opt .timed input { accent-color: var(--leaf); width: 20px; height: 20px; }
.mode-pick .row { margin-top: 6px; }
.tag-mode { display: inline-block; font-size: 14px; font-weight: 600; color: var(--honey-ink, #7a5a06); background: var(--bean-soft); border-radius: 6px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }
.timer.up { background: var(--leaf-soft); color: var(--acc-ink, #2f5f24); }
.player input[type=range] { width: 160px; accent-color: var(--leaf); }
.tip-src { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; font-size: 14px; color: var(--muted); }
@media (max-width: 640px) { .player input[type=range] { flex: 1 1 0; width: auto; min-width: 24px; } }

/* ---------- home: two columns on wide screens ---------- */
.home.dash { max-width: 1200px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "guide" "tests" "speak" "side" "recent"; gap: 0 24px; padding-top: 14px; }
.area-top { grid-area: top; }
.area-guide { grid-area: guide; }
.area-tests { grid-area: tests; }
.area-side { grid-area: side; }
.area-recent { grid-area: recent; }
.today { display: none; }
@media (min-width: 1000px) {
  .home.dash { grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "top top" "guide side" "tests side" "speak side" "recent side"; align-items: start; padding-top: 18px; }
  .area-side { grid-row: 2 / span 4; position: sticky; top: 20px; }
  .today { display: block; background: var(--paper); border-radius: 18px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(80, 55, 30, .06); }
  .today-big { display: flex; align-items: baseline; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
  .today-big b { font-size: 38px; line-height: 1; color: #2f5f24; }
  .today-big span { color: var(--muted); }
  .today-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14.5px; }
  .today-row span { color: var(--muted); }
  .area-side .sec { margin-top: 20px; }
  .area-side .minis { grid-template-columns: 1fr; gap: 6px; }
  .area-side .mini { flex-direction: row; align-items: center; gap: 10px; padding: 4px 14px 4px 6px; }
  .area-side .mini img { width: 52px; height: 52px; margin: 0; flex: none; }
  .area-side .mini b { font-size: 14.5px; }
  .area-side .mini small { margin-top: 0; }
  .area-side .mini span { display: block; }
  .home.dash .guide .nep { width: 190px; height: 190px; }
  .home.dash .feat.big img { width: 170px; height: 170px; }
}
.mini span b, .mini span small { display: block; }

/* ---------- account ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.logo { display: flex; align-items: center; gap: 4px; font-size: 17px; }
.logo img { width: 44px; height: 44px; margin: -6px -2px -6px -8px; }
.account { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 14px 4px 4px; font-weight: 600; }
.account img { width: 30px; height: 30px; border-radius: 50%; }
.account-in { border-radius: 999px; }
.account-box { text-align: center; }
.account-box .avatar { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 8px; }
.account-box .nep-av { width: 120px; height: 120px; border-radius: 0; margin: -16px auto -6px; }
.account-box .small { font-size: 14px; color: var(--muted); }
.devices { text-align: left; margin: 12px 0 14px; font-size: 14px; }
.devices:empty { display: none; }
.device { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.device:first-of-type { margin-top: 6px; }
.device small { display: block; color: var(--muted); font-size: 14px; }
.device .btn { padding: 6px 12px; font-size: 14px; }
.gbtn { display: flex; justify-content: center; min-height: 44px; margin-bottom: 10px; }
.apple-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 260px; max-width: 100%; height: 42px; margin: 0 auto; border: 0; border-radius: 999px; background: #000; color: #fff; font: 600 15px var(--ui); cursor: pointer; }
.apple-btn svg { margin-top: -3px; }
.legal { margin: 14px 0; font-size: 14px; color: var(--muted); }
.legal a { color: inherit; text-decoration: underline; }
.warn-box { background: var(--bean-soft); color: var(--honey-ink, #6b4f05) !important; border-radius: 10px; padding: 10px 12px; font-size: 14px; text-align: left; }

/* ---------- idioms ---------- */
.search { width: 100%; font: inherit; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); margin-bottom: 12px; }
.search:focus { outline: 2px solid var(--leaf); border-color: var(--leaf); }
.idioms { display: grid; gap: 8px; }
.idiom { background: var(--paper); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(80, 55, 30, .06); }
.idiom summary { list-style: none; cursor: pointer; padding: 12px 16px; display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: baseline; }
.idiom summary::-webkit-details-marker { display: none; }
.iw { font: 700 20px var(--kr-sans); grid-row: span 2; }
.ih { color: var(--muted); font-size: 14px; }
.ivi { font-size: 14.5px; }
.idiom-body { padding: 0 16px 14px; font-size: 14.5px; }
.idiom-body p { margin: 6px 0; }
.idiom-body .kr { font-family: var(--kr-sans); font-size: 15px; }
.idiom-body .ex { background: var(--bg); border-radius: 8px; padding: 6px 10px; }
.small { font-size: 14px; color: var(--muted); }
.center { text-align: center; }
.quiz { margin-top: 14px; }
.quiz-head { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.qk { margin: 0 0 8px; font-weight: 600; }
.big-idiom { font: 700 34px var(--kr-sans); text-align: center; margin: 8px 0 14px; }
.big-idiom small { display: block; font: 500 16px var(--ui); color: var(--muted); }
.big-idiom.vi { font: 700 26px var(--ui); }
.gap-sent { font: 17px/1.8 var(--kr-sans); background: var(--bg); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.quiz .opt { font-family: var(--ui); font-size: 15.5px; }
.quiz .opt small { color: var(--muted); }
.quiz-nep { width: 160px; height: 160px; margin: 0 auto; }

/* ---------- hello screen ---------- */
/* Warm cream to the edges and a short 3D clip of Nep on it, like an app's launch screen (index.html plays it). The
   clip's own background is this same flat cream; on a wide screen it sits in the middle and its sides fade into it. */
/* As tall as the largest viewport (lvh), not pinned to the bottom: on an iPhone the bottom edge of `inset: 0` is the small
   viewport's, so with Safari's bar tucked away or from the home screen a strip of the page (black in dark mode) showed */
.splash { position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100lvh; z-index: 100; overflow: hidden; cursor: pointer;
  -webkit-tap-highlight-color: transparent; background: #F3EDE3; transition: opacity .4s ease-out; }
.splash.fade { opacity: 0; pointer-events: none; }
/* By season (<html data-season>, index.html seasonOf): the ground (--season-bg) and what drifts down over it
   (--season-fall-*: two colours and a shape). Autumn: warm yellow to orange, golden leaves. Each is its own layer
   (.hs-bg, .hs-fall) so a new look can swap them; the falling bits move by transform only. */
.splash { --season-bg: #F3EDE3; --season-fall-a: transparent; --season-fall-b: transparent; --season-fall-r: 50%; --season-fall-on: none; }
[data-season="autumn"] .splash { --season-bg: radial-gradient(120% 70% at 50% 42%, #FFF1CF 0%, #FCD98A 55%, #F2B15B 100%);
  --season-fall-a: #F2B33D; --season-fall-b: #E07A2E; --season-fall-r: 0 80% 0 80%; --season-fall-on: block; }
[data-season="spring"] .splash { --season-bg: radial-gradient(120% 70% at 50% 42%, #FFF7F8 0%, #FBE3EA 100%);
  --season-fall-a: #F7B8C9; --season-fall-b: #F48FAA; --season-fall-r: 80% 0 80% 50%; --season-fall-on: block; }
[data-season="winter"] .splash { --season-bg: radial-gradient(120% 70% at 50% 42%, #FFFFFF 0%, #E3EEF8 100%);
  --season-fall-a: #FFFFFF; --season-fall-b: #DDE9F5; --season-fall-r: 50%; --season-fall-on: block; }
.hs-bg { position: absolute; inset: 0; background: var(--season-bg); }
.hs-fall { position: absolute; inset: 0; display: var(--season-fall-on); pointer-events: none; }
.hs-fall i { position: absolute; top: -40px; left: var(--x); width: calc(24px * var(--s)); height: calc(24px * var(--s));
  border-radius: var(--season-fall-r); background: linear-gradient(135deg, var(--season-fall-a), var(--season-fall-b));
  box-shadow: 0 1px 2px rgba(120, 60, 0, .15); will-change: transform; animation: hs-fall var(--t) linear var(--d) infinite; }
.hs-fall i:nth-child(odd) { animation-name: hs-fall2; }
@keyframes hs-fall { 0% { transform: translate3d(0, 0, 0) rotate(0); } 25% { transform: translate3d(28px, 27vh, 0) rotate(90deg); }
  50% { transform: translate3d(-10px, 54vh, 0) rotate(200deg); } 75% { transform: translate3d(24px, 81vh, 0) rotate(290deg); } 100% { transform: translate3d(0, calc(100vh + 80px), 0) rotate(380deg); } }
@keyframes hs-fall2 { 0% { transform: translate3d(0, 0, 0) rotate(20deg); } 33% { transform: translate3d(-30px, 36vh, 0) rotate(-80deg); }
  66% { transform: translate3d(14px, 72vh, 0) rotate(-170deg); } 100% { transform: translate3d(-20px, calc(100vh + 80px), 0) rotate(-260deg); } }
@media (prefers-reduced-motion: reduce) { .hs-fall i { animation-duration: calc(var(--t) * 2.4); } }   /* slower, never frozen */
/* into the app: the ground fades by opacity only (the cream under it goes at once), so it stays smooth while the
   page under it is still busy */
.splash.fly { background: transparent; pointer-events: none; }
.splash.fly .hs-bg, .splash.fly .hs-fall { opacity: 0; transition: opacity .5s ease-out; }
.splash.still .hs-bg, .splash.still .hs-fall { display: none; }
.seen-hi .splash { display: none; }
.hs-vid, .hs-end { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease-out; }
.hs-end { display: none; }
.splash.still .hs-vid, .splash.still .hs-rig { display: none; }
.hs-rig { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .4s ease-out; }
/* Nếp's layers (nep-rig.js rigSplashPlay) on the 640x570 frame of the renders, scaled to the screen */
.hs-f, .hs-f b, .hs-f i { position: absolute; left: 0; top: 0; }
.hs-f { width: 640px; height: 570px; transform-origin: 0 0; }
.hs-f i { background-repeat: no-repeat; }
.splash.fade .hs-rig { transform: scale(.92); }
.splash.still .hs-end { display: block; }
.splash.fade .hs-vid, .splash.fade .hs-end { transform: scale(.92); }
@media (min-aspect-ratio: 4/5) {
  /* the clip's flat cream is the page's own; a thin fade at its sides only softens what the close-up crops */
  .hs-vid, .hs-end { object-fit: contain;
    -webkit-mask-image: linear-gradient(90deg, transparent calc(50% - 28vh), #000 calc(50% - 24vh), #000 calc(50% + 24vh), transparent calc(50% + 28vh));
    mask-image: linear-gradient(90deg, transparent calc(50% - 28vh), #000 calc(50% - 24vh), #000 calc(50% + 24vh), transparent calc(50% + 28vh)); }
}

/* ---------- paragraph translation ---------- */
.trans { margin: -6px 0 14px; font: 15px/1.65 var(--ui); }
.bogi + .trans { margin: -2px 0 10px 22px; }
.trans summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--acc-ink, #2f5f24); background: var(--fill, #eaf2e3); border-radius: 999px; padding: 4px 14px; list-style: none; user-select: none; white-space: pre; }
.trans summary::-webkit-details-marker { display: none; }
.trans summary::before { content: "+ "; }
.trans[open] summary::before { content: "− "; }
.trans p { margin: 8px 0 0; padding: 12px 16px; background: var(--card2, #f5f9f1); border-left: 3px solid var(--hair, #9cc28a); border-radius: 0 10px 10px 0; white-space: pre-line; word-break: normal; }

/* ---------- speaking practice ---------- */
.area-speak { grid-area: speak; }
.feat.wide { width: 100%; padding: 6px 18px 6px 6px; gap: 6px; }
.feat.wide img { width: 120px; height: 120px; margin: -8px -4px -8px -6px; flex: none; }
.feat.wide b { font-size: 18px; }
.feat.wide small { font-size: 14px; margin-top: 2px; }
.feat.wide em { display: inline-block; margin-top: 6px; font-style: normal; font-size: 14px; font-weight: 700; color: #fff; background: var(--leaf); border-radius: 6px; padding: 1px 8px; }
.feat.wide:hover { border-color: var(--leaf); }
.sp-tone { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.speak .warn-box, .home.wide > .warn-box { margin: 12px 0 0; }
.sp-sets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sp-set { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; background: var(--paper); border: 1px solid transparent; border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 1px 3px rgba(80, 55, 30, .06); }
.sp-set:hover { border-color: var(--leaf); }
.sp-set-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sp-set-top b { font-size: 16px; }
.sp-set-top .kr { color: var(--muted); font-size: 14px; }
.sp-hook { font-family: var(--kr-sans); font-size: 18px; font-weight: 600; color: var(--acc-ink, #2f5f24); }
.sp-set em { font-style: normal; font-size: 14px; color: var(--muted); }
.kr { font-family: var(--kr-sans); }
.sp-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sp-head b { font-size: 17px; }
.sp-head .kr { color: var(--muted); }
.sp-head > span:last-child { margin-left: auto; color: var(--muted); font-size: 14px; }
.sp-card { background: var(--paper); border-radius: 18px; padding: 26px 22px 20px; margin-top: 14px; text-align: center; box-shadow: 0 1px 3px rgba(80, 55, 30, .06); }
.sp-text { font-family: var(--kr-sans); font-size: 30px; font-weight: 600; line-height: 1.6; }
.sp-pron { margin-top: 6px; color: var(--muted); font-size: 15px; }
.sp-pron .kr { color: var(--acc-ink, #2f5f24); font-weight: 600; font-size: 17px; }
.sp-vi { margin-top: 2px; font-size: 15px; }
.sp-ctrl { display: flex; justify-content: center; gap: 8px; margin: 16px 0 6px; flex-wrap: wrap; }
.sp-mic { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 14px auto 0; border: 0; background: var(--leaf); color: #fff; border-radius: 999px; padding: 14px 34px; box-shadow: 0 4px 14px rgba(78, 143, 62, .3); }
.sp-mic b { font-size: 16.5px; }
.sp-mic small { font-size: 14px; opacity: .85; }
.sp-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.sp-mic.on { background: var(--wrong); box-shadow: 0 4px 14px rgba(200, 70, 61, .35); }
.sp-mic.on .sp-dot { animation: sp-blink 1s infinite; }
@keyframes sp-blink { 50% { opacity: .25; } }
.sw { position: relative; display: inline-block; border-radius: 6px; padding: 0 3px 10px; }
.sw i { position: absolute; left: 0; right: 0; bottom: -6px; font: 600 14px var(--ui); font-style: normal; }
.sw.good { color: var(--acc-ink, #2f5f24); }
.sw.ok { color: var(--honey-ink, #9a6b00); background: var(--bean-soft); }
.sw.bad { color: var(--wrong); background: var(--wrong-soft); }
.sw.miss { color: var(--muted); text-decoration: line-through; }
.sp-score { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 18px; flex-wrap: wrap; }
.sp-ring { --c: var(--leaf); width: 104px; height: 104px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(closest-side, var(--paper) 78%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--v) * 1%), var(--fill, #EDE3D3) 0); }
.sp-ring.mid { --c: var(--bean); }
.sp-ring.low { --c: var(--wrong); }
.sp-ring b { font-size: 32px; line-height: 1; }
.sp-ring small { color: var(--muted); font-size: 14px; }
.sp-bars { display: grid; gap: 6px; min-width: 220px; }
.sp-bar { display: grid; grid-template-columns: 74px 1fr 30px; align-items: center; gap: 8px; font-size: 14px; text-align: left; }
.sp-bar div { height: 8px; background: var(--fill, #EDE3D3); border-radius: 99px; overflow: hidden; }
.sp-bar i { display: block; height: 100%; background: var(--leaf); border-radius: 99px; }
.sp-mine { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.sp-tip { text-align: left; background: var(--bg); border-radius: 10px; padding: 10px 14px; margin: 14px 0 0; font-size: 14px; }
.sp-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.sp-nav .btn:disabled { opacity: .4; cursor: default; }
@media (max-width: 640px) {
  .sp-sets { grid-template-columns: 1fr 1fr; gap: 8px; }
  .sp-set { padding: 12px; }
  .sp-hook { font-size: 16px; }
  .feat.wide { flex-direction: row; text-align: left; }
  .feat.wide img { width: 96px; height: 96px; }
  .sp-text { font-size: 24px; }
  .sp-card { padding: 20px 14px 16px; }
}

/* ---------- five sections: tabs on a computer, a bottom bar on a phone ---------- */
.shell { max-width: 1100px; margin: 0 auto; padding: 14px 16px calc(120px + env(safe-area-inset-bottom)); }
.navtabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.nt { border: 0; background: none; padding: 10px 16px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.nt:hover { color: var(--ink); }
.nt.on { color: var(--ink); border-bottom-color: var(--leaf); }
.navbar { display: none; }
@media (max-width: 760px) {
  .navtabs { display: none; }
  .navbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--paper); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .nb { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 2px 0; }
  .nb.on { color: var(--ink); }
  .nb-nep img { width: 58px; height: 58px; margin-top: -30px; border-radius: 50%; background: var(--leaf-soft); border: 3px solid var(--paper); box-shadow: 0 2px 8px rgba(43, 38, 35, .18); }
  .nb-nep.on img { background: var(--leaf); }
}
.pg-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; }
.pg-side .goal-card { margin-top: 14px; }
@media (min-width: 1000px) {
  .pg-grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .pg-side { position: sticky; top: 20px; }
}
/* On a computer the five sections sit in a sidebar, with the account at the top right */
.nt svg, .nt img { display: none; }
@media (min-width: 1000px) {
  .shell { max-width: 1320px; display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 32px; padding-top: 22px; }
  .topbar { display: contents; }
  .topbar > .logo { grid-area: 1 / 1; margin-bottom: 18px; }
  .topbar > :last-child { grid-area: 1 / 2; justify-self: end; align-self: start; }
  .navtabs { grid-area: 2 / 1; align-self: start; position: sticky; top: 22px; flex-direction: column; gap: 4px; margin: 0; border: 0; }
  .pg { grid-area: 2 / 2; min-width: 0; }
  .nt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0; border-bottom: 0; border-radius: 14px; font-size: 15.5px; text-align: left; }
  .nt.on { background: var(--paper); }
  .nt svg { display: block; flex: none; }
  .nt img { display: block; flex: none; width: 30px; height: 30px; margin: -4px; }
}
.sec.first { margin-top: 4px; }
.sec-n { color: var(--muted); font-weight: 500; font-size: .85em; margin-left: 6px; }
.plan-line { margin: -4px 0 12px; max-width: 60ch; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ---------- today's tasks ---------- */
.tasks { display: grid; gap: 8px; }
.task { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--paper); border: 1px solid transparent; border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 1px 3px rgba(80, 55, 30, .06); }
.task:hover { border-color: var(--leaf); }
.tk-box { width: 26px; height: 26px; flex: none; border: 2px solid var(--line); border-radius: 6px; display: grid; place-items: center; font-weight: 800; color: #fff; }
.task.done .tk-box { background: var(--leaf); border-color: var(--leaf); }
.task.done .tk-body b { text-decoration: line-through; color: var(--muted); }
.tk-body { flex: 1; min-width: 0; }
.tk-body b { display: block; }
.tk-body small { display: block; color: var(--muted); font-size: 14px; }
.task em { font-style: normal; color: var(--muted); font-size: 14px; white-space: nowrap; }
.goal-card { background: var(--paper); border-radius: var(--radius); padding: 14px 16px; }
.goal-card p { margin: 4px 0 10px; color: var(--muted); font-size: 14px; }
.path-card { margin: 12px 0 14px; }
.path-card small { display: block; color: var(--muted); font-size: 14px; font-weight: 700; }
.path-card b { display: block; margin-top: 2px; font-size: 18px; line-height: 1.3; }
.path-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.weak-tag { display: inline-block; margin: 6px 0 0 6px; font-style: normal; font-size: 14px; font-weight: 700; color: var(--wrong); background: var(--wrong-soft); border-radius: 6px; padding: 2px 8px; }
.feat.wide.soon { opacity: .6; cursor: default; }
.me-panel p { margin: 0 0 10px; }
.me-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.me-row img { width: 44px; height: 44px; border-radius: 50%; }
.me-row small { display: block; color: var(--muted); }

/* ---------- Nếp tab ---------- */
.mem h4, .me-h { margin: 14px 0 6px; font-size: 14px; color: var(--muted); font-weight: 700; }
.mem-stats, .mem-line { margin: 4px 0 10px; font-size: 14.5px; line-height: 1.5; }
.mem-fix, .mem-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14.5px; }
.mem-fix s { color: var(--wrong); }
.mem-fix em { margin-left: 8px; font-style: normal; font-size: 14px; color: var(--muted); }
.mem-facts li { display: flex; align-items: center; gap: 8px; }
.mem-facts button { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -10px -10px -10px auto; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.mem-facts button svg { display: block; width: 16px; height: 16px; }
.mem-weak { display: flex; flex-wrap: wrap; gap: 6px; }
.mem-weak span { font: 600 14px var(--kr-sans); background: var(--wrong-soft); border-radius: 999px; padding: 3px 10px; }
.mem-weak i { font: 600 14px var(--ui); font-style: normal; color: var(--wrong); }
.mem-proof { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.mem-proof:empty { display: none; }
.vr { margin: 10px 0 8px; padding: 12px 14px; border-radius: 14px; background: var(--bean-soft); }
.vr h4 { margin: 0 0 6px; font-size: 14.5px; }
.vr .small { margin: 6px 0 0; }
.vr-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.vr-list b { display: block; font: 600 14.5px var(--kr-sans); }
.vr-list small { color: var(--muted); font-size: 14px; }
.vr-report { width: 100%; margin: 0 0 12px; font-size: 14px; white-space: normal; }
.vform { text-align: left; width: min(460px, calc(100vw - 32px)); max-width: none; display: grid; gap: 10px; box-sizing: border-box; }
.vform h3 { margin: 0; }
.vform .small { margin: 0; }
.vform textarea, .vform input, .vform select { width: 100%; font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-sizing: border-box; }
.vform label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.vf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vform .vf-consent { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); }
.vform .vf-consent input { width: auto; margin-top: 3px; }
@media (max-width: 640px) { .vf-row { grid-template-columns: 1fr; } }
.course { background: var(--paper); border-radius: var(--radius); padding: 16px 18px; }
.course h3 { margin: 0; font-size: 17px; }
.course .small { margin: 4px 0 12px; }
.course ol + .small { margin: 10px 0 0; }
.course ol { list-style: none; margin: 0; padding: 4px 0 0; display: grid; gap: 4px; }
.course details { border-top: 1px solid var(--line); padding: 8px 0 4px; }
.course summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-size: 14.5px; padding: 2px; }
.course summary::-webkit-details-marker { display: none; }
.course summary small { margin-left: auto; color: var(--muted); }
.course summary::after { content: "▸"; color: var(--muted); }
.course details[open] > summary::after { content: "▾"; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; padding-top: 8px; }
.cs-grid button { height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font: 700 14px var(--ui); color: var(--muted); cursor: pointer; }
.cs-grid .cs-done { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.cs-grid .cs-next { background: var(--bean); border-color: var(--ink); color: var(--ink); }
.course-ideas { margin: 4px 0 0; padding-left: 18px; font-size: 14.5px; line-height: 1.7; }
.course li > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 12px; background: none; color: inherit; font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.course li > button:hover { background: var(--bg); }
.course li i { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; font: 700 14px var(--ui); background: var(--bg); color: var(--muted); }
.course li.cs-done { color: var(--muted); }
.course li.cs-done i { background: var(--leaf); color: #fff; }
.course li.cs-next > button { background: var(--bean-soft); font-weight: 700; }
.course li.cs-next i { background: var(--bean); color: var(--ink); }
.course li em { margin-left: auto; font-style: normal; font-size: 14px; font-weight: 700; white-space: nowrap; }
@media (max-width: 999px) { .course { margin-top: 26px; } }
.call-hero { display: flex; align-items: center; gap: 10px; background: var(--paper); border-radius: 18px; padding: 10px 24px 14px 6px; }
.call-hero-nep { width: 230px; height: 230px; flex: none; margin: -10px 0 -24px; }
.call-hero h2 { margin: 0 0 4px; font-size: 24px; }
.call-hero p { margin: 0 0 12px; }
.call-hero .small { margin: 8px 0 0; }
.call-btn { width: auto; padding: 13px 30px; }
@media (max-width: 640px) {
  .call-hero { flex-direction: column; text-align: center; padding: 4px 16px 18px; }
  .call-hero-nep { width: 210px; height: 210px; margin: -6px auto -20px; }
  .call-btn { width: 100%; }
}

/* ---------- first-visit survey ---------- */
.survey { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; text-align: center; }
.sv-top { display: flex; align-items: center; gap: 10px; }
.sv-back, .sv-skip { border: 0; background: none; color: var(--muted); font-weight: 600; padding: 6px; }
.sv-back { font-size: 20px; }
.sv-back:disabled { visibility: hidden; }
.sv-skip1 { display: block; margin: 12px auto 0; }
.sv-prog { flex: 1; height: 10px; background: var(--fill, #EDE3D3); border-radius: 99px; overflow: hidden; }
.sv-prog i { display: block; height: 100%; background: var(--leaf); border-radius: 99px; transition: width .3s; }
.sv-nep { width: 160px; height: 160px; margin: 8px auto -8px; }
.sv-q { font-size: 22px; margin: 6px 0 4px; line-height: 1.35; }
.sv-sub { color: var(--muted); margin: 0 0 6px; }
.sv-quote { margin: 14px 0 6px; padding: 16px 18px; background: var(--paper); border-radius: 14px; font-size: 16.5px; font-weight: 600; line-height: 1.55; text-align: left; }
.sv-opts { display: grid; gap: 10px; margin-top: 14px; text-align: left; }
.sv-opts.grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); text-align: center; }
.sv-opt { border: 2px solid transparent; background: var(--paper); border-radius: 14px; padding: 13px 16px; box-shadow: 0 1px 3px rgba(80, 55, 30, .06); }
.sv-opt b { display: block; font-size: 16px; }
.sv-opt small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.sv-opt.on { border-color: var(--leaf); background: var(--leaf-soft); }
.sv-next { margin-top: 16px; }
.sv-say { display: inline-block; position: relative; max-width: 92%; margin: 2px auto 8px; padding: 10px 14px; background: var(--paper); border-radius: 16px; font-weight: 700; line-height: 1.4; }
.sv-say::before { content: ""; position: absolute; top: -8px; left: 50%; margin-left: -8px; border: 8px solid transparent; border-top: 0; border-bottom-color: var(--paper); }
.sv-score { display: grid; gap: 10px; margin-top: 14px; }
.sv-score label { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--paper); border-radius: 14px; padding: 10px 14px; font-weight: 700; }
.sv-score input { width: 110px; font: 600 18px var(--ui); text-align: center; padding: 8px; border: 2px solid var(--line); border-radius: 10px; background: var(--card, #fff); color: inherit; }
.sv-score .ghost { justify-self: center; }
.sv-matrix { display: grid; gap: 8px; margin-top: 14px; text-align: left; }
.sv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--paper); border-radius: 14px; padding: 10px 14px; }
.sv-row b { font-size: 15.5px; }
.sv-chips { display: flex; gap: 6px; flex: none; }
.sv-word { font: 700 44px var(--kr-sans); margin: 4px 0 8px; }
.sv-opts .sv-opt.wrong { border-color: var(--wrong); background: var(--wrong-soft); }
.sv-opt.dunno { background: none; box-shadow: none; text-align: center; color: var(--muted); }
.sv-name { display: grid; margin-top: 14px; }
.sv-name input { font: 600 18px var(--ui); text-align: center; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); color: inherit; }
.sv-name input:focus { outline: none; border-color: var(--leaf); }
.sv-build { list-style: none; padding: 0; margin: 18px auto; max-width: 440px; text-align: left; display: grid; gap: 10px; }
.sv-build li { display: flex; justify-content: space-between; gap: 10px; align-items: center; background: var(--paper); border-radius: 12px; padding: 12px 14px; opacity: .4; transition: opacity .3s; }
.sv-build li.ok { opacity: 1; }
.sv-build i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font: normal 800 14px var(--ui); color: #fff; }
.sv-build li.ok i { background: var(--leaf); border-color: var(--leaf); }
.sv-build li.ok i::after { content: "✓"; }
.sv-plan { background: var(--paper); border-radius: 12px; padding: 12px 14px; font-weight: 600; margin: 10px 0; }
.sv-h { margin: 18px 0 8px; font-size: 16px; text-align: left; }
.sv-tasks { text-align: left; margin: 0 0 18px; padding-left: 22px; display: grid; gap: 8px; }
.sv-tasks b, .sv-tasks small { display: block; }
.sv-tasks small { color: var(--muted); font-size: 14px; }
.sv-miles { list-style: none; padding-left: 0; }
.sv-login { margin-top: 10px; width: 100%; white-space: normal; line-height: 1.3; }
.sv-path { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; text-align: left; }
.sv-path li { background: var(--paper); border-radius: 12px; padding: 10px 14px; }
.sv-path b, .sv-path small { display: block; }
.sv-path small { color: var(--muted); font-size: 14px; margin-top: 2px; }
.sv-path .sv-can { color: var(--ink); }
.sv-path li.now { outline: 2px solid var(--leaf); }
.sv-path li.done { opacity: .6; }
.course li span small { display: block; color: var(--muted); font-size: 14px; font-weight: 400; line-height: 1.4; }
.sv-week { text-align: left; margin-bottom: 8px; }
.sv-test { background: var(--paper); border-radius: 12px; padding: 12px 14px; margin: 0 0 10px; text-align: left; }
.sv-test p { margin: 0 0 8px; font-size: 14px; }
.sv-week details { border-top: 0; padding-top: 0; }
.path-page .sv-path { margin-top: 14px; }
.path-stage { margin-top: 14px; }
.path-stage details { padding: 8px 0; }

/* ---------- the call: a phone screen over a soft, blurred Nếp ---------- */
.lc { position: fixed; inset: 0; z-index: 60; overflow: hidden auto; color: #2B2623;
  background: linear-gradient(160deg, #cfe8ff 0%, #f3dcf3 48%, #ffe8cc 100%); }
.lc-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.lc-blur { position: absolute; left: 50%; top: 34%; width: 120vmin; height: 120vmin; transform: translate(-50%, -50%);
  filter: blur(46px) saturate(1.5); opacity: .5; }
.lc-blob { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(70px); opacity: .55; animation: lc-float 18s ease-in-out infinite alternate; }
.lc-blob.a { background: #8fcaff; left: -25vmax; top: -20vmax; }
.lc-blob.b { background: #F0B5C4; right: -28vmax; top: 20vh; animation-duration: 23s; }
.lc-blob.c { background: #ffe09a; left: -10vmax; bottom: -32vmax; animation-duration: 27s; }
@keyframes lc-float { to { transform: translate(8vmax, 6vmax) scale(1.15); } }
.lc-win { position: relative; width: 100%; max-width: 520px; min-height: 100%; margin: 0 auto; display: flex; flex-direction: column;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom)); }
.lc-top { display: grid; justify-items: center; gap: 2px; text-align: center; }
.lc-name { font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.lc-status { font-size: 15px; font-variant-numeric: tabular-nums; opacity: .75; }
.lc-topic { font-size: 14px; opacity: .6; }
.lc[data-state="ring"] .lc-status { animation: lc-blink 1.4s ease-in-out infinite; }
@keyframes lc-blink { 50% { opacity: .35; } }

.lc-stage { position: relative; flex: 1 0 230px; display: grid; place-items: center; }
.lc[data-state="talk"] .lc-stage { cursor: pointer; }
.lc[data-state="talk"] .lc-stage::after { content: "Chạm Nếp để ngắt lời"; position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 14px; opacity: .55; }
.lc-nep { position: relative; width: 250px; height: 250px; transition: transform .08s linear; }
.lc-wave { position: absolute; width: 210px; height: 210px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .9);
  background: radial-gradient(circle, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 70%); opacity: 0; }
.lc[data-state="ring"] .lc-wave { animation: lc-ripple 2.4s ease-out infinite; }
.lc[data-state="ring"] .lc-wave:nth-child(2) { animation-delay: .8s; }
.lc[data-state="ring"] .lc-wave:nth-child(3) { animation-delay: 1.6s; }
.lc[data-state="ring"] .lc-nep { animation: lc-shake 3s ease-in-out infinite; }
.lc[data-state="talk"] .lc-wave:first-child { opacity: 1; animation: lc-breathe 1s ease-in-out infinite; }
.lc[data-state="listen"] .lc-wave:first-child { opacity: 1; border-color: rgba(255, 140, 190, .9); animation: lc-breathe 1.6s ease-in-out infinite; }
.lc[data-state="think"] .lc-wave:first-child { opacity: .6; animation: lc-breathe 2.4s ease-in-out infinite; }
@keyframes lc-ripple { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
@keyframes lc-breathe { 50% { transform: scale(1.12); } }
@keyframes lc-shake { 0%, 60%, 100% { rotate: 0deg; } 64%, 72%, 80% { rotate: -5deg; } 68%, 76% { rotate: 5deg; } }

.lc-card, .lc-cc, .lc-end, .lc-type input, .lc-btn svg {
  background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .75);
  -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); box-shadow: 0 10px 30px rgba(70, 45, 90, .12); }
.lc-card { border-radius: 22px; padding: 14px 18px; text-align: center; margin-bottom: 10px; }
.lc-card s { display: block; color: #C8463D; font: 600 16px/1.4 var(--kr-sans); }
.lc-card b { display: block; font: 700 24px/1.4 var(--kr-sans); }
.lc-card small { display: block; font-size: 14.5px; opacity: .7; }
.lc-card p { margin: 6px 0 0; font-size: 14px; }
.lc-cc { border-radius: 18px; padding: 12px 16px; min-height: 64px; font-size: 15.5px; line-height: 1.5; }
.lc-says { margin: 0; font-weight: 600; }
.lc-says:empty::before { content: "..."; opacity: .4; }
.lc-me { margin: 4px 0 0; opacity: .65; font-size: 14.5px; }
.lc-me:empty { display: none; }
.lc-type { display: flex; gap: 8px; margin-top: 10px; }
.lc-type input { flex: 1; min-width: 0; font: 16px var(--kr-sans); padding: 11px 14px; border-radius: 999px; color: inherit; }

.lc-bar { display: flex; justify-content: space-around; gap: 6px; padding-top: 16px; }
.lc-btn { display: grid; justify-items: center; gap: 6px; border: 0; background: none; color: inherit; font-size: 14px; font-weight: 600; padding: 0; min-width: 64px; }
.lc-btn svg { width: 62px; height: 62px; padding: 17px; border-radius: 50%; transition: background .15s, color .15s; }
.lc-btn.on svg { background: rgba(255, 255, 255, .92); }
.lc-btn.off svg { background: #2B2623; color: #fff; }
.lc-btn.hang svg { background: #E5484D; border-color: #E5484D; color: #fff; }
.lc-btn:active svg { transform: scale(.94); }

.lc-end { margin: auto 0; border-radius: 26px; padding: 22px 20px; text-align: center; }
.lc-end h2 { margin: 4px 0; }
.lc-end p { margin: 0 0 6px; }
.lc-end-nep { width: 170px; height: 170px; margin: -6px auto 0; }
.lc-end h3 { text-align: left; margin: 16px 0 8px; font-size: 15px; }
.lc-fixes { text-align: left; list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 8px; }
.lc-fixes li { background: rgba(255, 255, 255, .7); border-radius: 14px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lc-fixes li > div { min-width: 0; }
.lc-fixes s { color: #C8463D; font-family: var(--kr-sans); }
.lc-fixes b { color: #2f5f24; font-family: var(--kr-sans); }
.lc-fixes small { display: block; opacity: .7; font-size: 14px; }
.lc-end .actions { margin-top: 14px; }
@media (max-width: 640px), (max-height: 760px) {
  .lc-nep { width: 200px; height: 200px; }
  .lc-wave { width: 170px; height: 170px; }
  .lc-name { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .lc-blob, .lc .lc-wave, .lc .lc-nep, .lc .lc-status { animation: none !important; }
}

/* ---------- study map ---------- */
.map-page .mp-target { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 14px 0; }
.map-page .sv-test { margin: 14px 0 12px; }
.ex-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; background: var(--paper); border-radius: 14px; padding: 12px 14px; margin: 12px 0; }
.ex-pick b { flex: 1 1 100%; }
.ex-pick span { flex: 1 1 auto; color: var(--muted); font-size: 14px; }
.ex-pick.on span { color: var(--ink); font-weight: 700; }
.sv-opt.closed { opacity: .55; cursor: default; }
.mp { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.mp-stage { background: var(--paper); border-radius: 16px; padding: 14px 16px; border: 2px solid transparent; }
.mp-stage.now { border-color: var(--leaf); }
.mp-stage.done { opacity: .7; }
.mp-stage.beyond, .mp-stage.before { opacity: .45; }
.mp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.mp-head b { font-size: 17px; }
.mp-head small { color: var(--muted); font-weight: 600; }
.mp-can { margin: 4px 0 10px; font-size: 14px; color: var(--muted); }
.mp-row { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 10px; font-size: 14px; margin: 4px 0; }
.mp-row em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }
.mp-bar { display: block; height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.mp-bar i { display: block; height: 100%; background: var(--leaf); border-radius: 99px; }
.mp-list { margin-top: 10px; }
.mp-list summary { cursor: pointer; font-size: 14px; font-weight: 700; }
.mp-gram { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.mp-g { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 4px 10px; font: 600 14px var(--kr-sans); cursor: pointer; color: var(--ink); }
.mp-g.ok { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.mp-skip { margin-top: 12px; }
.mp-mark { margin: 0 0 0 18px; padding: 2px 0 2px 12px; border-left: 3px dashed var(--line); font-size: 14px; font-weight: 700; color: var(--muted); }
.mp-mark.goal { color: var(--ink); border-left-color: var(--leaf); }
.map-card p { margin: 4px 0 8px; }

/* ---------- learning new words ---------- */
.lw-card { cursor: default; }
.lw-card .pos { color: var(--muted); font-size: 14px; }
.lw-say { align-self: center; margin: 6px 0; }
.lw-q { text-align: center; margin-bottom: 16px; }
.lw-ask { color: var(--muted); margin: 0 0 6px; }
.lw-q .kw { font: 700 40px/1.2 var(--kr-sans); display: block; border: 0; background: none; padding: 0; }
.lw-opts { display: grid; gap: 10px; }
.lw-opts .sv-opt { text-align: left; cursor: pointer; }
.lw-opts .sv-opt.wrong { border-color: var(--coral, #E5484D); background: var(--red-soft, #FDECEC); }

/* ---------- a grammar point ---------- */
.gr-card { text-align: center; padding: 26px 18px; }
.gr-p { font: 700 26px/1.35 var(--kr-sans); }
.gr-vi { font-size: 18px; font-weight: 600; margin: 8px 0 16px; }
.gr-card .actions { justify-content: center; }

/* ---------- home map (road.js keeps the progress, metro.js draws it) ---------- */
.rd-hi { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.rd-hi img { width: 40px; height: 40px; }
.rd-hi b { font-weight: 800; font-size: 18px; color: #1E3326; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-stat { display: flex; align-items: center; gap: 4px; padding: 5px 10px 5px 6px; border-radius: 12px; font-size: 17px; }
.rd-stat b { font-weight: 800; }
.rd-stat small { font-size: 14px; font-weight: 700; margin-left: 1px; }
.ic-play { width: 1.1em; height: 1.1em; vertical-align: -.15em; flex: none; }
.rd-stat.fire { color: #7A5300; background: #FFF1CC; }
.rd-stat.grain { color: #8A6100; background: #FFF1CC; }
.rd-resume { display: block; width: 100%; margin: 12px 0; padding: 12px 14px; text-align: left; font: inherit; font-weight: 700; color: #fff;
  background: #237A3E; border: 0; border-radius: 16px; box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4); }
.rd-resume:active { transform: translateY(4px); box-shadow: none; }
.rd-road { margin: 0 -16px -120px; padding-bottom: 120px; background: #2E86A8; }
/* Nếp, big, next to today's stop, with a speech bubble */
.rd-nep { position: absolute; width: 112px; transform: translate(-50%, -100%); pointer-events: none; z-index: 2; }
.rd-nep img { width: 112px; animation: rd-bob 1.6s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(23, 90, 44, .25)); }
@keyframes rd-bob { 50% { translate: 0 -6px; } }
.rd-say { position: absolute; bottom: calc(100% - 6px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 180px; padding: 7px 12px;
  font-weight: 800; font-size: 14px; line-height: 1.3; color: #1E3326; text-align: center; background: #fff; border-radius: 14px; box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4); }
.rd-say::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top-color: #fff; }
.rd-sheet-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center; animation: rd-fade .2s; }
.rd-sheet { width: 100%; max-width: 520px; max-height: 86vh; overflow: auto; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); background: #fff;
  border-radius: 26px 26px 0 0; animation: rd-up .32s cubic-bezier(.2, 1.2, .4, 1); }
.rd-sheet .tasks { display: grid; gap: 10px; margin: 16px 0 14px; padding: 0; background: none; border: 0; }
.rd-sheet > .btn { width: 100%; }
.rd-grip { display: block; width: 44px; height: 5px; margin: 0 auto 12px; border-radius: 3px; background: #CDE0C2; }
.rd-sh-head { display: flex; gap: 12px; align-items: center; padding: 12px; color: #fff; background: #237A3E; border-radius: 18px; box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4); }
.rd-sh-head img { width: 76px; flex: none; margin: -14px 0 -10px; }
.rd-sh-head small { font-weight: 800; font-size: 14px; opacity: .9; }
.rd-sh-head b { display: block; font-weight: 800; font-size: 21px; letter-spacing: -.02em; line-height: 1.25; }
.rd-sh-head p { margin: 2px 0 0; font-weight: 600; }
@keyframes rd-up { from { transform: translateY(100%); } }
@keyframes rd-fade { from { opacity: 0; } }
@media (min-width: 761px) {
  .rd-road { margin: 14px 0 0; padding: 0; border-radius: 22px; overflow: hidden; box-shadow: 0 10px 20px -12px rgba(23, 90, 44, .55); }
}
@media (prefers-reduced-motion: reduce) { .rd-nep img, .rd-sheet, .rd-sheet-bg { animation: none; } }

/* ---------- page heads: a band in the section's colour, Nếp with a bubble ---------- */
.pg-head { display: flex; align-items: center; gap: 6px; background: var(--hc, var(--leaf)); color: #fff; border-radius: var(--radius); padding: 8px 16px 8px 0; margin: 4px 0 18px; min-height: 132px; }
.pg-head-nep { width: 130px; height: 130px; flex: none; margin: -6px -8px -10px -4px; }
.pg-head-body { min-width: 0; }
.pg-head h2 { margin: 0 0 8px; font-size: 25px; line-height: 1.15; color: #fff; }
.pg-head-say { position: relative; margin: 0; background: var(--paper); color: var(--ink); border-radius: 16px; padding: 9px 13px; font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.pg-head-say::before { content: ""; position: absolute; left: -7px; top: 14px; border: 7px solid transparent; border-right-color: var(--paper); border-left: 0; }
.pg-thi { --hc: var(--sky); --hd: var(--sky-d, var(--sky)); }
.pg-toi { --hc: var(--pink, var(--coral)); --hd: var(--pink-d, var(--coral)); }
.ex-no { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--sky); color: #fff; font-weight: 800; font-size: 19px; }
.call-say { display: none; }

/* ---------- the flows: a progress bar, a right/wrong strip, the end of a lesson, confetti ---------- */
.sv-ic { display: none; }
.pr-prog { width: calc(100% - 32px); max-width: 1148px; height: 8px; margin: 0 auto 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.pr-prog i { display: block; width: 0; height: 100%; background: var(--leaf); border-radius: 99px; transition: width .4s; }
.fb { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 16px; background: var(--leaf-soft); color: var(--leaf-d, var(--acc-ink, #2f5f24)); font-family: var(--ui); line-height: 1.4; animation: fb-in .25s ease-out; }
.fb.no { background: var(--wrong-soft); color: var(--wrong-d, var(--wrong)); }
.fb i { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--card, #fff); }
.fb svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.fb b { display: block; font-size: 18px; font-weight: 800; }
.fb small { display: block; font-size: 14px; font-weight: 600; }
.fb.float { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; border-radius: 0; padding: 16px 20px calc(20px + env(safe-area-inset-bottom)); }
@keyframes fb-in { from { transform: translateY(24px); opacity: 0; } }
.pr-act { flex-wrap: wrap; }
.pr-act .fb { flex: 1 0 100%; }
.win { max-width: 440px; margin: 0 auto; padding: 4px 0 24px; text-align: center; }
.win-nep { position: relative; width: 240px; height: 240px; margin: 0 auto; display: grid; place-items: center; }
.win-rays { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--bean); opacity: .35; animation: win-spin 16s linear infinite; }
.win-nep img { position: relative; width: 190px; height: 190px; }
.win-title { margin: 4px 0 2px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: var(--leaf-d, var(--leaf)); }
.win-sub { margin: 0; color: var(--muted); font-weight: 600; }
/* three buttons do not fit one row on a phone: stack them, the main one on top */
.win .actions:has(> .btn:nth-child(3)) { flex-direction: column; }
.win .actions:has(> .btn:nth-child(3)) .btn.primary { order: -1; }
.win-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 6px; }
.win-stat { --wc: var(--leaf); border: 2px solid var(--wc); border-radius: 16px; overflow: hidden; background: var(--paper); animation: pop .4s both cubic-bezier(.3, 1.6, .5, 1); }
.win-stat:nth-child(2) { animation-delay: .12s; }
.win-stat:nth-child(3) { animation-delay: .24s; }
.win-stat small { display: block; background: var(--wc); color: #fff; font-weight: 800; font-size: 14px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-stat b { display: block; font-size: 22px; font-weight: 800; padding: 8px 4px 10px; color: var(--wc); }
.win-stat.c-sky { --wc: var(--sky); }
.win-stat.c-orange { --wc: var(--orange, var(--coral)); }
.win-stat.c-purple { --wc: var(--purple, #9B6BD8); }
.win-stat.c-pink { --wc: var(--pink, #E87BB5); }
@keyframes win-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .win-rays { animation: none; } }

/* ---------- game 1: Nếp hops across the stream (game.js) ---------- */
.st { max-width: 600px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.st-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.st-x { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; border: 0; background: none; cursor: pointer; }
.st-x svg { display: block; width: 24px; height: 24px; fill: none; stroke: #7B8A7F; stroke-width: 3; stroke-linecap: round; }
.st-prog { flex: 1; height: 14px; background: #CDE0C2; border-radius: 99px; overflow: hidden; }
.st-prog i { display: block; width: 0; height: 100%; background: #237A3E; border-radius: 99px; transition: width .4s; }
.st-hearts { display: flex; gap: 3px; }
.st-hearts svg { width: 26px; height: 24px; fill: #C23A2C; transition: fill .3s; }
.st-hearts svg.lost { fill: #D0D5DB; }
.st-hearts svg.shake { animation: st-shake .45s; }
.st-scene { position: relative; height: 260px; overflow: hidden; flex: none; background: #2E86A8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='52'%3E%3Cpath d='M6 14q12-7 24 0t24 0M66 40q12-7 24 0t24 0' fill='none' stroke='%23fff' stroke-opacity='.22' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  animation: st-flow 9s linear infinite; }
.st-track { position: absolute; left: 0; top: 0; height: 100%; transition: transform .55s ease-in-out; }
.st-bank { position: absolute; left: 0; top: 0; width: 120px; height: 100%; }
.st-far { position: absolute; top: 0; width: 150px; height: 100%; }
.st-far .st-bank { width: 100%; transform: scaleX(-1); }
.st-flag { position: absolute; left: 82px; top: 64px; width: 54px; height: 82px; }
.st-cloth { transform-origin: 13px 20px; animation: st-wave 1.6s ease-in-out infinite; }
.st-far.won .st-cloth { animation-duration: .5s; }
.st-stone { position: absolute; width: 84px; height: 48px; transition: transform .45s ease-in, opacity .45s ease-in; }
.st-stone svg { display: block; width: 100%; height: 100%; }
.st-ring { fill: none; stroke: #fff; stroke-opacity: .5; stroke-width: 2; }
.st-stone.bob { animation: st-bob .3s; }
.st-stone.sink { transform: translateY(16px) scale(.85); opacity: 0; }
.st-stone.rise { animation: st-rise .45s; }
.st-nep { position: absolute; width: 96px; height: 96px; z-index: 2; transition: left .48s ease-in-out, top .48s ease-in-out; pointer-events: none; }
.st-nep img { display: block; width: 100%; height: 100%; object-fit: contain; }
.st-nep img.hop { animation: st-hop .48s ease-in-out; }
.st-nep img.fall { animation: st-fall .35s ease-in forwards; }
.st-nep img.back { animation: st-back .45s cubic-bezier(.3, 1.6, .5, 1); }
.st-splash { position: absolute; width: 100px; height: 60px; z-index: 3; pointer-events: none; }
.st-splash i { position: absolute; left: 46px; top: 22px; width: 9px; height: 9px; border-radius: 50%; background: #fff; opacity: 0; }
.st-splash b { position: absolute; left: 10px; top: 24px; width: 80px; height: 24px; border: 3px solid #fff; border-radius: 50%; opacity: 0; }
.st-splash.on i { animation: st-drop .6s ease-out; }
.st-splash.on i:nth-child(1) { --dx: -34px; --dy: -34px; }
.st-splash.on i:nth-child(2) { --dx: -14px; --dy: -46px; }
.st-splash.on i:nth-child(3) { --dx: 6px; --dy: -50px; }
.st-splash.on i:nth-child(4) { --dx: 24px; --dy: -40px; }
.st-splash.on i:nth-child(5) { --dx: 38px; --dy: -24px; }
.st-splash.on b { animation: st-ripple .7s ease-out; }
.st-combo { position: absolute; right: 12px; top: 12px; background: #237A3E; color: #fff; font-weight: 800; font-size: 14px; padding: 4px 12px; border-radius: 99px; box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4); opacity: 0; }
.st-combo.on { animation: st-combo 1.6s; }
.st-play { padding: 16px 16px 28px; }
.st-q { position: relative; background: var(--paper); border: 2px solid #CDE0C2; border-radius: 20px; box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4); padding: 12px 16px 14px; text-align: center; }
.st-q small { display: block; color: var(--muted); font-weight: 700; font-size: 14px; }
.st-ask { font-family: var(--kr-sans); font-size: 34px; font-weight: 800; line-height: 1.3; margin: 4px 0; }
.st-ask.long { font-size: 18px; font-weight: 600; line-height: 1.7; text-align: left; white-space: pre-line; }
.st-say { margin-top: 2px; }
.st-type { display: flex; gap: 10px; margin-top: 14px; }
.st-type input { flex: 1; min-width: 0; padding: 12px; font: 20px var(--kr-sans); border: 2px solid var(--line, #DDD); border-radius: 12px; background: var(--card, #fff); color: inherit; }
.st-type input.right { border-color: #237A3E; }
.st-type input.wrong { border-color: #A02D21; }
.st-tiles { margin-top: 14px; }
.st-built { display: flex; flex-wrap: wrap; gap: 8px; min-height: 62px; padding: 8px; border: 2px dashed var(--line, #DDD); border-radius: 14px; background: var(--card, #fff); align-content: flex-start; }
.st-built.right { border: 2px solid #237A3E; }
.st-built.wrong { border: 2px solid #A02D21; }
.st-pool { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 2px; }
.st-tile { min-width: 48px; min-height: 48px; padding: 8px 14px; background: var(--paper); color: var(--ink); border: 2px solid #CDE0C2; border-radius: 14px; box-shadow: 0 5px 12px -8px rgba(23, 90, 44, .4); font: 700 24px/1.2 var(--kr-sans); cursor: pointer; }
.st-tile:active:not(:disabled) { transform: translateY(2px); }
.st-tile.ghost { background: transparent; border-style: dashed; box-shadow: none; color: transparent; cursor: default; }
.st-mode { flex: none; padding: 8px 4px; background: none; border: 0; color: var(--muted); font: 700 15px var(--ui); text-decoration: underline; cursor: pointer; }
.st-sub { margin-top: 2px; }
.st-kbd { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.st-type:has(.st-mode) { align-items: center; }
.st-fix { margin: 8px 0 0; color: #A02D21; font-weight: 600; }
.st-opts { display: grid; gap: 10px; margin-top: 14px; }
.st-opts.grid { grid-template-columns: 1fr 1fr; }
.st-opt { padding: 13px 12px; background: var(--paper); color: var(--ink); border: 2px solid #CDE0C2; border-radius: 16px; box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4);
  font: 600 16px/1.4 var(--ui); font-family: var(--ui), var(--kr-sans); cursor: pointer; transition: transform .1s, box-shadow .1s; }
.st-opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #CDE0C2; }
.st-opt:disabled { cursor: default; }
.st-opt.ko { font-family: var(--kr-sans), var(--ui); font-size: 22px; font-weight: 700; line-height: 1.35; }
.st-opt.ko.k1 { font-size: 26px; }
.st-opts.pics { gap: 12px; }
.st-opt.pic { display: grid; grid-template-rows: minmax(0, 1fr); place-items: center; height: clamp(84px, calc((100dvh - 540px) / 2), 150px); min-height: 0; padding: 6px; font-weight: 700; }
.st-opt.pic img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.st-ask.emo { font-size: clamp(64px, calc((100dvh - 420px) / 3), 96px); line-height: 1.15; margin: 2px 0 0; }
.st-ask.emo img { display: block; height: clamp(96px, calc((100dvh - 420px) / 2), 150px); margin: 0 auto; }
.st-emo { font-size: clamp(44px, calc((100dvh - 540px) / 3), 72px); line-height: 1; }
.st-match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.st-match > div { display: grid; gap: 10px; align-content: start; }
.st-mt { min-height: 56px; padding: 8px; overflow-wrap: anywhere; }
.st-mt.ko { font-family: var(--kr-sans); font-size: 22px; font-weight: 800; }
.st-mt.on { border-color: #237A3E; box-shadow: 0 0 0 3px rgba(35, 122, 62, .3); }
.st-opt.right { background: #D5EDD0; border-color: #237A3E; box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4); color: #175A2C; }
.st-opt.wrong { background: #FDE2DE; border-color: #C23A2C; box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4); color: #A02D21; animation: st-shake .4s; }
.st-lose { display: grid; justify-items: center; gap: 6px; text-align: center; background: var(--paper); border: 2px solid #CDE0C2; border-radius: 20px; box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4); padding: 16px; animation: pop .4s both; }
.st-lose img { width: 120px; height: 120px; object-fit: contain; }
.st-lose b { font-size: 22px; font-weight: 800; color: #A02D21; }
.st-lose p { margin: 2px 0 6px; color: var(--muted); font-weight: 600; }
@keyframes st-flow { to { background-position: 120px 0; } }
@keyframes st-wave { 50% { transform: skewY(-6deg) scaleX(.92); } }
@keyframes st-hop { 45% { transform: translateY(-48px); } }
@keyframes st-fall { from { transform: translateY(-20px); } to { transform: translateY(46px) scale(.7); opacity: 0; } }
@keyframes st-back { from { transform: scale(.4); opacity: 0; } }
@keyframes st-bob { 40% { transform: translateY(5px); } }
@keyframes st-rise { from { transform: translateY(14px) scale(.85); opacity: 0; } }
@keyframes st-drop { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.6); } }
@keyframes st-ripple { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.4); } }
@keyframes st-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes st-combo { 0% { opacity: 0; transform: scale(.6); } 15%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@media (min-width: 700px) {
  .st-scene { height: 300px; margin: 0 16px; border-radius: 24px; }
  .st-play { padding: 20px 16px 32px; }
}
/* a short phone (iPhone SE): the scene gives room back so the answers stay on screen */
@media (max-height: 700px) { .st-scene { height: 30dvh; } }
/* a phone on its side: the stream on the left, the question and every answer on the right */
@media (orientation: landscape) and (max-height: 500px) {
  .st { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); grid-template-rows: auto 1fr; align-items: start; }
  .st-top { grid-column: 1 / -1; padding: 6px 16px; }
  .st-scene { height: calc(100dvh - 72px); margin: 0 0 0 max(16px, env(safe-area-inset-left)); border-radius: 20px; }
  .st-play { padding: 0 max(16px, env(safe-area-inset-right)) 12px 16px; }
  .st-opts { margin-top: 10px; }
  /* four answers in two rows of two, the question tighter, so all four are seen without scrolling */
  .st-opts, .st-opts.grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .st-opt { padding: 9px 10px; }
  .st-q { padding: 8px 12px 10px; }
  .st-ask { font-size: 26px; margin: 2px 0; }
  .st-ask.long { font-size: 16px; line-height: 1.5; }
  .st-ask.emo { font-size: 48px; }
  .st-ask.emo img { height: 64px; }
  .st-opt.pic { height: 72px; }
}
@media (prefers-reduced-motion: reduce) { .st-scene { animation: none; } }
/* the way in from the review page */
.rv-game { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 14px; padding: 8px 16px 8px 8px; text-align: left; color: #fff; cursor: pointer;
  background: #237A3E; border: 0; border-radius: var(--radius); box-shadow: 0 10px 20px -12px rgba(23, 90, 44, .55); }
.rv-game:active { transform: translateY(3px); box-shadow: 0 2px 0 #175A2C; }
.rv-game img { width: 64px; height: 64px; flex: none; object-fit: contain; }
.rv-game span { flex: 1; min-width: 0; }
.rv-game b { display: block; font-size: 17px; font-weight: 800; }
.rv-game small { display: block; font-size: 14px; line-height: 1.4; font-weight: 600; opacity: .95; }
.rv-game svg { width: 70px; height: 34px; flex: none; }

/* ---------- game 2: grains, the streak flame, half-done days, chests, the boss, looking after Nếp (pet.js) ---------- */
.rd-stat.fire.off { color: #55695B; background: #F0F0F0; }
.rd-stat.fire.off svg { filter: grayscale(1); opacity: .55; }
.rd-stat.bump, .gr-pill.bump { animation: gr-bump .35s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes gr-bump { 40% { transform: scale(1.22); } }
.rd-nudge { margin: 10px 0 0; padding: 8px 12px; font-size: 14px; font-weight: 700; color: #8A5A00; background: #FFF1CC; border-radius: 12px; }
.rd-lid { transform-box: fill-box; transform-origin: 0 100%; transition: transform .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes rd-wiggle { 0%, 70%, 100% { rotate: 0deg; } 76% { rotate: -9deg; } 84% { rotate: 8deg; } 92% { rotate: -4deg; } }
@keyframes rd-shake { 20%, 60% { transform: translateX(-3px) rotate(-6deg); } 40%, 80% { transform: translateX(3px) rotate(6deg); } }
.gr-pill { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 14px; z-index: 210; display: flex; align-items: center; gap: 4px; padding: 6px 12px 6px 8px; font-size: 18px;
  color: #8A6100; background: #FFF1CC; border: 2px solid #F5CF7A; border-radius: 14px; box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4); animation: rd-fade .2s; }
.gr-pill b { font-weight: 800; }
.gr-fly { position: fixed; z-index: 211; width: 22px; height: 22px; pointer-events: none; will-change: transform, opacity; contain: layout style; }
.gr-fly svg { will-change: transform, opacity; }
.gr-fly svg { display: block; }
.win-stat.c-bean { --wc: #8F640A; }
.st-tag { flex: none; padding: 3px 9px; font-weight: 800; font-size: 14px; color: #fff; background: #175A2C; border-radius: 9px; box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4); }
.st.boss .st-prog i { background: var(--acc-btn, #175A2C); }
@keyframes pet-hop { 40% { transform: translateY(-14px) scale(1.04, .97); } }

/* ---------- game 3: blowing up balloons by reading aloud (balloon.js) ---------- */
.bn-count { display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: 18px; color: #9A3249; }
.bn-count svg { width: 18px; height: 24px; }
.bn-scene { position: relative; height: 300px; overflow: hidden; flex: none; background: #9CC3E6; }
.bn-sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.bn-hill { position: absolute; left: -10%; right: -10%; bottom: -60px; height: 120px; border-radius: 50% 50% 0 0; background: #5DB36A; box-shadow: inset 0 10px 20px -12px rgba(23, 90, 44, .55); }
.bn-nep { position: absolute; left: 50%; bottom: 26px; width: 110px; transform: translateX(-50%); }
.bn-nep img { display: block; width: 110px; filter: drop-shadow(0 4px 6px rgba(23, 90, 44, .25)); }
.bn-hand { position: absolute; left: calc(50% + 26px); bottom: 110px; width: 0; height: 0; z-index: 1; }
.bn-b { position: absolute; left: 0; top: 0; }
.bn-b:not(.now) { opacity: .9; }
.bn-b:not(.now) .bn-ball { transform: scale(.55); }
.bn-ball { transform-box: view-box; transition: transform .6s cubic-bezier(.3, 1.6, .5, 1); }
.bn-b.now { z-index: 2; }
.bn-b.fly { animation: bn-fly 1.3s cubic-bezier(.5, 0, .8, .6) forwards; }
@keyframes bn-fly { to { transform: translate(30px, -420px) rotate(8deg); } }
.bn-b.hiss .bn-ball { animation: bn-hiss .9s; }
@keyframes bn-hiss { 20%, 60% { translate: -5px 0; } 40%, 80% { translate: 5px 0; } }
.bn-say { position: absolute; left: 16px; bottom: 140px; max-width: 150px; padding: 7px 11px; font-weight: 800; font-size: 14px; line-height: 1.3; color: #1E3326;
  background: #fff; border-radius: 14px; box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4); opacity: 0; transform: scale(.8); transition: opacity .2s, transform .2s; z-index: 3; }
.bn-say.on { opacity: 1; transform: none; }
.bn-ask { font-size: 38px; }
.bn-ask.mid { font-size: 26px; }
.bn-vi { margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.bn-note { margin: 12px 0 0; padding: 9px 12px; font-size: 14px; font-weight: 600; color: #175A2C; background: #D5EDD0; border-radius: 12px; }
.bn-mic { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin: 14px 0 0; padding: 16px; font: inherit; font-weight: 800; font-size: 19px;
  color: #fff; background: #C23A2C; border: 0; border-radius: 18px; box-shadow: 0 10px 20px -12px rgba(23, 90, 44, .55); touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.bn-mic svg { width: 28px; height: 28px; fill: #fff; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.bn-mic.on { transform: translateY(4px); box-shadow: 0 1px 0 #A02D21; animation: bn-rec 1s ease-in-out infinite; }
@keyframes bn-rec { 50% { background: #FF7070; } }
.bn-mic[disabled] { background: #CDE0C2; box-shadow: 0 10px 20px -12px rgba(23, 90, 44, .55); color: #7B8A7F; cursor: default; }
.bn-mic[disabled] svg { fill: #7B8A7F; stroke: #7B8A7F; }
.bn-row { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.bn-row:empty { display: none; }
.rv-game.bn-go { background: var(--acc-btn, #175A2C); box-shadow: 0 10px 20px -12px rgba(23, 90, 44, .55); }
.rv-game.bn-go:active { box-shadow: 0 2px 0 #9A3249; }
@media (prefers-reduced-motion: reduce) { .bn-b.fly { animation-duration: .01s; } .bn-mic.on { animation: none; } }

/* ---------- Nếp reacts (react.js): a small Nếp in the top right corner with a bubble, never blocking a tap ---------- */
.nr { position: fixed; top: calc(128px + env(safe-area-inset-top)); right: 8px; z-index: 150; width: 84px; height: 84px; pointer-events: none; animation: nr-in 2.4s both; }
.nr img { position: absolute; inset: 0; width: 84px; height: 84px; filter: drop-shadow(0 4px 6px rgba(23, 90, 44, .25)); }
.nr-say { position: absolute; right: 70px; top: 6px; width: max-content; max-width: 190px; padding: 7px 11px; font-weight: 800; font-size: 14px; line-height: 1.3; color: #1E3326;
  background: #fff; border-radius: 14px 14px 4px 14px; box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4); z-index: 1; }
/* a win screen with the stamp: the big Nếp and the 참 잘했어요 stamp fill that corner and say it already, so the
   small one stays out (at the bottom he would sit on the buttons of a short phone) */
body:has(.win .win-seal) .nr { display: none; }
.nr-bit { position: absolute; left: 30px; top: 20px; width: 16px; height: 16px; opacity: 0; animation: nr-bit 1.3s .35s ease-out both; animation-delay: calc(.35s + var(--d)); }
.nr-wrong .nr-bit { animation-name: nr-drip; }
@keyframes nr-in { 0% { transform: translateX(130%); } 14% { transform: none; } 20% { transform: translateY(-8px); } 26%, 84% { transform: none; } 100% { transform: translateX(130%); } }
@keyframes nr-bit { 0% { opacity: 0; transform: rotate(var(--a)) translateY(0) scale(.4); } 25% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-44px) scale(1); } }
@keyframes nr-drip { 0% { opacity: 0; transform: translate(calc(var(--a) * .5), 0) scale(.5); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(var(--a) * .5), 30px) scale(.9); } }
/* the corner coach would cover the last answer on a phone; the reaction above says the same thing */
@media (max-width: 600px) { .wlayout:has(.practice) ~ .coach { display: none; } }
/* same in chữa bài: the marks on each question say it, and a phone has no room beside the answers */
@media (max-width: 600px) { .wlayout ~ .coach, .review-mode .omr .coach { display: none; } }
@media (prefers-reduced-motion: reduce) { .nr { animation: nr-fade 2.4s both; } .nr-bit { display: none; } @keyframes nr-fade { 0%, 100% { opacity: 0; } 10%, 85% { opacity: 1; } } }

/* ---------- a lesson part (lesson.js) ---------- */
.lp { max-width: 640px; padding-bottom: 110px; }
.lp-step { background: var(--paper); border: 2px solid var(--hair, #CDE0C2); border-radius: 18px; box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4); padding: 14px 16px; margin: 0 0 14px; }
.lp-step h3 { margin: 0 0 8px; font-size: 17px; font-weight: 800; color: var(--acc-ink, #175A2C); }
.lp-goal { background: var(--acc-soft, #D5EDD0); border-color: #B9D1AD; box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4); }
.lp-tip { margin: 4px 0 8px; color: var(--muted); font-size: 14px; font-weight: 600; line-height: 1.5; }
.lp-vs { margin: 0 0 8px; padding: 8px 10px; font-size: 14px; background: var(--honey-soft, #FFF1CC); border-radius: 10px; }
.lp-line { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--hair, #F0F0F0); }
.lp-line:first-of-type { border-top: 0; }
.lp-line b { display: block; font-family: var(--kr-sans); font-size: 19px; font-weight: 700; }
.lp-line small { display: block; color: var(--muted); font-size: 14px; line-height: 1.45; }
.lp-ex { margin-top: 2px; font-family: var(--kr-sans); color: var(--text, #1E3326) !important; }
.lp-ex span { font-family: var(--ui); color: var(--muted); }
.lp-say { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #fff; background: var(--acc-btn, #237A3E); box-shadow: 0 6px 14px -8px rgba(23, 90, 44, .4); font-size: 14px; cursor: pointer; }
.lp-say:active { transform: translateY(2px); box-shadow: none; }
.lp-text { position: relative; padding: 12px 48px 12px 14px; font-family: var(--kr-sans); font-size: 18px; line-height: 1.7; background: var(--card2, #F7F7F7); border-radius: 12px; }
.lp-text .lp-say { position: absolute; top: 10px; right: 10px; }
.lp-vi { margin: 6px 0 10px; font-size: 14px; color: var(--muted); }
.lp-vi summary { cursor: pointer; padding: 10px 0; font-weight: 700; color: var(--acc-ink, #175A2C); }
.lp-bub { position: relative; max-width: 88%; padding: 8px 12px 8px 48px; background: var(--acc-soft, #E3F0DA); border-radius: 14px 14px 14px 4px; }
.lp-bub.r { justify-self: end; background: var(--honey-soft, #FFF1CC); border-radius: 14px 14px 4px 14px; }
.lp-bub i { display: block; font-style: normal; font-size: 14px; font-weight: 800; color: var(--muted); }
.lp-bub .lp-say { position: absolute; left: 8px; top: 12px; }
.lp-bub b { display: block; font-family: var(--kr-sans); font-size: 17px; font-weight: 600; }
.lp-bub small { display: block; font-size: 14px; color: var(--muted); }
.lp-pic { flex: none; width: 56px; height: 56px; object-fit: contain; border-radius: 10px; background: var(--paper, #fff); }
.lp-chip-pic { width: 22px; height: 22px; vertical-align: middle; margin-right: 4px; object-fit: contain; }
.lw-pic { display: block; width: 120px; height: 120px; margin: 0 auto 6px; object-fit: contain; }
.nw { text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--acc-btn, #237A3E); cursor: pointer; }
.nw-tip { position: fixed; z-index: 60; display: flex; align-items: center; gap: 8px; max-width: min(86vw, 300px); padding: 6px 12px 6px 6px; background: var(--paper, #fff); color: var(--ink, #1E3326); border: 2px solid var(--acc-btn, #237A3E); border-radius: 14px; box-shadow: 0 8px 20px -10px rgba(23, 90, 44, .5); font-size: 15px; line-height: 1.35; }
.nw-tip .lp-say { width: 32px; height: 32px; }
.lp-sub { margin: 10px 0 6px; font-size: 14px; color: var(--muted); }
.lp-words { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-wd { display: flex; flex-direction: column; align-items: flex-start; padding: 5px 10px; border: 0; border-radius: 10px; background: var(--acc-soft, #E3F0DA); color: inherit; font: inherit; text-align: left; }
.lp-wd b { font-family: var(--kr-sans); font-size: 16px; }
.lp-wd small { font-size: 12px; color: var(--muted); }
.lp-chip { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 9px; font-family: var(--kr-sans); font-weight: 700; color: var(--text, #1E3326); background: var(--honey-soft, #FFF1CC); border-radius: 8px; }
.lp-rec { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--hair, #F0F0F0); }
.lp-rec > div { flex: 1; min-width: 0; }
.lp-rec b { display: block; font-family: var(--kr-sans); font-size: 19px; font-weight: 700; }
.lp-rec small { display: block; color: var(--muted); font-size: 14px; line-height: 1.45; }
.lp-me { border-top: 0; align-items: flex-end; }
.lp-me textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; font: 17px/1.5 var(--kr-sans); border: 2px solid var(--line, #DDD); border-radius: 12px; background: var(--card, #fff); color: inherit; resize: none; }
.lp-mic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 2px solid var(--acc-btn, #237A3E); border-radius: 50%; color: var(--acc-btn, #237A3E); background: transparent; cursor: pointer; }
.lp-mic svg { width: 22px; height: 22px; }
.lp-mic.on { color: #fff; background: #D9483B; border-color: #D9483B; animation: lp-rec 1s ease-in-out infinite; }
.lp-mic.busy { opacity: .5; pointer-events: none; }
@keyframes lp-rec { 50% { box-shadow: 0 0 0 7px rgba(217, 72, 59, .18); } }
.lp-sc:empty { display: none; }
.lp-sc { display: inline-block; margin-top: 4px; padding: 1px 9px; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--card2, #F3F3F3); border-radius: 99px; }
.lp-sc b { display: inline; font: 800 15px/1.4 inherit; }
.lp-sc.good { color: #1D6B35; background: #E1F2E3; }
.lp-sc.ok { color: #8A5B00; background: #FFF1CC; }
.lp-sc.bad { color: #A02D21; background: #FBE3DF; }
.st-q .st-vi { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.st-rec { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; }
.st-rec .lp-mic { width: 64px; height: 64px; }
.st-rec .lp-mic svg { width: 30px; height: 30px; }
.lp-task { margin: 6px 0 0; padding: 10px 12px; font-weight: 600; background: var(--card2, #F7F7F7); border-left: 4px solid var(--acc-btn, #237A3E); border-radius: 8px; }
.lp-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96); border-top: 2px solid #CDE0C2; }
.lp-cta .btn { flex: 1; max-width: 320px; }
.rd-more { margin: 4px 0 -6px; font-size: 14px; font-weight: 800; color: var(--muted); }

/* the review page without its own Nếp: the page head has one */
.rv-hero { min-height: 0; padding: 16px 20px; width: 100%; }

/* a finished stop and the next one open: one big button to go on */
.rd-cont { display: block; width: 100%; margin: 14px 0 0; }

/* ---------- the route page (route.js) ---------- */
.rt-title { margin: 0 0 2px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.mp-stage.rt-skipped { opacity: .6; background: var(--fill, #F0F0F0); }
.mp-stage.rt-skipped .btn { margin-top: 4px; }
.mp-stage.rt-beyond { opacity: .5; }
.mp-stage.rt-now { border-color: var(--leaf); box-shadow: 0 10px 20px -12px rgba(23, 90, 44, .55); }
.mp-stage.rt-done .mp-head small { color: var(--leaf-d, var(--acc-ink, #175A2C)); }
.rt-lessons { display: grid; gap: 6px; margin-top: 10px; }
.rt-les { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; font: inherit; font-weight: 600; background: var(--bg); border: 2px solid transparent; border-radius: 12px; }
.rt-les i { flex: none; display: grid; place-items: center; width: 26px; height: 26px; font-style: normal; font-weight: 800; font-size: 14px; color: var(--muted); background: var(--card, #fff); border-radius: 50%; }
.rt-les.ok i { color: #fff; background: var(--leaf); }
.rt-les.cur { border-color: var(--acc-btn, #237A3E); }
.rt-les.cur i { color: #fff; background: var(--acc-btn, #237A3E); }

/* ---------- one top bar, plain page titles, a flat bottom bar, 44 px to tap ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top); z-index: 30; display: flex; align-items: center; gap: 8px; margin: -14px -16px 14px; padding: 8px 16px;
  background: var(--paper); border-bottom: 1px solid var(--line); }
.tb-stats { display: flex; gap: 8px; flex: none; }
.shell:has(.rd) .topbar { margin-bottom: 0; }
@media (min-width: 1000px) {
  .topbar { position: static; display: contents; }
  .topbar > .rd-hi { grid-area: 1 / 1; margin-bottom: 18px; }
  .topbar > .tb-stats { grid-area: 1 / 2; justify-self: end; align-self: start; margin-bottom: 14px; }
}
.pg-head { display: block; min-height: 0; margin: 4px 0 16px; padding: 0; background: none; color: var(--ink); border-radius: 0; box-shadow: none; }
.pg-head h2 { margin: 0; font-size: 26px; line-height: 1.2; color: var(--ink); }
.pg-head-say { margin: 4px 0 0; padding: 0; background: none; color: var(--ink); font-size: 16px; font-weight: 600; }
.pg-head-say::before { display: none; }
@media (max-width: 760px) {
  .nb { font-size: 12px; padding: 0; min-height: 52px; justify-content: center; }
  .nb-nep img { width: 30px; height: 30px; margin: -2px 0 -1px; padding: 0; border: 0; border-radius: 50%; box-shadow: none; }
}
/* every tap target at least 44 x 44, and 8 px apart */
.btn, .chip, .btn.small, .account { min-height: 44px; }
.filters { gap: 8px; }
.lp-say { width: 44px; height: 44px; }
.lp-bub { padding-left: 60px; }
.st-x { width: 44px; height: 44px; padding: 10px; }
.sv-back, .sv-skip { min-width: 44px; min-height: 44px; }
.brand { min-width: 44px; min-height: 44px; justify-content: center; }
.back { min-height: 44px; }
/* Korean lines to read and repeat */
.lp-line .lp-ex { font-size: 18px; }
.lp-ex span { font-size: 14px; }
small { font-size: 14px; }
.opt { min-height: 44px; }

/* lesson units without a call: letters, an example on a word card, typing a sentence back */
.hg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin-top: 6px; }
.hg-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 96px; padding: 10px 6px; border: 2px solid var(--line, var(--hair, #CDE0C2)); border-radius: 16px; background: var(--paper); cursor: pointer; }
.hg-tile b { font: 700 34px/1.1 var(--kr-sans); color: var(--leaf-d, var(--acc-ink, #175A2C)); }
.hg-tile em { font: 700 15px/1.2 var(--kr-sans); font-style: normal; color: var(--muted); }
.hg-tile small { font-size: 14px; font-weight: 700; color: var(--muted); }
.hg-tile i { font: 600 16px/1.2 var(--kr-sans); font-style: normal; color: var(--ink, var(--text, #1E3326)); }
.hg-tile:active { transform: translateY(2px); }
.tc { display: flex; flex-direction: column; align-items: center; }
.tc h3 { align-self: flex-start; }
.tc-dots { display: flex; gap: 6px; margin: 2px 0 12px; }
.tc-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tc-dots i.on { background: var(--muted); }
.tc-dots i.ok { background: var(--leaf); }
.tc-pad { width: min(300px, calc(100vw - 76px)); aspect-ratio: 1; border: 2px solid var(--line); border-radius: 18px; background: var(--paper); touch-action: none; user-select: none; -webkit-user-select: none; }
.tc-pad.tc-shake { animation: st-shake .35s; }
.tc-svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.tc-svg polyline, .tc-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tc-cross { stroke: var(--line); stroke-width: .5; stroke-dasharray: 2 2; }
.tc-guide polyline { stroke: color-mix(in srgb, var(--ink) 11%, transparent); stroke-width: 9; }
.tc-cur { stroke: color-mix(in srgb, var(--leaf) 28%, transparent); stroke-width: 9; }
.tc-cur.tc-demo { stroke: color-mix(in srgb, var(--leaf) 55%, transparent); stroke-dasharray: 1; animation: tc-draw 1.1s ease-in-out; }
@keyframes tc-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.tc-ok polyline { stroke: var(--leaf); stroke-width: 9; }
.tc-ink { stroke: var(--ink); stroke-width: 6; opacity: .85; }
.tc-arrow { stroke: var(--leaf); stroke-width: 1.8; }
.tc-dot { fill: var(--leaf); }
.tc-no { fill: #fff; font: 700 5.6px var(--ui); text-anchor: middle; pointer-events: none; }
.tc-win { border-color: var(--leaf); }
.tc-skip { margin: 12px 0 2px; min-height: 44px; padding: 8px 16px; border: 0; background: none; color: var(--muted); font: 600 14px var(--ui); text-decoration: underline; cursor: pointer; }
.lw-ex { margin: 8px 0 0; font: 500 18px/1.5 var(--kr-sans); color: var(--ink, var(--text, #1E3326)); }
/* the example of a word card: play button, the sentence, its Vietnamese; the whole line plays on a tap */
.lw-exline { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 8px; text-align: left; cursor: pointer; }
.lw-exline .lw-ex { margin: 0; }
.lw-exline small { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.cp-in { width: 100%; box-sizing: border-box; min-height: 48px; margin-top: 10px; padding: 10px 12px; font: 500 19px/1.4 var(--kr-sans); border: 2px solid var(--line, var(--hair, #CDE0C2)); border-radius: 12px; background: var(--paper); color: var(--ink, var(--text, #1E3326)); }
.cp-in:focus { outline: none; border-color: var(--leaf, var(--acc-btn, #237A3E)); }
.cp-no { margin: 10px 0 0; font-size: 16px; color: var(--wrong-d, #A02D21); }
.cp-no b { font-family: var(--kr-sans); color: var(--ink, var(--text, #1E3326)); }

/* ---------- streak screen "Nếp quyết tâm" (streak.js draws it) ----------
   It runs by itself from the moment it is added. Every element's own style is its final look; the animations run
   in from the start look with their delays read from variables streak.js sets on .sk (ms from the start):
   --tf fire, --ts stamp lands, --tn the count ends, --tt today's mini stamp, --td parcel drops, --tp parcel opens,
   --tl reward lands. The fire itself is two canvases (.sk-fb behind, .sk-ff in front) drawn by skFire.
   Reduced motion: .sk-still, no animation at all, so only the final look shows. Colours fall back to the app's tokens. */
.sk { --sk-bg: #F6EFE4; --sk-ink: var(--ink, #2B2623); --sk-red: var(--red, #C82E27); --sk-gold: #C98A06; --sk-warm: rgba(255, 150, 40, .3);
  --sk-ray: rgba(170, 80, 20, .1); --sk-card: var(--card, #FFFFFF); --sk-line: #E6D9C6; --sk-muted: var(--ink2, #6F675E); --sk-font: var(--font, Nunito, system-ui, sans-serif);
  position: fixed; inset: 0; z-index: 101; overflow: hidden; display: grid; place-items: center; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background: var(--sk-bg); color: var(--sk-ink); font-family: var(--sk-font);
  cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  animation: sk-fade .2s ease-out both; }
.sk.sk-out { animation: sk-gone .3s ease-in both; }
@keyframes sk-gone { to { opacity: 0; } }
/* dark: the app's switch on <html data-theme> (it follows the phone by default) */
html[data-theme="dark"] .sk { --sk-bg: #120E0B; --sk-ink: #F1E8DA; --sk-red: #FF5A44; --sk-gold: #FFC93C; --sk-warm: rgba(255, 110, 20, .34);
  --sk-ray: rgba(255, 170, 70, .12); --sk-card: #1E1813; --sk-line: #3A2E24; --sk-muted: #B5A895; }

.sk-fire { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sk-fb { z-index: 0; }
.sk-ff { z-index: 2; }
.sk-box { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 420px; padding: 0 16px; box-sizing: border-box; }
.sk.sk-shake .sk-box, .sk.sk-shake .sk-fire { animation: sk-shake .32s linear; }
@keyframes sk-shake { 15% { transform: translate(-5px, 3px) rotate(-.4deg); } 35% { transform: translate(5px, -3px) rotate(.4deg); }
  55% { transform: translate(-3px, -2px); } 75% { transform: translate(2px, 2px); } }
@keyframes sk-fade { from { opacity: 0; } }
@keyframes sk-hold { from, to { opacity: 1; } }   /* shown only while running, hidden after */
@keyframes sk-hide { from, to { opacity: 0; } }   /* hidden only while running, shown after */

/* the warm light behind and the manga speed lines of a milestone */
.sk-warm { position: absolute; left: 50%; top: 30%; width: 620px; height: 620px; margin: -310px 0 0 -310px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--sk-warm), transparent); pointer-events: none; animation: sk-fade .5s ease-out var(--tf) both; }
.sk-br .sk-warm { animation-duration: .8s; }
.sk-rays { position: absolute; left: 50%; top: 30%; width: 900px; height: 900px; margin: -450px 0 0 -450px; fill: var(--sk-ray); opacity: 0; pointer-events: none;
  animation: sk-rays-ms 4.4s ease-out var(--tf) both; }
@keyframes sk-rays-ms { 0% { opacity: 0; transform: scale(.6) rotate(0); } 8% { opacity: 1; } 70% { opacity: .7; } 100% { opacity: 0; transform: scale(1.2) rotate(30deg); } }

/* Nếp: the puppet in his clay, standing in the fire (the canvases draw it round him) */
.sk-stage { position: relative; width: min(250px, 30vh); aspect-ratio: 1; margin-top: 4vh; }
.sk-me { position: absolute; left: 0; right: 0; bottom: 0; animation: sk-pop .5s cubic-bezier(.3, 1.5, .5, 1) both; transform-origin: 50% 90%; }
.sk-me .nd { width: 100%; }
@keyframes sk-pop { 0% { opacity: 0; transform: translateY(26px) scale(.35); } 35% { opacity: 1; } }
.sk-q { position: absolute; right: 6%; top: 18%; font: 900 32px/1 var(--sk-font); color: var(--sk-muted); opacity: 0;
  animation: sk-qpop .4s cubic-bezier(.3, 1.8, .5, 1) .25s backwards, sk-hold calc(var(--tf) - 250ms) linear .25s; }
@keyframes sk-qpop { from { opacity: 0; transform: scale(.2) rotate(-20deg); } to { opacity: 1; } }
/* a small sigh on a broken streak */
.sk-puff { position: absolute; left: 50%; top: 62%; z-index: 2; width: 0; height: 0; pointer-events: none; }
.sk-puff i { position: absolute; width: 16px; height: 11px; border-radius: 50%; background: var(--sk-card); border: 2px solid var(--sk-line); opacity: 0; }
.sk-br .sk-puff i { animation: sk-puff .9s ease-out .35s both; }
.sk-br .sk-puff i:nth-child(2) { animation-delay: .45s; width: 11px; height: 8px; }
.sk-br .sk-puff i:nth-child(3) { animation-delay: .55s; width: 8px; height: 6px; }
@keyframes sk-puff { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 25% { opacity: .9; } 100% { opacity: 0; transform: translate(40px, 14px) scale(1.3); } }

/* the stamp, the count running up inside it */
.sk-stamp { position: relative; width: min(150px, 19vh); aspect-ratio: 1; margin-top: 2px; color: var(--sk-red); transform: rotate(-11deg);
  animation: sk-stamp .16s cubic-bezier(.6, 0, .9, .5) calc(var(--ts) - 160ms) both, sk-press .2s ease-out var(--ts); }
.sk-stamp svg { width: 100%; height: 100%; overflow: visible; }
.sk-stamp text { font-family: var(--sk-font); }
.sk-num { font-size: 66px; font-weight: 900; letter-spacing: -2px; transform-box: fill-box; transform-origin: 50% 100%; }
.sk-num.go { animation: sk-jump .45s cubic-bezier(.3, 1.9, .5, 1); }
@keyframes sk-jump { 0% { transform: translateY(0) scale(.7, 1.25); } 35% { transform: translateY(-14px) scale(1.15, .9); } }
.sk-d3 .sk-num { font-size: 46px; }
.sk-d4 .sk-num { font-size: 36px; }
@keyframes sk-stamp { from { opacity: 0; transform: translateY(-40px) scale(2.4) rotate(-26deg); } }
@keyframes sk-press { 40% { transform: rotate(-11deg) scale(.94); } }
.sk-ms .sk-stamp { width: min(170px, 21vh); color: var(--sk-gold); }
.sk-ms .sk-stamp::after { content: ""; position: absolute; inset: 6%; border-radius: 50%; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .75) 50%, transparent 62%) no-repeat; background-size: 300% 100%; background-position: -20% 0;
  opacity: 0; mix-blend-mode: soft-light; animation: sk-shine .7s ease-in-out var(--tn) backwards; }
@keyframes sk-shine { from { background-position: 120% 0; opacity: 1; } 99% { opacity: 1; } to { opacity: 0; } }
.sk-dust { position: absolute; inset: 0; pointer-events: none; }
.sk-dust i { position: absolute; left: 50%; top: 50%; width: 3px; height: 14px; margin: -7px 0 0 -1.5px; border-radius: 2px; background: currentColor; opacity: 0;
  animation: sk-dust .35s ease-out var(--ts) forwards; }
.sk-dust i:nth-child(1) { --a: 0deg; } .sk-dust i:nth-child(2) { --a: 45deg; } .sk-dust i:nth-child(3) { --a: 90deg; } .sk-dust i:nth-child(4) { --a: 135deg; }
.sk-dust i:nth-child(5) { --a: 180deg; } .sk-dust i:nth-child(6) { --a: 225deg; } .sk-dust i:nth-child(7) { --a: 270deg; } .sk-dust i:nth-child(8) { --a: 315deg; }
@keyframes sk-dust { 0% { opacity: 1; transform: rotate(var(--a)) translateY(-70px) scaleY(.4); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-104px) scaleY(1); } }

/* the parcel: a bojagi drops, the knot lets go, the four corners fall open */
.sk-gift { position: relative; display: flex; align-items: center; gap: 6px; height: min(124px, 15vh); margin: -2px 0 0 -20px; }
.sk-pack { position: relative; width: min(150px, 18vh); aspect-ratio: 160 / 134;
  animation: sk-drop .42s cubic-bezier(.3, 1.4, .5, 1) var(--td) both, sk-wiggle .3s ease-in-out calc(var(--td) + 350ms) 1; }
@keyframes sk-drop { from { opacity: 0; transform: translateY(-260px) rotate(-12deg); } }
@keyframes sk-wiggle { 25% { transform: rotate(-6deg) scale(1.04); } 75% { transform: rotate(6deg) scale(1.04); } }
.sk-cloth { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sk-cloth g, .sk-cloth path { transform-box: view-box; }
.sk-bagc { opacity: 0; animation: sk-hold var(--tp) linear; }
.sk-ears { opacity: 0; animation: sk-hold calc(var(--tp) + 120ms) linear; }
.sk-ears .l { transform-origin: 66px 40px; animation: sk-earl .25s ease-out var(--tp) both; }
.sk-ears .r { transform-origin: 74px 40px; animation: sk-earr .25s ease-out var(--tp) both; }
@keyframes sk-earl { from { transform: none; } to { transform: translate(-14px, 4px) rotate(-50deg); } }
@keyframes sk-earr { from { transform: none; } to { transform: translate(14px, 4px) rotate(50deg); } }
.sk-ears .k { transform-origin: 70px 40px; animation: sk-earl-k .2s ease-out var(--tp) both; }
@keyframes sk-earl-k { to { transform: scale(1.4); opacity: 0; } }
.sk-open { animation: sk-hide var(--tp) linear; }
.sk-skirt { transform-origin: 70px 104px; animation: sk-skirt .45s cubic-bezier(.3, 1.5, .5, 1) var(--tp) both; }
@keyframes sk-skirt { 0% { transform: scale(.3, .5); opacity: .4; } 55% { transform: scale(1.06, 1.12); opacity: 1; } }
.sk-item { position: absolute; left: 22%; top: 7%; width: 55%; aspect-ratio: 1; overflow: visible; opacity: 0;
  filter: drop-shadow(0 0 10px rgba(255, 210, 90, .95));
  animation: sk-rise .4s cubic-bezier(.3, 1.6, .5, 1) calc(var(--tp) + 50ms) both, sk-fly .38s cubic-bezier(.5, 0, .7, 1) calc(var(--tp) + 510ms) forwards; }
@keyframes sk-rise { from { opacity: 0; transform: translateY(28px) scale(.2); } to { opacity: 1; transform: none; } }
@keyframes sk-fly { from { opacity: 1; transform: none; } 85% { opacity: 1; } to { opacity: 0; transform: translate(var(--fx, 0), var(--fy, -200px)) scale(.55); } }
.sk-item.sk-lay { left: calc(50% - 104px); top: calc(50% - 93px); width: 209px; height: 186px; transform: scale(.4); pointer-events: none;
  animation: sk-lrise .4s cubic-bezier(.3, 1.6, .5, 1) calc(var(--tp) + 50ms) both, sk-lfly .38s cubic-bezier(.5, 0, .7, 1) calc(var(--tp) + 510ms) forwards; }
@keyframes sk-lrise { from { opacity: 0; transform: scale(.08); } to { opacity: 1; transform: scale(.4); } }
@keyframes sk-lfly { from { opacity: 1; transform: scale(.4); } 85% { opacity: 1; } to { opacity: 0; transform: translate(var(--fx, 0), var(--fy, -200px)) scale(1); } }
.sk-shine { position: absolute; left: 50%; top: 45%; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; opacity: 0;
  background: radial-gradient(closest-side, rgba(255, 220, 110, .9), rgba(255, 200, 80, .35) 55%, transparent); pointer-events: none;
  animation: sk-glow 1s ease-out var(--tp) both; }
@keyframes sk-glow { 0% { opacity: 0; transform: scale(.3); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.3); } }
.sk-got { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sk-got b { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px 5px 8px; border-radius: 20px 7px 20px 7px;
  background: var(--sk-card); border: 2px solid var(--sk-line); font-size: 17px; font-weight: 900; color: var(--sk-ink);
  animation: sk-chip .35s cubic-bezier(.3, 1.6, .5, 1) calc(var(--tp) + 250ms) both; }
.sk-got .sk-gname { animation-delay: calc(var(--tp) + 400ms); }
@keyframes sk-chip { from { opacity: 0; transform: translateX(-12px) scale(.6); } }
.sk-it-aura path { opacity: .75; }

/* what Nếp shouts: the Korean line, what it means under it */
.sk-sub { margin: 10px 0 0; min-height: 46px; text-align: center; opacity: 0; transform: translateY(6px) scale(.9); transition: opacity .18s, transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.sk-sub.on { opacity: 1; transform: none; }
.sk-sub b { display: block; font: 800 21px/1.25 'Noto Sans KR', system-ui, sans-serif; color: var(--sk-ink); }
.sk-sub small { display: block; margin-top: 2px; font-size: 14px; font-weight: 700; color: var(--sk-muted); }
.sk-sub:empty, .sk-sub b:empty + small:empty { visibility: hidden; }

/* the week: one small stamp a day, today's last */
.sk-week { display: flex; justify-content: center; gap: 6px; margin-top: 12px; padding: 10px 12px 12px; border-radius: 20px 7px 20px 7px;
  background: var(--sk-card); border: 2px solid var(--sk-line); animation: sk-fade .3s ease-out .15s both; }
.sk-day { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 38px; }
.sk-day small { font-size: 12px; font-weight: 900; color: var(--sk-muted); }
.sk-day.now small { color: var(--sk-red); }
.sk-day span { width: 34px; height: 34px; border-radius: 50%; border: 2px dashed var(--sk-line); box-sizing: border-box; display: grid; place-items: center; }
.sk-day svg { width: 36px; height: 36px; color: var(--sk-red); opacity: 0; transform: rotate(-12deg); }
.sk-day.on span, .sk-day.now span { border-color: transparent; }
.sk-day.on svg { opacity: .9; }
.sk-day.now svg { opacity: 1; animation: sk-mini .14s cubic-bezier(.6, 0, .9, .5) calc(var(--tt) - 140ms) both; }
.sk-day.now span { animation: sk-dash var(--tt) steps(1); }
@keyframes sk-dash { from, to { border-color: var(--sk-line); } }
@keyframes sk-mini { from { opacity: 0; transform: scale(2.6) rotate(-30deg); } }

/* still: no motion, just the final look */
.sk-still, .sk-still *, .sk-still *::before, .sk-still *::after { animation: none !important; transition: none !important; }
.sk-still .sk-rays, .sk-still .sk-puff, .sk-still .sk-dust, .sk-still .sk-item, .sk-still .sk-shine, .sk-still .sk-q { display: none; }
@media (prefers-reduced-motion: reduce) { .sk *, .sk *::before, .sk *::after { animation: none !important; transition: none !important; } }

/* the wait screen when the app opens: a low flame, the streak so far, today's ring blinking */
.sk-wait .sk-warm { animation: sk-fade .5s ease-out both; }
.sk-wait.sk-br .sk-warm { animation: sk-fade .6s ease-out 1.1s both; }
.sk-wn { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; color: var(--sk-red); font-family: var(--sk-font);
  animation: sk-chip .4s cubic-bezier(.3, 1.6, .5, 1) .25s both; }
.sk-wn b { font-size: 64px; font-weight: 900; line-height: 1; letter-spacing: -2px; }
.sk-wn small { font-size: 20px; font-weight: 900; }
.sk-wl { margin: 6px 0 0; font: 900 18px/1.3 var(--sk-font); color: var(--sk-ink); text-align: center; animation: sk-fade .3s ease-out .4s both; }
.sk-wait.sk-br .sk-wl { animation-delay: var(--tf); }
.sk-wait .sk-sub { min-height: 0; margin-top: 6px; }
.sk-wait .sk-sub b { font-size: 17px; }
.sk-wait .sk-sub small { font-size: 13px; }
.sk-wait .sk-day.now svg { opacity: 0; animation: none; }
.sk-wait .sk-day.now span { border: 2.5px dashed var(--sk-red); animation: sk-blink 1s ease-in-out infinite; }
@keyframes sk-blink { 50% { opacity: .25; transform: scale(.9); } }
@media (max-height: 640px) { .sk-sub { min-height: 40px; margin-top: 6px; } .sk-sub b { font-size: 18px; } .sk-week { margin-top: 8px; padding: 8px 10px 10px; } }

/* ---------- study reminders (push.js) ---------- */
.nh-msg { margin: 8px 0 0; }
.nh-steps { margin: 8px 0 0; padding-left: 22px; line-height: 1.7; }
.nh-ic { width: 20px; height: 20px; vertical-align: -4px; color: var(--sky-d, #1899D6); }
/* ---------- Nếp dressed (shop.js nepDressed): the clay picture and one layer per thing he wears ---------- */
.nd { position: relative; display: block; aspect-ratio: 640 / 570; }
.nd > img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.nd > .nd-back { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* Nếp alive (nep-rig.js): canvases where his pictures were; the CSS for those <img> is mirrored onto them */
canvas.nrig { -webkit-tap-highlight-color: transparent; user-select: none; touch-action: manipulation; }
.nd > canvas.nrig { position: absolute; }
.rd-nep canvas.nrig { pointer-events: auto; cursor: pointer; }   /* the map lets taps through; he takes his own */
.sk-im { overflow: visible; }
/* what Nếp says when tapped: the Korean line, what it means under it */
.nrb { position: fixed; z-index: 120; max-width: 220px; padding: 7px 12px 8px; border-radius: 14px; background: var(--paper, #fff); color: var(--ink, #2B2623);
  box-shadow: 0 6px 18px -6px rgba(43, 38, 35, .35); border: 2px solid var(--line, #E6DED2); pointer-events: none; text-align: center; animation: nrb-in .22s cubic-bezier(.3, 1.6, .5, 1); }
.nrb b { display: block; font: 700 17px/1.25 'Noto Sans KR', system-ui, sans-serif; }
.nrb small { display: block; font: 500 12.5px/1.3 var(--ui, system-ui); color: var(--muted, #7A7068); margin-top: 1px; }
.nrb::after { content: ''; position: absolute; left: var(--tx, 50%); bottom: -7px; width: 12px; height: 12px; margin-left: -6px; background: inherit; border: inherit; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.nrb.below::after { bottom: auto; top: -7px; border-width: 2px 0 0 2px; }
.nrb.side::after { left: -7px; top: 50%; bottom: auto; margin: -6px 0 0; border-width: 0 0 2px 2px; }
.nrb.out { opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; }
@keyframes nrb-in { 0% { opacity: 0; transform: scale(.7) translateY(6px); } 100% { opacity: 1; transform: none; } }

/* the Tôi panel: Nếp standing on the card in what he wears, the shop under him */
.pet .pet-stage { display: block; width: min(200px, 62%); margin: 6px auto 0; padding: 0; border: 0; background: none; cursor: pointer; }
.pet .pet-stage .nd { display: block; width: 100%; }
.pet-acts { display: flex; margin: 10px 0 2px; }
.pet-acts .btn { flex: 1 1 0; min-width: 0; padding: 9px 8px; min-height: 46px; }

/* the map: Nếp by today's stop */
.rd-nep .nd { width: 128px; margin: 0 -8px -8px; animation: rd-bob 1.6s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(23, 90, 44, .25)); }
.rd-nep .nd img { width: 100%; animation: none; filter: none; }

/* ---------- the shop ---------- */
html.shop-on { overflow: hidden; }
.shop { position: fixed; inset: 0; z-index: 62; overflow: hidden auto; background: var(--bg); color: var(--ink); animation: rd-fade .18s; overscroll-behavior: contain; }
.sh-in { max-width: 1000px; margin: 0 auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); overflow-x: clip; }
.sh-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 0 12px; background: var(--bg); }
.sh-top h2 { flex: 1; margin: 0; font-size: 22px; font-weight: 900; }
.sh-x { flex: none; width: 44px; height: 44px; padding: 0; display: flex; align-items: center; justify-content: center; border: 2px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink); }
.sh-x svg { display: block; width: 22px; height: 22px; }
.sh-have { display: flex; align-items: center; gap: 4px; padding: 6px 12px 6px 8px; border-radius: 99px; background: var(--paper); border: 2px solid var(--line); font-size: 18px; }
.sh-have b { font-weight: 800; }
.sh-have.bump { animation: gr-bump .35s cubic-bezier(.3, 1.8, .5, 1); }
.sh-body { display: grid; gap: 16px; }
.sh-stage { position: relative; display: grid; justify-items: center; padding: 56px 0 12px; }
.sh-nep { width: min(340px, 88vw); }
/* he stands on the page: only a soft round of floor under his feet (the frame's feet are at 83%) */
.sh-nep::before { content: ''; position: absolute; left: 6%; right: 6%; top: 71%; height: 25%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(96, 72, 40, .17), rgba(96, 72, 40, .08) 60%, transparent); }
html[data-theme="dark"] .sh-nep::before { background: radial-gradient(closest-side, rgba(255, 238, 210, .14), rgba(255, 238, 210, .06) 60%, transparent); }
.sh-stage.dress .sh-nep { animation: pet-hop .5s cubic-bezier(.3, 1.6, .5, 1); }
.sh-nep { touch-action: pan-y; cursor: grab; }
.sh-nep.spinning, .sh-nep.turning { cursor: grabbing; }
.nd.spinning > :not(.nd-spin) { visibility: hidden; }
.sh-spin-hint { position: absolute; left: 50%; bottom: -4%; width: 52px; margin-left: -26px; color: var(--ink); opacity: .55; pointer-events: none; animation: sh-sway 1.6s ease-in-out infinite; }
.sh-spin-hint svg { display: block; width: 100%; }
@keyframes sh-sway { 0%, 100% { transform: translateX(-7px); } 50% { transform: translateX(7px); } }
.sh-stage.hinted .sh-act { margin-top: 30px; }   /* the ↔ hint hangs under him: room for it above the name */
.sh-act { position: relative; z-index: 1; min-height: 50px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; }
.sh-act > b { width: 100%; text-align: center; font-size: 17px; font-weight: 800; }
.sh-act .btn { min-height: 46px; padding: 10px 20px; font-weight: 800; }
.sh-buy[disabled] { opacity: .7; cursor: default; }
.sh-shelf { position: relative; z-index: 1; min-width: 0; }   /* his canvas reaches past him: the shelf stays on top to take taps */
.sh-tabs { display: flex; gap: 5px; margin-bottom: 12px; }
.sh-tab { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 6px; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); font-weight: 800; font-size: 15px; white-space: nowrap; }
.sh-sch { scroll-margin-top: 76px; }
.sh-tab.on { border-color: var(--leaf); background: var(--leaf); color: #fff; }
.sh-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sh-it { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 4px 10px; border: 2px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); text-align: center; }
.sh-it:active { transform: translateY(2px); }
.sh-th { width: 72px; height: 72px; display: grid; place-items: center; }
.sh-th img, .sh-th svg { width: 100%; height: 100%; object-fit: contain; }
.sh-it b { font-size: 14px; font-weight: 800; line-height: 1.25; }
.sh-it small { display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 800; color: var(--honey-ink, #8A6100); }
.sh-it small svg { width: 16px; height: 16px; }
.sh-it.dear small { color: var(--muted); }
.sh-it.on { border-color: var(--leaf); box-shadow: 0 0 0 2px var(--leaf) inset; }
.sh-it.on small { color: var(--leaf); }
.sh-it.try { border-color: var(--bean); box-shadow: 0 0 0 2px var(--bean) inset; }
.sh-it.lock .sh-th { filter: grayscale(1); opacity: .45; }
.sh-it.lock small { color: var(--muted); }
/* tiers: a coloured edge and a small tag (thường has neither) */
.sh-tier { position: absolute; top: 6px; left: 6px; z-index: 1; padding: 1px 7px; border-radius: 99px; font: 800 12px/18px var(--ui, inherit); font-style: normal; color: #fff; pointer-events: none; }
.sh-it.tier1 { border-color: #8DBBEA; } .tier1 .sh-tier { background: #2F74C0; }
.sh-it.tier2 { border-color: #B79AE6; } .tier2 .sh-tier { background: #7A4CC9; }
.sh-it.tier3 { border-color: #E9C25A; background-image: linear-gradient(160deg, rgba(255, 216, 102, .22), transparent 55%); }
.tier3 .sh-tier { background: linear-gradient(100deg, #C8890E, #F0BE3A 45%, #C8890E); background-size: 200% 100%; color: #3A2600; animation: sh-shine 2.6s linear infinite; }
@keyframes sh-shine { to { background-position: -200% 0; } }
.sh-th:has(> canvas.vt-th) { position: relative; }
.sh-th canvas.vt-th { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
/* the school jackets: search, region, kind */
.sh-sch { margin-top: 20px; }
.sh-sch-h { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 10px; }
.sh-sch-h h3 { margin: 0; font-size: 18px; font-weight: 800; }
.sh-sch-h small { font-size: 14px; font-weight: 700; color: var(--muted); }
.sh-find { display: flex; gap: 8px; }
.sh-q, .sh-reg { min-height: 46px; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); font: 600 16px var(--ui, inherit); }
.sh-q { flex: 1 1 auto; min-width: 0; padding: 0 12px; }
.sh-reg { flex: 0 1 40%; min-width: 0; padding: 0 8px; }
.sh-q:focus, .sh-reg:focus { outline: none; border-color: var(--leaf); }
.sh-kinds { display: flex; gap: 6px; margin: 10px 0 2px; }
.sh-kinds button { min-height: 38px; padding: 0 14px; border: 2px solid var(--line); border-radius: 99px; background: var(--paper); color: var(--ink); font-weight: 800; font-size: 14px; }
.sh-kinds button.on { border-color: var(--leaf); background: var(--leaf); color: #fff; }
.sh-sgrid { margin-top: 12px; }
.sh-none { grid-column: 1 / -1; margin: 18px 0; text-align: center; color: var(--muted); font-weight: 700; }
@media (min-width: 760px) {
  .sh-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; gap: 28px; }
  .sh-stage { position: sticky; top: 76px; }
  .sh-nep { width: min(420px, 100%); }
  .sh-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* phone: the frame's empty bottom (feet are at 83%) and the idle action row no longer leave a gap above the tabs */
@media (max-width: 759.98px) {
  .sh-stage { padding-bottom: 0; }
  .sh-nep { margin-bottom: -8%; }
  .sh-stage.hinted .sh-act { margin-top: calc(30px + 8%); }
  .sh-act-idle:empty { min-height: 0; margin: 0; }
}

  html[data-theme="dark"] .sh-it small { color: #F4C763; }
  html[data-theme="dark"] .sh-it.tier1 { border-color: #3D6CA3; }
  html[data-theme="dark"] .sh-it.tier2 { border-color: #6B54A3; }
  html[data-theme="dark"] .sh-it.tier3 { border-color: #B08A2E; background-image: linear-gradient(160deg, rgba(255, 216, 102, .12), transparent 55%); }

@media (prefers-reduced-motion: reduce) { .rd-nep .nd, .sh-stage.dress .sh-nep, .shop, .sh-spin-hint, .tier3 .sh-tier { animation: none; } }

/* ---------- home map as a Seoul subway line (metro.js draws, road.js keeps the data) ----------
   Colours come from the app's tokens with fallbacks, so the new palette drops in. --ln/--lnd: the book's line, set
   inline; --l is the one in use (brighter in the dark). */
.mt { --mt-card: var(--card, var(--paper, #fff)); --mt-fill: var(--fill, #EFECE4); --mt-ink: var(--ink, #1B201C); --mt-ink2: var(--ink2, var(--muted, #535B55));
  --mt-ink3: #5C635D; --mt-line: var(--line, #ECE8DE); --mt-rail: #DCD7CB; --mt-red: var(--red, #DE4636); }
.mt, .mt-sign, .mt-scene, .mt-row { --l: var(--ln); --lf: var(--lnf, var(--ln)); --lt: var(--lnt, #fff); }
.mt-row.xfer { --o: var(--lo); }
.mt-scene { --mt-ceil1: #EEE9DE; --mt-ceil2: #DED7C8; --mt-floor: #DAD3C4; --mt-edge: #B8AF9C; }
html[data-theme="dark"] .mt { --mt-fill: var(--fill, #272B26); --mt-ink3: #A6ADA5; --mt-rail: #3A3F3A; --mt-red: var(--red, #F0604F); }
html[data-theme="dark"] :is(.mt, .mt-sign, .mt-scene, .mt-row) { --l: var(--lnd); --lf: var(--lndf, var(--lnd)); --lt: var(--lndt, #fff); }
html[data-theme="dark"] .mt-row.xfer { --o: var(--lod); }
html[data-theme="dark"] .mt-scene { --mt-ceil1: #2B2F31; --mt-ceil2: #212527; --mt-floor: #2E312E; --mt-edge: #4A4E48; }
html[data-theme="dark"] .mt-train svg { filter: brightness(.84); }

.mt.rd-road { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; padding: 0 0 8px; background: none; border-radius: 0; box-shadow: none; overflow: visible; color: var(--mt-ink); }
.mt-head { display: flex; align-items: center; gap: 10px; margin: 14px 4px 10px; }
.mt-ln-no { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--lf); color: var(--lt); font: 800 15px/1 system-ui, sans-serif; font-style: normal; }
.mt-head b { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.mt-card { margin-bottom: 14px; background: var(--mt-card); border-radius: 24px; overflow: hidden; box-shadow: 0 1px 0 var(--mt-line), 0 12px 26px -20px rgba(0, 0, 0, .45); }
.mt-code { display: inline-grid; place-items: center; box-sizing: border-box; min-width: 46px; height: 26px; padding: 0 7px; border: 2.5px solid var(--l); border-radius: 13px;
  background: var(--mt-card); color: var(--mt-ink); font: 800 14px/1 system-ui, sans-serif; font-style: normal; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* the station sign: the one before, this one in the line's pill with its number, the next; the band under */
.mt-sign { padding-top: 14px; }
.mt-sg-top { display: grid; }
.mt-sg-in { grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 0 14px; }
.mt-sign.was .mt-sg-in.new { opacity: 0; }
.mt-sg-side { display: flex; flex-direction: column; min-width: 0; color: var(--mt-ink2); }
.mt-sg-side b { font: 700 14px/1.3 var(--kr-sans, system-ui), sans-serif; }
.mt-sg-side small { font-size: 13px; line-height: 1.25; font-weight: 600; color: var(--mt-ink3); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
/* a narrow phone: the next station's name on one line, its Vietnamese in two at most, so the sign stays short */
@media (max-width: 420px) {
  .mt-sg-side b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* the side column is too narrow for a Vietnamese word here ("Quản / g cáo"): the Korean name and its arrow are enough */
  .mt-sg-side small { display: none; }
}
/* a short phone (iPhone SE): the platform a little smaller, so the big button shows above the tab bar */
@media (max-width: 600px) and (max-height: 700px) { .mt .mt-scene { zoom: .72; } }
.mt-sg-side > * { max-width: 100%; }
.mt-sg-side.pv b::before { content: '\2039\00a0'; }
.mt-sg-side.nx { align-items: flex-end; text-align: right; }
.mt-sg-side.nx b::after { content: '\00a0\203A'; }
.mt-sg-mid { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.mt-sg-pill { display: flex; align-items: center; gap: 8px; max-width: 62vw; padding: 5px 15px 5px 5px; border: 4px solid var(--l); border-radius: 999px; background: var(--mt-card); }
.mt-sg-pill b { font: 800 clamp(20px, 6.2vw, 26px)/1.15 var(--kr-sans, system-ui), sans-serif; letter-spacing: -.03em; word-break: keep-all; }
.mt-sg-pill .mt-code { flex: none; height: 30px; min-width: 30px; padding: 0 8px; border: 0; border-radius: 999px; background: var(--lf); color: var(--lt); }
.mt-sg-mid small { font-size: 14px; font-weight: 700; color: var(--mt-ink2); text-align: center; }
.mt-sg-band { position: relative; height: 10px; margin-top: 12px; background: var(--l); }
.mt-sg-band::after { content: ''; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; border: solid #fff; border-width: 2px 2px 0 0; transform: translateY(-50%) rotate(45deg); }
.mt-sg-trk { position: absolute; inset: 0; }
.mt-sg-car { position: absolute; left: 0; top: 50%; box-sizing: border-box; width: 26px; height: 16px; margin: -8px 0 0 -13px; border: 2px solid var(--l); border-radius: 5px 8px 8px 5px;
  background: linear-gradient(var(--l), var(--l)) 13px 3px / 6px 6px no-repeat, #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .25); }
.mt-sg-sub { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 9px 16px 11px; font-size: 14px; font-weight: 600; color: var(--mt-ink3); }
.mt-sg-sub b { color: var(--mt-ink2); font-weight: 800; }
.mt-sg-sub span:last-child { text-align: right; }

/* the platform: tunnel and rails, the train, then the ceiling, screen doors and floor (they slide when the train runs) */
.mt-scene { position: relative; height: 244px; overflow: hidden; isolation: isolate; background: #1B2023; }
.mt-tun { position: absolute; inset: 0; overflow: hidden;
  background: linear-gradient(#8C9399, #8C9399) 0 176px / 100% 3px no-repeat, linear-gradient(#5F666B, #5F666B) 0 186px / 100% 3px no-repeat, linear-gradient(#15191C, #262C30 55%, #15191B 82%); }
.mt-tun::before { content: ''; position: absolute; top: 26px; left: 0; width: calc(100% + 160px); height: 5px; background: repeating-linear-gradient(90deg, rgba(255, 214, 140, .9) 0 34px, transparent 34px 160px); }
.mt-tun::after { content: ''; position: absolute; top: 179px; left: 0; width: calc(100% + 40px); height: 10px; background: repeating-linear-gradient(90deg, #3E3731 0 14px, transparent 14px 40px); }
.mt-scene.go .mt-tun::before { animation: mt-lamp .3s linear infinite; }
.mt-scene.go .mt-tun::after { animation: mt-slp .12s linear infinite; }
@keyframes mt-lamp { to { transform: translateX(-160px); } }
@keyframes mt-slp { to { transform: translateX(-40px); } }
.mt-train { position: absolute; left: calc(50% - 385px); top: 70px; width: 1100px; height: 104px; }
.mt-train svg { display: block; }
.mt-scene.go .mt-train { animation: mt-jig .22s linear infinite; }
@keyframes mt-jig { 50% { transform: translateY(1px); } }
.mt-train .tb { fill: #F1F3F4; } .mt-train .tr { fill: #D2D8DC; } .mt-train .tk { fill: #BBC3C9; } .mt-train .tg { fill: url(#mt-gl); }
.mt-train .td { fill: #E3E7EA; stroke: #AAB3BA; stroke-width: 1; } .mt-train .te { fill: none; stroke: #97A1A8; stroke-width: 1.5; }
.mt-train .tp { fill: #B5BCC1; } .mt-train .tc { fill: #4A5157; }
/* inside the car (metro.js MT_TRAIN): warm-lit ivory walls, benches in the line's colour, steel and glass */
.mt-train .ti { fill: #F1EADB; } .mt-train .tl { fill: #FFFDF3; } .mt-train .tlg { fill: url(#mt-lg); }
.mt-train .ta { fill: color-mix(in srgb, var(--l) 40%, #fff); } .mt-train .ta2 { fill: #CFE2EA; } .mt-train .tz { fill: #FFD27A; }
.mt-train .to { fill: #DCE1E4; } .mt-train .tq { fill: rgba(214, 232, 240, .65); stroke: #A6B1B8; stroke-width: .8; }
.mt-train .ts { fill: color-mix(in srgb, var(--l) 82%, #1C2630); } .mt-train .ts2 { fill: color-mix(in srgb, var(--l) 88%, #fff); } .mt-train .tk2 { fill: #BCC3C8; }
.mt-train .tf { fill: #CBC4B4; } .mt-train .tfl { stroke: rgba(255, 255, 255, .45); stroke-width: 2; stroke-linecap: round; }
.mt-train .th { fill: none; stroke: #8E979E; stroke-width: 1.3; stroke-linejoin: round; } .mt-train .tph { fill: #F2F4F5; }
.mt-train .tsd { stroke: rgba(0, 0, 0, .18); stroke-width: 1; } .mt-train .tj { fill: rgba(40, 46, 52, .14); }
.mt-train .tm { fill: #34404B; opacity: .32; } .mt-train .tms { fill: none; stroke: #34404B; stroke-width: 1.6; stroke-linecap: round; }
html[data-theme="dark"] .mt-train .ti { fill: #F6EEDC; }
html[data-theme="dark"] .mt-train .tm { opacity: .42; }
.mt-train .tu { fill: #2D3236; } .mt-train .tw { fill: #1D2124; stroke: #565D62; stroke-width: 1.5; } .mt .ln { fill: var(--l); }
.mt-dl, .mt-dr, .mt-pl, .mt-pr { transition: transform .5s cubic-bezier(.5, 0, .3, 1); }
.mt-scene.open .mt-dl { transform: translateX(-26px); }
.mt-scene.open .mt-dr { transform: translateX(26px); }
.mt-scene.open .mt-pl { transform: translateX(-33px); }
.mt-scene.open .mt-pr { transform: translateX(33px); }
.mt-w2 { position: absolute; inset: 0; z-index: 1; }
.mt-ceil { position: absolute; left: 0; right: 0; top: 0; height: 52px; background: linear-gradient(var(--mt-ceil1), var(--mt-ceil2)); }
.mt-ceil::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 4px; background: repeating-linear-gradient(90deg, #FFFCEF 0 72px, transparent 72px 130px); box-shadow: 0 2px 6px rgba(255, 244, 205, .5); }
.mt-hang { position: absolute; left: max(12px, calc(50% - 175px)); top: 15px; display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 6px; background: #2C3238; color: #fff;
  white-space: nowrap; max-width: calc(100% - 24px); box-sizing: border-box; box-shadow: 0 3px 6px -2px rgba(0, 0, 0, .4); }
.mt-hang::before { content: ''; position: absolute; left: 16px; right: 16px; top: -15px; height: 15px; border: solid #8D949A; border-width: 0 2px; }
.mt-hang b { font: 800 15px/1.1 var(--kr-sans, system-ui), sans-serif; }
.mt-hang small { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 600; color: #C9CED2; }
.mt-hang .mt-code { flex: none; height: 22px; min-width: 42px; padding: 0 5px; border-width: 2px; font-size: 14px; background: #fff; color: #1B201C; }
.mt-hang.new, .mt-scene.shut .mt-hang.old { display: none; }
.mt-scene.shut .mt-hang.new { display: flex; }
.mt-psd { position: absolute; top: 52px; left: calc(50% - 650px); width: 1300px; height: 112px; }
.mt-psd svg { display: block; }
.mt-psd .pt { fill: #394047; } .mt-psd .pp { fill: #8F989F; } .mt-psd .pg { fill: rgba(205, 228, 238, .14); stroke: rgba(160, 180, 190, .55); stroke-width: 1; }
.mt-psd .pl { fill: rgba(205, 228, 238, .2); stroke: #A3ADB4; stroke-width: 1.5; }
.mt-floor { position: absolute; left: 0; right: 0; top: 164px; bottom: 0; border-top: 3px solid var(--mt-edge);
  background: radial-gradient(rgba(0, 0, 0, .07) 1px, transparent 1.4px) 0 0 / 9px 9px, linear-gradient(var(--mt-floor), color-mix(in srgb, var(--mt-floor) 86%, #000)); }
.mt-floor::before { content: ''; position: absolute; left: 0; right: 0; top: 5px; height: 11px; background: radial-gradient(circle, rgba(110, 80, 0, .35) 1.3px, transparent 1.7px) 0 0 / 6px 5.5px, #F2C21B; }
.mt .mt-nep { position: absolute; left: calc(50% + 46px); top: auto; bottom: 0; z-index: 3; width: 104px; transform: none; pointer-events: none; }
.mt .mt-nep .nd { width: 104px; margin: 0; animation: none; filter: drop-shadow(0 5px 4px rgba(0, 0, 0, .2)); }
/* the greeting stands on the floor to his left (the floor is 34px taller than the doors need), so it hides no door */
.mt .mt-nep .rd-say { max-width: 150px; left: auto; right: calc(100% - 4px); bottom: 12px; transform: none; color: var(--mt-ink); background: var(--mt-card); transition: opacity .2s; }
.mt .mt-nep .rd-say::after { top: 50%; left: 100%; margin: -7px 0 0; border-top-color: transparent; border-left-color: var(--mt-card); }
.mt-scene.trip .rd-say { opacity: 0; }
/* the open door: the car's light on the platform floor (.today and .rd-stop must not paint the button) */
.mt .mt-board { display: block; padding: 0; border: 0; border-radius: 4px; background: none; box-shadow: none; }
.mt-floor::after { content: ''; position: absolute; left: calc(50% - 60px); top: 0; width: 120px; height: 34px; opacity: 0; transition: opacity .45s;
  background: radial-gradient(60px 26px at 50% 0, rgba(255, 238, 190, .55), transparent); }
.mt-scene.open .mt-floor::after { opacity: 1; }
.mt-board { position: absolute; left: calc(50% - 40px); top: 52px; z-index: 2; width: 80px; height: 112px; padding: 0; border: 0; border-radius: 4px; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mt-board::after { content: ''; position: absolute; inset: 18px 4px 4px; border-radius: 4px; opacity: 0; animation: mt-door 2.4s ease-in-out infinite;
  box-shadow: 0 0 14px 2px color-mix(in srgb, var(--l) 60%, transparent), inset 0 0 0 2px color-mix(in srgb, var(--l) 70%, transparent); }
@keyframes mt-door { 50% { opacity: .85; } }
.mt-scene.trip .mt-board::after, .mt-board.calm::after { animation: none; }
:is(.mt-b, .mt-board):focus-visible { outline: 3px solid var(--l); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .mt-board::after, .mt-scene.go .mt-tun::before, .mt-scene.go .mt-tun::after, .mt-scene.go .mt-train { animation: none; }
  .mt-dl, .mt-dr, .mt-pl, .mt-pr { transition: none; }
}

/* map shell */
.mt-map { position: relative; padding: 6px 0; }
.mt-line { list-style: none; margin: 0; padding: 0; }

.mt-row { position: relative; display: flex; align-items: center; min-height: 54px; }
.mt-row::before, .mt-row::after { content: ''; position: absolute; left: 27px; width: 6px; background: var(--mt-rail); }
.mt-row::before { top: 0; height: 50%; }
.mt-row::after { top: 50%; bottom: 0; }
.mt-row.up::before, .mt-row.dn::after { background: var(--l); }
.mt-row.xfer.up::before { background: var(--o); }
.mt-row:first-child::before { display: none; }
.mt-row:last-child::after { background: linear-gradient(var(--mt-rail), transparent); }

.mt-node { position: absolute; left: 30px; top: 50%; z-index: 1; display: grid; place-items: center; box-sizing: border-box; border-radius: 50%; transform: translate(-50%, -50%); background: var(--mt-card); border: 3px solid var(--mt-rail); width: 14px; height: 14px; color: var(--lt); transition: none; }
.mt-node svg { width: 60%; height: 60%; display: block; }

/* stations */
.mt-st { min-height: 70px; padding: 10px 16px 10px 60px; gap: 10px; }
.mt-st .mt-node { width: 22px; height: 22px; border-width: 4px; }
.mt-st.past .mt-node { background: var(--l); border-color: var(--l); }
.mt-st.here .mt-node { width: 30px; height: 30px; border: 6px solid var(--l); box-shadow: 0 0 0 5px color-mix(in srgb, var(--l) 20%, transparent); }
.mt-st.xfer .mt-node { width: 30px; height: 30px; border: 5px solid var(--l); box-shadow: inset 0 0 0 3px var(--mt-card), inset 0 0 0 9px var(--o); }
.mt-st .mt-txt { flex: 1; min-width: 0; }
.mt-txt b { font: 800 19px/1.25 var(--kr-sans, system-ui), sans-serif; letter-spacing: -.02em; color: var(--mt-ink); }
.mt-txt > span { font-size: 15px; font-weight: 600; color: var(--mt-ink2); }
.mt-st .mt-txt > span { display: block; font-size: 14px; }
.mt-txt small { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; color: var(--mt-ink3); font-variant-numeric: tabular-nums; }
.mt-st.next .mt-txt b { color: var(--mt-ink2); }
.mt-st .mt-code { flex: none; }
.mt-st.next .mt-code { opacity: .65; }
.mt-stamp { flex: none; width: 36px; height: 36px; color: var(--mt-red); transform: rotate(-12deg); opacity: .9; }
.mt-xf { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 8px; background: var(--lf); color: var(--lt); font-size: 14px; font-weight: 800; font-style: normal; }
.mt-flag { display: inline-block; max-width: 100%; margin-top: 5px; padding: 2px 9px; border-radius: 8px; background: color-mix(in srgb, var(--mt-red) 14%, transparent); color: var(--mt-red); font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }

/* stops */
.mt-sub { padding: 0 10px 0 0; }
.mt-b { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; margin: 2px 0; padding: 8px 10px 8px 60px; border: 0; border-radius: 16px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s; }
.mt .mt-b { border: 0; border-radius: 16px; box-shadow: none; }
.mt-b:active { background: var(--mt-fill); }
.mt .mt-b.later { background: none; }
.mt .mt-b.later .mt-node { animation: none; }
.mt-b.today { background: color-mix(in srgb, var(--l) 10%, var(--mt-card)); }
.mt-b .mt-txt { flex: 1; min-width: 0; }
.mt-b .mt-txt b { font-size: 16px; font-weight: 700; line-height: 1.3; font-family: inherit; letter-spacing: 0; }
.mt-pt.lock .mt-txt b { color: var(--mt-ink2); }
.mt-pt.done .mt-node { width: 20px; height: 20px; background: var(--l); border-color: var(--l); }
.mt-pt.half .mt-node { width: 18px; height: 18px; border-color: var(--l); background: conic-gradient(var(--l) var(--p, 50%), var(--mt-card) 0); }
.mt-pt.now .mt-node { width: 18px; height: 18px; border: 4px solid var(--l); }
.mt-b.today .mt-node { animation: mt-pulse 1.6s ease-out infinite; }
@keyframes mt-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--l) 50%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.mt-go { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--lf); color: var(--lt); font-size: 14px; font-weight: 800; font-style: normal; white-space: nowrap; box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .3); }

.mt-rv .mt-node { width: 26px; height: 26px; border-color: var(--l); color: var(--l); }
.mt-rv.done .mt-node { background: var(--l); color: var(--lt); }

.mt-ch .mt-node { width: 32px; height: 32px; border: 0; border-radius: 0; background: none; }
.mt-ch .mt-node svg { width: 32px; height: 29px; overflow: visible; }
.mt-ch:not(.open, .ready, .opening) .mt-node svg { filter: grayscale(.6); opacity: .7; }
.mt-ch.ready .mt-node svg { animation: rd-wiggle 1.8s ease-in-out infinite; }
.mt-ch.opening .mt-node svg { animation: rd-shake .7s; }
.mt-ch .rd-lid { transform-box: fill-box; transform-origin: 0 100%; transition: transform .45s cubic-bezier(.3, 1.6, .5, 1); }
.mt-ch.open .rd-lid { transform: translate(-3px, -7px) rotate(-30deg); }

.mt-bs .mt-node { width: 34px; height: 34px; border: 0; border-radius: 11px; background: #5B3A8E; }
.mt-bs .mt-node svg { width: 26px; height: 26px; }
.mt-bs.won .mt-node { background: var(--honey, #EDA328); }
.mt-bs.lock .mt-node { background: #B6A5D3; }
.mt-bs.lock .mt-txt b { color: var(--mt-ink2); }

/* moving train */
.mt-tram { position: absolute; left: 30px; top: 0; z-index: 2; width: 20px; height: 30px; margin: -15px 0 0 -10px; box-sizing: border-box; border: 2px solid var(--mt-card); border-radius: 9px 9px 6px 6px; background: linear-gradient(#fff, #fff) 4px 4px / 8px 7px no-repeat, var(--l); box-shadow: 0 3px 8px -2px rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity .2s; }
.mt-tram.on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .mt-b.today .mt-node, .mt-ch.ready .mt-node svg { animation: none; }
}
.mt-sign.was .mt-sg-sub { opacity: 0; }

/* the Nếp page as a call screen (plan.js pageNep): Nếp waiting on the line in a ring that pulses (red when he is
   savage, grey for an interview), the tone switch, the three calls each drawn after what it is: a chat bubble, an
   interview room's name plate, the metro sign of the lesson; one button dials the one picked. A call's own page
   (.nc-page) has Nếp small in his ring, the call's mark and name, the button, then its settings as segments. */
.nc { --nc-c: var(--acc, #14884F); --nc-soft: var(--acc-soft, #E2F3E8); display: grid; gap: 16px; padding: 0 0 20px; }
:is(.nc, .nc-head)[data-mood="gat"] { --nc-c: var(--red, #DE4636); --nc-soft: var(--red-soft, #FBE4E0); }
.nc[data-mode="iv"], .nc-head.nc-iv { --nc-c: var(--ink2, #4F5751); --nc-soft: var(--fill, #EFECE4); }
.nc-stage { display: flex; flex-direction: column; align-items: center; text-align: center; }
.nc-ring { position: relative; display: grid; place-items: center; width: 220px; height: 220px; }
.nc-ring::before, .nc-ring i { content: ''; position: absolute; inset: 18px; border-radius: 50%; transition: background .3s, border-color .3s; }
.nc-ring::before { background: var(--nc-soft); }
.nc-ring i { border: 2px solid var(--nc-c); opacity: 0; animation: nc-ring 2.8s cubic-bezier(.2, .6, .3, 1) infinite; }
.nc-ring i + i { animation-delay: 1.4s; }
@keyframes nc-ring { 0% { transform: scale(.92); opacity: .6; } 100% { transform: scale(1.3); opacity: 0; } }
.nc-nep { position: relative; width: 210px; height: 210px; }
.nc-name { margin: 0; font: 800 32px/1.1 var(--font, inherit); letter-spacing: -.03em; color: var(--ink); }
/* the line under his name sits on the sky: the text shade of the mood colour, a touch further from the page (4.5:1 on the sky) */
.nc-say { margin: 4px 0 0; font-size: 16px; font-weight: 700; color: color-mix(in srgb, var(--acc-ink, #0E7A43) 90%, var(--ink, #1B201C)); }
.nc[data-mood="gat"] .nc-say { color: color-mix(in srgb, var(--red-ink, #B8321F) 90%, var(--ink, #1B201C)); }
.nc[data-mode="iv"] .nc-say { color: var(--ink2, var(--muted)); }
.nc-free { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--ink3, var(--muted)); font-variant-numeric: tabular-nums; }
.nc-panel { display: grid; gap: 14px; }

/* segments: the tone, the voice, where an interview is */
.nc-field { display: grid; gap: 6px; margin-top: 16px; }
.nc-panel .nc-field { margin-top: 0; }
.nc-lab { font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink3, var(--muted)); }
.nc-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--fill, #EFECE4); }
.nc-seg button { min-height: 44px; padding: 6px 8px; border: 0; border-radius: 12px; background: transparent; color: var(--ink2, var(--muted));
  font: 700 15px/1.2 var(--font, inherit); cursor: pointer; transition: background .2s, color .2s; }
.nc-seg button.on { background: var(--card, #fff); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 4px 10px -6px rgba(0, 0, 0, .3); }
html[data-theme="dark"] .nc-seg button.on { background: color-mix(in srgb, var(--ink) 16%, var(--fill, #272B26)); }
.nc-seg button[data-tone="gat"].on { color: var(--red-ink, var(--red, #DE4636)); }
.nc-seg i { font-style: normal; font-size: 10px; margin-right: 5px; vertical-align: 1px; }

/* the three calls */
.nc-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nc-m { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; min-height: 112px; padding: 12px; border-radius: 16px;
  font: inherit; text-align: left; color: var(--ink); background: color-mix(in srgb, var(--card, #fff) 55%, transparent); border: 2px solid var(--line);
  cursor: pointer; transition: transform .15s, background .2s, color .2s, border-color .2s; }
.nc-m:active { transform: scale(.97); }
.nc-m b { margin-top: auto; font-size: clamp(13.5px, 3.8vw, 15.5px); font-weight: 800; line-height: 1.2; white-space: nowrap; letter-spacing: -.01em; }
@media (max-width: 400px) { .nc-m { padding: 12px 10px; } }
.nc-m small { margin-top: -6px; font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--ink2, var(--muted)); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-m[aria-pressed="true"] small { color: inherit; }
.nc-mk { display: inline-block; flex: none; }
/* free talk: a chat bubble */
.nc-m[aria-pressed="true"] { background: var(--acc-btn, #14884F); border-color: var(--acc-btn, #14884F); color: #fff; }
.nc-mk-talk { padding: 6px 9px; border-radius: 12px 12px 12px 3px; background: var(--acc-soft, #E2F3E8); color: var(--acc-ink, #0E7A43); font: 800 14px/1 var(--kr-sans, inherit); }
.nc-m-talk[aria-pressed="true"] .nc-mk-talk { background: rgba(255, 255, 255, .2); color: #fff; }
/* the interview: a name plate on the door, square and serious */
.nc-mk-iv { padding-bottom: 3px; border-bottom: 2px solid currentColor; font: 700 20px/1 var(--kr-serif, serif); letter-spacing: .14em; }
/* the lesson: the station sign, the line's band under it */
:is(.nc-m-road, .nc-mk-road, .nc-for-road, .nc-act) { --l: var(--ln); --lf: var(--lnf, var(--ln)); --lt: var(--lnt, #fff); --mt-card: var(--card, #fff); --mt-ink: var(--ink); }
html[data-theme="dark"] :is(.nc-m-road, .nc-mk-road, .nc-for-road, .nc-act) { --l: var(--lnd); --lf: var(--lndf, var(--lnd)); --lt: var(--lndt, #fff); }

/* what the call picked is set to (its own page), and the button */
.nc-for { display: none; gap: 10px; }
.nc:is([data-mode="talk"]) .nc-for-talk, .nc[data-mode="iv"] .nc-for-iv, .nc[data-mode="road"] .nc-for-road { display: grid; }
/* tone and voice on the call screen itself; the interview has its own interviewer */
.nc-voice { display: grid; gap: 10px; }
.nc[data-mode="iv"] .nc-voice { display: none; }
.nc-more { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 2px; border: 0; border-bottom: 1px dashed var(--line);
  background: none; color: var(--ink2, var(--muted)); font: 700 15px/1.3 var(--font, inherit); text-align: left; cursor: pointer; }
.nc-more span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-more .chev { flex: none; }
.nc-call { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--acc-btn, #14884F); color: #fff; font: 800 18px/1.2 var(--font, inherit); cursor: pointer;
  box-shadow: var(--sh-btn, 0 8px 18px -10px rgba(0, 0, 0, .5)); transition: transform .15s; }
.nc-call:active { transform: scale(.98); }
.nc-call svg { flex: none; transform-origin: 50% 60%; animation: nc-buzz 4s ease-in-out infinite; }
@keyframes nc-buzz { 0%, 84%, 100% { transform: rotate(0); } 86% { transform: rotate(-14deg); } 88% { transform: rotate(14deg); } 90% { transform: rotate(-10deg); } 92% { transform: rotate(10deg); } 94% { transform: rotate(0); } }
.nc-call.ink { background: var(--ink); color: var(--bg, #fff); }
.nc-call.ink svg { animation: none; }
.nc-call.line { background: var(--lf); color: var(--lt); }
.nc-call.ghost { min-height: 50px; background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 22%, transparent); font-size: 16px; }
.nc-call.ghost span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .nc-ring i { animation-duration: 6s; } .nc-call svg { animation: none; } }

/* a call's own page */
.nc-page .back { margin-bottom: 4px; }
.nc-solo { max-width: 560px; }
.nc-head { --nc-c: var(--acc, #14884F); --nc-soft: var(--acc-soft, #E2F3E8); display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.nc-head[data-mood="gat"]:not(.nc-iv) { --nc-c: var(--red, #DE4636); --nc-soft: var(--red-soft, #FBE4E0); }
.nc-ring.sm { flex: none; width: 128px; height: 128px; }
.nc-ring.sm::before, .nc-ring.sm i { inset: 10px; }
.nc-ring.sm .nc-nep { width: 122px; height: 122px; }
.nc-head-tx { min-width: 0; }
.nc-head-tx h2 { margin: 10px 0 2px; font: 800 26px/1.15 var(--font, inherit); letter-spacing: -.02em; color: var(--ink); }
.nc-head-tx p { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--ink2, var(--muted)); }
.nc-head .nc-mk-iv { font-size: 18px; }
.nc-act { display: grid; gap: 10px; }
.nc-act .nc-free { margin-top: 4px; text-align: center; }
.nc-rule { margin: 14px 0 0; padding-left: 12px; border-left: 3px solid var(--ink); font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--ink2, var(--muted)); }
.nc-h { margin: 22px 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink3, var(--muted)); }
.pg-side > .nc-h:first-child { margin-top: 18px; }
/* the lesson's parts, each a call of its own: a timetable, ruled */
.nc-rows { display: grid; border-top: 1px solid var(--line); }
.nc-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--line); background: none;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.nc-row > span { flex: 1; min-width: 0; }
.nc-row b { display: block; font-size: 16px; font-weight: 800; line-height: 1.3; }
.nc-row b [lang="ko"] { font-family: var(--kr-sans, inherit); font-size: 18px; }
.nc-row small { display: block; margin-top: 2px; font-size: 14px; line-height: 1.35; color: var(--ink2, var(--muted)); }
.nc-row svg { flex: none; width: 20px; height: 20px; color: var(--acc-ink, var(--leaf)); }
.nc-row:active { background: var(--fill, #EFECE4); }
@media (max-width: 999px) { .nc-page .pg-side { margin-top: 8px; } }

/* during a call: how Nếp talks, the verdict of a mock interview */
.iv-verdict { margin: 6px 0; font-size: 22px; font-weight: 800; }
.iv-verdict.pass { color: var(--leaf-d); }
.iv-verdict.fail { color: var(--wrong-d); }
.iv-weak { list-style: none; margin: 8px 0 0; padding: 0; text-align: left; display: grid; gap: 10px; }
.iv-weak b { display: block; font-size: 15.5px; }
.iv-weak span { display: block; font-size: 14.5px; color: var(--muted); }
.iv-weak em { display: block; font-style: normal; font-size: 14.5px; }
/*NM-END*/
/* thi vượt: the end of a book's exam waiting after a fail (a lesson's is the train, tau.css) */
.mt-bs.wait { opacity: .7; }
/* the next part as a plain button under the platform */
.mt .mt-next-w { padding: 12px 14px 14px; }
.mt .mt-next.today { display: block; min-height: 54px; font-size: 17px; font-weight: 800; line-height: 1.25; text-align: center; }
/* a long name goes to a second line, never cut off */
.mt .mt-next.today span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: normal; text-wrap: balance; }
/* what a lesson teaches: its button on today's station, and the card (metro.js mtIntro), headed like the station sign */
.mt-what { min-height: 36px; margin: 6px 8px 0 0; padding: 6px 2px; border: 0; background: none; color: var(--mt-ink2); font: inherit; font-size: 14px; font-weight: 700;
  text-decoration: underline; text-decoration-color: var(--l); text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: pointer; }
.mt-in { --l: var(--ln); --lf: var(--lnf, var(--ln)); --lt: var(--lnt, #fff); --mt-card: var(--card, var(--paper, #fff)); --mt-ink: var(--ink, #1B201C); --mt-ink2: var(--ink2, var(--muted, #535B55));
  display: flex; flex-direction: column; max-width: 420px; max-height: calc(100dvh - 40px); padding: 0; overflow: hidden; text-align: left; animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); }
html[data-theme="dark"] .mt-in { --l: var(--lnd); --lf: var(--lndf, var(--lnd)); --lt: var(--lndt, #fff); }
.mt-in-sign { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 18px 0; text-align: center; }
.mt-in-pill { display: flex; align-items: center; gap: 8px; max-width: 100%; box-sizing: border-box; padding: 5px 16px 5px 5px; border: 4px solid var(--l); border-radius: 999px; background: var(--mt-card); }
.mt-in-pill .mt-code { flex: none; height: 30px; min-width: 30px; padding: 0 8px; border: 0; border-radius: 999px; background: var(--lf); color: var(--lt); }
.mt-in-pill b { min-width: 0; font: 800 clamp(20px, 6.2vw, 26px)/1.15 var(--kr-sans, system-ui), sans-serif; letter-spacing: -.03em; word-break: keep-all; overflow-wrap: anywhere; color: var(--mt-ink); }
.mt-in-vi { font-size: 16px; font-weight: 700; color: var(--mt-ink2); }
.mt-in-band { flex: none; display: block; height: 10px; margin-top: 14px; background: var(--l); }
.mt-in-sub { padding: 8px 18px 0; font-size: 14px; font-weight: 700; color: var(--mt-ink2); text-align: center; font-variant-numeric: tabular-nums; }
.mt-in-body { min-height: 0; overflow: auto; padding: 4px 22px 2px; overflow-wrap: anywhere; }
.mt-in-body.more { -webkit-mask-image: linear-gradient(#000 calc(100% - 40px), rgba(0, 0, 0, .12)); mask-image: linear-gradient(#000 calc(100% - 40px), rgba(0, 0, 0, .12)); }
.mt-in h4 { margin: 16px 0 6px; font-size: 14px; font-weight: 800; color: var(--mt-ink2); }
.mt-in .mt-in-body p { margin: 0; font-size: 16px; line-height: 1.5; font-weight: 600; color: var(--mt-ink); }
.mt-in .mt-in-body .mt-in-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-in-chips span { max-width: 100%; box-sizing: border-box; padding: 5px 12px; border: 2px solid var(--l); border-radius: 999px; font-size: 15px; line-height: 1.3; font-weight: 700; word-break: keep-all; overflow-wrap: anywhere; }
.mt-in-chips span[lang="ko"] { font-family: var(--kr-sans, system-ui), sans-serif; }
.mt-in-acts { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px; }
.mt-in-vuot { min-height: 44px; padding: 8px 18px; border: 2px solid var(--l); border-radius: 999px; background: transparent; color: var(--mt-ink); font: inherit; font-size: 15px; font-weight: 800; line-height: 1.2; cursor: pointer; }
.mt-in-vuot.wait { border-style: dashed; color: var(--mt-ink2); }
@media (prefers-reduced-motion: reduce) { .mt-in { animation: none; } }

/* Ask Nếp, the corner button and its sheet */
.ak-btn { position: fixed; right: 14px; bottom: 96px; z-index: 26; display: flex; align-items: center; gap: 6px; height: 50px; padding: 0 14px 0 4px; border: 2px solid var(--line, #d9dfd2); border-radius: 25px; background: var(--card, #fff); color: inherit; font: inherit; font-size: 14px; font-weight: 700; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); cursor: pointer; animation: ak-in .45s cubic-bezier(.3, 1.5, .5, 1) both, ak-hop 6s ease-in-out 1.2s infinite; }
.ak-btn img { width: 42px; height: 42px; object-fit: contain; transform-origin: 50% 90%; animation: ak-sway 3s ease-in-out infinite; }
@keyframes ak-in { from { opacity: 0; transform: translateY(16px) scale(.7); } }
@keyframes ak-hop { 0%, 86%, 100% { translate: 0 0; } 90% { translate: 0 -8px; } 94% { translate: 0 0; } 97% { translate: 0 -3px; } }
@keyframes ak-sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .ak-btn, .ak-btn img { animation: none; } }
/* in a lesson's bottom bar: beside the main button, Nếp's face alone on a phone */
.lp-cta .ak-btn { position: static; flex: none; align-self: center; }
@media (max-width: 599px) {
  .lp-cta .ak-btn { width: 54px; height: 54px; padding: 0; justify-content: center; border-radius: 50%; }
  .lp-cta .ak-btn span { display: none; }
}
.ak-in { width: 100%; margin-top: 12px; }
.ak h3 { margin: 6px 0 10px; }
.ak-list { display: grid; gap: 8px; }
.ak-q { padding: 11px 14px; border: 2px solid var(--line, #d9dfd2); border-radius: 14px; background: transparent; color: inherit; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.ak-you { margin: 14px 0 4px; font-weight: 700; }
.ak-say { margin: 0 0 8px; line-height: 1.6; }
.ak-form { display: flex; gap: 8px; margin-top: 12px; }
.ak-form input { flex: 1; min-width: 0; padding: 11px 12px; border: 2px solid var(--line, #d9dfd2); border-radius: 12px; background: transparent; color: inherit; font: inherit; }

.lp-rep { margin: 18px 0 0; text-align: center; }
.lp-rep button { background: none; border: 0; min-height: 44px; padding: 8px 14px; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lp-repbox { text-align: left; }
.lp-repbox textarea { display: block; width: 100%; box-sizing: border-box; margin: 0 0 10px; padding: 10px 12px; font: inherit; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); resize: none; }

/* ---------- Ôn tập (review.js): the lesson being learnt, the lessons done by book with a tick each, the bar to pick ---------- */
.rv-a, .rv-b { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; min-width: 0; }
.rv-a > section > .sec { margin: 10px 0 10px; }
.rv-bk { margin: 0 0 10px; background: var(--card); border-radius: var(--r-card); box-shadow: var(--sh-card), inset 0 0 0 1px var(--rim); overflow: hidden; }
.rv-bk summary { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 16px 0 20px; font-size: 16px; font-weight: 700; color: var(--ink); cursor: pointer; list-style: none; }
.rv-bk summary::-webkit-details-marker { display: none; }
.rv-bk summary small { flex: 1; font-size: 14px; font-weight: 500; color: var(--ink3); }
.rv-bk summary .chev { color: var(--ink3); transform: rotate(90deg); transition: transform var(--t-page) var(--ease-out); }
.rv-bk[open] summary .chev { transform: rotate(-90deg); }
.rv-bk summary:focus-visible, .rv-chk:focus-visible { outline: 3px solid var(--acc); outline-offset: -3px; }
.rv-les { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px 10px 20px; border-top: 1px solid var(--line); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rv-les:has(.rv-chk:checked) { background: var(--acc-soft); }
.rv-chk { flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin: 0; border: 2px solid var(--ink3); border-radius: 8px; background: var(--card); appearance: none; -webkit-appearance: none; cursor: pointer; }
.rv-chk:checked { border-color: var(--acc-btn); background: var(--acc-btn); }
.rv-chk:checked::after { content: ''; width: 6px; height: 11px; margin-top: -3px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.rv-les-tx { flex: 1; min-width: 0; }
.rv-les-tx b { display: block; font-size: 16px; line-height: 22px; font-weight: 600; overflow-wrap: anywhere; }
.rv-les-tx small { display: block; font-size: 14px; line-height: 19px; font-weight: 500; color: var(--ink3); }
.rv-les-tx small.old { color: var(--honey-ink); font-weight: 600; }
.rv-star { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; color: var(--ink2); font-variant-numeric: tabular-nums; }
.rv-star svg { fill: var(--honey); }
.rv-pick { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; gap: 6px; padding: 8px; background: var(--card); border-radius: var(--r-card); box-shadow: var(--sh-float), inset 0 0 0 1px var(--rim); }
.rv-pick[hidden] { display: none; }
.rv-pick-n { flex: 1; min-width: 0; padding-left: 10px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.rv-pick button { flex: none; min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--r-sm); background: var(--acc-soft); color: var(--acc-ink); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.rv-pick button.main { background: var(--acc-btn); color: #fff; }
.rv-pick button:active { transform: scale(.97); }
.rv-b .rv-games { margin-top: 0; }
@media (max-width: 759px) { .rv { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .rv-pick { bottom: calc(72px + env(safe-area-inset-bottom)); } }

/* ---------- Nếp chấm: the AI grade of a writing paper (grade.js) ---------- */
.ex-ng { display: block; width: fit-content; max-width: 100%; border: 0; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; text-align: left; }
.ex-ng::after { content: " ›"; }
.ng { --ng-hi: var(--acc-ink, #2f5f24); --ng-mid: var(--honey-ink, #7a5a06); --ng-lo: var(--red-ink, var(--wrong)); margin: 0 0 18px; }
.ng-ask { display: flex; align-items: center; gap: 12px; background: var(--card, var(--paper)); border: 1px solid var(--rim, transparent); border-radius: var(--r-card, 16px); padding: 12px 14px; box-shadow: var(--sh-card, 0 1px 3px rgba(80, 55, 30, .08)); }
.ng-nep { width: 56px; height: 56px; flex: none; }
.ng-ask-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ng-ask-body b { font-size: 17px; }
.ng-ask-body small { color: var(--ink2, var(--muted)); font-size: 14px; line-height: 1.4; }
.ng-ask .btn { flex: none; }
.ng-wait .ng-nep { animation: ng-bob 1.1s ease-in-out infinite; }
.ng-dots { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.ng-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: ld-dot 1.1s infinite; }
.ng-dots i:nth-child(2) { animation-delay: .18s; }
.ng-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes ng-bob { 50% { transform: translateY(-4px) rotate(-3deg); } }
.ng-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 16px; background: var(--card, var(--paper)); border: 1px solid var(--rim, transparent); border-radius: var(--r-card, 16px); padding: 16px 16px 14px 18px; box-shadow: var(--sh-card, 0 1px 3px rgba(80, 55, 30, .08)); }
.ng-total small, .ng-lv small { display: block; color: var(--ink2, var(--muted)); font-size: 13px; font-weight: 600; }
.ng-total b { font-size: 46px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ng-total em { font-style: normal; font-size: 17px; font-weight: 700; color: var(--ink3, var(--muted)); margin-left: 2px; }
.ng-lv { border-left: 1px solid var(--line); padding-left: 16px; min-width: 0; }
.ng-lv b { display: block; font-size: 19px; color: var(--acc-ink, #2f5f24); white-space: nowrap; }
.ng-top-nep { width: 64px; height: 64px; }
.ng-note { margin: 10px 2px 0; font-size: 15px; line-height: 1.5; }
.ng-left { margin: 10px 2px 0; color: var(--ink3, var(--muted)); font-size: 13px; }
.ng-qs { display: grid; gap: 8px; margin-top: 12px; }
.ng-q { background: var(--card, var(--paper)); border: 1px solid var(--rim, transparent); border-radius: var(--r-sm, 14px); box-shadow: var(--sh-card, 0 1px 3px rgba(80, 55, 30, .06)); }
.ng-q summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ng-q summary::-webkit-details-marker { display: none; }
.ng-no { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--fill, #EDE3D3); }
.ng-q-title { flex: 1; min-width: 0; font-weight: 600; }
.ng-pt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ng-pt small { font-weight: 600; color: var(--ink3, var(--muted)); }
.ng-pt.ng-hi { color: var(--ng-hi); } .ng-pt.ng-mid { color: var(--ng-mid); } .ng-pt.ng-lo { color: var(--ng-lo); }
.ng-q summary .ng-pt { font-size: 18px; }
.ng-chev { flex: none; width: 8px; height: 8px; border-right: 2px solid var(--ink3, var(--muted)); border-bottom: 2px solid var(--ink3, var(--muted)); transform: rotate(45deg); margin: -4px 4px 0 2px; transition: transform var(--t-page, .18s) var(--ease-out, ease); }
.ng-q[open] .ng-chev { transform: rotate(225deg); margin-top: 4px; }
.ng-q-body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.ng-q[open] .ng-q-body { animation: ng-in .22s var(--ease-out, ease); }
@keyframes ng-in { from { opacity: 0; transform: translateY(-4px); } }
.ng-crit { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; }
.ng-crit b { font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.ng-band { display: inline-block; font: 700 12px/18px var(--kr-sans); padding: 0 6px; margin-right: 6px; border-radius: 6px; background: var(--fill, #EDE3D3); vertical-align: 1px; }
.ng-band.ng-hi { color: var(--ng-hi); } .ng-band.ng-mid { color: var(--ng-mid); } .ng-band.ng-lo { color: var(--ng-lo); }
.ng-why { display: block; grid-column: 1 / -1; margin-top: -4px; color: var(--ink2, var(--muted)); font-size: 13.5px; line-height: 1.4; }
.ng-blank .ng-why { margin-top: 4px; }
.ng-track { height: 8px; border-radius: 999px; background: var(--fill, #EDE3D3); overflow: hidden; }
.ng-track i { display: block; height: 100%; border-radius: inherit; background: var(--acc, var(--leaf)); }
.ng-track i.ng-mid { background: var(--honey, var(--bean)); } .ng-track i.ng-lo { background: var(--red, var(--wrong)); }
.ng-say { margin: 12px 0 0; font-size: 15px; line-height: 1.55; }
.ng-none { margin: 12px 0 0; font-weight: 700; color: var(--ng-lo); }
.ng-lbl { margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--ink2, var(--muted)); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.ng-lbl .good { color: var(--ng-hi); } .ng-lbl .warn { color: var(--ng-lo); }
.ng-mine, .ng-fixed { font: 16px/1.85 var(--kr-sans); border-radius: 10px; padding: 8px 12px; margin-top: 4px; }
.ng-mine { background: var(--card2, var(--bg)); }
.ng-fixed { background: var(--acc-soft, var(--leaf-soft)); }
.ng-mine i { color: var(--ink3, var(--muted)); font-family: var(--ui); }
mark.ng-bad { background: var(--red-soft, var(--wrong-soft)); color: var(--red-ink, var(--wrong)); border-bottom: 2px solid var(--red, var(--wrong)); border-radius: 3px; padding: 0 1px; }
mark.ng-bad sup { font: 700 10px var(--ui); margin-left: 1px; }
.ng-errs { margin: 10px 0 0; padding: 0 0 0 22px; display: grid; gap: 6px; font-size: 15px; }
.ng-errs li::marker { color: var(--red-ink, var(--wrong)); font-weight: 700; font-size: 13px; }
.ng-errs del { color: var(--red-ink, var(--wrong)); text-decoration-thickness: 1.5px; }
.ng-errs ins { color: var(--acc-ink, #2f5f24); text-decoration: none; font-weight: 700; }
.ng-errs [lang="ko"] { font-family: var(--kr-sans); }
.ng-to { color: var(--ink3, var(--muted)); }
.ng-errs small { display: block; color: var(--ink2, var(--muted)); font-size: 13.5px; line-height: 1.4; }
mark.ng-up { background: none; color: inherit; border-bottom: 2px dashed var(--ink2, var(--muted)); padding: 0 1px; }
mark.ng-up sup { font: 700 10px var(--ui); margin-left: 1px; color: var(--ink2, var(--muted)); }
.ng-errs li.up::marker { color: var(--ink2, var(--muted)); }
.ng-errs li.up del { color: var(--ink2, var(--muted)); text-decoration: none; }
.ng-errs small b { font-weight: 700; color: var(--ink); }
.ng-blank { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; }
.ng-k { font: 700 18px var(--kr-sans); width: 22px; flex: none; padding-top: 6px; }
.ng-blank-body { flex: 1; min-width: 0; }
.ng-blank > .ng-pt { padding-top: 8px; font-size: 15px; }
.ng-blank .ng-mine { margin-top: 0; }
.ng-fix { font: 15px/1.6 var(--kr-sans); margin-top: 4px; padding: 4px 12px; background: var(--acc-soft, var(--leaf-soft)); border-radius: 8px; }
.ng-fix span { font: 700 12px var(--ui); color: var(--acc-ink, #2f5f24); margin-right: 8px; }
.ng-show { margin-top: 12px; }
.ng-model { margin-top: 8px; }
.ng-model .model { font-size: 15.5px; }
@media (max-width: 420px) {
  .ng-top { gap: 4px 12px; padding: 14px; }
  .ng-top-nep { width: 48px; height: 48px; }
  .ng-total b { font-size: 40px; }
  .ng-lv { padding-left: 12px; }
}
@media (prefers-reduced-motion: reduce) { .ng-wait .ng-nep, .ng-q[open] .ng-q-body { animation: none; } }
/* toasts sit above the phone tab bar and let taps through, so a tab is never blocked for 4 s */
.toast { pointer-events: none; }
@media (max-width: 760px) { body:has(.navbar) .toast { bottom: calc(70px + env(safe-area-inset-bottom)); } }
