/* Học viện Claude AKA — theo brand guideline AKA (gradient xanh → tím, Albula + Averta) */
@font-face { font-family: "Averta"; src: url("/assets/AvertaStdCY-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Averta"; src: url("/assets/AvertaStdCY-Semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Averta"; src: url("/assets/AvertaStdCY-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Albula"; src: url("/assets/albula-semibold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  --bg: #F3F6FC; --surface: #FFFFFF; --surface-2: #EAF1FC; --ink: #0B1530; --muted: #56627E; --line: #D7E2F3;
  --blue: #0596FF; --blue-deep: #0167F8; --cyan: #2DDCFF; --indigo: #323CEB; --violet: #5B2BF0;
  --ok: #0F9D58; --ok-bg: #E3F6EC; --warn: #B87400; --warn-bg: #FFF3DC; --bad: #D42828; --bad-bg: #FDE7E7;
  --lock: #A5B1CA;
  --grad: linear-gradient(90deg, #0167F8 0%, #0596FF 56%, #2DDCFF 100%);
  --grad-kv: linear-gradient(120deg, #0596FF 0%, #323CEB 55%, #5B2BF0 100%);
  --shadow: 0 12px 28px rgba(50, 60, 235, .10);
  --r: 12px; --r-lg: 18px;
  --display: "Albula", "Averta", "Be Vietnam Pro", system-ui, sans-serif;
  --body: "Averta", "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #060C1C; --surface: #0E1830; --surface-2: #13213F; --ink: #E9EFFB; --muted: #9AA8C7; --line: #22335A;
    --blue: #3AA9FF; --ok: #3DD68C; --ok-bg: #0F2F22; --warn: #F2B544; --warn-bg: #33270C; --bad: #FF6B6B; --bad-bg: #3A1418;
    --lock: #4B5A7C; --shadow: 0 12px 28px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--blue); }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.2; text-wrap: balance; margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }

/* Thanh trên */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--grad-kv); color: #fff; box-shadow: 0 6px 20px rgba(50, 60, 235, .25); }
.topbar-in { max-width: 1160px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; flex-shrink: 0; }
.brand-logo { height: 30px; width: auto; }
.brand-sub { font: 600 13px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; opacity: .9; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.35); }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { color: rgba(255,255,255,.82); text-decoration: none; padding: 7px 13px; border-radius: 99rem; font-weight: 600; font-size: 14px; white-space: nowrap; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.12); }
.nav a.on { color: var(--indigo); background: #fff; }
.me { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; flex-shrink: 0; }
.me img, .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,.25); display: inline-grid; place-items: center; font: 700 13px var(--body); color: #fff; flex-shrink: 0; }
.avatar { background: var(--grad-kv); }
@media (max-width: 760px) {
  .topbar-in { flex-wrap: wrap; row-gap: 6px; }
  .brand-sub { display: none; }
  .nav { order: 3; flex-basis: 100%; }
  .me { margin-left: auto; }
  .me > span:last-child { display: none; }
}

.wrap { max-width: 1160px; margin: 0 auto; padding: 24px 16px 64px; }

/* Khối chung */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.eyebrow { font: 600 12px/1.2 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99rem; font-weight: 600; font-size: 12.5px; line-height: 1.5; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--surface-2); color: var(--blue-deep); }
.pill.lock { background: var(--surface-2); color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none; padding: 11px 20px; border-radius: 99rem; font-weight: 700; font-size: 15px; background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(5, 150, 255, .28); transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(5, 150, 255, .36); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--blue-deep); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.sm { padding: 7px 14px; font-size: 13.5px; }
.stars { color: #F5B700; letter-spacing: 1px; font-size: 13px; }
.stars .off { color: var(--line); }

/* Trang chủ */
.home { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .home { grid-template-columns: 1fr; } }
.col { display: grid; gap: 20px; min-width: 0; align-content: start; }

.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 26px; color: #fff; background: var(--grad-kv); box-shadow: var(--shadow); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 99rem; background: rgba(255,255,255,.10); transform: rotate(-35deg); pointer-events: none; }
.hero::before { width: 340px; height: 70px; right: -80px; top: 30px; }
.hero::after { width: 240px; height: 50px; right: 30px; bottom: -6px; background: rgba(45, 220, 255, .22); }
.hero > * { position: relative; }
.hero .eyebrow { color: rgba(255,255,255,.8); }
.hero-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.hero-n { font: 600 64px/0.9 var(--display); letter-spacing: -.02em; }
.hero h1 { font-size: 28px; margin-top: 6px; max-width: 22ch; }
.hero .stars { color: #FFD84D; }
.hero .stars .off { color: rgba(255,255,255,.3); }
.clock { background: rgba(6, 12, 40, .28); border: 1px solid rgba(255,255,255,.18); border-radius: 16px; padding: 12px 16px; min-width: 210px; }
.clock-v { font: 600 34px/1 var(--display); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.clock-l { font-size: 12.5px; opacity: .85; margin-top: 4px; }
.clock.late .clock-v { color: #FFB3B3; }
.clock.soon .clock-v { color: #FFE08A; }
.hero-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.hero-meta .pill { background: rgba(255,255,255,.16); color: #fff; }
.hero .btn { background: #fff; color: var(--indigo); box-shadow: 0 8px 20px rgba(6, 12, 40, .25); }
.hero-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

/* Chỉ số */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface-2); border-radius: var(--r); padding: 12px 14px; }
.stat-v { font: 600 26px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.stat-l { font-size: 12.5px; color: var(--muted); }
.lvl { margin-top: 14px; }
.lvl-bar { height: 8px; border-radius: 99rem; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.lvl-bar i { display: block; height: 100%; background: var(--grad); border-radius: 99rem; }

/* Hành trình */
.journey { display: grid; gap: 18px; }
.stage { display: grid; gap: 10px; }
.stage-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stage-h h3 { font-size: 17px; }
.stage-cap { font-size: 12.5px; color: var(--violet); font-weight: 700; }
.nodes { display: flex; flex-wrap: wrap; gap: 10px; }
.node { position: relative; width: 112px; min-height: 92px; border-radius: 14px; padding: 10px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); display: flex; flex-direction: column; gap: 4px; transition: transform .15s, border-color .15s; }
.node:hover { transform: translateY(-2px); }
.node-n { font: 600 20px/1 var(--display); font-variant-numeric: tabular-nums; }
.node-t { font-size: 12px; line-height: 1.35; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.node .ic { position: absolute; top: 9px; right: 9px; width: 18px; height: 18px; }
.node.dat { background: var(--grad-kv); border-color: transparent; color: #fff; }
.node.dat .node-t { color: rgba(255,255,255,.85); }
.node.cur { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(5,150,255,.15); animation: pulse 2.2s ease-in-out infinite; }
.node.khoa { background: repeating-linear-gradient(-45deg, var(--surface), var(--surface) 8px, var(--surface-2) 8px, var(--surface-2) 16px); color: var(--lock); cursor: not-allowed; }
.node.khoa .node-t { color: var(--lock); font-style: italic; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(5,150,255,.06); } }
@media (max-width: 520px) { .node { width: calc(33.333% - 7px); min-height: 84px; } }

/* Danh sách xếp hạng & bảng tin */
.list { display: grid; gap: 2px; }
.row { display: grid; grid-template-columns: 28px 32px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.rk { font: 600 16px var(--display); color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.row .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 12.5px; color: var(--muted); }
.row .xp { font: 600 16px var(--display); font-variant-numeric: tabular-nums; text-align: right; }
.feed-i { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.feed-i:last-child { border-bottom: 0; }
.feed-i time { display: block; font-size: 12px; color: var(--muted); }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 10px; }
.sec-h h2 { font-size: 18px; }
.sec-h a { font-size: 13.5px; font-weight: 600; text-decoration: none; }

/* Trang nhiệm vụ */
.mission { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .mission { grid-template-columns: 1fr; } }
.m-head { display: grid; gap: 8px; margin-bottom: 18px; }
.m-head h1 { font-size: 32px; }
.crumb { font-size: 13.5px; }
.crumb a { text-decoration: none; font-weight: 600; }
.prose { max-width: 70ch; }
.prose h2 { font-size: 20px; margin: 26px 0 10px; color: var(--indigo); }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose blockquote { margin: 12px 0; padding: 12px 16px; padding-top: 34px; border-radius: var(--r); background: var(--surface-2); border: 1px dashed var(--blue); font-size: 14px; position: relative; }
.prose blockquote p { margin: 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 13.5px; }
.copy { position: absolute; top: 8px; right: 8px; border: 0; background: var(--surface); color: var(--blue-deep); border-radius: 99rem; font-size: 12px; font-weight: 700; padding: 3px 10px; cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.side { position: sticky; top: 84px; display: grid; gap: 16px; }
@media (max-width: 900px) { .side { position: static; } }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.form { display: grid; gap: 14px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field textarea, .field input { width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; font-size: 14.5px; line-height: 1.5; }
.field textarea { min-height: 110px; resize: vertical; }
.field textarea:focus, .field input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(5,150,255,.15); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.field.err textarea, .field.err input { border-color: var(--bad); }
.alert { border-radius: var(--r); padding: 12px 14px; font-size: 14px; }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.hist { display: grid; gap: 10px; }
.hist-i { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 6px; }
.score { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; font-size: 12px; text-align: center; }
.score b { display: block; font: 600 18px var(--display); }
.score div { background: var(--surface-2); border-radius: 8px; padding: 6px 4px; }

/* Ảnh đính kèm */
.drop { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 10px; background: var(--surface); }
.drop.over { border-color: var(--blue); background: var(--surface-2); }
.field.err .drop { border-color: var(--bad); }
.drop-cta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs:empty { display: none; }
.thumb { position: relative; margin: 0; width: 84px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); display: block; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(6,12,40,.7); color: #fff; cursor: pointer; font-size: 15px; line-height: 1; }
.field .check, .check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; margin-top: 8px; cursor: pointer; }
.field .check input { width: auto; flex: none; margin-top: 3px; accent-color: var(--blue); }

/* Khoá */
.locked { text-align: center; max-width: 520px; margin: 40px auto; display: grid; gap: 14px; justify-items: center; }
.locked .big { width: 84px; height: 84px; border-radius: 24px; background: var(--grad-kv); display: grid; place-items: center; box-shadow: var(--shadow); }
.locked h1 { font-size: 28px; }

/* Xếp hạng */
.tabs { display: inline-flex; background: var(--surface-2); border-radius: 99rem; padding: 4px; gap: 4px; }
.tabs button { border: 0; background: transparent; padding: 7px 16px; border-radius: 99rem; font-weight: 700; cursor: pointer; color: var(--muted); }
.tabs button.on { background: var(--surface); color: var(--indigo); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; align-items: end; margin: 18px 0; }
.pod { text-align: center; border-radius: var(--r-lg); padding: 16px 10px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 4px; justify-items: center; }
.pod.p1 { background: var(--grad-kv); color: #fff; border: 0; padding-top: 26px; }
.pod.p1 .muted { color: rgba(255,255,255,.8); }
.pod .medal { font: 600 30px/1 var(--display); }
.pod .avatar { width: 48px; height: 48px; font-size: 17px; }
.pod .nm { font-weight: 700; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--surface-2); border-radius: 99rem; min-width: 80px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); }

/* Hồ sơ */
.badges { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
@media (max-width: 560px) { .badges { grid-template-columns: 1fr; } }
.badge { border-radius: var(--r-lg); padding: 18px; text-align: center; display: grid; gap: 6px; justify-items: center; border: 1.5px dashed var(--line); color: var(--muted); }
.badge.on { border: 0; color: #fff; background: var(--grad-kv); box-shadow: var(--shadow); }
.badge .gem { width: 56px; height: 56px; }

/* Đăng nhập */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--grad-kv); position: relative; overflow: hidden; }
.login::before, .login::after { content: ""; position: absolute; border-radius: 99rem; transform: rotate(-35deg); background: rgba(255,255,255,.08); }
.login::before { width: 620px; height: 120px; left: -160px; top: 12%; }
.login::after { width: 420px; height: 90px; right: -100px; bottom: 14%; background: rgba(45,220,255,.18); }
.login-card { position: relative; background: var(--surface); border-radius: 24px; padding: 32px 28px; max-width: 440px; width: 100%; display: grid; gap: 16px; box-shadow: 0 24px 60px rgba(6,12,40,.35); }
.login-card h1 { font-size: 30px; }
.login-card .logo { height: 40px; width: auto; }
.lark-btn { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.dev-box { border-top: 1px dashed var(--line); padding-top: 14px; display: grid; gap: 8px; }
.dev-box a { font-size: 14px; }

/* Thông báo */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 99rem; font-weight: 600; font-size: 14px; z-index: 50; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
.celebrate { position: fixed; inset: 0; display: grid; place-items: center; z-index: 55; background: rgba(6, 12, 40, .55); padding: 16px; }
.celebrate .card { max-width: 400px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.celebrate h2 { font-size: 26px; }
.celebrate .gem { width: 72px; height: 72px; }

.empty { text-align: center; padding: 28px 10px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.page-h { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-h h1 { font-size: 30px; }
.adm-sub { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 10px; }
.adm-sub dl { margin: 0; display: grid; gap: 8px; }
.adm-sub dt { font-weight: 700; font-size: 13px; color: var(--muted); }
.adm-sub dd { margin: 0; white-space: pre-wrap; font-size: 14px; }
.adm-grade { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.adm-grade input { width: 100%; }

/* Cửa ải (NV 8, 16, 21) */
.node.boss { border-width: 2px; border-color: #F5B700; }
.node.boss.dat { box-shadow: 0 0 0 2px #F5B700 inset; }
.node .crown { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; color: #F5B700; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.hero.boss { background: linear-gradient(120deg, #323CEB 0%, #5B2BF0 55%, #8A3FF5 100%); box-shadow: 0 0 0 3px #F5B700, var(--shadow); }

/* Đang chấm */
.clock.grading .clock-v { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; display: inline-block; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.me-row { background: var(--surface-2); border-radius: 10px; }
.ach-line { display: block; margin-top: 12px; font-weight: 700; font-size: 14px; text-decoration: none; }

/* Thử thách */
.tt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tt-card { display: grid; gap: 8px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); transition: transform .15s, border-color .15s; }
.tt-card:hover { transform: translateY(-2px); border-color: var(--blue); }
.tt-card h3 { font-size: 16px; }
.tt-card.locked { background: repeating-linear-gradient(-45deg, var(--surface), var(--surface) 8px, var(--surface-2) 8px, var(--surface-2) 16px); color: var(--lock); }
.tt-card.done { border-color: var(--ok); }
.tt-top, .tt-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tt-tag { font: 700 12px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--violet); }
.xp-chip { font: 700 12.5px/1 var(--body); color: #8A5A00; background: #FFF1C2; padding: 4px 9px; border-radius: 99rem; white-space: nowrap; }
.tt-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; text-decoration: none; color: var(--ink); padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.tt-sum { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }

/* Thành tựu */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ach { border: 1.5px dashed var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 4px; justify-items: start; color: var(--muted); }
.ach .ach-ic { font-size: 24px; filter: grayscale(1); opacity: .5; }
.ach b { color: var(--ink); font-size: 14px; }
.ach .ach-d { font-size: 12px; }
.ach .bar { width: 100%; min-width: 0; }
.ach.on { border: 0; background: var(--grad-kv); color: rgba(255,255,255,.85); box-shadow: var(--shadow); }
.ach.on b { color: #fff; }
.ach.on .ach-ic { filter: none; opacity: 1; }

/* Hướng dẫn */
.guide { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .guide { grid-template-columns: 1fr; } }
.guide h2 { font-size: 20px; margin-bottom: 10px; }
.steps { padding-left: 20px; display: grid; gap: 8px; margin: 0 0 16px; }
.qa { border-bottom: 1px solid var(--line); padding: 12px 0; }
.qa:last-child { border-bottom: 0; }
.qa summary { font-weight: 700; cursor: pointer; }
.qa p { margin: 8px 0 0; color: var(--muted); }
.onb { max-width: 440px; }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--blue); width: 22px; border-radius: 99rem; }

/* Hướng dẫn từng bước */
.guide-box summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; font: 600 18px/1.2 var(--display); color: var(--indigo); list-style: none; }
.guide-box summary::-webkit-details-marker { display: none; }
.g-steps { margin: 14px 0 0; padding-left: 22px; display: grid; gap: 16px; }
.g-steps li::marker { font: 600 16px var(--display); color: var(--blue); }
.g-t { font-size: 14.5px; }
.g-shot { position: relative; margin: 8px 0 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); cursor: zoom-in; max-width: 100%; }
.g-shot img { display: block; width: 100%; height: auto; }
.g-box { position: absolute; border: 3px solid #E12E2D; border-radius: 8px; box-shadow: 0 0 0 3px rgba(225,46,45,.25); pointer-events: none; }
.g-box em { position: absolute; left: -3px; top: -26px; background: #E12E2D; color: #fff; font: 700 12px/1 var(--body); font-style: normal; padding: 5px 8px; border-radius: 6px; white-space: nowrap; }
.g-pending { margin-top: 8px; padding: 14px; border-radius: 10px; border: 1.5px dashed var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.g-video { width: 100%; border-radius: 10px; margin-top: 12px; background: #000; }
.aifirst { border-radius: var(--r-lg); padding: 14px 16px; background: var(--surface-2); font-size: 14px; border: 1px solid var(--line); }
.lightbox { cursor: zoom-out; }
.lightbox .g-shot { max-width: min(1100px, 100%); cursor: zoom-out; background: #fff; }
.node-n small { font-size: 11px; }

/* Chế độ duyệt */
.review-banner { background: #FFF3DC; color: #7A4B00; font-size: 13.5px; padding: 8px 16px; text-align: center; }
.review-banner a { font-weight: 700; color: inherit; }
.review { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .review { grid-template-columns: 1fr; } .rv-toc { position: static !important; max-height: none !important; } }
.rv-toc { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; display: grid; gap: 2px; font-size: 13px; }
.rv-toc a { text-decoration: none; padding: 4px 6px; border-radius: 6px; color: var(--ink); }
.rv-toc a:hover { background: var(--surface-2); }
.rv-toc-h { font-weight: 700; color: var(--violet); margin-top: 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.rv-item h2 { font-size: 24px; margin: 6px 0 12px; }
.rv-guide { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.rv-guide ol { margin: 8px 0 0; padding-left: 20px; }
.rv-nop { border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 10px; font-size: 14px; }
.rv-nop ul { margin: 6px 0 0; padding-left: 20px; }
.rv-sub { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.rv-sub h3 { font-size: 17px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prose tr.my-dept td { background: #FFF1C2; font-weight: 600; color: #3A2A00; }

/* Bài tập thực chiến theo phòng */
.baitap { border: 2px solid var(--blue); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.baitap .eyebrow { color: var(--blue-deep); font-size: 13px; }
.baitap summary { cursor: pointer; font: 600 17px var(--display); color: var(--blue-deep); }
.bt-body { font-size: 16px; line-height: 1.6; margin: 8px 0; }
.bt-all { display: grid; gap: 10px; margin-top: 10px; font-size: 14px; }
.bt-all > div { border-top: 1px solid var(--line); padding-top: 8px; }
.rv-bt { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.rv-bt table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.rv-bt td { border-top: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
.rv-bt td:first-child { font-weight: 700; white-space: nowrap; width: 130px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
