:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --border: #e2e6ef;
  --border-strong: #cdd4e3;
  --text: #172042;
  --muted: #61698a;
  /* Màu thương hiệu lấy từ logo Domi English */
  --navy: #14235c;
  --sky: #3ba4f0;
  --gold: #f5a300;
  --primary: #1e3a8a;
  --primary-600: #162d6e;
  --primary-50: #ebf0fb;
  --ok: #138a43;
  --ok-50: #e8f7ee;
  --warn: #b45309;
  --warn-50: #fff4e2;
  --err: #d92d20;
  --err-50: #fdeceb;
  --accent: #f5a300;
  --accent-600: #a86400;
  --accent-50: #fff6e0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, .2);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
p { margin: 0 0 10px; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13.5px; }
.mono { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; }

.pre { white-space: pre-wrap; word-break: break-word; }
.muted { color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); }
.strong { font-weight: 600; }
.center { text-align: center; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap { gap: 8px; }
.spacer { flex: 1; }
.mt-sm { margin-top: 6px; }
.mt { margin-top: 12px; }
.mt-lg { margin-top: 24px; }
.mb { margin-bottom: 14px; }
.ml { margin-left: 6px; }
.warn-text { color: var(--warn); font-weight: 600; }
.ico { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ico svg { display: block; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:focus-visible { outline: 3px solid #bcd0f5; outline-offset: 1px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-600); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger:hover { filter: brightness(.94); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger-text { color: var(--err); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; gap: 5px; }
.btn.lg { height: 46px; font-size: 15.5px; }
.btn.icon-only { width: 38px; padding: 0; }
.btn.sm.icon-only { width: 32px; }
.btn.block { width: 100%; }

/* ---------- Form ---------- */
input:not([type=radio]):not([type=checkbox]):not([type=file]):not([type=range]), select, textarea {
  width: 100%; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 10px; padding: 9px 12px; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
input:not([type=radio]):not([type=checkbox]):not([type=file]), select { height: 40px; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--primary); margin: 0; flex: none; cursor: pointer; }
input.narrow { max-width: 180px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { font-weight: 500; font-size: 14px; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; margin-bottom: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-error { background: var(--err-50); color: var(--err); padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
.class-picker .checks { display: flex; flex-wrap: wrap; gap: 0 18px; padding-left: 26px; margin-top: 4px; transition: opacity .15s; }
.class-picker .checks.dim { opacity: .45; }
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: 12px; padding: 24px 16px; text-align: center;
  cursor: pointer; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.dropzone strong { color: var(--text); word-break: break-all; }

/* ---------- Layout ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #1e3a8a, #3ba4f0);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 19px; flex: none;
}
.brand-name { font-weight: 700; font-size: 17px; line-height: 1.2; }
.brand-sub { font-size: 12.5px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav-btn {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: var(--text); font-weight: 500; font-size: 14.5px;
}
.nav a:hover, .nav-btn:hover { background: var(--surface-2); }
.nav a.active { background: var(--primary-50); color: var(--primary); }
.nav .count { margin-left: auto; background: var(--err); color: #fff; border-radius: 999px; font-size: 12px; padding: 0 7px; min-width: 22px; text-align: center; font-weight: 600; }
.nav-btn { width: 100%; border: 0; background: none; cursor: pointer; text-align: left; color: var(--muted); font-size: 14px; padding: 8px 12px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-weight: 700; flex: none; }
.me-text { min-width: 0; }
.me-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-sub { font-size: 12.5px; color: var(--muted); }
.content { min-width: 0; }
.main { padding: 30px 32px 90px; }
.view { max-width: 1080px; margin: 0 auto; }
.topbar, .scrim { display: none; }

.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-title { min-width: 0; flex: 1 1 260px; }
.page-head h1 { font-size: 25px; font-weight: 700; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); margin-top: 5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.back:hover { color: var(--primary); }

/* ---------- Cards, stats ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h2 { font-size: 17px; font-weight: 600; margin-bottom: 16px; }
.section-title { font-size: 17px; font-weight: 600; margin: 30px 0 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-title .more { margin-left: auto; font-size: 14px; font-weight: 500; }
.section-title .totals { font-size: 14px; font-weight: 400; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; color: var(--text); box-shadow: var(--shadow); }
a.stat:hover { border-color: #c3cfee; }
.stat .num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 13.5px; }
.stat-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; flex: none; }
.stat.alert .stat-ico { background: var(--err-50); color: var(--err); }
.stat.alert .num { color: var(--err); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.quick-item { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.quick-item:hover { border-color: #c3cfee; box-shadow: 0 4px 14px rgba(30, 58, 138, .08); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.class-card { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.class-card:hover { border-color: #c3cfee; box-shadow: 0 4px 14px rgba(30, 58, 138, .08); }
.class-name { font-weight: 700; font-size: 17px; }
.class-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-top: auto; padding-top: 8px; }
.banner { display: block; padding: 12px 16px; border-radius: 12px; background: var(--primary-50); color: #23367f; margin-bottom: 16px; font-size: 14px; }
.banner.warn-banner { background: var(--warn-50); color: #8a4108; }
a.banner:hover { filter: brightness(.98); }
.boxed { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.boxed.hint { display: block; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: #f8f9ff; }
.table .actions { white-space: nowrap; text-align: right; }

/* ---------- Badges, tabs, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-50); color: var(--ok); }
.badge.warn { background: var(--warn-50); color: var(--warn); }
.badge.err { background: var(--err-50); color: var(--err); }
.badge.primary { background: var(--primary-50); color: var(--primary); }
.chip { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .tabs { margin-bottom: 0; }
.tab { padding: 7px 15px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500; }
.tab:hover { border-color: var(--border-strong); }
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tab .n { opacity: .7; margin-left: 6px; font-size: 12.5px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search .ico { position: absolute; left: 11px; top: 11px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 37px !important; }

/* ---------- Materials ---------- */
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.mat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: box-shadow .15s, border-color .15s; box-shadow: var(--shadow); }
.mat:hover, .mat:focus-visible { border-color: #c3cfee; box-shadow: 0 4px 16px rgba(30, 58, 138, .1); outline: none; }
.mat-top { display: flex; gap: 12px; align-items: flex-start; }
.mat-info { min-width: 0; }
.mat-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.cat-textbook { background: var(--primary-50); color: var(--primary); }
.cat-document { background: #e6f6f0; color: #0b7a5c; }
.cat-audio { background: #fff1e3; color: #c25e05; }
.cat-video { background: #fdebf2; color: #b8185a; }
.cat-link { background: #e7f3fc; color: #0b6aad; }
.cat-other { background: #f0f1f4; color: #565e72; }
.mat-title { font-weight: 600; line-height: 1.4; word-break: break-word; }
.mat-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.mat-desc { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mat-foot { display: flex; align-items: center; gap: 4px; margin-top: auto; }

.player { width: 100%; max-width: 560px; height: 44px; display: block; }
.player.wide { max-width: none; }
.video { width: 100%; max-height: 70vh; border-radius: 10px; background: #000; display: block; }
.video-frame { position: relative; padding-top: 56.25%; border-radius: 10px; overflow: hidden; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pdf-frame { width: 100%; height: 72vh; border: 1px solid var(--border); border-radius: 10px; display: block; }
.preview-img { max-width: 100%; max-height: 72vh; display: block; margin: 0 auto; border-radius: 10px; }

/* ---------- Assignment cards ---------- */
.as-list { display: flex; flex-direction: column; gap: 10px; }
.as-card { display: flex; align-items: center; gap: 14px; padding: 15px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.as-card:hover { border-color: #c3cfee; box-shadow: 0 4px 14px rgba(30, 58, 138, .08); }
.as-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; flex: none; }
.as-body { flex: 1; min-width: 0; }
.as-title { font-weight: 600; font-size: 15.5px; }
.as-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.due { display: inline-flex; align-items: center; gap: 5px; }
.due.soon { color: var(--warn); font-weight: 600; }
.due.past { color: var(--err); }
.as-head h1 { font-size: 23px; margin-bottom: 6px; }
.instructions { margin-top: 14px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; }

.score-card { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; border-left: 5px solid var(--ok); }
.score-card.pending { border-left-color: var(--primary); }
.score-big { font-size: 40px; font-weight: 700; color: var(--ok); line-height: 1; }
.score-card.pending .score-big { color: var(--primary); }
.feedback { background: var(--warn-50); border-color: #f6dfb8; }

/* ---------- Questions ---------- */
.q-section { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--primary); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 14px; box-shadow: var(--shadow); }
.q-section h3 { font-size: 17px; margin-bottom: 8px; }
.passage { line-height: 1.75; margin-top: 6px; font-size: 15.5px; }
.q-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 14px; box-shadow: var(--shadow); }
.q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.q-num { font-weight: 700; color: var(--primary); }
.q-pts { font-size: 13px; color: var(--muted); }
.q-prompt { font-size: 15.5px; margin-bottom: 12px; line-height: 1.7; }
.media { margin: 4px 0 14px; }
.q-img { max-width: 100%; max-height: 440px; border-radius: 10px; border: 1px solid var(--border); display: block; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--surface-2); border-radius: 8px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 11px; cursor: pointer; transition: border-color .12s, background .12s; }
.opt:hover { border-color: #b9c4ec; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.opt:focus-within { box-shadow: 0 0 0 3px var(--primary-50); }
.opt.chosen { border-color: var(--primary); background: var(--primary-50); }
.opt.readonly { cursor: default; }
.opt.readonly:hover { border-color: var(--border); }
.opt.readonly.chosen:hover { border-color: var(--primary); }
.opt.key, .opt.key:hover { border-color: var(--ok); background: var(--ok-50); }
.opt.wrong, .opt.wrong:hover { border-color: var(--err); background: var(--err-50); }
.opt-letter { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.opt.chosen .opt-letter { background: var(--primary); color: #fff; }
.opt.key .opt-letter { background: var(--ok); color: #fff; }
.opt.wrong .opt-letter { background: var(--err); color: #fff; }
.opt-text { line-height: 1.45; }
.fill-input { display: inline-block; width: 190px !important; max-width: 100%; height: 36px !important; margin: 2px 4px; vertical-align: middle; border-width: 0 0 2px !important; border-radius: 6px 6px 0 0 !important; background: var(--primary-50) !important; font-weight: 600; }
.fill-line .fill-input { width: 100% !important; max-width: 360px; margin: 0; }
.fill-answer { display: inline-block; padding: 1px 10px; border-radius: 6px; font-weight: 600; margin: 0 3px; background: var(--surface-2); }
.fill-answer.right { background: var(--ok-50); color: var(--ok); }
.fill-answer.wrong { background: var(--err-50); color: var(--err); text-decoration: line-through; }
.key-line { margin-top: 8px; font-size: 14px; color: var(--ok); }
.answer-box { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; line-height: 1.65; }
textarea.essay { font-size: 15.5px; line-height: 1.65; }
.teacher-comment { margin-top: 12px; background: var(--warn-50); border-radius: 10px; padding: 10px 14px; font-size: 14px; white-space: pre-wrap; }
.grade-box { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--primary-50); display: flex; flex-direction: column; gap: 10px; }
.pts-input { width: 90px !important; background: #fff; }
.uploader { display: flex; flex-direction: column; gap: 10px; }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px 8px 12px; }
.file-row { display: flex; align-items: center; gap: 10px; }
.file-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-extra:not(:empty) { margin-top: 8px; }
.sub-img { max-width: 100%; max-height: 520px; border-radius: 8px; display: block; }
.recorder { display: inline-flex; align-items: center; gap: 10px; }
.recorder.on .btn { background: var(--err); border-color: var(--err); animation: pulse 1.4s infinite; }
.rec-timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--err); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217, 45, 32, .35); } 50% { box-shadow: 0 0 0 8px rgba(217, 45, 32, 0); } }

.submit-bar, .save-bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-top: 18px; box-shadow: 0 -4px 20px rgba(15, 23, 42, .06);
}
.submit-progress { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--primary); transition: width .25s; }
.grade-sum { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 14px; }
.grade-sum .total { font-size: 15.5px; }

/* ---------- Editor ---------- */
.qe-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); }
.qe-card.invalid { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-50); }
.qe-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.qe-type { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; margin-left: 4px; }
.qe-body { padding: 16px; }
.pts { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-right: 6px; }
.pts input { width: 74px !important; height: 32px !important; padding: 4px 8px !important; }
.opts-edit { margin-bottom: 12px; }
.opts-edit .field-label { display: block; margin-bottom: 6px; }
.opt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.opt-row.correct input[type=text] { border-color: var(--ok); background: var(--ok-50); }
.opt-row.correct .opt-letter { background: var(--ok); color: #fff; }
.media-edit { margin-top: 4px; }
.media-attached { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 12px; background: var(--surface-2); border-radius: 10px; }
.media-attached .media { margin: 0; width: 100%; }
.add-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 14px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; }
.pick-item:hover { border-color: var(--primary); background: var(--primary-50); }
.mono-area { font-family: ui-monospace, Consolas, monospace; font-size: 14px !important; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 100; overflow-y: auto; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 540px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .18s; }
.modal.wide { max-width: 880px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 14px 0 22px; }
.modal-head h3 { font-size: 18px; font-weight: 600; flex: 1; min-width: 0; }
.modal-body { padding: 16px 22px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 20px; flex-wrap: wrap; }
.confirm-text { font-size: 15px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }

/* ---------- Toast, loading, empty ---------- */
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 480px; }
.toast { background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: 0 8px 24px rgba(15, 23, 42, .25); font-size: 14px; animation: pop .2s; pointer-events: auto; transition: opacity .3s; }
.toast.err { background: var(--err); }
.toast.warn { background: #a8510a; }
.toast.out { opacity: 0; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 40px 0; justify-content: center; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--muted); padding: 38px 18px; background: var(--surface); border: 1.5px dashed var(--border); border-radius: var(--radius); }
.empty > .ico { color: #b3bbcc; margin-bottom: 4px; }

/* ---------- Login ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1100px 600px at 0% -10%, #dcecff, transparent 60%), radial-gradient(900px 500px at 110% 110%, #fff0c2, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 410px; background: var(--surface); border-radius: 20px; padding: 34px 30px 26px; box-shadow: 0 12px 44px rgba(30, 41, 80, .12); }
.login-card.wide { max-width: 520px; }
.login-card .brand { padding: 0 0 6px; }
.login-title { font-size: 21px; margin: 18px 0 16px; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 44px !important; }
.pass-toggle { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.pass-toggle:hover { background: var(--surface-2); }
.steps { padding-left: 20px; margin: 10px 0 14px; }
.steps li { margin-bottom: 6px; }

/* =====================================================================
   DOMI ENGLISH – phần bổ sung: chế độ thi, kỹ năng, trang công khai
   ===================================================================== */

.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--navy); font-weight: 600; }
.btn.accent:hover { background: #e69900; border-color: #e69900; }
.btn.outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn.outline:hover { background: var(--primary-50); }
.btn.light { background: #fff; border-color: #fff; color: var(--primary); font-weight: 600; }
.btn.light:hover { background: #eef2ff; }
.mb-sm { margin-bottom: 8px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.auth-col { width: 100%; max-width: 410px; display: flex; flex-direction: column; }
.auth-col:has(.wide) { max-width: 520px; }

/* Nhãn trình độ & kỹ năng */
.tag-chips { display: inline-flex; gap: 5px; margin-left: 8px; vertical-align: 2px; }
.lv-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 1px 8px; border-radius: 7px; font-size: 12px; font-weight: 700; background: var(--navy); color: #fff; letter-spacing: .02em; line-height: 1.6; }
.lv-chip.big { font-size: 16px; padding: 4px 12px; border-radius: 10px; }
.lv-chip.target { background: var(--accent); color: var(--navy); }
.sk-chip { display: inline-block; padding: 1px 8px; border-radius: 7px; font-size: 12px; font-weight: 600; color: #fff; line-height: 1.6; }
.sk-reading { --sk1: #fbbf24; --sk2: #f97316; }
.sk-listening { --sk1: #60b8f5; --sk2: #1e3a8a; }
.sk-writing { --sk1: #34d399; --sk2: #0f9b6c; }
.sk-speaking { --sk1: #f472b6; --sk2: #c2185b; }
.sk-grammar { --sk1: #a78bfa; --sk2: #6a5cf0; }
.sk-vocabulary { --sk1: #22d3ee; --sk2: #0b7fa3; }
.sk-mixed { --sk1: #94a3b8; --sk2: #475569; }
.sk-chip, .sk-top { background: linear-gradient(135deg, var(--sk1, #8aa0ff), var(--sk2, #3557e0)); }
.as-ico[class*="sk-"] { background: linear-gradient(135deg, var(--sk1), var(--sk2)); color: #fff; }

/* Thẻ kỹ năng (trang Bài tập của học sinh) */
.level-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow); scrollbar-width: none; }
.level-tabs:empty { display: none; }
.level-tab { flex: none; border: 0; background: none; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.level-tab:hover { color: var(--text); }
.level-tab.active { background: var(--accent-50); color: var(--accent-600); }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.skill-card { padding: 0; border: 1px solid var(--border); background: var(--surface); border-radius: 18px; overflow: hidden; text-align: left; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; }
.skill-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(30, 41, 80, .12); }
.skill-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.sk-top { position: relative; height: 104px; padding: 16px; color: #fff; overflow: hidden; }
.sk-big { font-size: 22px; font-weight: 800; letter-spacing: .01em; text-transform: uppercase; text-shadow: 0 2px 6px rgba(0, 0, 0, .12); line-height: 1.15; max-width: 80%; }
.sk-ghost { position: absolute; right: 12px; bottom: 6px; font-size: 18px; font-weight: 800; text-transform: uppercase; opacity: .28; white-space: nowrap; }
.sk-ico { position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .22); display: grid; place-items: center; }
.sk-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.sk-name { font-weight: 700; color: var(--text); }
.sk-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--muted); }
.sk-meta span { display: inline-flex; align-items: center; gap: 5px; }
.sk-meta .ico { color: var(--accent); }
.sk-done { font-size: 13.5px; color: var(--muted); }
.sk-done b { color: var(--ok); }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--primary); background: var(--primary-50); color: var(--primary); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 500; cursor: pointer; }

/* Chế độ làm bài */
.exam-root { --bar-top: 0px; }
.exam-bar { position: sticky; top: var(--bar-top); z-index: 20; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; margin-bottom: 16px; box-shadow: 0 6px 18px rgba(15, 23, 42, .06); }
.exam-timer { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; background: var(--primary-50); color: var(--primary); font-weight: 700; }
.exam-clock { font-variant-numeric: tabular-nums; font-size: 17px; letter-spacing: .02em; }
.exam-timer.warn { background: var(--err-50); color: var(--err); animation: pulse 1.4s infinite; }
.exam-prog { display: flex; flex-direction: column; gap: 5px; min-width: 150px; flex: 0 1 260px; font-size: 13.5px; font-weight: 600; }
.pal-toggle { display: none; }
.exam-body { display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: 20px; align-items: start; }
.exam-side { position: sticky; top: calc(var(--bar-top) + 78px); }
.palette { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.palette-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.palette-head .btn { display: none; }
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 6px; max-height: 52vh; overflow-y: auto; }
.pal-btn { position: relative; height: 36px; border-radius: 9px; border: 1.5px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--text); }
.pal-btn:hover { border-color: var(--primary); }
.pal-btn.done { background: var(--primary); border-color: var(--primary); color: #fff; }
.pal-btn.flag::after { content: ''; position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.pal-btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.pal-btn.err { background: var(--err); border-color: var(--err); color: #fff; }
.pal-btn.blank { background: var(--surface-2); color: var(--muted); }
.pal-btn.manual { background: #ede9fe; border-color: #c4b5fd; color: #5b21b6; }
.pal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.pal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lgd { width: 12px; height: 12px; border-radius: 4px; border: 1.5px solid var(--border-strong); background: var(--surface); display: inline-block; }
.lgd.done { background: var(--primary); border-color: var(--primary); }
.lgd.flag { background: var(--accent); border-color: var(--accent); border-radius: 50%; }
.lgd.ok { background: var(--ok); border-color: var(--ok); }
.lgd.err { background: var(--err); border-color: var(--err); }
.lgd.manual { background: #ede9fe; border-color: #c4b5fd; }
.q-card { scroll-margin-top: 150px; }
.flag-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; }
.flag-btn:hover { border-color: var(--accent); color: var(--accent-600); }
.flag-btn.on { background: var(--accent-50); border-color: var(--accent); color: var(--accent-600); font-weight: 600; }
.q-card.flagged { border-color: #fdc9a3; box-shadow: 0 0 0 3px var(--accent-50); }
.q-card.blink { animation: blink 1s ease; }
@keyframes blink { 0%, 100% { box-shadow: var(--shadow); } 30% { box-shadow: 0 0 0 4px #bcd0f5; } }
.start-card { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; border-left: 5px solid var(--accent); }
.start-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-50); color: var(--accent); display: grid; place-items: center; flex: none; }
.start-text { flex: 1 1 260px; }

/* Kết quả */
.explain { margin-top: 12px; background: #fffbea; border: 1px solid #f7e4a1; border-radius: 10px; padding: 10px 14px; font-size: 14.5px; line-height: 1.6; }
.explain-title { display: flex; align-items: center; gap: 6px; font-weight: 700; color: #a16207; margin-bottom: 2px; }
.result-stats { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.ring { --p: 0; width: 128px; height: 128px; border-radius: 50%; background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--surface-2) 0); display: grid; place-items: center; flex: none; }
.ring-inner { width: 98px; height: 98px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-num { font-size: 26px; font-weight: 800; line-height: 1; }
.ring-lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rs-grid { flex: 1 1 300px; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.rs-cell { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); }
.rs-cell.ok { background: var(--ok-50); color: var(--ok); }
.rs-cell.err { background: var(--err-50); color: var(--err); }
.rs-cell.primary { background: var(--primary-50); color: var(--primary); }
.rs-num { font-size: 19px; font-weight: 700; color: var(--text); line-height: 1.2; }
.rs-lbl { font-size: 12.5px; }
.rs-note { width: 100%; }
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: 20px; align-items: start; }
.review-side { position: sticky; top: 20px; }
.review-pal { padding: 14px; }

/* Đăng ký tư vấn (giáo viên) */
.lead-list { display: flex; flex-direction: column; gap: 10px; }
.lead-item { margin: 0; padding: 16px 18px; }
.lead-item.is-new { border-left: 4px solid var(--accent); }
.lead-top { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.lead-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.lead-tags:empty { display: none; }

/* ---------- Trang công khai ---------- */
.pub { background: #fff; min-height: 100vh; }
.pub .exam-root { --bar-top: 80px; }
.pub-wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.pub-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.pub-head-row { display: flex; align-items: center; gap: 10px; height: 72px; }
.pub-logo { height: 56px; width: auto; display: block; }
.brand { color: var(--text); }
.brand-mark { width: 48px; height: 48px; object-fit: contain; flex: none; margin: -4px -2px -4px -6px; }
.brand-name { color: var(--navy); }
.brand-text { min-width: 0; }
.brand-sub { font-size: 12px; line-height: 1.35; color: var(--navy); font-weight: 500; margin-top: 2px; }
.brand-sub span { display: block; white-space: nowrap; }
.brand-sub .gold { color: #c98400; font-weight: 600; }
.ha-bee { position: absolute; z-index: 2; width: 118px; height: auto; left: -34px; top: -26px; filter: drop-shadow(0 10px 18px rgba(245, 163, 0, .35)); animation: bee 4.5s ease-in-out infinite; }
@keyframes bee { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .ha-bee { animation: none; } }
.pub-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 19px; }
.pub-brand .brand-logo { width: 38px; height: 38px; font-size: 18px; }
.pub-brand-name b { color: var(--primary); font-weight: 800; }
.pub-nav { display: flex; gap: 2px; margin-left: 18px; }
.pub-nav button { border: 0; background: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; color: #3c4559; cursor: pointer; }
.pub-nav button:hover { background: var(--surface-2); color: var(--primary); }
.kicker { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-600); margin-bottom: 8px; }

.hero { background: radial-gradient(900px 500px at 85% 10%, #fff0c2, transparent 60%), radial-gradient(900px 560px at 0% 0%, #dcecff, transparent 60%), #f7faff; padding: 56px 0 64px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: #fff; color: var(--accent-600); font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(30px, 4.2vw, 48px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; margin: 16px 0 14px; color: #141b2d; }
.hero-sub { font-size: 17px; color: #4a5367; max-width: 560px; line-height: 1.65; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-cta .btn { height: 52px; padding: 0 22px; border-radius: 14px; font-size: 16px; font-weight: 600; }
.hero-points { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 18px; color: #4a5367; font-size: 14px; }
.hero-points span { display: inline-flex; align-items: center; gap: 6px; }
.hero-points .ico { color: var(--ok); }
.hero-art { position: relative; padding: 24px 10px; }
.ha-card { background: #fff; border-radius: 22px; padding: 22px; box-shadow: 0 24px 60px rgba(30, 41, 80, .16); display: flex; flex-direction: column; gap: 18px; transform: rotate(-1.5deg); }
.ha-head { display: flex; align-items: center; justify-content: space-between; }
.ha-main { display: flex; align-items: center; gap: 20px; }
.ha-bars { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.ha-bar { display: grid; grid-template-columns: 74px 1fr 38px; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ha-bar b { color: var(--text); font-size: 13px; text-align: right; }
.ha-bar .progress { height: 8px; }
.ha-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--accent-50); color: var(--accent-600); font-weight: 600; font-size: 14px; }
.ha-float { position: absolute; display: inline-flex; align-items: center; gap: 7px; background: #fff; border-radius: 12px; padding: 9px 14px; font-weight: 700; font-size: 14px; box-shadow: 0 12px 30px rgba(30, 41, 80, .14); color: var(--primary); }
.ha-float.f1 { top: 0; right: 0; }
.ha-float.f2 { bottom: 0; left: -6px; color: var(--accent-600); }

.pub-sec { padding: 72px 0; scroll-margin-top: 68px; }
.pub-sec.alt { background: #f6f7fb; }
.sec-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.sec-head h2, .t-text h2, .contact-text h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -.015em; line-height: 1.25; color: #141b2d; }
.sec-head p { color: var(--muted); font-size: 16px; margin-top: 10px; }
.steps-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; counter-reset: s; }
.step { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 22px 20px; box-shadow: var(--shadow); }
.step-num { position: absolute; top: 14px; right: 18px; font-size: 34px; font-weight: 800; color: #eef0f6; line-height: 1; }
.step-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; margin-bottom: 14px; }
.step:nth-child(2) .step-ico { background: var(--accent-50); color: var(--accent-600); }
.step:nth-child(3) .step-ico { background: var(--ok-50); color: var(--ok); }
.step:nth-child(4) .step-ico { background: #f3e8ff; color: #7c3aed; }
.step h3, .feat h3, .course h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.step p, .feat p { color: var(--muted); font-size: 14.5px; margin: 0; }
.levels-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.level-card { position: relative; background: #fff; border-radius: 18px; padding: 20px 20px 18px; border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.level-card::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 5px; background: var(--lc, var(--primary)); }
.level-card.lv-1 { --lc: #34d399; } .level-card.lv-2 { --lc: #22d3ee; } .level-card.lv-3 { --lc: #60a5fa; }
.level-card.lv-4 { --lc: #818cf8; } .level-card.lv-5 { --lc: #f59e0b; } .level-card.lv-6 { --lc: #f43f5e; }
.lc-top { display: flex; align-items: baseline; gap: 10px; }
.lc-id { font-size: 30px; font-weight: 800; color: var(--lc); line-height: 1; }
.lc-en { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.lc-name { font-weight: 700; font-size: 16px; margin: 8px 0 4px; }
.level-card p { color: var(--muted); font-size: 14px; margin: 0; }
.feat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feat { padding: 22px; border-radius: 18px; border: 1px solid var(--border); background: #fff; transition: box-shadow .15s, transform .15s; }
.feat:hover { box-shadow: 0 14px 30px rgba(30, 41, 80, .1); transform: translateY(-2px); }
.feat-ico { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(135deg, #1e3a8a, #3ba4f0); color: #fff; display: grid; place-items: center; margin-bottom: 14px; }
.feat:nth-child(even) .feat-ico { background: linear-gradient(135deg, #ffc93c, #f5a300); color: var(--navy); }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.course { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 22px 20px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.course .btn { margin-top: auto; }
.course .ticks { margin: 6px 0 10px; }
.route { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); margin-bottom: 4px; }
.route .lv-chip { font-size: 13px; padding: 3px 10px; }
.course-dur { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--primary); font-weight: 600; }
.ticks { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.ticks li { display: flex; align-items: flex-start; gap: 8px; font-size: 14.5px; color: #3c4559; }
.ticks .ico { color: var(--ok); margin-top: 3px; }
.teacher { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: center; }
.t-photo { width: 100%; aspect-ratio: 1; border-radius: 28px; object-fit: cover; box-shadow: 0 24px 50px rgba(30, 41, 80, .16); }
.t-initial { display: grid; place-items: center; background: linear-gradient(135deg, #1e3a8a, #3ba4f0); color: #fff; font-size: 110px; font-weight: 800; }
.t-role { color: var(--accent-600); font-weight: 600; margin: 6px 0 14px; }
.t-text p { color: #4a5367; font-size: 16px; line-height: 1.7; }
.testi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.testi { margin: 0; background: #fff; border-radius: 18px; padding: 22px; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.testi blockquote { margin: 0; color: #3c4559; line-height: 1.65; }
.testi-result { align-self: flex-start; background: var(--ok-50); color: var(--ok); font-weight: 700; border-radius: 8px; padding: 2px 10px; font-size: 13px; }
.cta-band { background: linear-gradient(120deg, #14235c, #1e3a8a 55%, #2f7fd8); color: #fff; padding: 44px 0; }
.cta-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cta-row h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; }
.cta-row p { margin: 6px 0 0; opacity: .9; }
.cta-row .btn { height: 52px; padding: 0 24px; border-radius: 14px; }
.contact { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: start; }
.contact-text p { color: #4a5367; font-size: 16px; margin-top: 10px; }
.lead-form { padding: 26px; margin: 0; box-shadow: 0 20px 50px rgba(30, 41, 80, .1); }
.lead-form h3 { font-size: 19px; margin-bottom: 16px; }
.hp { position: absolute !important; left: -9999px; width: 1px !important; height: 1px !important; opacity: 0; }
.lead-done { text-align: center; padding: 26px 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.done-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-50); color: var(--ok); display: grid; place-items: center; }
.pub-footer { background: #0f1b45; color: #cbd2e0; padding: 46px 0 22px; }
.pub-footer .pub-brand { color: #fff; } .pub-footer .pub-logo { background: #fff; border-radius: 14px; padding: 6px 10px; height: 64px; }
.pub-footer .pub-brand-name b { color: #8fc6ff; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 30px; }
.foot-grid > div { display: flex; flex-direction: column; gap: 8px; }
.foot-grid a, .foot-grid span { color: #cbd2e0; display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; }
.foot-grid a:hover { color: #fff; }
.foot-title { color: #fff; font-weight: 700; margin-bottom: 4px; }
.foot-tag { margin-top: 10px; color: #8f9ab0; font-style: italic; }
.foot-copy { margin-top: 30px; padding-top: 18px; border-top: 1px solid #22336b; font-size: 13px; color: #8f9ab0; }
.float-chat { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; background: #0068ff; color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 104, 255, .35); }
.float-chat:hover { filter: brightness(1.06); }

/* Bài test trình độ */
.test-page { background: var(--bg); }
.test-main { padding-top: 28px; padding-bottom: 80px; }
.test-intro { max-width: 760px; margin: 10px auto; padding: 32px; }
.test-intro h1 { font-size: 30px; font-weight: 800; margin-bottom: 10px; }
.ti-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0 10px; }
.ti-cell { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.ti-cell .ico { color: var(--primary); }
.ti-num { font-weight: 700; font-size: 17px; }
.test-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.test-title h1 { font-size: 24px; font-weight: 800; }
.level-hero { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; padding: 28px; background: linear-gradient(120deg, #fff 55%, #fff6e0); }
.lh-badge { width: 130px; height: 130px; border-radius: 28px; background: linear-gradient(135deg, #1e3a8a, #3ba4f0); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; box-shadow: 0 16px 34px rgba(30, 58, 138, .3); }
.lh-id { font-size: 50px; font-weight: 800; line-height: 1; }
.lh-en { font-size: 11px; font-weight: 600; opacity: .85; margin-top: 8px; text-transform: uppercase; letter-spacing: .04em; text-align: center; line-height: 1.3; padding: 0 8px; }
.lh-text { flex: 1 1 300px; }
.lh-text h1 { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.lh-text p { color: #4a5367; }
.result-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.result-cols .card { margin: 0; }
.lv-bars { display: flex; flex-direction: column; gap: 12px; }
.lv-bar { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 12px; }
.lv-bar .progress { height: 10px; }
.lv-bar b { text-align: right; }
.progress-fill.ok { background: var(--ok); }
.progress-fill.low { background: #f59e0b; }
.next-card { display: flex; flex-direction: column; gap: 12px; }
.next-card h2 { margin-bottom: 4px; }
.sugg { padding: 14px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.sugg-name { font-weight: 700; font-size: 17px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .exam-body, .review-layout { grid-template-columns: minmax(0, 1fr); }
  .review-side { position: static; order: -1; }
  .pal-toggle { display: inline-flex; }
  .exam-side { position: fixed; left: 12px; right: 12px; bottom: 12px; top: auto; z-index: 70; transform: translateY(calc(100% + 20px)); transition: transform .22s ease; }
  .exam-side .palette { box-shadow: 0 -10px 40px rgba(15, 23, 42, .25); }
  .exam-root.pal-open .exam-side { transform: none; }
  .palette-head .btn { display: inline-flex; }
  .hero-grid, .contact, .teacher { grid-template-columns: 1fr; }
  .hero-art { max-width: 460px; padding-left: 26px; }
  .ha-bee { left: -6px; }
  .teacher { justify-items: start; }
  .t-photo { max-width: 220px; }
  .steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .levels-grid, .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pub-nav { display: none; }
  .result-cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell .exam-root { --bar-top: 56px; }
  .form-grid.three { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .pub-wrap { padding: 0 16px; }
  .pub .exam-root { --bar-top: 70px; }
  .pub-head-row { height: 62px; }
  .pub-logo { height: 46px; }
  .ha-bee { width: 90px; left: -10px; top: -30px; }
  .hide-xs { display: none !important; }
  .hero { padding: 36px 0 44px; }
  .hero-cta .btn { width: 100%; }
  .pub-sec { padding: 52px 0; }
  .steps-grid, .levels-grid, .feat-grid, .ti-grid { grid-template-columns: 1fr; }
  .ha-main { flex-direction: column; align-items: stretch; }
  .ha-main .ring { align-self: center; }
  .foot-grid { grid-template-columns: 1fr; }
  .float-chat span { display: none; }
  .float-chat { padding: 14px; }
  .test-intro, .level-hero { padding: 22px 18px; }
  .lh-badge { width: 100px; height: 100px; border-radius: 22px; }
  .lh-id { font-size: 40px; }
  .exam-bar { gap: 10px; padding: 8px 10px; }
  .exam-prog { flex: 1 1 120px; min-width: 0; }
  .result-stats { justify-content: center; }
  .lead-form { padding: 20px 16px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 8px; height: 56px; padding: 0 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .topbar-title { font-weight: 700; font-size: 16px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 276px; z-index: 50; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 40; }
  .main { padding: 18px 16px 90px; }
  .page-head h1 { font-size: 21px; }
  .form-grid { grid-template-columns: 1fr; }
  .card { padding: 18px 16px; }
  .q-card, .q-section { padding: 16px; }
  .hide-sm { display: none; }
  .search { max-width: none; }
  .score-big { font-size: 32px; }
  .overlay { padding: 12px 10px; }
  .modal-body { padding: 14px 16px 16px; }
  .modal-foot { padding: 0 16px 16px; }
  .modal-head { padding: 14px 10px 0 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px; gap: 10px; }
  .stat-ico { width: 36px; height: 36px; }
  .stat .num { font-size: 22px; }
}
@media (max-width: 480px) {
  .as-card { flex-wrap: wrap; }
  .as-status { width: 100%; padding-left: 58px; }
  .page-head .actions { width: 100%; }
  .submit-bar .btn, .save-bar .btn { flex: 1 1 auto; }
  .mat-grid { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .topbar, .submit-bar, .save-bar, .exam-bar, .exam-side, .review-side, .float-chat, .pub-header { display: none !important; }
  .shell { display: block; }
}
