/* =============================================================================
   LHD · Luyện thi AI — theme dùng chung cho trang chủ, dashboard và trang đăng nhập
   Nhận diện theo lhd-software.com: navy #0a0e27, gradient xanh dương → cyan, điểm nhấn hồng.
   Sáng/tối theo hệ điều hành qua color-scheme + light-dark().
   ============================================================================= */

:root {
  color-scheme: light dark;

  /* raw brand colors */
  --navy-950: #070a1c;
  --navy-900: #0a0e27;
  --navy-800: #111739;
  --navy-700: #1b2350;
  --blue-600: #0a6fd6;
  --blue-500: #0b84f3;
  --cyan-400: #22d3ee;
  --pink-500: #f0197d;
  --green-500: #16a34a;
  --amber-500: #d97706;
  --red-500: #dc2626;

  /* semantic tokens */
  --bg: light-dark(#f5f7fb, var(--navy-900));
  --bg-alt: light-dark(#ffffff, var(--navy-800));
  --surface: light-dark(#ffffff, #131a40);
  --surface-2: light-dark(#eef2f9, #1a2250);
  --border: light-dark(#dde3ee, #283063);
  --text: light-dark(#0d1330, #eef1fb);
  --text-muted: light-dark(#4b5574, #a3abcb);
  --brand: light-dark(var(--blue-600), #4fb3ff);
  --brand-strong: light-dark(#0756a8, #8fd0ff);
  --brand-soft: light-dark(#e3f0fd, #0f2a52);
  --accent: light-dark(#d4106b, #ff5aa5);
  --accent-soft: light-dark(#fde7f1, #3a1230);
  --success: light-dark(var(--green-500), #4ade80);
  --success-soft: light-dark(#e3f5ea, #12301f);
  --warning: light-dark(var(--amber-500), #fbbf24);
  --warning-soft: light-dark(#fdf3dd, #33280f);
  --danger: light-dark(var(--red-500), #f87171);
  --danger-soft: light-dark(#fde8e8, #3a1717);
  --gradient: linear-gradient(100deg, var(--blue-600) 0%, var(--blue-500) 45%, var(--cyan-400) 100%);
  --gradient-text: linear-gradient(100deg, #2f9bff 0%, var(--cyan-400) 100%);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: light-dark(0 1px 2px rgb(13 19 48 / .06), 0 1px 2px rgb(0 0 0 / .4)), light-dark(0 8px 24px rgb(13 19 48 / .06), 0 8px 24px rgb(0 0 0 / .25));
  --shadow-lg: 0 24px 60px light-dark(rgb(13 19 48 / .14), rgb(0 0 0 / .45));
  --font: "Be Vietnam Pro", ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --container: 1160px;
  --header-h: 68px;

  accent-color: var(--brand);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.015em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.container { width: min(var(--container), 100% - 32px); margin-inline: auto; }
.muted { color: var(--text-muted); }
.small { font-size: .875rem; }
.gradient-text { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.accent-text { color: var(--accent); }

/* ---------------------------------------------------------------- header -- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--navy-900) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid rgb(255 255 255 / .08);
  color: #fff;
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font-size: .7rem; font-weight: 500; color: #9fb3d9; letter-spacing: .02em; }
.site-nav { display: flex; gap: 4px; margin-inline-start: auto; }
.site-nav a { color: #cfd8f0; text-decoration: none; font-size: .94rem; font-weight: 500; padding: 8px 12px; border-radius: var(--radius-sm); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; background: rgb(255 255 255 / .08); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.site-header .site-nav + .header-actions { margin-inline-start: 8px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; color: #e6ebfa; font-size: .9rem; }
.user-chip img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .2); }
@media (max-width: 860px) { .site-nav { display: none; } .header-actions { margin-inline-start: auto; } .user-chip span { display: none; } }

/* --------------------------------------------------------------- buttons -- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-border: var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--btn-border);
  background: var(--btn-bg); color: var(--btn-fg); font: inherit; font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { --btn-bg: var(--blue-600); --btn-fg: #fff; --btn-border: transparent; background: var(--gradient); }
.btn-primary:hover { box-shadow: 0 8px 24px rgb(11 132 243 / .35); }
.btn-accent { --btn-bg: var(--pink-500); --btn-fg: #fff; --btn-border: transparent; }
.btn-ghost-dark { --btn-bg: transparent; --btn-fg: #fff; --btn-border: rgb(255 255 255 / .25); }
.btn-ghost-dark:hover { --btn-bg: rgb(255 255 255 / .08); }
.btn-ghost { --btn-bg: transparent; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .875rem; }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------ hero -- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 480px at 15% 10%, rgb(11 132 243 / .32), transparent 60%),
    radial-gradient(700px 420px at 90% 80%, rgb(240 25 125 / .20), transparent 60%),
    var(--navy-900);
  padding: clamp(56px, 9vw, 112px) 0 clamp(48px, 7vw, 88px);
}
.hero::before { /* lưới mờ */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgb(255 255 255 / .05) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .05) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.hero .container { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero .container > * { min-width: 0; }
@media (max-width: 960px) { .hero .container { grid-template-columns: 1fr; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #9fd6ff; background: rgb(11 132 243 / .15); border: 1px solid rgb(79 179 255 / .3); padding: 6px 12px; border-radius: 999px; margin-bottom: 20px; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan-400); box-shadow: 0 0 10px var(--cyan-400); }
.hero h1 { font-size: clamp(1.85rem, 4.6vw, 3.5rem); font-weight: 800; margin-bottom: 18px; overflow-wrap: break-word; }
.hero .lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: #c3cdea; max-width: 58ch; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 620px; }
@media (max-width: 560px) { .hero-stats { grid-template-columns: repeat(2, 1fr); } }
.hero-stats div { background: rgb(255 255 255 / .04); border: 1px solid rgb(255 255 255 / .1); border-radius: var(--radius); padding: 14px 16px; }
.hero-stats b { display: block; font-size: 1.6rem; font-weight: 800; background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.1; }
.hero-stats span { font-size: .82rem; color: #a9b5d6; }

/* mock card on hero */
.hero-card { background: rgb(255 255 255 / .05); border: 1px solid rgb(255 255 255 / .12); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-lg); backdrop-filter: blur(8px); }
.hero-card .hc-head { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: #a9b5d6; margin-bottom: 12px; }
.hero-card .hc-q { font-weight: 600; margin-bottom: 14px; line-height: 1.45; }
.hero-card ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.hero-card li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid rgb(255 255 255 / .1); background: rgb(255 255 255 / .03); font-size: .9rem; color: #d6ddf2; }
.hero-card code { background: rgb(255 255 255 / .1); color: #e6ebfa; }
.hero-card li b { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; background: rgb(255 255 255 / .1); }
.hero-card li.ok { border-color: rgb(74 222 128 / .55); background: rgb(74 222 128 / .1); }
.hero-card li.ok b { background: #22c55e; color: #fff; }
.hero-card li.no { border-color: rgb(248 113 113 / .5); background: rgb(248 113 113 / .08); }
.hero-card li.no b { background: #ef4444; color: #fff; }
.hero-card .hc-why { margin-top: 12px; font-size: .85rem; color: #b9c4e3; border-top: 1px dashed rgb(255 255 255 / .15); padding-top: 12px; }

/* -------------------------------------------------------------- sections -- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section.alt { background: var(--bg-alt); }
.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head.center { text-align: center; margin-inline: auto; }
.kicker { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 10px; }
.section h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 800; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 14px; }
.card .icon svg { width: 22px; height: 22px; }
.card.feature:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }

.fact { text-align: center; }
.fact b { display: block; font-size: 2.2rem; font-weight: 800; color: var(--brand); line-height: 1.1; margin-bottom: 4px; }
.fact span { color: var(--text-muted); font-size: .92rem; }

/* domain weight bars */
.domains { display: grid; gap: 14px; }
.domain-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; }
.domain-row .code { font-weight: 800; color: var(--brand); }
.domain-row .name { font-weight: 600; }
.domain-row .bar { grid-column: 2 / 3; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.domain-row .bar i { display: block; height: 100%; border-radius: inherit; background: var(--gradient); }
.domain-row .pct { font-weight: 700; font-variant-numeric: tabular-nums; grid-row: 1 / 3; grid-column: 3; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.chip.brand { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* comparison */
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.compare .card { border-top: 4px solid var(--danger); }
.compare .card.good { border-top-color: var(--success); }
.compare ul { margin: 0; padding-left: 1.2em; } .compare li { margin: .35em 0; }

/* timeline / roadmap */
.roadmap { display: grid; gap: 12px; counter-reset: s; }
.roadmap li { list-style: none; display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.roadmap .no { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: var(--brand-soft); color: var(--brand-strong); }
.roadmap li.mock .no { background: var(--accent-soft); color: var(--accent); }
.roadmap h3 { font-size: 1rem; margin: 0 0 2px; }
.roadmap p { margin: 0; color: var(--text-muted); font-size: .9rem; }
@media (max-width: 640px) { .roadmap li { grid-template-columns: 44px 1fr; } .roadmap .chips { grid-column: 1 / -1; } }
.roadmap { padding: 0; margin: 0; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 18px; counter-reset: step; }
.step { position: relative; padding-top: 8px; }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gradient); color: #fff; font-weight: 800; margin-bottom: 14px; }
.step h3 { font-size: 1.05rem; }
.step p { color: var(--text-muted); font-size: .95rem; margin: 0; }

.session-flow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 28px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--border); }
.session-flow span { font-size: .88rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); }
.session-flow i { color: var(--text-muted); font-style: normal; }

/* FAQ — details/summary (Modern Web Guidance: accordion) */
.faq { display: grid; gap: 10px; max-width: 860px; margin-inline: auto; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.faq summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 16px 20px; font-weight: 600; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: ""; inline-size: 1.1em; block-size: 1.1em; flex-shrink: 0; background-color: var(--brand);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
  rotate: -90deg;
}
.faq details[open] > summary::before { rotate: 0deg; }
.faq details > div { padding: 0 20px 18px 52px; color: var(--text-muted); }
.faq details > div p:last-child { margin: 0; }
.faq details::details-content { interpolate-size: allow-keywords; overflow: clip; contain: layout; }
.faq details:not([open])::details-content { block-size: 0; }
@media (prefers-reduced-motion: no-preference) {
  .faq summary::before { transition: rotate .2s; }
  .faq details::details-content { transition: block-size .25s ease-in-out, content-visibility .25s allow-discrete; }
}

/* CTA band */
.cta-band { background: radial-gradient(600px 300px at 80% 0%, rgb(240 25 125 / .25), transparent 60%), radial-gradient(700px 320px at 0% 100%, rgb(11 132 243 / .35), transparent 60%), var(--navy-900); color: #fff; border-radius: var(--radius-lg); padding: clamp(32px, 5vw, 56px); display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.cta-band h2 { color: #fff; margin: 0 0 6px; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.cta-band p { color: #c3cdea; margin: 0; }

/* ---------------------------------------------------------------- footer -- */
.site-footer { background: var(--navy-950); color: #9aa6c8; padding: 40px 0; font-size: .88rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: flex-start; }
.site-footer a { color: #cfd8f0; }
.site-footer .disclaimer { max-width: 640px; }

/* =========================================================== DASHBOARD ==== */
.app-main { padding: 32px 0 64px; }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--text-muted); }
.demo-banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--warning); font-size: .88rem; font-weight: 600; margin-bottom: 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat .label { font-size: .82rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: clamp(1.5rem, 4vw, 1.9rem); font-weight: 800; line-height: 1.2; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.stat .hint { font-size: .85rem; color: var(--text-muted); }

/* continue card */
.continue { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 22px 24px; border-radius: var(--radius-lg); color: #fff; margin-bottom: 28px;
  background: radial-gradient(500px 220px at 100% 0%, rgb(240 25 125 / .25), transparent 60%), radial-gradient(600px 260px at 0% 100%, rgb(34 211 238 / .22), transparent 60%), var(--navy-800); }
.continue .kicker { color: #9fd6ff; margin-bottom: 4px; }
.continue h2 { font-size: 1.35rem; margin: 0 0 6px; color: #fff; }
.continue p { margin: 0; color: #c3cdea; font-size: .92rem; }
@media (max-width: 640px) { .continue { grid-template-columns: 1fr; } }

.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.layout-2 > * { min-width: 0; }
.layout-2 > aside { grid-template-columns: minmax(0, 1fr); }
.panel { min-width: 0; }
@media (max-width: 1000px) { .layout-2 { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 1.1rem; margin: 0; }
.panel-body { padding: 8px 20px 20px; }

/* session list */
.session-list { list-style: none; margin: 0; padding: 0; }
.session-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.session-item:last-child { border-bottom: 0; }
.session-item .no { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); color: var(--text-muted); }
.session-item[data-status="done"] .no { background: var(--success-soft); color: var(--success); }
.session-item[data-status="active"] .no { background: var(--brand-soft); color: var(--brand-strong); }
.session-item h3 { font-size: 1rem; margin: 0 0 4px; }
.session-item .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .84rem; color: var(--text-muted); }
.session-item .progress-line { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: .82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.session-item .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) { .session-item { grid-template-columns: 40px minmax(0, 1fr); } .session-item .no { width: 40px; height: 40px; } .session-item .actions { grid-column: 1 / -1; justify-content: flex-start; } }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.done { background: var(--success-soft); color: var(--success); }
.status.active { background: var(--brand-soft); color: var(--brand-strong); }
.status.todo { background: var(--surface-2); color: var(--text-muted); }
.status.pending { background: var(--warning-soft); color: var(--warning); }
.status.rejected { background: var(--danger-soft); color: var(--danger); }

/* native <progress> — Modern Web Guidance: progress */
progress {
  --progress-bar-radius: 1e5px;
  appearance: none; border: 0 solid; overflow: clip; inline-size: 100%; block-size: 8px;
  border-radius: var(--progress-bar-radius); background: var(--surface-2);
}
progress::-webkit-progress-bar { background: transparent; }
progress::-webkit-progress-value { background: var(--progress-bar-fill, var(--gradient)); border-radius: var(--progress-bar-radius); transition: inline-size .3s; }
progress::-moz-progress-bar { background: var(--progress-bar-fill, var(--gradient)); border-radius: var(--progress-bar-radius); }
progress.good { --progress-bar-fill: var(--success); }
progress.mid { --progress-bar-fill: var(--warning); }
progress.low { --progress-bar-fill: var(--danger); }
.session-item progress { max-inline-size: 220px; }

/* domain mastery */
.mastery { display: grid; gap: 16px; }
.mastery-row label { display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.mastery-row label span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 500; }
.tip { margin-top: 18px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-strong); font-size: .88rem; }

/* table */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 700; }
table.data tr:last-child td { border-bottom: 0; }
.score-pill { font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.score-pill.good { background: var(--success-soft); color: var(--success); }
.score-pill.mid { background: var(--warning-soft); color: var(--warning); }
.score-pill.low { background: var(--danger-soft); color: var(--danger); }
.empty { padding: 28px 20px; text-align: center; color: var(--text-muted); }

/* ============================================================ AUTH PAGES === */
.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; color: var(--text);
  background: radial-gradient(800px 420px at 10% 0%, rgb(11 132 243 / .28), transparent 60%), radial-gradient(700px 400px at 100% 100%, rgb(240 25 125 / .18), transparent 60%), var(--navy-900); }
.auth-page .brand { margin-bottom: 18px; }
.auth-wrap { width: min(460px, 100%); display: grid; justify-items: center; }
.auth-card { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 1.45rem; margin: 4px 0 8px; }
.auth-card .kicker { margin-bottom: 0; }
.auth-card .btn { width: 100%; margin-top: 12px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 16px 0; }
.user-row img { width: 40px; height: 40px; border-radius: 50%; }
.user-row .who { display: flex; flex-direction: column; min-width: 0; }
.user-row .who span:last-child { color: var(--text-muted); font-size: .85em; overflow: hidden; text-overflow: ellipsis; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; margin: 14px 0 4px; }
.consent input { margin-top: .3em; width: 18px; height: 18px; flex: none; }
.note-box { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: .9rem; }
.error-box { display: none; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: .9rem; }
.error-box.show { display: block; }
.auth-footer { margin-top: 18px; font-size: .78rem; color: #9aa6c8; text-align: center; max-width: 460px; }
.auth-footer a { color: #cfd8f0; }

/* policy page */
.policy { max-width: 780px; margin: 0 auto; padding: 40px 16px 64px; }
.policy h1 { font-size: 2rem; } .policy h2 { font-size: 1.2rem; margin-top: 1.8em; }

/* ============================================================== ADMIN ===== */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-banner.viewing { background: var(--brand-soft); color: var(--brand-strong); }
.demo-banner.viewing a { color: inherit; font-weight: 700; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 8px 0 20px; overflow-x: auto; }
.tabs [role="tab"] { font: inherit; font-weight: 600; color: var(--text-muted); background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 16px; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count:not(:empty) { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: .75rem; }

.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); gap: 2px; flex-wrap: wrap; }
.segmented button { font: inherit; font-size: .85rem; font-weight: 600; border: 0; background: none; color: var(--text-muted); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input[type="search"], .filters select, .modal textarea {
  font: inherit; font-size: .9rem; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; min-height: 38px;
}
.filters input[type="search"] { min-width: 220px; }
.panel-head { flex-wrap: wrap; }
.legend { padding: 12px 20px 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.person { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.person > div { display: flex; flex-direction: column; min-width: 0; }
.person b { font-weight: 600; }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.avatar-fallback { display: inline-block; border-radius: 50%; background: var(--surface-2); flex: none; }
table.data td.num, table.data th.num { text-align: right; }
table.data td { vertical-align: middle; }
.actions-cell { display: flex; gap: 6px; justify-content: flex-end; }
.note { white-space: normal; max-width: 280px; margin-top: 4px; }

/* ô màu tiến độ theo buổi */
.heat-th, .heat-td { text-align: center !important; padding-inline: 3px !important; }
.heat { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 4px; border-radius: 6px; font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.heat.good { background: var(--success-soft); color: var(--success); }
.heat.mid { background: var(--warning-soft); color: var(--warning); }
.heat.low { background: var(--danger-soft); color: var(--danger); }
.heat.partial { background: var(--brand-soft); color: var(--brand-strong); }
.heat.none { background: var(--surface-2); color: var(--text-muted); }

/* phân tích câu hỏi */
table.items td.question { white-space: normal; min-width: 320px; max-width: 520px; line-height: 1.45; }
.trap { margin-top: 6px; color: var(--danger) !important; }
.choices { display: grid; gap: 3px; min-width: 170px; }
.choice { display: grid; grid-template-columns: 16px 1fr 26px; gap: 6px; align-items: center; font-size: .75rem; }
.choice .k { font-weight: 700; color: var(--text-muted); }
.choice .bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.choice .bar i { display: block; height: 100%; background: var(--danger); opacity: .7; border-radius: inherit; }
.choice.correct .k { color: var(--success); }
.choice.correct .bar i { background: var(--success); opacity: 1; }
.choice .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); }

/* hộp thoại */
dialog.modal { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); padding: 24px; width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgb(7 10 28 / .55); }
dialog.modal h2 { font-size: 1.25rem; margin-bottom: 4px; }
dialog.modal label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 6px; }
dialog.modal textarea { width: 100%; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.person-link { color: inherit; text-decoration: none; display: block; }
.person-link:hover b { color: var(--brand); text-decoration: underline; }

/* ============================================================ LUYỆN ĐỀ ===== */
.setup-form { margin-top: 8px; }
.setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 20px; padding-top: 18px; }
.setup-grid fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.setup-grid legend { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 10px; padding: 0; }
.check-list { display: grid; gap: 8px; }
.check-list label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.check-list input { width: 18px; height: 18px; margin: 0; }
.check-list select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; }
.chip-toggle { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-toggle button { font: inherit; font-size: .85rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); cursor: pointer; }
.chip-toggle button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
.panel-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-top: 1px solid var(--border); }
.setup-form .panel-foot { justify-content: flex-end; }

.run-bar { position: sticky; top: var(--header-h); z-index: 5; display: grid; grid-template-columns: auto 1fr auto auto; gap: 16px; align-items: center; padding: 12px 0; background: var(--bg); margin-bottom: 12px; }
@media (max-width: 640px) { .run-bar { grid-template-columns: 1fr auto; } .run-bar progress { grid-column: 1 / -1; grid-row: 2; } .save-pill { display: none; } }
.save-pill { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.save-pill[data-state="saved"] { color: var(--success); }
.save-pill[data-state="error"] { color: var(--warning); font-weight: 600; }

.question-card .panel-body { padding: 22px 24px; }
.q-text { font-size: 1.08rem; font-weight: 500; line-height: 1.65; margin: 14px 0 18px; }
.q-text p, .q-explain p, .opt-note p, .review-body p { margin: 0 0 .7em; }
.q-text pre, .q-explain pre, .review-body pre { background: var(--navy-900); color: #e6ebfa; padding: 12px 14px; border-radius: var(--radius-sm); overflow-x: auto; font-size: .85rem; }
.q-text pre code, .q-explain pre code { background: none; padding: 0; color: inherit; }
.answer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.answer-list button { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.answer-list button:hover:not(:disabled) { border-color: var(--brand); }
.answer-list button:disabled { cursor: default; }
.answer-list .key { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--surface-2); }
.answer-list .opt p:last-child { margin: 0; }
.answer-list li.correct button { border-color: var(--success); background: var(--success-soft); }
.answer-list li.correct .key { background: var(--success); color: #fff; }
.answer-list li.wrong button { border-color: var(--danger); background: var(--danger-soft); }
.answer-list li.wrong .key { background: var(--danger); color: #fff; }
.opt-note { margin: 6px 0 2px 54px; font-size: .88rem; color: var(--text-muted); border-left: 3px solid var(--border); padding-left: 12px; }
.answer-list li.correct .opt-note { border-left-color: var(--success); }
.answer-list li.wrong .opt-note { border-left-color: var(--danger); }
.q-explain { margin-top: 18px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface-2); line-height: 1.65; }
.verdict { font-weight: 700; }
.verdict.ok { color: var(--success); }
.verdict.no { color: var(--danger); }
.kbd-hint { flex: 1; text-align: center; }
@media (max-width: 640px) { .kbd-hint { display: none; } }

.review-list { display: grid; gap: 10px; padding-top: 16px; }
details.review { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
details.review summary { cursor: pointer; padding: 12px 14px; display: flex; gap: 8px; align-items: baseline; list-style: none; }
details.review summary::-webkit-details-marker { display: none; }
details.review[open] summary { border-bottom: 1px solid var(--border); }
.review-body { padding: 14px; line-height: 1.6; }
.review-body .opt-note { margin-left: 0; }

.email-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.toast { position: fixed; right: 16px; bottom: 16px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border-radius: var(--radius); background: var(--success-soft); color: var(--success); border: 1px solid currentColor; font-weight: 600; box-shadow: var(--shadow-lg); }
.toast.warn { background: var(--warning-soft); color: var(--warning); }
