/* ===== English for IT — shared styles ===== */
:root {
  --bg: #0b0f17;
  --bg-elev: #121826;
  --bg-elev-2: #1a2233;
  --border: #262f42;
  --text: #e7ecf5;
  --text-dim: #9aa7bd;
  --text-faint: #6b7690;
  --accent: #0ea5e9;
  --accent-2: #a855f7;
  --accent-soft: rgba(14, 165, 233, 0.14);
  --green: #4ade80;
  --amber: #fbbf24;
  --red: #f87171;
  --code-bg: #0d1320;
  --radius: 14px;
  --max-w: 1180px;
  --sidebar-w: 280px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f7fb;
    --bg-elev: #ffffff;
    --bg-elev-2: #eef1f8;
    --border: #dfe3ee;
    --text: #1b2130;
    --text-dim: #55617a;
    --text-faint: #8892a6;
    --accent: #0369a1;
    --accent-2: #7e22ce;
    --accent-soft: rgba(3, 105, 161, 0.1);
    --code-bg: #eef1f8;
  }
}
:root[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --bg-elev-2: #eef1f8;
  --border: #dfe3ee;
  --text: #1b2130;
  --text-dim: #55617a;
  --text-faint: #8892a6;
  --accent: #0369a1;
  --accent-2: #7e22ce;
  --accent-soft: rgba(3, 105, 161, 0.1);
  --code-bg: #eef1f8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* Layout shell */
.shell {
  display: flex;
  min-height: 100vh;
}

/* Topbar (mobile) */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 700; font-size: 15px; }
.topbar .spacer { flex: 1; }
.icon-btn {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 16px 40px;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.sidebar .brand .logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 15px;
  flex-shrink: 0;
}
.sidebar .brand .name { font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.sidebar .brand .name small { display: block; font-weight: 500; color: var(--text-faint); font-size: 11.5px; }

.progress-box {
  margin: 0 8px 16px;
  padding: 12px 14px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.progress-box .label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.progress-box .bar { height: 7px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-box .bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .3s ease; width: 0%; }

.nav-group { margin-bottom: 6px; }
.nav-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); padding: 12px 12px 6px;
}
.navlink {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px;
  color: var(--text-dim); font-size: 13.5px; font-weight: 500;
  margin: 1px 0;
}
.navlink:hover { background: var(--bg-elev-2); text-decoration: none; color: var(--text); }
.navlink.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.navlink .num {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--bg-elev-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text-faint); flex-shrink: 0;
}
.navlink.active .num { background: var(--accent); border-color: var(--accent); color: #fff; }
.navlink.done .num { background: var(--green); border-color: var(--green); color: #06240f; }
.navlink.done .num::after { content: "✓"; }
.navlink.done .num-text { display: none; }

/* Main content */
.main {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
}
.content { max-width: 860px; margin: 0 auto; }
.wide { max-width: var(--max-w); margin: 0 auto; }

.crumb { font-size: 13px; color: var(--text-faint); margin-bottom: 14px; }
.crumb a { color: var(--text-faint); }
.crumb a:hover { color: var(--accent); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 99px;
  margin-bottom: 14px; letter-spacing: .02em;
}
.badge.alt { background: rgba(250, 204, 21, .12); color: var(--amber); }

h1 { font-size: 32px; font-weight: 800; margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: 22px; font-weight: 750; margin: 40px 0 14px; letter-spacing: -.005em; padding-top: 6px; }
h3 { font-size: 17px; font-weight: 700; margin: 24px 0 10px; color: var(--text); }
p { color: var(--text-dim); margin: 0 0 14px; }
h1 + p.lead, p.lead { font-size: 17px; color: var(--text-dim); margin-bottom: 22px; }
ul, ol { color: var(--text-dim); padding-left: 22px; margin: 0 0 14px; }
li { margin-bottom: 6px; }
li > strong { color: var(--text); }
strong { color: var(--text); }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 36px 0; }

code {
  font-family: var(--mono);
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--accent);
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 18px;
}
pre code { background: none; border: none; padding: 0; color: var(--text); font-size: 13px; line-height: 1.6; }

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--bg-elev);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 0 0 18px;
}
.callout p:last-child { margin-bottom: 0; }
.callout .ct-title { font-weight: 700; color: var(--accent); font-size: 13px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.callout.warn { border-left-color: var(--amber); }
.callout.warn .ct-title { color: var(--amber); }
.callout.tip { border-left-color: var(--green); }
.callout.tip .ct-title { color: var(--green); }

.grid { display: grid; gap: 16px; margin: 18px 0 24px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card h4 { margin: 0 0 6px; font-size: 14.5px; font-weight: 700; }
.card p { margin: 0; font-size: 13.5px; }

/* Module cards (homepage grid) */
.module-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .15s, transform .15s;
  position: relative;
}
.module-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.module-card .mc-top { display: flex; align-items: center; justify-content: space-between; }
.module-card .mc-num {
  font-size: 12px; font-weight: 800; color: var(--accent);
  background: var(--accent-soft); padding: 3px 9px; border-radius: 99px;
}
.module-card .mc-time { font-size: 11.5px; color: var(--text-faint); }
.module-card h4 { margin: 4px 0 0; font-size: 15.5px; font-weight: 750; color: var(--text); }
.module-card p { margin: 0; font-size: 13px; color: var(--text-dim); }
.module-card .mc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag {
  font-size: 10.5px; font-weight: 600; color: var(--text-dim);
  background: var(--bg-elev-2); border: 1px solid var(--border);
  padding: 3px 8px; border-radius: 6px;
}
.module-card.done { border-color: var(--green); }
.module-card .mc-check {
  position: absolute; top: 16px; right: 16px;
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--green); color: #06240f; font-size: 12px;
  display: none; align-items: center; justify-content: center; font-weight: 800;
}
.module-card.done .mc-check { display: flex; }

/* Objectives / checklist */
.checklist { list-style: none; padding: 0; margin: 0 0 18px; }
.checklist li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 8px; background: var(--bg-elev); cursor: pointer; font-size: 14px; color: var(--text-dim);
}
.checklist li input { margin-top: 3px; accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; }
.checklist li.checked { color: var(--text-faint); text-decoration: line-through; }

/* Timeline (12-month roadmap) */
.timeline { position: relative; margin: 20px 0 30px; padding-left: 28px; border-left: 2px solid var(--border); }
.tl-item { position: relative; padding-bottom: 26px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -34px; top: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}
.tl-month { font-size: 12px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.tl-item h4 { margin: 3px 0 4px; font-size: 15.5px; }
.tl-item p { margin: 0; font-size: 13.5px; }

/* Resources */
.res-list { list-style: none; padding: 0; margin: 0 0 18px; }
.res-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px;
  background: var(--bg-elev);
}
.res-list a { font-weight: 650; font-size: 14px; }
.res-list .res-desc { font-size: 12.5px; color: var(--text-faint); display: block; margin-top: 2px; }
.res-list .res-type { font-size: 10.5px; font-weight: 700; color: var(--text-faint); background: var(--bg-elev-2); padding: 3px 8px; border-radius: 6px; white-space: nowrap; }

table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text-dim); }
th { color: var(--text); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }

/* Prev/next footer nav */
.pagenav { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; }
.pagenav a {
  flex: 1; display: block; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 18px; background: var(--bg-elev); text-decoration: none;
}
.pagenav a:hover { border-color: var(--accent); }
.pagenav .dir { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.pagenav .title { font-weight: 700; color: var(--text); font-size: 14px; }
.pagenav .next { text-align: right; }

.mark-done-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; border: none;
  padding: 11px 20px; border-radius: 10px; font-weight: 700; font-size: 13.5px;
  cursor: pointer; margin: 30px 0 0;
}
.mark-done-btn.is-done { background: var(--green); color: #06240f; }
.mark-done-btn:hover { opacity: .9; }

.hero {
  padding: 8px 0 10px;
}
.hero h1 { font-size: 38px; }
.stat-row { display: flex; gap: 28px; flex-wrap: wrap; margin: 22px 0 32px; }
.stat { min-width: 110px; }
.stat .num { font-size: 26px; font-weight: 800; color: var(--accent); }
.stat .lbl { font-size: 12.5px; color: var(--text-faint); }

.milestone {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; background: var(--bg-elev); position: relative; overflow: hidden;
}
.milestone .m-idx { font-size: 11px; font-weight: 800; color: var(--text-faint); letter-spacing: .05em; text-transform: uppercase; }
.milestone h4 { margin: 6px 0 6px; font-size: 16px; }
.milestone p { font-size: 13px; margin-bottom: 0; }

footer.site-footer {
  max-width: var(--max-w); margin: 60px auto 0; padding: 24px 0; border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: 12.5px; text-align: center;
}

/* Responsive */
@media (max-width: 980px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .topbar { display: flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50; height: 100vh;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.4);
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 24px 18px 60px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .pagenav { flex-direction: column; }

  /* Cỡ chữ lớn hơn một chút để dễ đọc trên mobile */
  body { font-size: 17px; }
  h1 { font-size: 27px; }
  .hero h1 { font-size: 29px; }
  h2 { font-size: 21px; }
  h3 { font-size: 18px; }
  h1 + p.lead, p.lead { font-size: 16.5px; }
  .card p, .module-card p, .milestone p, .tl-item p, .res-list .res-desc { font-size: 14.5px; }
  .module-card h4 { font-size: 16px; }
  .milestone h4 { font-size: 16.5px; }
  .checklist li { font-size: 15.5px; padding: 11px 14px; }
  .checklist li input { width: 19px; height: 19px; }
  .res-list a { font-size: 15px; }
  .tag { font-size: 11px; padding: 4px 9px; }
  .badge { font-size: 12.5px; }
  .crumb { font-size: 13.5px; }
  code { font-size: 14px; }
  pre code { font-size: 13.5px; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 14.5px; }
  .icon-btn { width: 42px; height: 42px; }
  .stat .num { font-size: 24px; }
}
@media (max-width: 480px) {
  body { font-size: 17.5px; }
  h1 { font-size: 24px; }
  .hero h1 { font-size: 25px; }
  .main { padding: 20px 14px 50px; }
}
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 45; }
.overlay.show { display: block; }

/* ===== Fullstack course: difficulty levels ===== */
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.badge-row .badge { margin-bottom: 0; }
.table-wrap { overflow-x: auto; margin-bottom: 20px; }
.lvl {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 99px; white-space: nowrap; letter-spacing: .02em;
}
.lvl1 { color: #16a34a; background: rgba(22, 163, 74, .13); }
.lvl2 { color: #0891b2; background: rgba(8, 145, 178, .13); }
.lvl3 { color: #d97706; background: rgba(217, 119, 6, .14); }
.lvl4 { color: #dc2626; background: rgba(220, 38, 38, .13); }
.lvl-count { font-size: 12px; color: var(--text-faint); margin-right: 10px; }

/* ===== Desktop: chữ lớn hơn cho dễ đọc (màn hình >= 861px) ===== */
@media (min-width: 861px) {
  :root { --sidebar-w: 300px; --max-w: 1240px; }
  body { font-size: 18px; line-height: 1.7; }
  .content { max-width: 960px; }
  h1 { font-size: 36px; }
  .hero h1 { font-size: 42px; }
  h2 { font-size: 25px; }
  h3 { font-size: 19.5px; }
  h1 + p.lead, p.lead { font-size: 19px; }
  .crumb { font-size: 14.5px; }
  .badge { font-size: 13.5px; }
  code { font-size: 15px; }
  pre code { font-size: 14.5px; }
  table { font-size: 15.5px; }
  th { font-size: 13.5px; }
  .callout .ct-title { font-size: 14.5px; }
  .topbar .brand { font-size: 16px; }
  .sidebar .brand .name { font-size: 16px; }
  .sidebar .brand .name small { font-size: 12.5px; }
  .progress-box .label { font-size: 13px; }
  .nav-title { font-size: 12px; }
  .navlink { font-size: 15px; }
  .navlink .num { font-size: 12px; }
  .card h4 { font-size: 16.5px; }
  .card p { font-size: 15px; }
  .module-card .mc-num { font-size: 13px; }
  .module-card .mc-time { font-size: 12.5px; }
  .module-card h4 { font-size: 17.5px; }
  .module-card p { font-size: 15px; }
  .tag { font-size: 12px; }
  .lvl { font-size: 12.5px; }
  .milestone .m-idx { font-size: 12px; }
  .milestone h4 { font-size: 18px; }
  .milestone p { font-size: 15px; }
  .tl-item h4 { font-size: 17px; }
  .tl-item p { font-size: 15px; }
  .checklist li { font-size: 16.5px; }
  .res-list a { font-size: 16px; }
  .res-list .res-desc { font-size: 14px; }
  .res-list .res-type { font-size: 11.5px; }
  .pagenav .dir { font-size: 12px; }
  .pagenav .title { font-size: 15.5px; }
  .mark-done-btn { font-size: 15px; }
  .stat .num { font-size: 30px; }
  .stat .lbl { font-size: 14px; }
  footer.site-footer { font-size: 13.5px; }
  /* Khoá phỏng vấn */
  .q-text { font-size: 19px; }
  .q-num { font-size: 15.5px; }
  .q-label { font-size: 14.5px; }
  .q-details > summary { font-size: 15.5px; }
  .tool-btn { font-size: 15px; }
  .tool-hint { font-size: 14px; }
}

/* ===== English for IT: thành phần riêng ===== */
.tbl-title { font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); margin: 18px 0 8px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-faint); font-weight: 700; background: var(--bg-elev-2); }
td { color: var(--text-dim); }
table.phr td.en, table.reg td.en, table.mist td.en { color: var(--text); font-weight: 600; }
table.phr td.ex { font-weight: 400; font-style: italic; color: var(--text-dim); }
table.pron td.ipa { font-family: "Charis SIL", "Doulos SIL", "Lucida Sans Unicode", "Segoe UI", sans-serif; color: var(--accent); white-space: nowrap; }
.bad-txt { color: var(--red) !important; }
.good-txt { color: var(--green) !important; }

/* nút đọc */
.say-btn {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 24px; height: 24px; margin-left: 6px; padding: 0; border-radius: 99px;
  border: 1px solid var(--border); background: var(--bg-elev-2); color: var(--text-dim);
  cursor: pointer; font-size: 12px; line-height: 1; flex-shrink: 0;
}
.say-btn:hover { border-color: var(--accent); color: var(--accent); }
.say-btn.playing { background: var(--accent); color: #fff; border-color: var(--accent); }
.en-block + .say-btn, .tpl .say-btn { margin: 0; }

/* làm mờ tiếng Việt để tự luyện */
body.hide-vi .vi { filter: blur(5px); cursor: pointer; transition: filter .15s; user-select: none; }
body.hide-vi .vi.peek, body.hide-vi .vi:hover { filter: none; }

/* hội thoại */
.dialog { border: 1px solid var(--border); background: var(--bg-elev); border-radius: 14px; padding: 14px 16px; margin: 0 0 22px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.dlg-title { font-weight: 750; color: var(--text); font-size: 15px; }
.dlg-play, .copy-btn, .tool-btn {
  border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent);
  border-radius: 99px; padding: 5px 14px; font-weight: 700; font-size: 13px; cursor: pointer;
}
.dlg-play:hover, .copy-btn:hover, .tool-btn:hover { background: var(--accent); color: #fff; }
.line { display: flex; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--border); }
.line:first-of-type { border-top: none; }
.line .who { flex: 0 0 auto; min-width: 74px; max-width: 120px; font-size: 12.5px; font-weight: 800; padding-top: 3px; }
.line .txt p { margin: 0; }
.line .txt p.en { color: var(--text); }
.line .txt p.vi { font-size: .9em; color: var(--text-faint); margin-top: 2px; }
.line.sp0 .who { color: #0ea5e9; } .line.sp1 .who { color: #a855f7; }
.line.sp2 .who { color: #f59e0b; } .line.sp3 .who { color: #10b981; }
.line.active { background: var(--accent-soft); border-radius: 8px; }
.dlg-note { margin-top: 10px; font-size: .9em; color: var(--text-dim); border-top: 1px solid var(--border); padding-top: 10px; }

/* quiz */
.quiz-box { margin: 6px 0 22px; }
details.quiz { border: 1px solid var(--border); background: var(--bg-elev); border-radius: 10px; margin-bottom: 8px; }
details.quiz > summary { cursor: pointer; padding: 10px 14px; color: var(--text); list-style: none; display: flex; gap: 10px; align-items: flex-start; }
details.quiz > summary::-webkit-details-marker { display: none; }
details.quiz > summary .qn { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; margin-top: 2px; }
details.quiz[open] > summary { border-bottom: 1px dashed var(--border); }
details.quiz .ans { padding: 10px 14px 12px 48px; }
details.quiz .ans p { margin: 0 0 4px; }
details.quiz .ans p.en { color: var(--green); font-weight: 650; }
details.quiz .ans p.exp { font-size: .9em; }

/* template & câu trả lời mẫu */
.tpl { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin: 0 0 20px; background: var(--code-bg); }
.tpl-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-elev-2); font-weight: 700; font-size: 13.5px; color: var(--text); }
.tpl-head .acts { display: flex; gap: 6px; align-items: center; }
.tpl pre { margin: 0; border: none; border-radius: 0; white-space: pre-wrap; font-family: var(--mono); font-size: 14px; color: var(--text); }
.model-ans { border: 1px solid var(--border); border-left: 3px solid var(--accent-2); background: var(--bg-elev); border-radius: 10px; padding: 14px 18px; margin: 0 0 20px; }
.model-ans .ma-head { font-weight: 800; color: var(--accent-2); margin-bottom: 8px; font-size: 14.5px; }
.model-ans p.en { color: var(--text); }
.model-ans .ans-note { font-size: .9em; color: var(--text-dim); border-top: 1px dashed var(--border); padding-top: 8px; margin-top: 6px; }

/* bảng điều khiển giọng đọc (sidebar) */
.voice-box { border: 1px solid var(--border); background: var(--bg-elev); border-radius: 12px; padding: 12px; margin: 0 0 16px; font-size: 13px; }
.voice-box .vb-title { font-weight: 800; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }
.voice-box .vb-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.voice-box .vb-row:last-child { margin-bottom: 0; }
.chip { border: 1px solid var(--border); background: var(--bg-elev-2); color: var(--text-dim); border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.voice-warn { color: var(--amber); font-size: 12px; display: none; }

/* phòng luyện nói */
.speak-lab { border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elev); padding: 16px 18px; margin: 10px 0 24px; }
.speak-lab ol { margin-bottom: 12px; }
.speak-lab li { color: var(--text); }
.lab-ctrl { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lab-ctrl .rec-btn { border: 1px solid var(--red); color: var(--red); background: transparent; border-radius: 99px; padding: 6px 16px; font-weight: 800; cursor: pointer; }
.lab-ctrl .rec-btn.recording { background: var(--red); color: #fff; }
.lab-ctrl .timer { font-family: var(--mono); color: var(--text-dim); }
.lab-ctrl audio { height: 36px; max-width: 100%; }

/* sổ tay mẫu câu */
.pb-search { width: 100%; padding: 12px 16px; font-size: 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); margin: 0 0 12px; }
.pb-search:focus { outline: none; border-color: var(--accent); }
.pb-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pb-count { font-size: 13px; color: var(--text-faint); margin-bottom: 8px; }
table.pb td:first-child { white-space: nowrap; }
table.pb tr.hide { display: none; }

@media (max-width: 860px) {
  .line { flex-direction: column; gap: 2px; }
  .line .who { min-width: 0; }
  details.quiz .ans { padding-left: 14px; }
}
