/* Joukyuu Art Academy – giao diện tối lấy cảm hứng từ không gian làm việc của Photoshop */
:root {
  --bg: #121418;
  --surface: #1b1e24;
  --surface-2: #232730;
  --surface-3: #2c313b;
  --border: #333946;
  --text: #e8eaee;
  --text-2: #c3c8d0;
  --muted: #939cab;
  --accent: #31a8ff;
  --accent-2: #0d7fd6;
  --accent-soft: rgba(49, 168, 255, .12);
  --green: #2ecc71;
  --orange: #ff9f43;
  --red: #ff5c6c;
  --purple: #a78bfa;
  --pink: #ff5c8a;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 800; }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-3); padding: .1em .4em; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--border); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 760px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- Nút ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; background: var(--accent); color: #04121f; border: 1px solid transparent; border-radius: 10px; padding: .62em 1.15em; font: 600 .95rem/1.2 var(--font); cursor: pointer; transition: background .15s, transform .1s, border-color .15s; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: #5cbcff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-sm { padding: .42em .85em; font-size: .86rem; border-radius: 8px; }
.btn-lg { padding: .8em 1.4em; font-size: 1.02rem; border-radius: 12px; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(18, 20, 24, .88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.brand-mark { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: #0b1e33; color: var(--accent); border: 2px solid var(--accent); font-weight: 800; font-size: 1rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.02rem; }
.brand-text small { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav > a, .nav-right > a { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); padding: 8px 11px; border-radius: 9px; font-size: .92rem; font-weight: 500; text-decoration: none; }
.main-nav > a:hover, .nav-right > a:hover { background: var(--surface-2); color: var(--text); }
.main-nav a.active { color: var(--text); background: var(--surface-2); }
.main-nav > a.active .icon { color: var(--accent); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-right .btn { color: #04121f; }
.os-switch { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.os-switch a { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 7px; color: var(--muted); font-size: .82rem; font-weight: 600; text-decoration: none; }
.os-switch a.on { background: var(--accent); color: #04121f; }
.user-chip { background: var(--surface-2); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--purple)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 9px; padding: 7px 9px; cursor: pointer; }

.os-prompt { background: linear-gradient(90deg, rgba(49, 168, 255, .16), rgba(167, 139, 250, .12)); border-bottom: 1px solid var(--border); }
.os-prompt-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.os-prompt p { margin: 0; }
.os-prompt-actions { display: flex; gap: 8px; }

/* ---------- Thông báo ---------- */
.flashes { padding-top: 16px; }
.flash { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); margin: 0 0 12px; }
.flash ul { margin: .4em 0 0; padding-left: 1.2em; }
.flash-success { border-color: rgba(46, 204, 113, .5); background: rgba(46, 204, 113, .1); }
.flash-error { border-color: rgba(255, 92, 108, .55); background: rgba(255, 92, 108, .1); }
.flash-warn { border-color: rgba(255, 159, 67, .55); background: rgba(255, 159, 67, .1); }
.flash-info { border-color: rgba(49, 168, 255, .45); background: var(--accent-soft); }

/* ---------- Trang chủ ---------- */
.hero { padding: 56px 0 40px; background: radial-gradient(900px 400px at 85% 10%, rgba(49, 168, 255, .15), transparent 60%), radial-gradient(700px 400px at 0% 100%, rgba(167, 139, 250, .1), transparent 60%); }
.hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; font-size: .9rem; background: var(--accent-soft); padding: 5px 12px; border-radius: 99px; margin-bottom: 16px; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); }
.hl { background: linear-gradient(90deg, var(--accent), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.1rem; color: var(--text-2); max-width: 62ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0; }
.os-picker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.os-card { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none !important; cursor: pointer; transition: border-color .15s; }
.os-card .icon { width: 26px; height: 26px; color: var(--muted); }
.os-card > span { display: flex; flex-direction: column; line-height: 1.3; }
.os-card .keys { font-size: .85rem; }
.os-card small { color: var(--muted); font-size: .78rem; }
.os-card.on { border-color: var(--accent); background: var(--accent-soft); }
.os-card.on .icon { color: var(--accent); }
.os-card input { position: absolute; opacity: 0; pointer-events: none; }
.hero-art { position: relative; }
.hero-art .figure { margin: 0; box-shadow: var(--shadow); }
.floating-chip { position: absolute; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font-size: .85rem; font-weight: 600; box-shadow: var(--shadow); display: flex; align-items: center; gap: 6px; }
.chip-1 { left: 24px; bottom: -20px; color: var(--green); }
.chip-2 { right: -10px; top: -14px; }

.section { padding: 48px 20px; }
.section-head { margin-bottom: 24px; }
.roadmap-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: step; }
.roadmap-strip a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; position: relative; transition: transform .15s, border-color .15s; }
.roadmap-strip a:hover { transform: translateY(-2px); border-color: var(--accent); }
.step-no { position: absolute; right: 14px; top: 10px; font-size: 1.8rem; font-weight: 800; color: var(--surface-3); }
.step-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.level-intermediate .step-icon { background: rgba(255, 159, 67, .14); color: var(--orange); }
.level-advanced .step-icon { background: rgba(167, 139, 250, .15); color: var(--purple); }
.roadmap-strip small { color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feature p { color: var(--text-2); margin: 0; font-size: .95rem; }
.feature-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.feature-icon .icon { width: 24px; height: 24px; }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: linear-gradient(120deg, #0f2a44, #231d3f); border: 1px solid var(--border); border-radius: 20px; padding: 32px; margin-bottom: 48px; }
.cta-band p { margin: 0; color: var(--text-2); max-width: 70ch; }

/* ---------- Lộ trình ---------- */
.page-hero { padding: 40px 0 24px; background: linear-gradient(180deg, rgba(49, 168, 255, .07), transparent); }
.page-hero.compact { padding-bottom: 8px; }
.overall { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-top: 16px; }
.progress { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 99px; }
.roadmap { padding-bottom: 48px; }
.level-block { position: relative; padding-left: 28px; margin-bottom: 36px; border-left: 3px solid var(--accent); }
.level-block.level-intermediate { border-left-color: var(--orange); }
.level-block.level-advanced { border-left-color: var(--purple); }
.level-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.level-head p { margin: 0; color: var(--text-2); }
.level-pill { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.level-intermediate .level-pill { background: rgba(255, 159, 67, .14); color: var(--orange); }
.level-advanced .level-pill { background: rgba(167, 139, 250, .15); color: var(--purple); }
.module-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; scroll-margin-top: 80px; }
.module-card > header { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.module-card h2 { margin: 0 0 4px; }
.module-card header p { margin: 0; }
.module-icon { width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); }
.module-icon .icon { width: 26px; height: 26px; }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-item a { display: grid; grid-template-columns: 28px 1fr auto; gap: 14px; align-items: center; padding: 12px 12px; border-radius: 10px; color: var(--text); text-decoration: none; }
.lesson-item a:hover { background: var(--surface-2); }
.lesson-item + .lesson-item { border-top: 1px solid var(--border); }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; }
.state-started .dot { border-color: var(--orange); }
.state-done .dot { background: var(--green); border-color: var(--green); color: #062; }
.state-done .dot .icon { width: 14px; height: 14px; stroke-width: 3; }
.is-next a { background: var(--accent-soft); outline: 1px solid rgba(49, 168, 255, .35); }
.lesson-main { display: flex; flex-direction: column; min-width: 0; }
.lesson-main small { color: var(--muted); font-size: .86rem; }
.lesson-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .84rem; flex-wrap: wrap; justify-content: flex-end; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .76rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.tag-pen { background: rgba(167, 139, 250, .16); color: var(--purple); }
.tag-wait { background: rgba(255, 159, 67, .16); color: var(--orange); }
.tag-done { background: rgba(46, 204, 113, .15); color: var(--green); }
.mini-score { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 6px; border-radius: 7px; font-weight: 700; font-size: .85rem; background: var(--surface-3); }
.mini-score.great, .stat-num.great { color: var(--green); }
.mini-score.good, .stat-num.good { color: var(--accent); }
.mini-score.ok, .stat-num.ok { color: var(--orange); }
.mini-score.bad, .stat-num.bad { color: var(--red); }
.empty-state { text-align: center; padding: 60px 20px; }

/* ---------- Bài học ---------- */
.lesson-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; padding-top: 28px; padding-bottom: 48px; }
.lesson-aside .sticky { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 18px; }
.back-link { color: var(--muted); font-size: .9rem; }
.toc { display: flex; flex-direction: column; gap: 2px; border-left: 2px solid var(--border); padding-left: 12px; }
.toc strong { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.toc a { color: var(--text-2); font-size: .9rem; padding: 3px 0; }
.toc a:hover { color: var(--accent); text-decoration: none; }
.aside-score { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.score-parts { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.score-badge { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 88px; height: 88px; border-radius: 50%; border: 5px solid var(--surface-3); font-size: 1.9rem; font-weight: 800; line-height: 1; flex-shrink: 0; }
.score-badge small { font-size: .62rem; font-weight: 600; margin-top: 4px; text-transform: uppercase; letter-spacing: .04em; }
.score-badge.great { border-color: var(--green); color: var(--green); }
.score-badge.good { border-color: var(--accent); color: var(--accent); }
.score-badge.ok { border-color: var(--orange); color: var(--orange); }
.score-badge.bad { border-color: var(--red); color: var(--red); }
.score-badge.muted { color: var(--muted); }
.lesson { min-width: 0; max-width: 820px; }
.crumbs { color: var(--muted); font-size: .88rem; margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.lesson-head { margin-bottom: 20px; }
.lesson-badges { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; color: var(--muted); font-size: .9rem; }
.figure { margin: 24px 0; background: #1e2127; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.figure img { display: block; width: 100%; height: auto; }
.figure figcaption { padding: 10px 16px; font-size: .88rem; color: var(--muted); border-top: 1px solid var(--border); }

.prose { font-size: 1.03rem; color: var(--text-2); }
.prose h2 { color: var(--text); margin-top: 1.8em; scroll-margin-top: 84px; }
.prose h3 { color: var(--text); margin-top: 1.4em; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin: .3em 0; }
.prose table, .table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .94rem; }
.table th, .table td, .prose table th, .prose table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th, .prose table th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.card .table { margin: 0; }
.callout { border-radius: 12px; padding: 14px 16px 14px 48px; margin: 1.2em 0; position: relative; background: var(--surface); border: 1px solid var(--border); }
.callout::before { position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: .85rem; }
.callout.tip { border-color: rgba(46, 204, 113, .45); background: rgba(46, 204, 113, .07); }
.callout.tip::before { content: "✓"; background: var(--green); color: #052; }
.callout.warn { border-color: rgba(255, 159, 67, .5); background: rgba(255, 159, 67, .07); }
.callout.warn::before { content: "!"; background: var(--orange); color: #3a1d00; }
.callout.info { border-color: rgba(49, 168, 255, .45); background: var(--accent-soft); }
.callout.info::before { content: "i"; background: var(--accent); color: #04121f; }
.callout.mistake { border-color: rgba(255, 92, 108, .5); background: rgba(255, 92, 108, .07); }
.callout.mistake::before { content: "✕"; background: var(--red); color: #3a0008; }
.callout > :last-child { margin-bottom: 0; }
.steps { counter-reset: s; list-style: none; padding-left: 0 !important; }
.steps > li { counter-increment: s; position: relative; padding: 4px 0 12px 46px; margin: 0 !important; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #04121f; font-weight: 800; display: grid; place-items: center; }
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 36px; bottom: 2px; width: 2px; background: var(--border); }

kbd { display: inline-block; font: 600 .82em/1 var(--mono); padding: .32em .5em; border-radius: 6px; background: var(--surface-3); color: var(--text); border: 1px solid #454c5a; border-bottom-width: 3px; white-space: nowrap; }
.keys { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.keys .plus { color: var(--muted); font-size: .8em; padding: 0 1px; }
.menu-path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 1px 8px; font-size: .92em; color: var(--text); }
.menu-path .sep { color: var(--accent); font-style: normal; font-weight: 700; }
.os-text { border-bottom: 1px dashed rgba(49, 168, 255, .5); }

.lesson-section { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); scroll-margin-top: 80px; }
.lesson-section h2 { display: flex; align-items: center; gap: 10px; }
.lesson-section h2 .icon { color: var(--accent); }
.tip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 24px; }
.tip-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--orange); border-radius: 12px; padding: 16px; }
.tip-card strong { display: block; margin-bottom: 6px; }
.tip-card p { margin: 0 0 6px; color: var(--text-2); font-size: .95rem; }
.principles .tip-card { border-left-color: var(--accent); position: relative; padding-top: 44px; }
.principles .q-no { position: absolute; top: 12px; left: 16px; }

.quiz-result { display: flex; align-items: center; gap: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.quiz-result p { margin: 4px 0 0; color: var(--text-2); }
.quiz { display: flex; flex-direction: column; gap: 14px; }
.question { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin: 0; background: var(--surface); }
.question.answered { border-color: rgba(49, 168, 255, .45); }
.question.is-right { border-color: rgba(46, 204, 113, .6); }
.question.is-wrong { border-color: rgba(255, 92, 108, .6); }
.question legend { font-weight: 600; padding: 0 6px; margin-left: -6px; display: flex; gap: 10px; align-items: flex-start; float: left; width: 100%; margin-bottom: 12px; }
.question legend + * { clear: both; }
.q-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-3); font-size: .85rem; flex-shrink: 0; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.option:hover { background: var(--surface-2); }
.option input { margin-top: 5px; accent-color: var(--accent); }
.option:has(input:checked) { background: var(--accent-soft); border-color: rgba(49, 168, 255, .35); }
.option.opt-correct { background: rgba(46, 204, 113, .12); border-color: rgba(46, 204, 113, .5); }
.option.opt-wrong { background: rgba(255, 92, 108, .1); border-color: rgba(255, 92, 108, .5); }
.q-feedback { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: .95rem; }
.q-feedback p { margin: 0 0 6px; display: flex; gap: 8px; }
.fb-wrong { color: #ffb3bb; }
.fb-wrong .icon { color: var(--red); margin-top: 3px; }
.fb-right .icon { color: var(--green); margin-top: 3px; }
.quiz-actions { display: flex; align-items: center; gap: 14px; }
.exercise-teaser { background: linear-gradient(120deg, rgba(49, 168, 255, .1), rgba(167, 139, 250, .08)); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.exercise-teaser .btn { margin-right: 14px; }
.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 40px; }
.lesson-nav a { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; color: var(--text); text-decoration: none; }
.lesson-nav a:hover { border-color: var(--accent); }
.lesson-nav small { color: var(--muted); }
.lesson-nav .next { text-align: right; grid-column: 2; }

/* ---------- Thẻ & form ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; min-width: 0; }
.card > h2:first-child { margin-top: 0; }
.card-page { padding-top: 40px; padding-bottom: 48px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: .94rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input:not([type]), select, textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font: 400 1rem var(--font); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49, 168, 255, .2); }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.os-choice { display: flex; gap: 10px; flex-wrap: wrap; }
.os-choice legend { width: 100%; }
.os-choice .os-card { flex: 1; position: relative; flex-direction: row !important; }
.code-block { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px; overflow: auto; font: .85rem/1.5 var(--mono); }
.auth-page { display: grid; place-items: center; padding: 48px 20px; }
.auth-card { width: 100%; max-width: 460px; }
.logout-form { margin-top: 16px; }
.inline-form select { padding: 6px 8px; font-size: .88rem; }

/* ---------- Bài tập ---------- */
.exercise-page, .result-page, .dashboard, .admin { padding-top: 28px; padding-bottom: 48px; }
.exercise-page h1 { display: flex; align-items: center; gap: 12px; }
.exercise-page h1 .icon { color: var(--accent); }
.exercise-grid, .result-grid, .dash-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
.dash-grid { grid-template-columns: 1fr 1fr; }
.mistake-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.mistake-list li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: rgba(255, 92, 108, .06); border: 1px solid rgba(255, 92, 108, .25); border-radius: 10px; }
.mistake-list strong { color: #ffb3bb; }
.mistake-list span { color: var(--text-2); font-size: .94rem; }
.req-list { margin: 0 0 14px; display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.req-list div { display: grid; grid-template-columns: 130px 1fr; background: var(--surface-2); }
.req-list dt { padding: 8px 12px; color: var(--muted); font-size: .88rem; }
.req-list dd { margin: 0; padding: 8px 12px; font-weight: 600; }
.dropzone { position: relative; border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px 16px; text-align: center; cursor: pointer; display: flex !important; flex-direction: column; align-items: center; gap: 6px !important; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.has-file { border-style: solid; border-color: var(--green); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-icon .icon { width: 36px; height: 36px; color: var(--accent); }
.checklist { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; }
.checklist label { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-weight: 400 !important; padding: 5px 0; cursor: pointer; }
.checklist input { margin-top: 5px; accent-color: var(--green); width: 16px; height: 16px; }

.result-head { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.result-head > div:nth-child(2) { flex: 1; min-width: 240px; }
.result-head h1 { margin: 0 0 4px; font-size: 1.6rem; }
.result-head p { margin: 4px 0; }
.result-actions { display: flex; flex-direction: column; gap: 8px; }
.teacher-review { border-color: rgba(46, 204, 113, .45); }
.submission-img { display: block; width: 100%; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 14px; image-rendering: auto; }
.checker { background: repeating-conic-gradient(#3a3f4a 0 25%, #2a2e37 0 50%) 0 0 / 20px 20px; }
.layer-names { columns: 2; font-size: .88rem; color: var(--text-2); padding-left: 1.2em; }
details summary { cursor: pointer; color: var(--accent); margin: 10px 0; }
.check-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.check > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.check-icon { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.check-icon .icon { width: 15px; height: 15px; stroke-width: 3; }
.check.pass .check-icon { background: rgba(46, 204, 113, .18); color: var(--green); }
.check.fail { border-color: rgba(255, 92, 108, .4); }
.check.fail .check-icon { background: rgba(255, 92, 108, .18); color: var(--red); }
.check-list.compact .check { padding: 8px 10px; }
.fix { margin: 8px 0 0; padding: 10px 12px; background: rgba(49, 168, 255, .08); border-radius: 8px; color: var(--text-2); font-size: .94rem; }
.fix > span { font-weight: 700; color: var(--accent); }
.fail-title { color: #ffb3bb; display: flex; align-items: center; gap: 8px; }

/* ---------- Cá nhân / admin ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.stat-num { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.module-progress { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.module-progress li { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; }
.module-progress a { color: var(--text); display: flex; gap: 8px; align-items: center; }
.module-progress .progress { grid-column: 1 / -1; }
.sub-list { list-style: none; margin: 0; padding: 0; }
.sub-list a { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.sub-list a:hover { background: var(--surface-2); }
.sub-list a > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.admin-nav a { padding: 8px 14px; border-radius: 9px; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
.admin-nav a.on { background: var(--surface-2); color: var(--text); }
.score-input { display: flex; gap: 12px; align-items: center; }
.score-input input[type=range] { flex: 1; accent-color: var(--accent); }
.score-input input[type=number] { width: 90px; }
.quick-comments { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- Tiện ích lọc ---------- */
.toolbar-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 16px 0; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; min-width: 260px; }
.search-box input { border: 0; background: none; padding: 10px 0; box-shadow: none !important; }
.toggle { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; gap: 6px; align-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); border-radius: 99px; padding: 5px 12px; font: 500 .84rem var(--font); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); color: #04121f; border-color: var(--accent); }
.shortcut-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding-bottom: 48px; align-items: start; }
.shortcut-card h2 { display: flex; gap: 10px; align-items: center; font-size: 1.15rem; }
.shortcut-card h2 .icon { color: var(--accent); }
.shortcut-table td:nth-child(1), .shortcut-table td:nth-child(2) { width: 30%; }
.shortcut-table .cur { background: rgba(49, 168, 255, .06); }
.shortcut-table th.cur { color: var(--accent); }
.star-mark { color: #ffc94a; }
.tip-of-day { border-color: rgba(255, 201, 74, .4); background: linear-gradient(120deg, rgba(255, 201, 74, .08), transparent); margin-top: 8px; }
.tip-of-day .eyebrow { background: rgba(255, 201, 74, .15); color: #ffc94a; }
.section-title { margin-top: 32px; }
.guide { padding-bottom: 48px; }

/* ---------- Bảng luyện nét ---------- */
.drill-tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 16px 0; }
.drill-tab { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.drill-tab small { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.drill-tab.on { border-color: var(--accent); background: var(--accent-soft); }
.drill-card { padding: 16px; }
.drill-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.drill-goal { flex: 1; min-width: 260px; }
.drill-status { display: flex; gap: 10px; align-items: center; font-size: .86rem; color: var(--muted); }
.pressure-meter { width: 90px; height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.pressure-meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--pink)); transition: width .05s; }
.drill-stage { position: relative; width: 100%; aspect-ratio: 12 / 7; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #f4f1ea; }
.drill-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.drill-ink { touch-action: none; cursor: crosshair; }
.drill-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.value-picker { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2); padding: 6px 10px; border-radius: 10px; font-size: .86rem; }
.value-picker input[type=range] { width: 160px; }
.value-picker input[type=range]:first-of-type { accent-color: #888; }
.value-swatch { width: 28px; height: 28px; border-radius: 6px; border: 2px solid var(--border); }
.drill-result:empty { display: none; }
.drill-result > .btn { margin-top: 4px; }
.color-drill { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; }
.color-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-content: start; }
.color-slot { display: flex; flex-direction: column; gap: 4px; padding: 8px; background: var(--surface-2); border: 2px solid transparent; border-radius: 10px; cursor: pointer; color: var(--text-2); font: 500 .8rem var(--font); }
.color-slot.on { border-color: var(--accent); }
.color-slot .sw { display: block; height: 30px; border-radius: 6px; }
.color-panel { background: var(--surface-2); border-radius: 12px; padding: 16px; }
.color-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.big-sw { height: 120px; border-radius: 10px; border: 1px solid var(--border); }
.hsb-sliders { display: flex; flex-direction: column; gap: 12px; }
.hsb-row { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; color: var(--text-2); }
.hsb-row input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; border-radius: 99px; border: 1px solid var(--border); }
.hsb-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid #111; cursor: pointer; }
.hsb-row input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #111; cursor: pointer; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0 20px; margin-top: 24px; background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-inner p { max-width: 460px; margin-top: 10px; font-size: .92rem; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.footer-links a { color: var(--text-2); }
.fineprint { font-size: .8rem; margin-top: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .main-nav > a span { display: none; }
  .main-nav > a { padding: 8px; }
  .roadmap-strip, .features { grid-template-columns: repeat(2, 1fr); }
  .drill-tabs { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 16px 16px; gap: 2px; }
  .main-nav.open { display: flex; }
  .main-nav > a span { display: inline; }
  .main-nav > a { padding: 10px; }
  .nav-right { margin-left: 0; flex-direction: column; align-items: stretch; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px; }
  .os-switch { align-self: flex-start; }
  .hero-inner, .lesson-layout, .exercise-grid, .result-grid, .dash-grid, .grid-2, .shortcut-groups, .color-drill { grid-template-columns: 1fr; }
  .lesson-aside .sticky { position: static; }
  .toc { display: none; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .overall { grid-template-columns: 1fr; }
  .cta-band { flex-direction: column; align-items: flex-start; }
  .chip-1 { left: 8px; }
  .chip-2 { right: 8px; }
}
@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .roadmap-strip, .features { grid-template-columns: 1fr; }
  .drill-tabs { grid-template-columns: repeat(2, 1fr); }
  .lesson-item a { grid-template-columns: 24px 1fr; }
  .lesson-meta { grid-column: 2; justify-content: flex-start; }
  .lesson-nav { grid-template-columns: 1fr; }
  .lesson-nav .next { grid-column: 1; }
  .req-list div { grid-template-columns: 1fr; }
  .color-slots { grid-template-columns: repeat(3, 1fr); }
  .search-box { min-width: 0; width: 100%; }
  .table { display: block; overflow-x: auto; }
  .brand-text small { display: none; }
}

@media print {
  .site-header, .site-footer, .toolbar-row, .os-prompt { display: none; }
  body { background: #fff; color: #000; }
  .card { border-color: #ccc; background: #fff; }
  kbd { background: #eee; color: #000; border-color: #999; }
  .shortcut-groups { grid-template-columns: 1fr 1fr; }
}

/* ---------- Thuật ngữ Anh – Việt ---------- */
.term { text-decoration: underline dotted rgba(49, 168, 255, .7); text-underline-offset: 3px; cursor: help; position: relative; }
abbr.term { text-decoration: none; }
.term:hover::after, .term:focus::after { content: attr(data-vi); position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 40; width: max-content; max-width: 300px; white-space: normal; background: #0b1e33; color: var(--text); border: 1px solid var(--accent); border-radius: 10px; padding: 8px 11px; font: 500 .85rem/1.45 var(--font); box-shadow: var(--shadow); text-decoration: none; pointer-events: none; }
.vi-gloss { color: #7fc8ff; font-size: .86em; }
.menu-path .vi-gloss { display: block; font-size: .72em; line-height: 1.1; color: #7fc8ff; margin-top: -1px; }
.menu-path > span { display: inline-flex; flex-direction: column; padding: 1px 0; }
.gloss-off .vi-gloss { display: none; }
.gloss-toggle { background: var(--surface); border: 1px solid var(--border); color: var(--muted); border-radius: 9px; padding: 6px 9px; font: 700 .76rem var(--font); cursor: pointer; }
.gloss-toggle span { margin: 0 3px; }
.gloss-toggle[aria-pressed="true"] { color: #7fc8ff; border-color: rgba(49, 168, 255, .6); }
.glossary-page { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; padding-bottom: 48px; align-items: start; }
.glossary-page > .card:last-child { grid-column: 1 / -1; }
.glossary-list { margin: 0; }
.glossary-list > div { padding: 9px 0; border-bottom: 1px solid var(--border); }
.glossary-list > div:last-child { border-bottom: 0; }
.glossary-list dt { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.glossary-list .en { font-weight: 700; color: var(--text); font-family: var(--mono); font-size: .95rem; }
.glossary-list .vi { color: #7fc8ff; font-weight: 600; }
.glossary-list dd { margin: 2px 0 0; color: var(--text-2); font-size: .92rem; }
@media (max-width: 1280px) and (min-width: 861px) {
  .main-nav > a span { display: none; }
  .main-nav > a { padding: 8px; }
  .os-switch a span { display: none; }
}
.lang-note { display: block; background: var(--accent-soft); border: 1px solid rgba(49,168,255,.3); border-radius: 10px; padding: 10px 14px; font-size: .92rem; color: var(--text-2); }
.lang-note .icon { color: var(--accent); margin-right: 4px; }

@media (max-width: 1440px) and (min-width: 861px) {
  .os-switch a span { display: none; }
  .header-inner { gap: 14px; }
  .main-nav > a { padding: 8px 8px; }
}

/* ---------- Thực hành ---------- */
.diff { display: inline-flex; align-items: center; gap: 2px; font-size: .8rem; font-weight: 700; color: #ffc94a; white-space: nowrap; }
.diff-off { color: var(--surface-3); }
.diff-1 { color: var(--green); }
.diff-2 { color: #ffc94a; }
.diff-3 { color: var(--pink); }
.level-block.level-practice { border-left-color: var(--green); }
.level-practice .level-pill { background: rgba(46, 204, 113, .15); color: var(--green); }
.practice-page { padding-bottom: 48px; }
.practice-group { margin-bottom: 40px; }
.practice-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.practice-head h2 { margin: 0 0 4px; }
.practice-head p { margin: 0; }
.practice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.practice-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); text-decoration: none !important; transition: transform .15s, border-color .15s; }
.practice-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.practice-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #1e2127; border-bottom: 1px solid var(--border); }
.practice-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.practice-done { position: absolute; top: 10px; right: 10px; }
.practice-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.practice-body small { line-height: 1.45; }
.practice-meta { display: flex; gap: 12px; align-items: center; margin-top: auto; padding-top: 6px; color: var(--muted); font-size: .84rem; }
.downloads { margin: 20px 0; border-color: rgba(46, 204, 113, .4); background: rgba(46, 204, 113, .06); }
.downloads ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.downloads p { margin: 4px 0 0; }
.site-header .container { max-width: 1400px; }

/* ---------- Thiết bị vẽ ---------- */
.device-picker { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.device-picker .chip { text-decoration: none; }
.hero-device { margin-top: 14px; }
.device-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-top: 12px; }
.device-bar .icon { color: var(--accent); }
.device-guide-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.device-guide-head h2 { margin: 0; display: flex; gap: 8px; align-items: center; }
.device-guide { margin-top: 18px; }
.device-guide .callout ul { margin: 0; padding-left: 1.1em; }

/* ---------- Tab & thẻ phím tắt ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 8px 0 4px; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.tab { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding: 10px 14px; border-radius: 10px 10px 0 0; color: var(--text-2); font-weight: 600; font-size: .92rem; text-decoration: none !important; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { background: var(--surface); color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); background: var(--surface); }
.tab.on .icon { color: var(--accent); }
.shortcut-page { padding-bottom: 48px; }
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 20px; }
.shortcut-card2 { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.shortcut-card2:hover { border-color: rgba(49, 168, 255, .5); }
.sc-img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #1e2127; border-bottom: 1px solid var(--border); }
.sc-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sc-keys { font-size: 1.15rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sc-keys kbd { font-size: .8em; padding: .4em .6em; }
.sc-desc { margin: 0; color: var(--text); line-height: 1.45; }
.sc-other { margin-top: auto; }
.sc-other kbd { font-size: .72rem; }
.sc-body .tag { align-self: flex-start; }
@media print { .tabs, .search-box { display: none; } .shortcut-grid { grid-template-columns: repeat(3, 1fr); } .sc-img { display: none; } }

/* Tab: xuống dòng khi hẹp, không có thanh cuộn ngang */
.tabs { flex-wrap: wrap; overflow: visible; border-bottom: 0; padding-bottom: 0; gap: 8px; margin: 12px 0 8px; }
.tab { border-radius: 10px; border: 1px solid var(--border); margin-bottom: 0; padding: 8px 13px; background: var(--surface); }
.tab.on { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 560px) { .tab { padding: 7px 10px; font-size: .86rem; } }
.tab-count { font-size: .75rem; color: var(--muted); background: var(--surface-3); border-radius: 99px; padding: 1px 7px; }
.tab.on .tab-count { color: var(--accent); }

/* ---------- Từ điển & Mẹo dạng tab ---------- */
.glossary-wrap, .tips-page { padding-bottom: 48px; }
.glossary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 0; }
.glossary-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.glossary-item dt { display: flex; flex-direction: column; gap: 2px; }
.glossary-item .en { font-weight: 700; color: var(--text); font-family: var(--mono); font-size: 1rem; }
.glossary-item .vi { color: #7fc8ff; font-weight: 600; }
.glossary-item dd { margin: 0; color: var(--text-2); font-size: .92rem; line-height: 1.5; }
.glossary-item .tag { align-self: flex-start; margin-top: auto; }
.tips-page .tip-of-day { margin-top: 4px; }
/* Mỗi tổ hợp phím không bị ngắt dòng giữa chừng; chỉ xuống dòng giữa các lựa chọn "/" */
.sc-keys .keys { white-space: nowrap; flex-wrap: nowrap; }
.sc-keys > .muted { margin: 0 2px; }

/* Thuật ngữ: gạch chân chấm rõ ràng hơn */
.term, abbr.term { color: #cfe8ff; text-decoration: none; border-bottom: 2px dotted #31a8ff; padding-bottom: 1px; cursor: help; }
.term:hover, .term:focus { color: #fff; border-bottom-style: solid; background: rgba(49, 168, 255, .12); border-radius: 3px 3px 0 0; outline: none; }
.menu-path .term { color: var(--text); border-bottom-width: 1px; }

/* ---------- Cấp độ, chuỗi ngày, huy hiệu ---------- */
.gamify-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.level-card, .streak-card { display: flex; gap: 18px; align-items: center; }
.level-card h2, .streak-card h2 { margin: 0 0 2px; }
.level-info { flex: 1; min-width: 0; }
.level-info p { margin: 0 0 8px; }
.xp-hint { margin-top: 8px !important; font-size: .78rem; }
.level-badge { width: 84px; height: 84px; flex-shrink: 0; border-radius: 22px; background: linear-gradient(135deg, var(--accent), var(--purple)); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; box-shadow: 0 8px 24px rgba(49, 168, 255, .3); }
.level-badge span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.level-badge strong { font-size: 2rem; line-height: 1; }
.streak-flame { font-size: 2.6rem; filter: grayscale(1); opacity: .45; }
.streak-card.lit .streak-flame { filter: none; opacity: 1; }
.streak-card p { margin: 0 0 8px; }
.streak-week { display: flex; gap: 5px; }
.streak-week span { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: .7rem; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.streak-week span.on { background: rgba(255, 159, 67, .2); color: var(--orange); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); opacity: .45; filter: grayscale(1); }
.badge-item.earned { opacity: 1; filter: none; border-color: rgba(255, 201, 74, .45); background: linear-gradient(180deg, rgba(255, 201, 74, .08), transparent); }
.badge-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: #ffc94a; }
.badge-icon .icon { width: 24px; height: 24px; }
.badge-item strong { font-size: .9rem; }
.badge-item small { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.streak-chip { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: .85rem; color: var(--orange); }
@media (max-width: 860px) { .gamify-row { grid-template-columns: 1fr; } }

/* ---------- Tìm kiếm ---------- */
.big-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px 6px 6px 16px; max-width: 760px; margin: 8px 0 10px; }
.big-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49, 168, 255, .2); }
.big-search input { border: 0; background: none; box-shadow: none !important; font-size: 1.05rem; padding: 10px 0; }
.big-search .icon { color: var(--muted); width: 22px; height: 22px; }
.search-results { padding-bottom: 48px; }
.search-group { margin: 26px 0; scroll-margin-top: 80px; }
.search-group h2 { display: flex; gap: 8px; align-items: center; }
.result-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 10px; }
.result-list.compact { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.result-item { display: flex; gap: 14px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none !important; }
.result-item:hover { border-color: var(--accent); }
.result-item img { width: 120px; height: auto; aspect-ratio: 16 / 9; border-radius: 8px; flex-shrink: 0; background: #1e2127; }
.result-item > span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.result-item small { line-height: 1.4; }
.nav-search { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: var(--text-2); }
.nav-search:hover, .nav-search.active { background: var(--surface-2); color: var(--accent); }
@media (max-width: 560px) { .result-list { grid-template-columns: 1fr; } .result-item img { width: 90px; } }

/* ---------- Thư viện tác phẩm ---------- */
.gallery-page { padding-bottom: 48px; }
.gallery-grid { columns: 3 300px; column-gap: 16px; }
.gallery-item { break-inside: avoid; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gallery-img { display: block; }
.gallery-img img { display: block; width: 100%; height: auto; }
.gallery-item figcaption { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.gallery-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.gallery-item blockquote { margin: 4px 0 0; padding: 8px 10px; border-left: 3px solid var(--green); background: rgba(46, 204, 113, .06); color: var(--text-2); font-size: .88rem; border-radius: 0 8px 8px 0; }
.consent { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-weight: 400 !important; font-size: .92rem; cursor: pointer; }
.consent input { margin-top: 4px; accent-color: var(--green); width: 16px; height: 16px; }
.consent-form { margin-top: 12px; }
.forgot-link { align-self: flex-end; margin-top: -6px; }
