/* Font lấy từ wireframe (xem fonts/LICENSE.txt) */
@font-face { font-family: 'Baloo 2'; font-weight: 500 800; font-display: swap; src: url(../fonts/baloo2-vietnamese.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Baloo 2'; font-weight: 500 800; font-display: swap; src: url(../fonts/baloo2-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Baloo 2'; font-weight: 500 800; font-display: swap; src: url(../fonts/baloo2-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 400 700; font-display: swap; src: url(../fonts/inter-vietnamese.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Inter'; font-weight: 400 700; font-display: swap; src: url(../fonts/inter-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-weight: 400 700; font-display: swap; src: url(../fonts/inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 400 700; font-display: swap; src: url(../fonts/inter-greek.woff2) format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }

:root {
  --bg: #EAF5FF;
  --blue: #1A5FC4;
  --blue-2: #2A72D8;
  --navy: #17325C;
  --muted: #4A6488;
  --faint: #8A9BB3;
  --nav-idle: #5B7394;
  --mint: #8FE3C9;
  --mint-bg: #D2F4E8;
  --mint-fg: #0F4D39;
  --good-line: #2FA77F;
  --coral-bg: #FFE1DA;
  --coral-fg: #6E2014;
  --coral-chip: #8E2F1F;
  --bad-line: #E0715E;
  --panel: #F4F8FD;
  --chip: #EEF3FA;
  --line: #D5E2F2;
  --track: #E4EEF9;
  --sky: #DCEBFF;
  --bar-low: #A9C3E4;
  --goal: #F0A898;
  --head: 'Baloo 2', sans-serif;
  --nav-h: 78px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--navy); font-family: Inter, sans-serif; font-size: 15px; line-height: 1.5; }
h1, h2, h3, p, ul, ol { margin: 0; }
h1, h2, h3 { font-family: var(--head); line-height: 1.2; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 2px; }
#app:focus { outline: none; }

#app { width: 100%; max-width: 480px; min-height: 100dvh; margin: 0 auto; }
.screen { display: flex; flex-direction: column; gap: 18px; padding: 24px 20px 28px; }
.screen.sub { gap: 16px; padding-top: 16px; }
body.has-nav .screen { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 22px); }

/* Thanh 4 tab */
#tabbar { display: none; position: fixed; z-index: 10; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: #FFF; border-radius: 24px 24px 0 0; box-shadow: 0 -4px 16px rgba(23,50,92,.08); grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.has-nav #tabbar { display: grid; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--nav-idle); font-size: 11px; font-weight: 600; text-decoration: none; }
.tab span { display: flex; padding: 4px 14px; border-radius: 999px; }
.tab[aria-current="page"] { color: var(--blue); font-weight: 700; }
.tab[aria-current="page"] span { background: var(--sky); }

/* Thành phần chung */
.card { border-radius: 22px; background: #FFF; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-title { font-size: 18px; font-weight: 700; }
.small { font-size: 12px; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { padding: 4px 10px; border-radius: 999px; background: #FFF; color: var(--muted); font-size: 12px; font-weight: 600; }
.chip.sm { padding: 3px 8px; font-size: 11px; font-weight: 700; }
.icon-btn { flex-shrink: 0; width: 44px; height: 44px; border-radius: 14px; background: #FFF; color: var(--navy); display: flex; align-items: center; justify-content: center; }
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top-bar .label { font-size: 14px; font-weight: 600; color: var(--muted); text-align: center; }
.top-bar .spacer { width: 44px; flex-shrink: 0; }
.page-title { font-size: 28px; font-weight: 800; }
.cta { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 10px 18px; border-radius: 18px; background: linear-gradient(135deg, var(--blue) 0%, var(--blue-2) 100%); color: #FFF; font-family: var(--head); font-size: 18px; font-weight: 700; text-decoration: none; text-align: center; }
.cta.ghost { background: #FFF; color: var(--blue); }
.note { border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.note .katex-html > .base { margin: 3px 0; }
.nb { white-space: nowrap; }
.note.good { background: var(--mint-bg); color: var(--mint-fg); }
.note.bad { background: var(--coral-bg); color: var(--coral-fg); }
.note.info { background: var(--chip); color: var(--navy); }
.track { height: 8px; border-radius: 999px; background: var(--track); }
.track > div { height: 100%; border-radius: 999px; }
.empty { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.loading { padding: 48px 20px; text-align: center; color: var(--muted); }

/* Trang chủ */
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-head .who { display: flex; align-items: center; gap: 12px; }
.avatar { width: 48px; height: 48px; border-radius: 16px; background: var(--blue); color: #FFF; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-weight: 700; font-size: 18px; flex-shrink: 0; }
.home-head h1 { font-size: 26px; line-height: 1.1; font-weight: 800; }
.home-head p { font-size: 14px; color: var(--muted); }
.streak { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--coral-bg); color: var(--coral-chip); font-weight: 700; font-size: 13px; white-space: nowrap; }
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 20px; background: linear-gradient(135deg, var(--blue) 0%, var(--blue-2) 100%); color: #FFF; display: flex; flex-direction: column; gap: 10px; }
.hero > * { position: relative; }
.hero .blob { position: absolute; border-radius: 50%; }
.hero .blob.a { right: -30px; top: -30px; width: 120px; height: 120px; background: var(--mint); opacity: .35; }
.hero .blob.b { right: 50px; bottom: -40px; width: 80px; height: 80px; background: #FF9C8A; opacity: .35; }
.hero .pill { align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.2); font-size: 12px; font-weight: 600; }
.hero .where { font-size: 13px; font-weight: 500; }
.hero .name { font-family: var(--head); font-size: 21px; font-weight: 700; line-height: 1.2; }
.hero .meter { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; }
.hero .track { flex-grow: 1; background: rgba(255,255,255,.3); }
.hero .track > div { background: var(--mint); }
.hero .go { align-self: flex-start; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: 14px; background: #FFF; color: var(--blue); font-weight: 700; font-size: 14px; text-decoration: none; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.day { min-height: 44px; border-radius: 12px; font-size: 13px; font-weight: 700; border: 2px solid transparent; background: var(--panel); color: var(--navy); }
.day.off { color: var(--faint); }
.day.today { border-color: var(--blue); }
.day[aria-pressed="true"] { background: var(--blue); color: #FFF; }
.periods { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.period { display: flex; flex-direction: column; gap: 2px; min-height: 52px; padding: 6px; border-radius: 10px; background: var(--chip); color: var(--muted); }
.period small { font-size: 10px; font-weight: 600; opacity: .85; }
.period b { font-size: 12px; font-weight: 700; line-height: 1.2; }
.review { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 12px; background: var(--mint-bg); color: var(--mint-fg); font-size: 13px; font-weight: 600; text-decoration: none; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 20px; text-decoration: none; }
.tile span { font-size: 12px; }
.tile .t { font-size: 13px; font-weight: 600; }
.tile b { font-family: var(--head); font-size: 24px; font-weight: 800; line-height: 1.2; }
.tile.mint { background: var(--mint-bg); color: var(--mint-fg); }
.tile.coral { background: var(--coral-bg); color: var(--coral-fg); }
.week-link { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border-radius: 18px; background: #FFF; color: var(--navy); text-decoration: none; }
.week-link .ic { flex-shrink: 0; width: 36px; height: 36px; border-radius: 12px; background: var(--sky); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.week-link .tx { flex-grow: 1; display: flex; flex-direction: column; font-size: 14px; font-weight: 700; }
.week-link .tx small { font-size: 12px; font-weight: 400; color: var(--muted); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; }
.sec-head h2 { font-size: 21px; font-weight: 700; }
.sec-head span { font-size: 13px; color: var(--muted); }
.group-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); margin-bottom: -6px; }
.subject { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 20px; color: var(--navy); text-decoration: none; box-shadow: 0 2px 0 rgba(23,50,92,.06); background: linear-gradient(150deg, #FFF 50%, var(--c-bg) 100%); }
.subject .mark { position: absolute; right: -18px; bottom: -18px; color: var(--c-fg); opacity: .13; }
.subject .row { display: flex; align-items: center; justify-content: space-between; }
.subject .badge { position: relative; width: 40px; height: 40px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: var(--c-bg); color: var(--c-fg); }
.subject .prio { padding: 3px 8px; border-radius: 999px; background: var(--coral-bg); color: var(--coral-chip); font-size: 11px; font-weight: 700; }
.subject .nm { position: relative; display: flex; flex-direction: column; gap: 2px; }
.subject .nm b { font-family: var(--head); font-size: 18px; font-weight: 700; line-height: 1.2; }
.subject .nm span { font-size: 12px; color: var(--muted); }
.subject .track { position: relative; height: 6px; }
.subject .track > div { background: var(--c-fg); }

/* Mục lục môn */
.chapter h2 { font-size: 16px; font-weight: 700; }
.lesson-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 8px 12px; border-radius: 14px; background: var(--panel); color: var(--navy); font-size: 14px; font-weight: 600; text-decoration: none; }
.lesson-link .done { color: var(--good-line); flex-shrink: 0; }

/* Bài học */
.lesson-head { display: flex; flex-direction: column; gap: 8px; }
.lesson-head h1 { font-size: 26px; font-weight: 800; line-height: 1.15; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 16px; background: #FFF; }
.seg button, .seg a { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 12px; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.seg [aria-pressed="true"] { background: var(--blue); color: #FFF; font-weight: 700; }
.objectives { border-radius: 20px; background: var(--mint-bg); color: var(--mint-fg); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.objectives b { font-family: var(--head); font-size: 17px; font-weight: 700; }
.objectives ul { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.45; }

/* Khối nội dung */
.block { border-radius: 20px; gap: 10px; }
.md { display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.6; }
.md ul, .md ol { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.md h3 { font-size: 16px; font-weight: 700; }
.md.problem { font-weight: 600; line-height: 1.5; }
.card-title .katex { font-size: 1em; }
.katex-display { margin: .4em 0; overflow-x: auto; overflow-y: hidden; }

.step { display: flex; gap: 12px; }
.step-n { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #FFF; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.step-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.step-body b { font-size: 14px; font-weight: 700; }
.step-body .md { font-size: 14px; line-height: 1.5; }

/* Khối formula: navy, nổi bật nhất (schema mục 4) */
.formula { position: relative; overflow: hidden; border-radius: 22px; background: linear-gradient(160deg, var(--navy) 0%, #1F4A86 100%); color: #FFF; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 24px rgba(23,50,92,.25); }
.formula > * { position: relative; }
.formula .blob { position: absolute; border-radius: 50%; }
.formula .blob.a { right: -40px; top: -40px; width: 130px; height: 130px; background: var(--mint); opacity: .16; }
.formula .blob.b { left: -30px; bottom: -50px; width: 110px; height: 110px; background: #FF9C8A; opacity: .14; }
.f-title { display: flex; align-items: center; gap: 8px; }
.f-title svg { flex-shrink: 0; }
.f-title h2 { font-size: 19px; font-weight: 700; }
.f-sub { font-size: 13px; color: #B9CBE6; }
.f-list { display: flex; flex-direction: column; gap: 8px; }
.f-item { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.08); }
.f-item.key { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 6px; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--mint); background: rgba(143,227,201,.14); }
.f-row { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; }
.f-core { align-self: flex-start; padding: 2px 8px; border-radius: 999px; background: var(--mint); color: var(--mint-fg); font-size: 11px; font-weight: 800; }
.f-math { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; font-size: 16px; }
.f-item.key .f-math { font-size: 20px; font-weight: 700; }
.f-note { font-size: 12px; color: #B9CBE6; }

.fx-sweep { background-image: linear-gradient(var(--mint), var(--mint)); background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 4px; padding-bottom: 4px; }
.fx-on { animation: fxpop .5s ease-out; }
.fx-on .fx-sweep { animation: fxsweep .9s .3s ease-out forwards; }
.fx-on .fx-key { animation: fxglow 1.4s .9s ease-out 2; }
@keyframes fxpop { 0% { transform: translateY(14px) scale(.98); opacity: .5; } 100% { transform: none; opacity: 1; } }
@keyframes fxsweep { to { background-size: 100% 4px; } }
@keyframes fxglow { 0% { box-shadow: 0 0 0 0 rgba(143,227,201,.75); } 100% { box-shadow: 0 0 0 14px rgba(143,227,201,0); } }
@media (prefers-reduced-motion: reduce) {
  .fx-on, .fx-on .fx-key, .fx-on .fx-sweep { animation: none; }
  .fx-sweep, .fx-on .fx-sweep { background-size: 100% 4px; }
}

/* Khối graph2d */
.g2d-plot { border-radius: 14px; background: var(--panel); padding: 6px; }
.g2d-slider { display: flex; align-items: center; gap: 12px; }
.g2d-slider input { flex-grow: 1; min-width: 0; min-height: 44px; accent-color: var(--blue); }
.g2d-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.g2d-legend span { display: flex; align-items: center; gap: 5px; }
.g2d-legend i { width: 18px; }
.g2d-caption { font-size: 13px; line-height: 1.5; }

/* Quiz */
.quiz-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; margin: -16px -20px 0; padding: 12px 20px; background: var(--bg); }
.quiz-meter { flex-grow: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.quiz-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; }
.quiz-meta span:last-child { color: var(--muted); }
.seg-bars { display: grid; gap: 6px; }
.seg-bar { height: 8px; border-radius: 999px; background: #C6D8EE; }
.seg-bar.on { background: var(--blue); }
.q { padding: 18px; }
.q-n { font-family: var(--head); font-weight: 800; font-size: 16px; margin-right: 4px; }
.q-stem { font-size: 16px; font-weight: 600; line-height: 1.5; }
.q-help { font-size: 13px; }
.q-fb:empty, .q-actions:empty { display: none; }
.q-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.q-check { min-height: 44px; padding: 8px 18px; border-radius: 12px; background: var(--blue); color: #FFF; font-weight: 700; font-size: 14px; }
.q-link { min-height: 44px; padding: 8px 12px; color: var(--blue); font-weight: 600; font-size: 14px; text-decoration: underline; }
.q-opts { display: flex; flex-direction: column; gap: 8px; }
.q-opt { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border-radius: 14px; border: 2px solid var(--line); background: #FFF; text-align: left; }
.q-dot { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--chip); color: var(--blue); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.q-opt-text { font-size: 16px; min-width: 0; }
.good.q-opt, .good.q-blank, .good.q-input, .good.lr-item { background: var(--mint-bg); color: var(--mint-fg); border: 2px solid var(--good-line); }
.bad.q-opt, .bad.q-blank, .bad.q-input, .bad.lr-item { background: var(--coral-bg); color: var(--coral-fg); border: 2px solid var(--bad-line); }
[aria-disabled="true"] { cursor: default; }

.q-cloze { padding: 14px; border-radius: 14px; background: var(--panel); font-size: 18px; line-height: 2.8; }
.q-cloze.sentence { font-size: 15px; line-height: 1.6; }
.q-cloze.sentence .q-blank { display: block; width: 100%; margin: 10px 0 0; text-align: left; font-size: 15px; line-height: 1.5; }
.q-blank { display: inline-block; vertical-align: middle; line-height: 1.3; min-width: 72px; min-height: 44px; margin: 2px 4px; padding: 6px 12px; border-radius: 10px; border: 2px dashed #9DB7DA; background: #FFF; color: var(--faint); font-size: 18px; }
.q-blank.filled { color: var(--navy); border-style: solid; }
.q-input { display: inline-block; vertical-align: middle; line-height: 1.3; margin: 2px 4px; width: 120px; min-height: 44px; padding: 6px 12px; border-radius: 10px; border: 2px dashed #9DB7DA; background: #FFF; color: var(--navy); font: inherit; font-size: 16px; }
.q-bank { display: flex; gap: 8px; flex-wrap: wrap; }
.q-bank.sentence { flex-direction: column; }
.q-token { min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--line); background: #FFF; font-size: 16px; text-align: left; }
.q-bank.sentence .q-token { font-size: 14px; line-height: 1.5; }
.q-token.used { background: var(--chip); color: var(--faint); }

.lr-pool { display: flex; flex-direction: column; gap: 8px; }
.lr-pool-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.lr-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lr-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lr-col { display: flex; flex-direction: column; gap: 6px; min-height: 120px; padding: 10px; border-radius: 14px; border: 2px dashed; min-width: 0; }
.lr-col.l { border-color: #9DB7DA; background: var(--panel); }
.lr-col.r { border-color: var(--goal); background: #FFF6F3; }
.lr-col.b { border-color: #7FCFB4; background: #F1FBF7; min-height: 70px; }
.lr-head { font-family: var(--head); font-weight: 700; font-size: 15px; line-height: 1.3; }
.lr-col.l .lr-head { color: var(--blue); }
.lr-col.r .lr-head { color: #A8371F; }
.lr-col.b .lr-head { color: #1B7055; }
.lr-item { display: block; width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); background: #FFF; font-size: 14px; line-height: 1.35; text-align: left; }

.q-result { padding: 18px; }
.q-score { font-family: var(--head); font-size: 24px; font-weight: 800; line-height: 1.2; }
.q-row { display: flex; justify-content: space-between; font-size: 14px; }

/* Tiến độ */
.toggle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: #FFF; flex-shrink: 0; }
.toggle button { min-height: 44px; padding: 0 14px; border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.toggle [aria-pressed="true"] { background: var(--blue); color: #FFF; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; background: var(--panel); }
.stat b { font-family: var(--head); font-size: 20px; font-weight: 800; line-height: 1.1; }
.stat span { font-size: 11px; color: var(--muted); }
.bars { position: relative; display: grid; gap: 8px; align-items: end; }
.goal-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--goal); pointer-events: none; }
.bar-col { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; height: 100%; }
.bar-val { font-size: 10px; color: var(--muted); line-height: 1.4; }
.bar { width: 100%; border-radius: 8px 8px 4px 4px; background: var(--bar-low); }
.bar.met { background: var(--blue); }
.bar.future { height: 3px; border-radius: 4px; background: var(--track); }
.bar-labels { display: grid; gap: 8px; margin-top: -6px; }
.bar-labels span { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; white-space: nowrap; }
.bar-labels .cur { font-weight: 800; color: var(--blue); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--bar-low); }
.legend .sw.met { background: var(--blue); }
.legend .sw-line { width: 14px; border-top: 2px dashed var(--goal); }
.lv { display: flex; flex-direction: column; gap: 4px; }
.lv-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.lv-row b { font-weight: 700; }
.lv-row span { color: var(--muted); flex-shrink: 0; }
.track.big { height: 10px; }
.sub-row { display: flex; align-items: center; gap: 10px; }
.sub-row .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sub-name { width: 74px; flex-shrink: 0; font-size: 13px; font-weight: 600; }
.sub-row .track { flex-grow: 1; }
.sub-count { width: 52px; flex-shrink: 0; text-align: right; font-size: 12px; color: var(--muted); }
