/* Lớp học tiếng Anh — light classroom theme */
:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --bg-deep: #edf2f8;
  --card: #ffffff;
  --surface: #f1f5fa;     /* form boxes */
  --field: #ffffff;       /* inputs */
  --line: #e0e6ee;
  --line-strong: #c8d2df;
  --ink: #1b2a41;
  --text: #3d4b5f;
  --muted: #64748b;
  --orange: #e3784b;      /* large accents, icons */
  --orange-ink: #b5502a;  /* small orange text on light */
  --button: #c4572b;
  --button-hover: #a5461f;
  --peach: #fdeee6;       /* icon tiles */
  --danger: #c0392b;
  --ok: #1f7a48;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Literata, Georgia, 'Times New Roman', serif;
  font-optical-sizing: auto;
  line-height: 1.5;
}
h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { list-style: none; padding: 0; }
img, svg { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--orange-ink); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button, a { transition: background .2s, color .2s, transform .2s; }
button:active, .button:active { transform: scale(.98); }
:focus-visible { outline: 3px solid var(--orange-ink); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 10px 14px; border-radius: 8px; z-index: 10; }
.skip-link:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header {
  min-height: 68px; max-width: 1240px; padding: 0 36px; margin: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 19px; padding: 8px 0; white-space: nowrap; }
.logo > span { display: grid; place-items: center; background: var(--peach); color: var(--orange); border-radius: 12px; width: 42px; height: 42px; }
.site-nav { display: flex; gap: 10px; font-size: 14px; font-weight: 700; }
.site-nav a { padding: 12px 12px; border-radius: 8px; white-space: nowrap; }
.site-nav a.active { color: var(--orange-ink); }
.header-login {
  display: flex; align-items: center; gap: 10px; min-height: 46px;
  border: 1px solid var(--line-strong); border-radius: 9px; padding: 11px 19px; font-size: 14px; font-weight: 700;
  background: #fff;
}

/* Shared type */
.eyebrow { color: #b5502a; font-size: 11px; letter-spacing: 1.5px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; background: var(--orange); border-radius: 50%; }
h1 { font-size: 46px; font-weight: 700; line-height: 1.22; letter-spacing: -0.6px; margin: 23px 0; }
h1 span { color: var(--orange); }
h2 { font-size: 30px; font-weight: 700; letter-spacing: -.3px; margin: 14px 0; }
h3 { font-size: 18px; font-weight: 800; }
p { color: var(--text); font-size: 15px; line-height: 1.8; }

.button {
  background: var(--button); color: #fff !important; min-height: 48px;
  padding: 14px 23px; display: inline-flex; justify-content: center; align-items: center; gap: 13px;
  border: 0; border-radius: 10px; font-size: 14px; font-weight: 800;
}
.button:hover { background: var(--button-hover); }
.text-link {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 2px;
  font-weight: 700; font-size: 14px; background: none; border: 0;
}
.outline-button {
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 9px; min-height: 42px;
  padding: 10px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 13px; font-weight: 700;
}
.outline-button:hover { border-color: var(--orange-ink); color: var(--orange-ink); }
.outline-button.danger:hover { border-color: var(--danger); color: var(--danger); }

/* Hero */
.hero {
  max-width: 1240px; margin: auto; position: relative; min-height: 640px; padding: 75px 36px 55px;
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 24px;
  background: linear-gradient(110deg, var(--bg) 10%, var(--bg-deep));
}
.hero-actions { display: flex; gap: 23px; align-items: center; margin-top: 30px; }
.hero-checks { display: flex; gap: 17px; margin-top: 27px; font-size: 12px; color: var(--text); flex-wrap: wrap; }
.hero-checks span { display: flex; align-items: center; gap: 5px; }
.hero-checks svg { color: #2f6fdb; }
.hero-art { position: relative; margin-top: 12px; }
.hero-art > img { width: 100%; border-radius: 48%; filter: brightness(.92); box-shadow: 0 30px 80px #0000004d; }
.art-label {
  position: absolute; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 12px 35px #00000059;
  padding: 15px 18px; border-radius: 12px; display: flex; align-items: center; gap: 12px; font-size: 12px;
}
.art-label svg { color: var(--orange); }
.art-label strong, .art-label small { display: block; }
.art-label small { font-size: 11px; color: var(--muted); margin-top: 4px; }
.label-one { left: 5px; top: 10px; }
.label-two { right: 3px; bottom: 4px; }
.sparkle { position: absolute; right: 18px; top: 5px; color: #e0a86a; }

/* Benefits */
.benefits { max-width: 1168px; margin: auto; padding: 55px 0 70px; }
.section-title { text-align: center; }
.section-title p { margin: 8px 0 30px; }
.benefit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.benefit-grid article { background: var(--card); border: 1px solid var(--line); border-radius: 17px; padding: 28px; }
.benefit-grid h3 { margin-top: 18px; }
.benefit-grid p { font-size: 14px; min-height: 76px; margin: 8px 0; }
.benefit-grid a { font-size: 13px; font-weight: 800; display: inline-flex; gap: 9px; align-items: center; min-height: 44px; color: var(--orange-ink); }
.icon-box { display: inline-flex; padding: 13px; border-radius: 13px; background: var(--peach); color: var(--orange-ink); }

/* Steps */
.steps {
  max-width: 1168px; margin: 0 auto 65px; background: var(--bg-deep); padding: 45px 55px; border-radius: 22px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
}
.steps h2 { margin-bottom: 28px; }
.steps li { display: flex; gap: 21px; padding: 12px 0; }
.steps li > span { font-size: 25px; font-weight: 800; color: #c4572b; }
.steps h3 { margin: 0; font-size: 16px; }
.steps p { font-size: 14px; margin: 4px 0; }

/* Footer */
.site-footer {
  max-width: 1240px; margin: auto; border-top: 1px solid var(--line); padding: 35px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
}
.site-footer strong { display: flex; align-items: center; gap: 8px; }
.site-footer p { font-size: 13px; }
.footer-links { display: flex; gap: 8px 22px; font-size: 13px; flex-wrap: wrap; }
.footer-links a { display: inline-block; padding: 12px 0; }
.site-footer > small { width: 100%; color: var(--muted); font-size: 12px; }

/* Forms */
.form-page { padding: 65px 20px 85px; text-align: center; background: var(--bg-deep); min-height: 640px; }
.form-page > h1 { font-size: 36px; }
.form-page > .icon-box { display: flex; width: 50px; margin: 0 auto 20px; }
.form-box {
  max-width: 480px; margin: 30px auto 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 30px; text-align: left;
}
.form-box label, .manager-form label, .search-label { display: flex; flex-direction: column; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 20px; }
input, textarea, select {
  width: 100%; padding: 12px; min-height: 46px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--field);
  outline-color: var(--orange-ink);
}
::placeholder { color: #7f91b0; opacity: 1; }
textarea { min-height: 120px; resize: vertical; }
input[type=checkbox] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--orange); }
input[type=file] { padding: 10px; background: var(--field); }
.consent { flex-direction: row !important; align-items: flex-start; font-size: 13px !important; line-height: 1.7; font-weight: 400 !important; }
.consent input { flex-shrink: 0; margin-top: 3px; }
.form-box > .button { width: 100%; }
.form-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-top: 14px; font-size: 14px; }
.form-links a { color: var(--orange-ink); font-weight: 700; padding: 10px 0; }
.privacy { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 16px; font-size: 12px; color: var(--muted); }
.hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.success { text-align: center; }
.success svg { margin: 0 auto 10px; color: var(--orange); }
.success .button { margin-top: 16px; }

/* Messages */
.alert { border-radius: 10px; padding: 12px 15px; margin: 0 0 18px; font-size: 14px; text-align: left; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f3c2bc; }
.alert-ok { background: #e7f6ed; color: var(--ok); border: 1px solid #b9e6c9; }
.alert-info { background: var(--card); color: var(--ink); border: 1px solid var(--line); }

/* Workspace (students + admin) */
.workspace { max-width: 1240px; margin: auto; padding: 24px 36px 55px; min-height: 640px; }
.workspace h1 { font-size: 33px; margin: 14px 0 8px; }
.workspace-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 10px; }
.heading-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.workspace-heading > .heading-actions { flex-shrink: 0; justify-content: flex-end; align-self: flex-start; margin-top: 14px; }
.empty { text-align: center; padding: 60px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; margin-top: 25px; }
.empty > svg { margin: 0 auto 12px; color: var(--orange); }
.empty a { color: var(--orange-ink); font-weight: 700; display: inline-block; padding: 10px 0; }
.lesson-list { display: grid; gap: 20px; margin-top: 30px; }
.lesson-list article { padding: 25px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.lesson-list article > svg { color: var(--orange); }
.lesson-list h2 { font-size: 22px; margin: 12px 0 6px; }
.lesson-body { white-space: pre-wrap; margin-bottom: 14px; }
.lesson-meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; }

.tabs { display: flex; gap: 10px; margin-top: 25px; flex-wrap: wrap; }
.tabs a { padding: 12px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; font-weight: 700; font-size: 14px; }
.tabs a.selected { background: var(--peach); color: var(--orange-ink); border-color: #c8d2df; }
.badge { display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 4px; border-radius: 99px; background: var(--button); color: #fff; font-size: 11px; text-align: center; }
.manager-form { padding: 25px; border: 1px solid var(--line); border-radius: 16px; margin: 25px 0; background: var(--card); }
.manager-form h2 { font-size: 20px; margin: 0 0 16px; }
.manager-form small { display: block; margin-top: 12px; color: var(--muted); }
.form-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.check-row { flex-direction: row !important; align-items: center; font-weight: 600 !important; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th, td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); }
td input { min-width: 130px; min-height: 40px; padding: 8px 10px; }
.row-form { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.row-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 170px; }
.status { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.status-ok { background: #e3f4ea; color: #1f7a48; }
.status-wait { background: #fdf3dc; color: #8a5a00; }
.search-label { max-width: 400px; }
.lesson-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding: 15px; }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row h3 { font-size: 16px; }
.message-cell { white-space: pre-wrap; max-width: 460px; }
.handled td { opacity: .6; }
.manager-note { font-size: 13px; margin-top: 20px; }
details summary { cursor: pointer; font-weight: 700; font-size: 13px; padding: 12px 0; color: var(--orange-ink); }
td small a { display: inline-block; padding: 10px 0; color: var(--orange-ink); }

/* Error pages */
.error-page { text-align: center; }
.error-page .button { margin-top: 20px; }

@media (max-width: 900px) {
  .hero { padding: 45px 25px; grid-template-columns: 1fr; min-height: auto; text-align: center; }
  .hero-art { max-width: 500px; margin: 30px auto; }
  .hero-actions, .hero-checks { justify-content: center; }
  .benefits { padding: 45px 25px; }
  .benefit-grid { gap: 15px; }
  .steps { margin: 0 25px 45px; padding: 30px; gap: 20px; }
  .site-header { flex-wrap: wrap; padding: 14px 25px; gap: 8px; }
  .site-nav { order: 3; justify-content: center; width: 100%; gap: 4px; }
  .header-login { white-space: nowrap; }
  h1 { font-size: 43px; }
  .form-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .site-header { min-height: 84px; flex-wrap: wrap; padding: 14px 16px; gap: 8px; }
  .logo { font-size: 15px; }
  .header-login { padding: 10px 14px; font-size: 13px; }
  .site-nav { order: 3; justify-content: center; width: 100%; gap: 4px; font-size: 14px; }
  .hero { padding: 38px 16px 30px; }
  h1 { font-size: 33px; letter-spacing: -.3px; }
  .hero-top > p { font-size: 14px; }
  .desktop { display: none; }
  .hero-actions { flex-direction: column; gap: 12px; }
  .hero-checks { gap: 10px; justify-content: center; }
  .hero-art { margin-top: 45px; }
  .benefit-grid, .steps { grid-template-columns: 1fr; }
  .benefits { padding: 40px 16px; }
  .benefit-grid article { padding: 23px; }
  .benefit-grid p { min-height: 0; }
  .steps { margin: 0 16px 40px; padding: 28px 22px; gap: 10px; }
  h2 { font-size: 26px; }
  .section-title p { font-size: 14px; }
  .site-footer { padding: 25px 16px; }
  .form-page { padding: 40px 16px; }
  .form-page > h1 { font-size: 29px; }
  .form-box { padding: 23px; }
  .workspace { padding: 20px 16px 36px; }
  .workspace-heading > .heading-actions { justify-content: flex-start; margin-top: 0; }
  .workspace-heading { align-items: flex-start; flex-direction: column; }
  .workspace h1 { font-size: 29px; }
  .form-row { grid-template-columns: 1fr; }
  .lesson-row { flex-direction: column; align-items: flex-start; }
}

/* Bulk student import */
.bulk-result { border-color: var(--orange); }
.password { font-family: ui-monospace, Menlo, monospace; font-size: 15px; background: var(--field); border: 1px solid var(--line-strong); padding: 4px 8px; border-radius: 6px; user-select: all; }

/* Listening practice */
kbd { font-family: ui-monospace, Menlo, monospace; font-size: 12px; padding: 2px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--field); color: var(--ink); }
.eyebrow a { color: inherit; padding: 8px 0; display: inline-block; }
.inline-label { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; margin: 0 !important; }
.inline-label select { width: auto; min-height: 40px; padding: 6px 10px; }
.progress { height: 8px; border-radius: 99px; background: var(--field); border: 1px solid var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--button), var(--orange)); border-radius: 99px; transition: width .4s; }
.progress.big { height: 10px; margin-top: 18px; }

.exercise-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 28px; }
.exercise-card { padding: 25px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); display: flex; flex-direction: column; gap: 6px; }
.exercise-card .icon-box { align-self: flex-start; }
.exercise-card h2 { font-size: 20px; margin: 12px 0 0; }
.exercise-card .progress { margin-top: 8px; }
.exercise-card .button { margin-top: auto; align-self: flex-start; }

.dictation-card { margin-top: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.dictation-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dictation-top strong { font-size: 16px; }
.dictation-audio { display: flex; align-items: center; gap: 18px; margin: 20px 0 14px; flex-wrap: wrap; }
.dictation-audio .hint { margin-top: 6px; }
.play-button {
    width: 64px; height: 64px; border-radius: 50%; border: 0; display: grid; place-items: center;
    background: var(--button); color: #fff; box-shadow: 0 8px 24px #0000004d;
}
.play-button:hover { background: var(--button-hover); }
.play-button svg { margin-left: 4px; }
.dictation-hint { font-size: 14px; color: var(--orange-ink); margin-bottom: 10px; }
#dc-input { font-size: 18px; line-height: 1.6; min-height: 96px; }
.dictation-feedback { margin: 14px 0 4px; }
.answer-line { font-size: 18px; line-height: 1.9; color: var(--ink); word-spacing: 2px; }
.w-ok { color: var(--ok); }
.w-shown { color: var(--orange-ink); }
.w-miss { color: var(--muted); letter-spacing: 1px; }
.w-next { border-bottom: 2px solid var(--orange); }
.answer-msg { font-size: 14px; margin-top: 4px; }
.answer-msg.ok { color: var(--ok); font-weight: 700; }
.dictation-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.transcript { margin-top: 24px; padding: 6px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.transcript ol { list-style: decimal; padding-left: 22px; margin: 6px 0 14px; }
.transcript li { padding: 4px 0; font-size: 15px; }
.transcript-line { background: none; border: 0; padding: 4px 0; text-align: left; color: var(--text); font-size: 15px; line-height: 1.6; }
.transcript-line:hover { color: var(--orange-ink); }

/* Teacher: cutting editor */
.editor-player audio { width: 100%; margin-bottom: 14px; }
.editor-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cut-button { background: #2f7a45; }
.cut-button:hover { background: #24603a; }
.segment-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.segment { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.segment.current { border-color: var(--orange); box-shadow: 0 0 0 2px #e3784b55; }
.segment.bad { border-color: var(--danger); }
.segment-head { display: flex; gap: 10px; align-items: center; }
.segment-num { min-width: 28px; font-weight: 800; color: var(--orange-ink); }
.segment-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; padding-left: 38px; }
.segment-hint { max-width: 260px; min-height: 38px; padding: 6px 10px; font-size: 13px; }
.segment-times { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.outline-button.tiny { min-height: 36px; padding: 6px 10px; font-size: 12px; }
.save-bar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; background: var(--bg); border-top: 1px solid var(--line); margin-top: 16px; }

@media (max-width: 600px) {
  .dictation-card { padding: 18px; }
  .answer-line, #dc-input { font-size: 17px; }
  .segment-row { padding-left: 0; }
  .site-nav a { padding: 12px 8px; }
}
.listening-banner { display: flex; align-items: center; gap: 16px; margin-top: 24px; padding: 18px 22px; border: 1px solid var(--line-strong); border-radius: 16px; background: linear-gradient(110deg, var(--card), var(--peach)); }
.listening-banner > span:nth-child(2) { flex: 1; }
.listening-banner strong { display: block; font-size: 17px; }
.listening-banner small { color: var(--text); font-size: 14px; }
.listening-banner:hover { border-color: var(--orange); color: var(--ink); }
.stars { color: #e0a020; font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.segment-vocab { margin-top: 8px; margin-left: 38px; width: calc(100% - 38px); min-height: 38px; padding: 6px 10px; font-size: 13px; }
@media (max-width: 600px) { .segment-vocab { margin-left: 0; width: 100%; } }
.w-given { color: var(--ink); font-weight: 700; }
.w-miss { letter-spacing: 2px; }
.dictation-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.seg-map { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.map-chip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1; min-width: 40px; height: 46px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--card); color: var(--muted); font-size: 12px; font-weight: 700; }
.map-chip.s1 { border-bottom: 6px solid #2f8f5b; }
.map-chip.s2 { border-bottom: 6px solid #e0a83a; }
.map-chip.s3 { border-bottom: 6px solid #c0392b; }
.map-chip.done { background: #e3f4ea; color: #1f7a48; }
.map-chip.seen { background: #fdf3dc; color: #8a5a00; }
.map-chip.current { outline: 2px solid var(--orange); outline-offset: 1px; color: var(--ink); }
.map-chip.dim { opacity: .35; }
.dictation-top .stars { font-size: 15px; margin-left: 6px; }
.vocab-box { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--peach); border: 1px solid #c8d2df; }
.vocab-title { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--orange-ink); margin-bottom: 6px; }
.vocab-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 15px; color: var(--text); }
.vocab-list strong, .vocab-mini strong { color: var(--ink); }
.vocab-mini { list-style: none; padding: 0; margin: 2px 0 8px; font-size: 13px; color: var(--muted); }
.seg-map-wrap { margin-top: 12px; }
.seg-map-wrap summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--orange-ink); padding: 8px 0; }

/* Mèo Cam mascot */
.cat { width: 120px; height: 120px; flex-shrink: 0; overflow: visible; }
.cat .eyes, .cat .mouth, .cat .cat-sparkles { display: none; }
.cat .eyes-open, .cat .mouth-smile { display: inline; }
.cat--happy .eyes-open, .cat--wow .eyes-open, .cat--sad .eyes-open, .cat--think .eyes-open { display: none; }
.cat--happy .eyes-happy, .cat--wow .eyes-wow, .cat--sad .eyes-sad, .cat--think .eyes-open { display: inline; }
.cat--wow .mouth-smile, .cat--sad .mouth-smile, .cat--think .mouth-smile { display: none; }
.cat--wow .mouth-open, .cat--sad .mouth-flat, .cat--think .mouth-flat { display: inline; }
.cat--happy .cat-sparkles, .cat--wow .cat-sparkles { display: inline; }
.cat .eyes-open { transform-origin: 70px 54px; animation: cat-blink 4.5s infinite; }
.cat .cat-tail { transform-origin: 104px 108px; animation: cat-tail 2.4s ease-in-out infinite; }
.cat--think .cat-head { transform-origin: 70px 70px; transform: rotate(-8deg); transition: transform .3s; }
.cat-bounce { animation: cat-bounce .7s ease; }
.cat-sparkles path { transform-box: fill-box; transform-origin: center; animation: cat-twinkle 1.2s ease-in-out infinite; }
@keyframes cat-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes cat-tail { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-12deg); } }
@keyframes cat-bounce { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-16px) rotate(-4deg); } 60% { transform: translateY(0) rotate(3deg); } 80% { transform: translateY(-5px); } }
@keyframes cat-twinkle { 0%, 100% { transform: scale(.6); opacity: .5; } 50% { transform: scale(1.15); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cat *, .cat-bounce { animation: none !important; } }

.mascot { display: flex; align-items: flex-end; gap: 12px; margin-top: 16px; }
.mascot .cat { width: 96px; height: 96px; }
.bubble {
    position: relative; flex: 1; padding: 12px 16px; border-radius: 16px; background: var(--surface);
    border: 1px solid var(--line-strong); color: var(--ink); font-size: 15px; line-height: 1.5; margin-bottom: 18px;
}
.bubble::before { content: ''; position: absolute; left: -9px; bottom: 16px; width: 16px; height: 16px; background: var(--surface); border-left: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); transform: rotate(45deg); }
.bubble strong { color: var(--orange-ink); }

/* Level chooser */
.level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
.level-card {
    display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 14px;
    border-radius: 18px; border: 2px solid var(--line-strong); background: var(--card); color: var(--ink);
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.level-card:hover, .level-card:focus-visible { transform: translateY(-4px); box-shadow: 0 12px 30px #0000004d; }
.level-easy:hover { border-color: #2f8f5b; } .level-normal:hover { border-color: #e0a83a; } .level-hard:hover { border-color: #c0392b; }
.level-name { font-size: 24px; font-weight: 800; }
.level-easy .level-name { color: #2f8f5b; } .level-normal .level-name { color: #8a5a00; } .level-hard .level-name { color: #c0392b; }
.level-plays { font-size: 18px; letter-spacing: 1px; }
.level-desc { font-size: 14px; color: var(--text); }
.rules { margin-top: 24px; padding: 20px 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.rules h2 { font-size: 18px; margin: 0 0 10px; }
.rules ul { list-style: disc; padding-left: 20px; display: grid; gap: 6px; color: var(--text); font-size: 15px; }
@media (max-width: 600px) { .level-grid { grid-template-columns: 1fr; } .level-card { flex-direction: row; justify-content: space-between; padding: 16px 18px; } }

/* Score board and listens */
.scoreboard { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-top: 14px; }
.score-main { font-size: 20px; font-weight: 800; }
.score-main strong { color: #b26a00; font-size: 26px; }
.score-pct { margin-left: 6px; padding: 2px 10px; border-radius: 99px; background: var(--peach); color: var(--orange-ink); font-size: 15px; }
.level-badge { padding: 4px 12px; border-radius: 99px; font-size: 13px; font-weight: 700; border: 1px solid var(--line-strong); }
.level-badge.level-easy { color: #2f8f5b; } .level-badge.level-normal { color: #8a5a00; } .level-badge.level-hard { color: #c0392b; }
.streak { padding: 4px 12px; border-radius: 99px; font-size: 13px; font-weight: 800; background: #fff1e6; color: #b5502a; animation: cat-twinkle 1.6s ease-in-out infinite; }
.listens { font-size: 15px; font-weight: 700; margin-bottom: 8px; letter-spacing: .5px; color: var(--ink); }
.listens.last { color: #8a5a00; }
.listens.none { color: var(--danger); }
.play-button.out { background: #c3ccd8; box-shadow: none; cursor: not-allowed; }
.finish-card { display: flex; align-items: center; gap: 20px; margin-top: 22px; padding: 24px; border-radius: 20px; border: 2px solid #f0c25a; background: linear-gradient(120deg, var(--card), #fff4ec); }
.finish-card h2 { font-size: 26px; margin: 6px 0; }
.finish-score { font-size: 22px; font-weight: 800; color: #b26a00; margin: 0; }
@media (max-width: 600px) { .finish-card { flex-direction: column; text-align: center; } .score-main { font-size: 18px; } }
.result-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0 22px; }
.result-summary > div { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-align: center; }
.result-summary strong { display: block; font-size: 28px; color: #b26a00; }
.result-summary span { font-size: 13px; color: var(--muted); }
.exercise-card .score-line { font-weight: 800; color: #b26a00; }

/* Cat sits beside the play controls */
.mascot-inline { flex: 1; min-width: 260px; margin: 0 0 0 auto; align-items: center; position: relative; }
.mascot-inline .cat { width: 84px; height: 84px; }
.mascot-inline .bubble { margin-bottom: 0; }
.mascot-inline .bubble::before { bottom: auto; top: 50%; margin-top: -8px; }
.sound-toggle { position: absolute; top: -10px; right: -6px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card); font-size: 15px; line-height: 1; }
.sound-toggle[aria-pressed="false"] { opacity: .6; }
@media (max-width: 600px) { .mascot-inline { min-width: 100%; margin-left: 0; } .mascot-inline .cat { width: 72px; height: 72px; } }

/* Action rows: main actions first, help actions second */
.action-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.action-row > button { min-height: 50px; padding: 10px 8px; justify-content: center; white-space: nowrap; }
.main-actions { margin-top: 16px; }
.replay-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 10px;
    background: #2d7a6e; color: #fff; font-size: 14px; font-weight: 800; box-shadow: 0 6px 18px #0000003d;
}
.replay-button:hover { background: #246358; }
.replay-button.out { background: #c3ccd8; color: #ffffff; box-shadow: none; cursor: not-allowed; }
.help-actions > button { font-size: 13px; min-height: 44px; }
.action-row button:disabled { opacity: .45; cursor: default; }
@media (max-width: 600px) { .action-row { gap: 8px; } .action-row > button { font-size: 13px; padding: 8px 4px; gap: 5px; } }
.pending-badge { background: #d9922e; margin-left: -4px; align-self: center; }

/* Language switch */
.header-right { display: flex; align-items: center; gap: 10px; }
.lang-switch {
    display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 8px 12px;
    border: 1px solid var(--line-strong); border-radius: 9px; font-size: 13px; font-weight: 800; letter-spacing: .5px;
}
.lang-switch span { font-size: 18px; line-height: 1; }
.lang-switch:hover { border-color: var(--orange-ink); }
@media (max-width: 600px) { .lang-switch { min-height: 42px; padding: 6px 10px; } .header-right { gap: 6px; } }

/* Mock tests */
.mode-badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; border: 1px solid var(--line-strong); }
.mode-exam { color: #c0392b; } .mode-practice { color: #2f8f5b; }
.test-bar {
    position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap;
    padding: 12px 16px; margin: 14px 0; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-strong);
    box-shadow: 0 8px 24px #0000004d; font-size: 15px;
}
.test-bar .button { margin-left: auto; min-height: 42px; padding: 10px 18px; }
.test-section { margin-top: 22px; padding: 22px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); }
.test-section-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.test-section-head h2 { margin: 0; font-size: 24px; }
.practice-audio { width: min(100%, 420px); }
.exam-audio { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.exam-audio .replay-button { min-height: 46px; padding: 10px 16px; }
.exam-progress { width: 160px; height: 8px; border-radius: 99px; background: var(--field); overflow: hidden; border: 1px solid var(--line); }
.exam-progress span { display: block; height: 100%; width: 0; background: #2d7a6e; }
.q-group { margin-top: 20px; }
.q-group h3 { font-size: 17px; margin-bottom: 4px; }
.q-instructions { font-size: 14px; font-style: italic; margin: 0 0 10px; }
.q-heading { font-weight: 800; color: var(--ink); margin: 8px 0; }
.q-image { max-width: 100%; width: 640px; border-radius: 10px; margin: 8px 0 12px; background: #fff; }
.q-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; margin: 6px 0 12px; padding: 12px 14px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); font-size: 14px; }
.q-text { font-size: 15px; margin: 4px 0 4px 42px; color: var(--text); }
.q-item { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.q-num { min-width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--peach); color: var(--orange-ink); flex-shrink: 0; }
.q-gap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; color: var(--ink); line-height: 1.6; }
.q-gap input { width: 200px; min-height: 40px; padding: 6px 10px; }
.q-choice { border: 0; padding: 0; margin: 0; flex: 1; }
.q-choice legend { font-size: 15px; color: var(--ink); margin-bottom: 6px; padding: 0; }
.q-choice label { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 15px; color: var(--text); cursor: pointer; }
.q-choice input { width: 18px; min-height: 18px; height: 18px; accent-color: var(--orange); }
.q-letter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 15px; color: var(--ink); }
.q-letter select { width: 90px; min-height: 40px; padding: 6px 10px; }
.test-submit { display: flex; justify-content: center; margin: 26px 0; }
.test-submit .button { min-width: 220px; }
.result-hero { display: flex; align-items: center; gap: 20px; margin: 18px 0; padding: 22px; border-radius: 18px; border: 2px solid #f0c25a; background: linear-gradient(120deg, var(--card), var(--surface)); }
.result-band { font-size: 44px; font-weight: 800; color: #b26a00; margin: 0; line-height: 1.1; }
.result-score { font-size: 17px; margin: 4px 0 10px; color: var(--ink); }
.result-bubble { margin: 0; }
.result-bubble::before { display: none; }
.section-scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.section-scores > div { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); text-align: center; }
.section-scores strong { display: block; font-size: 22px; color: var(--ink); }
.section-scores span { font-size: 13px; color: var(--muted); }
.review-table { margin-top: 14px; }
.row-ok .mark { color: var(--ok); font-weight: 800; font-size: 18px; }
.row-bad .mark { color: var(--danger); font-weight: 800; font-size: 18px; }
.row-bad td:nth-child(2) { color: var(--danger); }
.progress.bad > span { background: linear-gradient(90deg, #c0392b, #e57364); }
@media (max-width: 600px) {
  .test-section { padding: 16px; }
  .q-gap input { width: 100%; }
  .q-text { margin-left: 0; }
  .section-scores { grid-template-columns: repeat(2, 1fr); }
  .result-hero { flex-direction: column; text-align: center; }
  .test-bar { font-size: 14px; }
}

/* List / grid switch (list is the default) */
.view-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.view-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 8px 12px; border: 0; background: var(--card); color: var(--muted); font-size: 13px; font-weight: 700; }
.view-btn + .view-btn { border-left: 1px solid var(--line-strong); }
.view-btn[aria-pressed="true"] { background: var(--peach); color: var(--orange-ink); }
.exercise-card .ex-stats { margin-top: auto; }
.exercise-card .ex-stats .progress { margin-top: 8px; }
.exercise-card > .button, .exercise-card .ex-actions { margin-top: 10px; align-self: flex-start; }
.exercise-grid.as-list { grid-template-columns: 1fr; gap: 12px; }
.as-list .exercise-card { flex-direction: row; align-items: center; gap: 18px; padding: 16px 20px; }
.as-list .exercise-card .icon-box { align-self: center; flex-shrink: 0; }
.as-list .ex-main { flex: 1; min-width: 0; }
.as-list .ex-main h2 { margin: 0; font-size: 19px; }
.as-list .ex-main .lesson-meta, .as-list .ex-main p { margin: 2px 0 0; }
.as-list .ex-stats { width: 260px; margin: 0; flex-shrink: 0; }
.as-list .ex-stats .progress { margin-top: 0; }
.as-list .ex-stats p { margin: 4px 0 0; }
.as-list .exercise-card > .button, .as-list .ex-actions { margin: 0; align-self: center; flex-shrink: 0; }
@media (max-width: 760px) {
  .as-list .exercise-card { flex-wrap: wrap; gap: 12px; }
  .as-list .ex-main { flex-basis: calc(100% - 70px); }
  .as-list .ex-stats { width: 100%; }
  .as-list .exercise-card > .button, .as-list .ex-actions { width: 100%; }
  .as-list .exercise-card > .button { justify-content: center; }
  .view-btn span { display: none; }
}

/* Header dropdown menus (Luyện tập, Đề thi) */
.nav-menu { position: relative; display: inline-flex; }
.nav-menu-btn { display: inline-flex; align-items: center; gap: 5px; padding: 12px 12px; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; border-radius: 8px; cursor: pointer; }
.nav-menu-btn svg { transition: transform .2s; }
.nav-menu.active > .nav-menu-btn { color: var(--orange-ink); }
.nav-menu-btn:hover { color: var(--orange-ink); }
.nav-dropdown {
    position: absolute; top: 100%; left: 50%; transform: translate(-50%, 6px); z-index: 20; min-width: 260px;
    padding: 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 16px 40px #00000066;
    opacity: 0; visibility: hidden; transition: opacity .15s, transform .15s, visibility .15s;
}
.nav-dropdown::before { content: ''; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }   /* keeps hover alive across the gap */
.nav-menu:hover .nav-dropdown, .nav-menu.open .nav-dropdown, .nav-menu:focus-within .nav-dropdown { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.nav-menu:hover .nav-menu-btn svg, .nav-menu.open .nav-menu-btn svg { transform: rotate(180deg); }
.nav-dropdown a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-weight: 400; }
.nav-dropdown a:hover, .nav-dropdown a:focus-visible { background: var(--card); color: var(--ink); }
.nav-dropdown .icon-box { padding: 9px; border-radius: 10px; flex-shrink: 0; }
.nav-dropdown strong { display: block; font-size: 15px; font-weight: 800; }
.nav-dropdown small { display: block; font-size: 12px; color: var(--muted); }
@media (hover: none) { .nav-menu:hover .nav-dropdown { opacity: 0; visibility: hidden; } .nav-menu.open .nav-dropdown { opacity: 1; visibility: visible; } }
@media (max-width: 600px) { .nav-menu-btn { padding: 12px 8px; } .nav-dropdown { min-width: 230px; } }
.nav-menu-btn, .site-nav > a { white-space: nowrap; }
@media (max-width: 600px) {
  .site-nav { position: relative; gap: 0; justify-content: space-between; font-size: 13px; }
  .site-nav > a { padding: 12px 6px; }
  .nav-menu { position: static; }
  .nav-menu-btn { padding: 12px 6px; gap: 3px; }
  .nav-dropdown { left: 0; right: 0; min-width: 0; transform: translateY(6px); }
  .nav-menu:hover .nav-dropdown, .nav-menu.open .nav-dropdown, .nav-menu:focus-within .nav-dropdown { transform: translateY(0); }
}

.status-free { background: #e3ecfb; color: #2457b3; }
.trial-note a { color: inherit; font-weight: 800; }

.map-chip small { font-size: 9px; letter-spacing: -1px; }
.map-chip small { color: var(--muted); opacity: .7; }
.map-chip.earned small { opacity: 1; font-size: 10px; }
.map-chip.earned.s1 small { color: #2f8f5b; } .map-chip.earned.s2 small { color: #8a5a00; } .map-chip.earned.s3 small { color: #c0392b; }
.progress-foot { margin: 16px 0 4px; }
.progress-foot .lesson-meta { margin-top: 6px; }
.bonus-badge { display: inline-block; padding: 4px 12px; border-radius: 99px; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 14px; }
.bonus-badge.has { border-style: solid; border-color: #e0a83a; color: #8a5a00; }
.dictation-card { padding-top: 12px; }
.dictation-top { margin-bottom: 4px; }
.dictation-top .outline-button { min-height: 0; height: 32px; width: 40px; padding: 0; justify-content: center; }
.transcript-vi { margin: 2px 0 6px; color: var(--muted); font-style: italic; font-size: .95em; }
.answer-line .word-count { font-size: 14px; font-weight: 400; color: var(--muted); white-space: nowrap; }

/* Nghe hiểu: video tests */
.video-wrap { position: relative; width: 100%; max-width: 820px; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-credit { margin: 6px 0 0; }
.chapters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.chapters span { padding: 2px 10px; border-radius: 99px; border: 1px solid var(--line-strong); font-size: 13px; color: var(--muted); }
.comp-card { padding-top: 0; overflow: hidden; }
.comp-thumb { position: relative; display: block; margin: 0 -20px 4px; aspect-ratio: 16 / 9; background: #dfe7f1; overflow: hidden; }
.comp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.comp-thumb .level-pill { position: absolute; top: 10px; right: 10px; padding: 3px 10px; border-radius: 99px; background: #f3c77a; color: #1b1b1b; font-weight: 800; font-size: 13px; }
.comp-thumb .play-dot { position: absolute; left: 12px; bottom: 12px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--orange); color: #fff; }
.exercise-grid.as-list .comp-thumb { margin: 0; width: 160px; flex: none; border-radius: 10px; }
.explain-row td { font-size: 14px; color: var(--muted); padding-top: 0; }
.comp-vocab { columns: 2; column-gap: 28px; padding-left: 18px; }
@media (max-width: 600px) { .comp-vocab { columns: 1; } .exercise-grid.as-list .comp-thumb { width: 100%; } }

/* Vocabulary before listening */
.vocab-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.vocab-card { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.vocab-card strong { font-size: 15px; }
.vocab-card span { color: var(--muted); font-size: 14px; }
.vocab-cards.quiz .vocab-card { cursor: pointer; }
.vocab-cards.quiz .vocab-card .vc-mean { visibility: hidden; }
.vocab-cards.quiz .vocab-card.shown .vc-mean { visibility: visible; }

.pre-vocab { margin-bottom: 16px; }
.pre-vocab-mini { margin: 10px 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; }
.pre-vocab-mini summary { cursor: pointer; font-weight: 700; }

.level-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.level-filter .chip { padding: 6px 16px; border-radius: 99px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.level-filter .chip.active { background: #f3c77a; border-color: #e0a83a; color: #1b1b1b; }

.vocab-card .vc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.vocab-card .vc-ipa, .vc-ipa { font-family: "Segoe UI", "Lucida Sans Unicode", "Arial Unicode MS", sans-serif; font-size: 13px; color: #2457b3; }
.vocab-card .vc-mean { color: var(--muted); font-size: 14px; }
.vocab-card .vc-ex { font-size: 12.5px; line-height: 1.45; color: var(--muted); opacity: .85; border-top: 1px dashed var(--line); padding-top: 5px; margin-top: 3px; }
/* Match game */
.vm-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.vm-top h2 { margin: 0 0 4px; }
.vm-side { display: flex; align-items: center; gap: 12px; }
.vm-time { font-size: 22px; font-weight: 800; min-width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
.vm-msg { min-height: 1.4em; margin: 10px 0 6px; }
.vm-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.vm-tile { min-height: 74px; padding: 10px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; transition: transform .12s, opacity .25s, background .15s; }
.vm-tile.vm-en { font-weight: 700; }
.vm-tile.vm-vi { color: #2457b3; }
.vm-tile:hover { border-color: #e0a83a; }
.vm-tile.sel { background: #fdf3dc; border-color: #e0a83a; }
.vm-tile.bad { background: #fbe6e4; border-color: #c0392b; animation: vm-shake .35s; }
.vm-tile.gone { opacity: 0; transform: scale(.85); pointer-events: none; }
@keyframes vm-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (max-width: 600px) { .vm-board { grid-template-columns: repeat(2, 1fr); } .vm-tile { min-height: 64px; font-size: 14px; } }

.status-member { background: #fdf3dc; color: #8a5a00; }
.comp-card.locked .comp-thumb img { filter: grayscale(.6) brightness(.6); }
.comp-card.locked .play-dot { background: #fdf3dc; font-size: 18px; }

/* Từ vựng */
.vocab-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.vocab-topic-card { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.vocab-topic-card:hover { border-color: #e0a83a; transform: translateY(-2px); }
.vocab-topic-card.locked { opacity: .75; }
.vt-emoji { font-size: 34px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; background: #eef3f9; flex: none; }
.vt-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vt-body strong { font-size: 17px; }
.vt-body small { color: var(--muted); }
.vt-progress { display: flex; gap: 4px; margin-top: 2px; }
.vt-progress i { width: 18px; height: 5px; border-radius: 3px; background: var(--line-strong); }
.vt-progress i.on { background: #2f8f5b; }
.vocab-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 16px; }
.vtab { padding: 9px 16px; border-radius: 99px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.vtab.active { background: #f3c77a; border-color: #e0a83a; color: #1b1b1b; }
.voice-pick { margin-left: auto; }
.vt-toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 12px; }
.vt-card .vc-head { align-items: center; }
.vc-emoji { font-size: 20px; }
.vc-pos { font-size: 12px; color: var(--muted); font-style: italic; }
.vc-tools { margin-left: auto; display: flex; gap: 2px; }
.say, .star { background: transparent; border: 0; cursor: pointer; font-size: 17px; padding: 2px 4px; color: var(--muted); line-height: 1; }
.say.small { font-size: 13px; }
.star.on { color: #8a5a00; }
.vc-ex mark, .fc-ex mark { background: transparent; color: #8a5a00; font-weight: 700; }
.flip-study { margin-bottom: 18px; }
.flip-card { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; border-radius: 20px; border: 1px solid var(--line-strong); background: linear-gradient(160deg, #ffffff, #eef3f9); cursor: pointer; outline: none; }
.flip-card:focus { border-color: #e0a83a; }
.flip-card strong { font-size: 32px; }
.flip-card .fc-emoji { font-size: 44px; }
.flip-card.back { background: linear-gradient(160deg, #fff8e6, #fdeccb); }
.fc-mean { font-size: 24px; font-weight: 700; color: #8a5a00; }
.fc-ex { color: var(--muted); max-width: 560px; }
.fc-tools { display: flex; gap: 8px; }
.fc-tools .say, .fc-tools .star { font-size: 24px; }
.flip-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; }
.ex-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ex-pick { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.ex-pick.active { border-color: #e0a83a; color: #8a5a00; font-weight: 700; }
.ex-list { padding-left: 22px; }
.ex-list li { margin-bottom: 14px; padding: 8px 10px; border-radius: 10px; }
.ex-list li.ok { background: rgba(143, 209, 154, .08); }
.ex-list li.bad { background: #fdecea; }
.ex-list .fb { margin: 6px 0 0; font-weight: 700; }
.ex-list li.ok .fb { color: #2f8f5b; } .ex-list li.bad .fb { color: #c0392b; }
.ex-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ex-opts label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.blank { display: inline-block; min-width: 70px; border-bottom: 2px solid #e0a83a; color: transparent; }
.word-box { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.word-box span { padding: 3px 10px; border-radius: 8px; background: #eef3f9; font-weight: 700; }
.gap-in { width: 140px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font: inherit; }
.gap-in.wide { width: 220px; }
.ex-result { font-size: 17px; margin: 12px 0; }
.sp-head { display: flex; justify-content: space-between; color: var(--muted); font-weight: 700; }
.sp-q { font-size: 22px; font-weight: 700; margin: 14px 0; }
.sp-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.next-step .button { margin: 4px 6px 4px 0; }
.box-level { padding: 2px 10px; border-radius: 99px; font-size: 13px; background: var(--line); }
.box-0 { background: #fbe6e4; color: #b3261e; } .box-1, .box-2 { background: #fdf3dc; color: #8a5a00; } .box-3 { background: #e3ecfb; color: #2457b3; } .box-4, .box-5 { background: #e3f4ea; color: #1f7a48; }
.fb-ok { color: #2f8f5b; font-weight: 700; } .fb-bad { color: #c0392b; font-weight: 700; }
@media (max-width: 600px) { .voice-pick { margin-left: 0; } .flip-card strong { font-size: 26px; } .sp-opts { grid-template-columns: 1fr; } }

/* Vocab: option rows and topic cards (picture-banner style) */
.ex-opts label { font-size: 16px; font-weight: 400; line-height: 1.4; }
.ex-opts input[type="radio"] { flex: none; width: 16px; height: 16px; margin: 0; }
.vocab-topics { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.vocab-topic-card { flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden; }
.vt-banner { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; }
.vt-big { font-size: 72px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
.vt-label { position: absolute; right: 12px; bottom: 12px; padding: 3px 10px; background: #fff; color: #e2557e; font-weight: 900; font-size: 14px; letter-spacing: .02em; border-radius: 4px; max-width: 85%; }
.vt-banner .level-pill { position: absolute; top: 10px; right: 10px; padding: 3px 10px; border-radius: 99px; background: #f3c77a; color: #1b1b1b; font-weight: 800; font-size: 13px; }
.vt-lock { position: absolute; top: 10px; left: 10px; font-size: 20px; }
.vocab-topic-card .vt-body { padding: 14px 16px 16px; }
.vt-c0 .vt-banner { background: linear-gradient(135deg, #ff7aa2, #f6a96a); }
.vt-c1 .vt-banner { background: linear-gradient(135deg, #4facfe, #00c6c2); }
.vt-c2 .vt-banner { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }
.vt-c3 .vt-banner { background: linear-gradient(135deg, #43e97b, #2bb3a0); }
.vt-c4 .vt-banner { background: linear-gradient(135deg, #f7971e, #ffd200); }
.vt-c5 .vt-banner { background: linear-gradient(135deg, #5b6cf0, #8e54e9); }
.vt-c6 .vt-banner { background: linear-gradient(135deg, #ff6a6a, #c94b7c); }
.vt-c7 .vt-banner { background: linear-gradient(135deg, #30cfd0, #3a6fd8); }
.vocab-topic-card.locked .vt-banner { filter: grayscale(.5) brightness(.75); }

.vt-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vt-credit { margin-top: 18px; }

.vt-ring { position: absolute; top: 48px; right: 12px; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#2f8f5b calc(var(--p) * 1%), #e0e6ee 0); box-shadow: 0 2px 8px rgba(27,42,65,.15); }
.vt-ring::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.vt-ring b { position: relative; font-size: 12.5px; color: var(--ink); }
.vt-ring.full { background: conic-gradient(#f3c77a 100%, #f3c77a 0); }
.vt-ring.full b::after { content: ' 🏆'; font-size: 9px; }

.vocab-topic-card[hidden] { display: none; }

/* Grammar ("Ngữ pháp") */
.grammar-list { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.grammar-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 14px; color: inherit; text-decoration: none; background: #fff; }
.grammar-card:hover { border-color: #e0a83a; }
.grammar-card.locked { opacity: .7; }
.gc-num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #f3c77a; color: #1b1b1b; font-weight: 800; }
.gc-body { flex: 1; display: grid; gap: 2px; min-width: 0; }
.gc-body small { color: var(--muted); }
.gc-ring { position: relative; top: auto; right: auto; flex: none; }
.gc-lock { font-size: 20px; }
.grammar-page h3 { margin: 18px 0 6px; }
.g-intro { font-size: 17px; }
.g-table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; }
.g-table th, .g-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-strong); text-align: left; vertical-align: top; }
.g-table th { color: #8a5a00; }
.g-tip { padding: 10px 14px; border-left: 4px solid #e0a83a; background: #fff7e6; border-radius: 6px; }
.g-mistakes ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.g-mistakes li { display: grid; gap: 2px; }
.g-wrong { color: #c0392b; text-decoration: line-through; text-decoration-thickness: 1px; }
.g-right { color: #2f8f5b; }
.g-mistakes small { color: var(--muted); }
.g-practice-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.g-ex { border: 0; padding: 0; margin: 0 0 18px; }
.g-ex legend { font-weight: 800; font-size: 17px; padding: 0; }
.g-items { padding-left: 22px; display: grid; gap: 12px; }
.g-q { margin: 0 0 6px; }
.g-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.g-opt { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 16px; cursor: pointer; }
.g-opt input { width: 16px; height: 16px; margin: 0; }
.g-wrongq { font-style: italic; }
.g-item .gap-in { margin: 0 4px; }
.g-item.ok .gap-in { border-color: #2f8f5b; } .g-item.bad .gap-in { border-color: #c0392b; }
.g-fb p { margin: 4px 0 0; }
.g-explain { color: var(--muted); font-size: 14.5px; }

/* Grammar gallery: photo banner with a speech bubble showing the grammar in a real sentence */
.grammar-gallery .g-bubble { position: absolute; left: 12px; bottom: 12px; max-width: 78%; padding: 8px 12px; background: #fff; color: #1b1b1b; font-weight: 800; font-size: 15px; line-height: 1.25; border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.25); text-align: left; }
.grammar-gallery .g-bubble::after { content: ''; position: absolute; left: 18px; top: -8px; border: 8px solid transparent; border-top: 0; border-bottom-color: #fff; }
.grammar-gallery .g-bubble strong { color: #e2264d; }
.grammar-gallery .vt-banner .level-pill { left: 10px; right: auto; }
.grammar-gallery .vt-ring { top: 10px; right: 10px; }
.grammar-gallery .vt-lock { position: absolute; top: 10px; left: auto; right: 12px; font-size: 22px; }
.grammar-gallery .vt-body strong { font-size: 16.5px; line-height: 1.3; }
.grammar-card-g[hidden] { display: none; }

/* IELTS Reading: passage beside the questions (stacked on small screens) */
.reading-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 16px; }
.reading-passage { position: sticky; top: 14px; max-height: calc(100vh - 110px); overflow-y: auto; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-deep); line-height: 1.7; }
.reading-passage h3 { margin: 0 0 4px; font-size: 22px; color: var(--ink); }
.reading-sub { margin: 0 0 14px; color: var(--muted); font-style: italic; }
.reading-passage p { margin: 0 0 14px; }
.para-label { display: inline-block; min-width: 26px; margin-right: 6px; color: var(--orange-ink); }
.reading-questions .q-group:first-child { margin-top: 0; }
.q-choice label:has(input[value="TRUE"]), .q-choice label:has(input[value="FALSE"]), .q-choice label:has(input[value="NOT GIVEN"]),
.q-choice label:has(input[value="YES"]), .q-choice label:has(input[value="NO"]) { display: inline-flex; margin-right: 14px; }
@media (max-width: 900px) {
  .reading-split { grid-template-columns: 1fr; }
  .reading-passage { position: static; max-height: none; }
}

/* Reading tests: white paper, black text (the same variables, redefined for this page) */
body:has(.reading-mode) main { background: #fff; }
.reading-mode {
  --bg: #fff; --bg-deep: #fff; --card: #fff; --surface: #f5f5f5; --field: #fff; --line: #d6d6d6; --line-strong: #b8b8b8;
  --ink: #2b2b2b; --text: #3a3a3a; --muted: #6b6b6b; --peach: #f1f1f1; --orange-ink: #a5461f; --ok: #1d7a35; --danger: #b3261e;
  color-scheme: light; color: var(--text); background: #fff; padding-bottom: 110px;
}
.reading-mode .q-choice input { accent-color: #2f8f5b; }
.reading-mode h1, .reading-mode h2, .reading-mode h3, .reading-mode strong, .reading-mode legend { color: var(--ink); }
.reading-mode .eyebrow a { color: var(--orange-ink); }
.reading-mode .test-bar { box-shadow: 0 6px 18px #0000001f; }
.reading-mode .test-section { box-shadow: none; }
.reading-mode .reading-passage { background: #fff; border-color: #dcdcdc; font-family: Georgia, "Times New Roman", serif; font-size: 16.5px; color: #333; }
.reading-mode input, .reading-mode select { background: #fff; color: #2b2b2b; border-color: #c4c4c4; }
.reading-mode .outline-button { color: #2b2b2b; border-color: #c4c4c4; background: #fff; }
/* Bar at the bottom of the screen: timer, question numbers (green = answered), full screen, submit */
.reading-mode .test-bar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 60; margin: 0; border-radius: 0; border-width: 1px 0 0;
  background: #fafafa; box-shadow: 0 -4px 16px #00000014; padding: 10px 18px; flex-wrap: nowrap; }
.reading-mode .test-bar .button { margin-left: 0; }
.qnav { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.qnav-list { flex: 1; min-width: 0; display: flex; gap: 5px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; padding: 2px; }
.qnav-list::-webkit-scrollbar { display: none; }
.qn { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 7px; border: 1px solid #cfcfcf; background: #fff; color: #444; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.qn:hover { border-color: #2f8f5b; }
.qn.done { background: #2f8f5b; border-color: #2f8f5b; color: #fff; }
.qnav-arrow { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; border: 1px solid #cfcfcf; background: #fff; color: #333; font-size: 20px; line-height: 1; cursor: pointer; }
.q-item.qflash { animation: qflash 1.2s ease; border-radius: 8px; }
@keyframes qflash { 0%, 40% { background: #e5f4ec; } 100% { background: transparent; } }
.rd-tip { margin: -4px 0 6px; }
mark.hl { background: #ffe14d; color: #111; border-radius: 2px; padding: 0 1px; cursor: pointer; }
.rd-tool { position: fixed; z-index: 1100; display: flex; gap: 6px; padding: 6px; border-radius: 10px; background: #111; box-shadow: 0 6px 18px #0000004d; }
.rd-tool button { border: 0; border-radius: 7px; padding: 7px 12px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; background: #ffe14d; color: #111; }
.rd-tool button.rd-clear { background: #fff; }
.rd-fs { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; border: 1px solid #c4c4c4; background: #fff; color: #333; cursor: pointer; }
.rd-fs .fs-off, .rd-fs[aria-pressed="true"] .fs-on { display: none; }
.rd-fs[aria-pressed="true"] .fs-off { display: block; }
@media (max-width: 760px) {
  .reading-mode .test-bar { flex-wrap: wrap; padding: 8px 10px; gap: 6px 10px; }
  .reading-mode .test-bar .qnav { order: 5; flex-basis: 100%; }
  .reading-mode .test-bar #tp-saved { display: none; }
  .reading-mode .test-bar .rd-fs { margin-left: auto; }
  .reading-mode { padding-bottom: 150px; }
}
/* Full screen: the test fills the screen (real full screen where supported, a fixed overlay elsewhere) */
.reading-mode:fullscreen, .reading-mode.fs-fallback { max-width: none; width: 100%; margin: 0; padding: 14px 24px 40px; overflow-y: auto; background: #fff; }
.reading-mode.fs-fallback { position: fixed; inset: 0; z-index: 1000; }
.reading-mode:fullscreen .eyebrow, .reading-mode.fs-fallback .eyebrow, .reading-mode:fullscreen > h1, .reading-mode.fs-fallback > h1 { display: none; }
.reading-mode:fullscreen .reading-passage, .reading-mode.fs-fallback .reading-passage { top: 14px; max-height: calc(100vh - 110px); }
body.rd-locked { overflow: hidden; }

/* Reading text size (A−/A+), tabs on small screens, reset */
.reading-mode .rd-text { font-size: var(--rd-size, 17px); }
.reading-mode .reading-passage.rd-text { font-size: calc(var(--rd-size, 17px) - 0.5px); }
.reading-mode .rd-text .q-gap, .reading-mode .rd-text .q-choice legend, .reading-mode .rd-text .q-choice label,
.reading-mode .rd-text .q-letter, .reading-mode .rd-text .q-list, .reading-mode .rd-text .q-instructions { font-size: calc(var(--rd-size, 17px) - 2px); }
.rd-size { display: flex; flex: 0 0 auto; border: 1px solid #c4c4c4; border-radius: 10px; overflow: hidden; }
.rd-size button { width: 40px; height: 40px; border: 0; background: #fff; color: #333; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }
.rd-size button + button { border-left: 1px solid #c4c4c4; }
.rd-reset { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px; border: 1px solid #c4c4c4; background: #fff; color: #333; font-size: 20px; cursor: pointer; }
.rd-tabs { display: none; }
#tp-timer.time-low { color: #b3261e; }
@media (max-width: 900px) {
  .rd-tabs { display: flex; gap: 6px; margin-top: 14px; }
  .rd-tabs button { flex: 1; min-height: 42px; border-radius: 10px; border: 1px solid #c4c4c4; background: #fff; color: #333; font: inherit; font-weight: 700; cursor: pointer; }
  .rd-tabs button[aria-selected="true"] { background: #2f8f5b; border-color: #2f8f5b; color: #fff; }
  .reading-split[data-tab="passage"] .reading-questions, .reading-split[data-tab="questions"] .reading-passage { display: none; }
}
/* Cam Reading list */
.cam-test { margin-top: 26px; }
.cam-test h2 { font-size: 22px; margin-bottom: 10px; }
.cam-parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cam-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.cam-card h3 { margin: 0; font-size: 18px; color: var(--ink); }
.cam-part { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--orange-ink); }
.cam-card .lesson-meta { margin: 0; }
.cam-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.cam-actions form { margin: 0; }
.cam-card.locked { opacity: .7; }
@media (max-width: 900px) { .cam-parts { grid-template-columns: 1fr; } }

/* Reading results on the passage page */
.rd-result { display: flex; gap: 18px; align-items: center; margin: 14px 0 6px; padding: 16px 20px; border-radius: 16px; border: 2px solid #2f8f5b; background: #f3faf6; }
.rd-score { font-size: 46px; font-weight: 800; color: #2f8f5b; line-height: 1; white-space: nowrap; }
.rd-score span { font-size: 22px; color: #6b6b6b; }
.rd-result-title { margin: 0; font-weight: 800; color: #2b2b2b; font-size: 18px; }
.rd-result-msg { margin: 2px 0 8px; color: #3a3a3a; }
.rd-result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rd-result-actions form { margin: 0; }
.rd-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border-radius: 99px; border: 1.5px solid #2f6fdb; background: #fff; color: #2f6fdb; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; }
.rd-chip[aria-pressed="true"] { background: #2f6fdb; color: #fff; }
.rd-bar-score { font-weight: 800; font-size: 17px; }
.qn.right { background: #2f8f5b; border-color: #2f8f5b; color: #fff; }
.qn.wrong { background: #d0453a; border-color: #d0453a; color: #fff; }
.q-item.is-right .q-num { background: #e3f4ea; color: #2f8f5b; }
.q-item.is-wrong .q-num { background: #fbe6e4; color: #d0453a; }
.q-item { flex-wrap: wrap; }
.rd-review { flex-basis: 100%; margin-left: 42px; }
.rd-verdict { margin: 4px 0 6px; font-weight: 800; font-size: 15px; }
.q-item.is-right .rd-verdict { color: #2f8f5b; }
.q-item.is-wrong .rd-verdict { color: #d0453a; }
.reading-mode .q-choice label.opt-right { color: #1f7a48; font-weight: 700; background: #e3f4ea; border-radius: 8px; padding: 4px 10px; }
.q-choice label.opt-right input { accent-color: #2f8f5b; }
.reading-mode .q-choice label.opt-wrong { color: #d0453a; text-decoration: line-through; background: #fbe6e4; border-radius: 8px; padding: 4px 10px; }
.reading-mode input:disabled, .reading-mode select:disabled { opacity: 1; color: #2b2b2b; }
.rd-ex { margin: 0 0 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid #d8e2f3; background: #f6f9ff; font-size: 15px; line-height: 1.65; color: #333; }
.rd-ex p { margin: 0 0 4px; }
.rd-ex-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; font-weight: 800; color: #2f6fdb; }
.rd-ex-k { color: #2f6fdb; }
.rd-ex b:not(.rd-ex-k) { color: #1d4fa8; }
.rd-ev { border: 0; border-radius: 99px; padding: 5px 12px; background: #e3ecfb; color: #2f6fdb; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
mark.ev { background: #b9e6c9; color: #111; border-radius: 3px; padding: 1px 0; box-shadow: 0 0 0 2px #b9e6c9; }
.rd-gist { display: none; margin: -6px 0 14px; padding: 8px 12px; border-left: 4px solid #2f8f5b; border-radius: 6px; background: #f1f8f3; font-family: inherit; font-size: 14.5px; color: #2b4a36; }
.show-gist .rd-gist { display: block; }
@media (max-width: 600px) { .rd-review { margin-left: 0; } .rd-result { flex-direction: column; align-items: flex-start; } }

/* Passage text size: its own A−/A+ in the top-right corner of the passage box */
.reading-mode .reading-passage p, .reading-mode .reading-passage .rd-gist { font-size: var(--rd-psize, 18px); line-height: 1.75; }
.reading-mode .reading-passage .rd-gist { font-size: calc(var(--rd-psize, 18px) - 2px); }
.reading-mode .reading-passage h3 { font-size: calc(var(--rd-psize, 18px) + 6px); padding-right: 80px; }
.rd-psize { position: sticky; top: 0; z-index: 2; float: right; display: flex; margin: -6px -8px 0 8px; border: 1px solid #d0d0d0; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 2px 6px #0000000f; }
.rd-psize button { width: 32px; height: 28px; border: 0; background: #fff; color: #444; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.rd-psize button + button { border-left: 1px solid #d0d0d0; }
.rd-psize button:hover { background: #f1f1f1; }

/* Vocabulary road race (Nha Trang) */
.rr-stage { position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: #cdeefb; touch-action: manipulation; }
.rr-stage canvas { display: block; width: 100%; outline: none; }
.rr-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: #0d2a3f55; }
.rr-overlay[hidden] { display: none; }
.rr-card { max-width: 90%; padding: 18px 22px; border-radius: 16px; background: #fff; color: #1b2b3a; text-align: center; box-shadow: 0 10px 30px #0004; }
.rr-card h3 { margin: 0 0 6px; color: #1b2b3a; }
.rr-card p { color: #3a4a5a; margin: 0 0 12px; }
.rr-new { color: #1d7a4a !important; font-weight: 800; }
.rr .vm-side select { min-height: 40px; }

/* Games page */
.game-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 18px; }
.game-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(140deg, var(--card), var(--surface)); color: var(--text); text-decoration: none; }
.game-card:hover { border-color: var(--orange); }
.game-icon { font-size: 40px; }
.game-card strong { font-size: 20px; color: var(--ink); }
.game-level { margin-top: 26px; font-size: 20px; }
.game-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.game-topic { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; }
.game-topic img { width: 100%; height: 110px; object-fit: cover; }
.game-topic span { display: flex; flex-direction: column; padding: 10px 12px; }
.game-topic strong { color: var(--ink); font-size: 15px; }
.game-topic small { color: var(--muted); }
.game-topic:hover { border-color: var(--orange); }
.game-topic.locked { opacity: .6; }

.game-levels { margin: 18px 0 14px; }
.game-search { min-width: 240px; min-height: 44px; }
.game-topic[hidden], .game-topics[hidden] { display: none; }

.workspace-heading > div:has(.game-title-row) { flex: 1; }
.game-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.game-title-row h1 { margin: 0; }
.game-topic small { display: flex; align-items: center; gap: 6px; }
.game-lv { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--peach); color: var(--orange-ink); }
.game-title-row .game-search { width: 260px; flex: 0 0 260px; min-width: 0; }
.game-title-row h1 { flex: 1 1 320px; }

/* Road race: start menu, type box, replay */
.rr-menu { width: min(520px, 94%); }
.rr-label { margin: 10px 0 6px !important; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #6b7a8a !important; }
.rr-opts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rr-opts button { flex: 1 1 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 10px; border-radius: 12px; border: 2px solid #d5dbe2; background: #fff; color: #1b2b3a; font: inherit; font-weight: 800; cursor: pointer; }
.rr-opts button small { font-weight: 500; font-size: 11.5px; color: #6b7a8a; }
.rr-opts button.on { border-color: #1d7a4a; background: #e8f6ee; }
.rr-menu .rr-start { margin-top: 12px; min-width: 180px; }
.rr-type { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); width: min(420px, 86%); }
.rr-type[hidden], .rr-replay[hidden] { display: none; }
.rr-type input { width: 100%; min-height: 48px; padding: 10px 16px; border-radius: 12px; border: 3px solid #1d4f91; background: #ffffffee; color: #111; font-size: 18px; font-weight: 700; text-align: center; box-shadow: 0 6px 18px #0004; }
.rr-replay { position: absolute; left: 12px; top: 58px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #0d2a3fcc; color: #fff; font-size: 20px; cursor: pointer; }
.rr-mute { position: absolute; right: 12px; top: 58px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #0d2a3fcc; color: #fff; font-size: 18px; cursor: pointer; }

/* Road race competitions */
.rr-menu { max-height: 92%; overflow-y: auto; }
.rr-overlay { overflow-y: auto; padding: 8px 0; }
.rr-name, .rr-code, .rr-linkrow input { width: 100%; min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 2px solid #d5dbe2; background: #fff; color: #111; font: inherit; }
.rr-code { text-transform: uppercase; letter-spacing: .2em; font-weight: 800; }
.rr-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.rr-actions .outline-button { color: #1b2b3a; border-color: #c4ccd6; background: #fff; }
.rr-linkrow { display: flex; gap: 6px; }
.rr-linkrow .outline-button { white-space: nowrap; color: #1b2b3a; border-color: #c4ccd6; background: #fff; }
.rr-rank { margin: 4px 0 0; padding: 0; list-style: none; text-align: left; }
.rr-rank li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 10px; border-radius: 8px; color: #1b2b3a; font-size: 14px; }
.rr-rank li:nth-child(odd) { background: #f2f5f8; }
.rr-board { margin-top: 10px; }
.rr-vs { font-weight: 800; color: #1b2b3a !important; }
.rr-share { margin-top: 8px; }
.rr-bigcode { display: inline-block; padding: 2px 10px; border-radius: 8px; background: #1b2b3a; color: #ffd23f; letter-spacing: .15em; }
.rr-err { color: #c0392b !important; font-weight: 700; }
.rr-back { border: 0; background: none; color: #2f6fdb; font: inherit; font-weight: 700; cursor: pointer; }

/* Reading tests: tighter margins, and question text stays beside its number. */
.workspace.reading-mode { max-width: 1480px; padding-left: 16px; padding-right: 16px; }
.reading-mode .test-section { padding: 12px 14px; }
.reading-mode .reading-split { gap: 16px; }
.reading-mode .reading-passage { padding: 12px 14px; }
.q-letter, .q-gap { flex: 1 1 0; min-width: 0; }
@media (max-width: 760px) {
  .reading-mode .test-section { padding: 10px; }
}

/* Grammar and vocabulary lists: level chips on the left, one progress square per lesson/topic on the right
   (Anki-style), laid out in long rows so the block stays about as tall as the chips. */
.filter-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 24px; margin: 4px 0 16px; }
.filter-row .level-filter { margin: 0; }
.lesson-map { margin-left: auto; flex: 1 1 360px; max-width: 700px; display: flex; flex-direction: column; gap: 5px; }
.lm-text { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: 13px; line-height: 1.35; color: var(--muted); }
.lm-sum { font-weight: 700; color: var(--ink); }
.lm-legend { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; white-space: nowrap; }
.lm-legend .lm-cell { width: 10px; height: 10px; }
.lm-grid { display: flex; flex-wrap: wrap; gap: 3px; }
.lm-cell { display: block; width: 12px; height: 12px; border-radius: 3px; background: #e3e8ef; }
a.lm-cell:hover, a.lm-cell:focus-visible { outline: 2px solid #e0a83a; outline-offset: 1px; }
.lm-cell.lm-1 { background: #c6e7b8; }
.lm-cell.lm-2 { background: #8fcf74; }
.lm-cell.lm-3 { background: #4fa83d; }
.lm-cell.lm-4 { background: #2f7a2a; }
.lm-cell.lm-lock { background: transparent; box-shadow: inset 0 0 0 1px #c8d2df; }
.lm-cell[hidden] { display: none; }
@media (max-width: 760px) {
  .lesson-map { margin-left: 0; width: 100%; }
}
/* Search box and a button side by side on the title line: one row, same height, same top and bottom. */
.title-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-tools > .game-search, .title-tools > .outline-button { height: 46px; min-height: 46px; margin: 0; box-sizing: border-box; }
.title-tools > .game-search { width: 260px; flex: 1 1 150px; max-width: 260px; min-width: 0; }
.title-tools > .outline-button { padding-top: 0; padding-bottom: 0; white-space: nowrap; }
/* Word book shortcut at the end of a topic's tab row: same height as the voice picker beside it. */
.vocab-tabs .vt-wordbook { margin-left: auto; height: 44px; min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; white-space: nowrap; }
.vocab-tabs .vtab, .vocab-tabs .voice-pick select { height: 44px; min-height: 44px; box-sizing: border-box; }
@media (max-width: 600px) { .vocab-tabs .vt-wordbook { margin-left: 0; } }
/* Word book: one folder per book/level/lesson type, one table per unit or topic, each with its own review button. */
.wb-folder { margin-top: 22px; }
.wb-folder-head, .wb-source-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wb-folder-head h2, .wb-source-head h3 { margin: 0; }
.wb-folder-head h2 small, .wb-source-head h3 small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.wb-folder-head .outline-button, .wb-source-head .outline-button { height: 40px; min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; box-sizing: border-box; }
.wb-source { margin-top: 12px; }
.wb-source-head { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.wb-source-head h3 { font-size: 16px; }

/* Fluid page width: the page fills the window (with side margins that grow with it) instead of staying a
   1240px block in the middle, so zooming out or a wide screen shows more content rather than empty sides.
   --page-max only stops lines getting absurdly long on very wide screens. */
:root { --page-max: 2400px; --gutter: clamp(16px, 3.2vw, 64px); }
.site-header, .hero, .site-footer, .workspace, .workspace.reading-mode { max-width: var(--page-max); padding-left: var(--gutter); padding-right: var(--gutter); }
.benefits { max-width: var(--page-max); padding-left: var(--gutter); padding-right: var(--gutter); }
.steps { max-width: none; margin-left: var(--gutter); margin-right: var(--gutter); }
.workspace-heading p { max-width: 90ch; }
.hero-art { max-width: 760px; justify-self: center; width: 100%; }

/* "Lớp của tôi": book pages and practice tests */
.cb-intro { font-size: 13px; line-height: 1.45; }
.cb-head { font-size: 22px; margin: 28px 0 12px; }
.cb-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.cb-unit { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 14px 16px; }
.cb-unit h3 { font-size: 17px; margin-bottom: 10px; }
.cb-unit h3 small { font-weight: 400; color: var(--muted); font-size: 14px; }
.cb-tests { display: flex; flex-direction: column; gap: 6px; }
.cb-test { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 9px; background: var(--surface); border: 1px solid transparent; font-size: 14.5px; }
.cb-test:hover { border-color: var(--orange-ink); color: var(--ink); }
.cb-test small { color: var(--muted); white-space: nowrap; }
.cb-vocab { background: var(--peach); }
.cb-pct { flex: 0 0 auto; font-size: 12.5px; padding: 2px 9px; border-radius: 99px; background: var(--bg-deep); color: var(--orange-ink); }
.cb-pct.new { color: var(--muted); font-weight: 400; }
.cb-pct.good { color: var(--ok); }
.cb-pct.full { background: #2f8f5b; color: #fff; }

.ct-page .ct-meta { font-size: 14px; margin-top: 4px; }
.ct-note { margin: 10px 0 0; font-size: 14px; color: var(--muted); line-height: 1.6; }
.ct-note a { color: var(--orange-ink); text-decoration: underline; }
.ct-sec { margin-top: 26px; }
.ct-inst { font-size: calc(var(--rd-size, 17px) + 1px); line-height: 1.4; padding-bottom: 8px; border-bottom: 2px solid #e4e4e4; margin-bottom: 12px; }
.ct-part { margin-bottom: 18px; }
.ct-part.has-passage { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.ct-passage { position: sticky; top: 12px; max-height: calc(100vh - 110px); overflow-y: auto; padding: 14px 18px; border: 1px solid #dcdcdc; border-radius: 12px;
  font-family: Georgia, "Times New Roman", serif; font-size: var(--rd-size, 17px); line-height: 1.75; color: #333; }
.ct-passage p { margin: 0 0 8px; }
.ct-p-h { font-weight: 700; text-align: center; font-size: 1.08em; }
.ct-p-li { padding-left: 1.3em; text-indent: -1em; }
.ct-p-li::before { content: "•"; display: inline-block; width: 1em; text-indent: 0; }
.ct-p-ln { margin-bottom: 3px !important; }
.ct-p-src { font-size: .88em; font-style: italic; color: var(--muted); }
.ct-passage img, .ct-stem img { max-width: min(100%, 520px); margin-top: 6px; border-radius: 6px; }
.ct-blank { font: inherit; border: 0; border-bottom: 2px dotted #9a9a9a; background: #f5f5f5; border-radius: 4px; padding: 0 6px; color: #2b2b2b; cursor: pointer; }
.ct-blank span { color: #888; }
.ct-blank span.on { color: #1f5fa8; font-weight: 700; }
.ct-blank.ok { background: #e3f4ea; } .ct-blank.no { background: #fbe6e4; }
.ct-blank.ok span { color: #1f7a48; font-weight: 700; }
.ct-blank.no span { color: #b3261e; font-weight: 700; }
.ct-q { display: flex; gap: 10px; padding: 10px 8px; border-bottom: 1px solid #efefef; font-size: var(--rd-size, 17px); }
.ct-n { flex: 0 0 auto; min-width: 2.2em; font-weight: 800; color: var(--ink); }
.ct-main { flex: 1; min-width: 0; }
.ct-stem { margin-bottom: 8px; line-height: 1.6; }
.ct-gap { display: inline-block; width: 4.5em; border-bottom: 1.5px solid #555; vertical-align: baseline; }
.ct-opts { display: grid; gap: 6px 14px; }
.ct-opts.c4 { grid-template-columns: repeat(4, minmax(0, max-content)); }
.ct-opts.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ct-opt { display: flex; align-items: flex-start; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 8px; cursor: pointer; line-height: 1.45; }
.ct-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ct-bub { flex: 0 0 auto; display: grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; border: 1.5px solid #9a9a9a; font-size: .8em; font-weight: 800; color: #555; }
.ct-opt:hover .ct-bub { border-color: #2f8f5b; }
.ct-opt:has(input:checked) .ct-bub { background: #2f8f5b; border-color: #2f8f5b; color: #fff; }
.ct-opt:has(input:focus-visible) { outline: 3px solid #2f8f5b; }
.ct-opt.is-key { background: #e3f4ea; color: #1f7a48; font-weight: 700; }
.ct-opt.is-key .ct-bub { background: #2f8f5b; border-color: #2f8f5b; color: #fff; }
.ct-opt.is-miss { background: #fbe6e4; color: #b3261e; text-decoration: line-through; }
.ct-opt.is-miss .ct-bub { background: #d0453a; border-color: #d0453a; color: #fff; }
.ct-typed { width: 100%; max-width: 640px; padding: 8px 12px; border: 1px solid #c4c4c4; border-radius: 9px; background: #fff; color: #2b2b2b; font-size: inherit; }
input.ct-typed { max-width: 320px; }
.ct-q.r-right .ct-typed { border-color: #2f8f5b; background: #f3faf6; }
.ct-q.r-wrong .ct-typed, .ct-q.r-blank .ct-typed { border-color: #d0453a; background: #fdf3f2; }
.ct-fb { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: #f7f7f7; font-size: calc(var(--rd-size, 17px) - 2px); line-height: 1.55; }
.ct-fb > * + * { margin-top: 6px; }
.ct-verdict .ok { color: #1f7a48; font-weight: 800; } .ct-verdict .no { color: #b3261e; font-weight: 800; } .ct-verdict .na { color: #6b6b6b; font-weight: 800; }
.ct-tag { display: inline-block; margin-right: 8px; padding: 0 8px; border-radius: 99px; background: #e8e8e8; font-size: .78em; font-weight: 800; color: #555; }
.ct-model { white-space: normal; }
.ct-self { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ct-self [aria-pressed="true"] { background: #2f8f5b; border-color: #2f8f5b; color: #fff; }
.ct-tr { color: #555; font-style: italic; }
.ct-only-wrong .ct-q.r-right, .ct-only-wrong .ct-q.r-none { display: none; }
.ct-end { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 26px 0; }
.ct-done .ct-end .outline-button { order: -1; }
@media (max-width: 860px) {
  .ct-part.has-passage { grid-template-columns: 1fr; }
  .ct-passage { position: static; max-height: none; }
  .ct-opts.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cb-units { grid-template-columns: 1fr; }
}
/* The last menu (Lớp của tôi) opens towards the left so it stays on screen */
.site-nav > .nav-menu:last-child .nav-dropdown { left: auto; right: 0; transform: translate(0, 6px); }
.site-nav > .nav-menu:last-child:hover .nav-dropdown, .site-nav > .nav-menu:last-child.open .nav-dropdown, .site-nav > .nav-menu:last-child:focus-within .nav-dropdown { transform: translate(0, 0); }

/* Lines between questions in notes and forms: same size as the questions; headings bold like the paper */
.reading-mode .rd-text .q-text { font-size: calc(var(--rd-size, 17px) - 2px); color: var(--ink); line-height: 1.6; }
.q-text.q-sub { font-weight: 800; color: var(--ink); margin-top: 16px; }
.reading-mode .rd-text .q-text.q-sub { font-size: calc(var(--rd-size, 17px) - 1px); }
.reading-mode .rd-text .q-heading { font-size: calc(var(--rd-size, 17px) + 2px); text-align: center; margin: 12px 0 6px; }
/* Nghe hiểu: folders (e.g. the parts of one FCE test) and audio-only tests have an icon instead of a video picture */
.comp-thumb .folder-big { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; background: linear-gradient(135deg, #e8eff8, #d6e3f3); }
.exercise-grid.as-list .comp-thumb .folder-big { font-size: 40px; }
/* Medium screens: logo and login on the first row, the menu centred on its own row (the full bar needs about 1430px with a long name) */
/* Header: one row, logo and buttons at the screen edges; the menu only drops to its own row when it really can't fit */
.site-header { max-width: none; padding-left: clamp(12px, 1.6vw, 28px); padding-right: clamp(12px, 1.6vw, 28px); }
@media (min-width: 601px) {
  .site-header { flex-wrap: nowrap; }
  .site-header .site-nav { flex: 1 1 auto; justify-content: center; gap: 2px; min-width: 0; }
  .site-header .nav-menu-btn, .site-header .site-nav > a { padding: 12px 10px; }
}
@media (max-width: 1500px) and (min-width: 901px) {
  .site-header .nav-menu-btn, .site-header .site-nav > a { padding: 12px 6px; font-size: 13.5px; }
  .site-header .logo { font-size: 17px; }
}
/* Listening review: transcript that lights up with the recording (karaoke) */
.rd-play { border: 0; border-radius: 99px; padding: 5px 12px; background: #e6f4ec; color: #1f7a48; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.rd-play:hover { background: #d3ecdf; }
.karaoke .k-line { padding: 4px 8px; margin: 0 -8px 10px; border-radius: 8px; transition: background .2s; }
.karaoke .k-line.k-on { background: #fff7d1; }
.karaoke .k-sp { color: #a5461f; font-family: Literata, Georgia, serif; }
.karaoke .k-w { cursor: pointer; border-radius: 4px; padding: 0 1px; transition: background .12s, color .12s; }
.karaoke .k-w:hover { background: #eef3fb; }
.karaoke .k-w.said { color: #7a5b00; }
.karaoke .k-w.now { background: #ffd84d; color: #111; }
/* Listening tests: the section title and audio player stay at the top of the screen while the questions scroll */
.listening-mode .test-section-head { position: sticky; top: 0; z-index: 30; background: #fff; margin: -12px -14px 0; padding: 10px 14px 12px; border-radius: 14px 14px 0 0; }
.listening-mode .reading-passage { top: 84px; max-height: calc(100vh - 84px - 100px); }
@media (max-width: 900px) {
  .listening-mode .test-section-head audio { width: 100%; }
}
@media (max-width: 760px) {
  .listening-mode .test-section-head { margin: -10px -10px 0; padding: 6px 10px 8px; gap: 4px; }
  .listening-mode .test-section-head h2 { font-size: 16px; }
  .listening-mode .test-section-head audio { height: 40px; }
}
.status-draft { background: #f1e8fb; color: #6b3fa0; }
/* Home: one city picture for each part of the site */
.cities { max-width: var(--page-max); margin: auto; padding: 55px var(--gutter) 10px; }
.city-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.city-card { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--card); border: 1px solid var(--line); transition: transform .2s, border-color .2s, box-shadow .2s; }
.city-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; transition: transform .35s; }
.city-card:hover { transform: translateY(-4px); border-color: var(--orange-ink); box-shadow: 0 14px 30px #0000004d; color: inherit; }
.city-card:hover img { transform: scale(1.04); }
.city-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.city-body strong { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--ink); font-size: 15px; }
.city-body strong svg { color: var(--orange-ink); flex: none; }
.city-body small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
@media (max-width: 1100px) { .city-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .city-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .cities { padding-top: 40px; } }
/* "Vòng quanh thế giới" sample: passport stamps and a city lesson */
.world-sample { display: inline-block; padding: 6px 12px; border-radius: 99px; background: #f1e8fb; color: #6b3fa0; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.passport { margin: 18px 0 26px; padding: 16px; border-radius: 18px; background: #eef3f9; border: 2px dashed var(--line-strong); }
.passport-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: var(--ink); }
.passport-head span { color: var(--muted); font-size: 14px; }
.passport-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.pp-city { position: relative; border-radius: 12px; overflow: hidden; background: var(--card); border: 1px solid var(--line); }
.pp-city img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; filter: grayscale(1) opacity(.45); transition: filter .4s; }
.pp-city.current img { filter: grayscale(.4) opacity(.8); }
.pp-city.current { border-color: var(--orange-ink); }
.pp-city.stamped img { filter: none; }
.pp-name { display: block; padding: 6px 8px; font-size: 12.5px; font-weight: 700; color: var(--ink); text-align: center; }
.pp-stamp { position: absolute; top: 24%; left: 50%; transform: translate(-50%, 0) rotate(-14deg) scale(1.6); opacity: 0; padding: 6px 10px; border: 3px solid #c0392b; border-radius: 10px; color: #c0392b; background: #fff8; font-size: 10px; font-weight: 800; letter-spacing: 1px; text-align: center; line-height: 1.3; transition: transform .45s cubic-bezier(.2,1.6,.4,1), opacity .3s; }
.pp-stamp b { font-size: 12px; }
.pp-city.stamped .pp-stamp { opacity: 1; transform: translate(-50%, 0) rotate(-14deg) scale(1); }
.world-lesson { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: center; padding: 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.world-hero { width: 100%; border-radius: 14px; }
.world-lesson h2 { margin: 8px 0; }
.world-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.world-steps li { padding: 6px 12px; border-radius: 99px; background: var(--surface); font-size: 14px; }
.world-h { margin: 30px 0 12px; font-size: 22px; }
.world-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.world-word { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.world-word:hover { border-color: var(--orange-ink); }
.ww-top { display: flex; justify-content: space-between; color: var(--ink); font-size: 17px; }
.ww-ipa { color: var(--muted); font-size: 13px; }
.ww-vi { color: var(--orange-ink); font-weight: 700; font-size: 14px; }
.world-word em { font-size: 13px; color: var(--muted); }
.world-reading { padding: 20px 22px; border-radius: 16px; background: #fff; color: #333; font-family: Georgia, serif; font-size: 17px; line-height: 1.75; }
.world-reading h3 { color: #222; margin-bottom: 8px; }
.world-reading p { margin-bottom: 12px; }
.world-reading .outline-button { color: #2b2b2b; border-color: #c4c4c4; background: #fff; }
.world-quiz { display: grid; gap: 12px; }
.wq { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--card); margin: 0; }
.wq legend { padding: 0 4px; color: var(--ink); font-weight: 700; }
.wq-opt { display: block; width: 100%; text-align: left; margin-top: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
.wq-opt:hover { border-color: var(--orange-ink); }
.wq-opt.right { background: #e3f4ea; border-color: #2f8f5b; color: #1f5a3a; }
.wq-opt.wrong { background: #fbe6e4; border-color: #d0453a; color: #b3261e; }
.wq-why { margin-top: 8px; font-size: 14px; color: var(--muted); }
.world-result { margin: 18px 0 40px; padding: 18px; border-radius: 16px; background: #e3f4ea; color: #1f5a3a; border: 1px solid #b9e6c9; }
.world-result p { margin: 6px 0 10px; }
@media (max-width: 900px) { .passport-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } .world-lesson { grid-template-columns: 1fr; } .world-hero { max-width: 320px; } }
/* Home hero: Saigon diorama with moving boats, motorbikes, clouds and birds (app/views/_saigon.php) */
.saigon { position: relative; aspect-ratio: 976 / 800; border-radius: 32px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 20%, #e3f0fb, #c9def3); box-shadow: 0 30px 80px #0000004d; }
.saigon img, .saigon svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.saigon img { animation: saigon-float 9s ease-in-out infinite; }
.saigon svg { animation: saigon-float 9s ease-in-out infinite; }
@keyframes saigon-float { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .saigon img, .saigon svg { animation: none; } }
.hero-art .label-one { left: -22px; top: auto; bottom: 22px; }
.hero-art .label-two { right: -14px; top: auto; bottom: 30px; }
.hero-art .sparkle { display: none; }
@media (max-width: 600px) {
  .hero-art .label-one { display: none; }
  .hero-art .label-two { right: 50%; transform: translateX(50%); bottom: -18px; white-space: nowrap; }
}
/* Home: the Saigon scene fills the first screen (same sky colour as the picture, so the edges disappear) */
.city-hero { position: relative; height: calc(100svh - 69px); min-height: 420px; background: #cfe4f6; display: grid; place-items: center; overflow: hidden; }
.city-hero .saigon { height: min(100%, 82vw); width: auto; max-width: 100%; aspect-ratio: 976 / 800; border-radius: 0; box-shadow: none; background: none; overflow: visible; }
.city-hero-down { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%) rotate(90deg); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #ffffffcc; color: #2b4a73; box-shadow: 0 6px 18px #0002; animation: city-down 2s ease-in-out infinite; }
.city-hero-down:hover { color: #a5461f; }
@keyframes city-down { 50% { transform: translateX(-50%) translateY(6px) rotate(90deg); } }
/* moving things never catch the mouse; the landmarks do */
.saigon-live > :not(.sg-spots) { pointer-events: none; }
.saigon-live.still > :not(.sg-spots):not(.sg-name) { display: none; }
.sg-name text { font: 800 28px Literata, Georgia, serif; letter-spacing: 2px; fill: #1d3557; text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: #ffffffcc; stroke-width: 6px; stroke-linejoin: round; }
.sg-spots polygon { fill: transparent; stroke: transparent; stroke-width: 3; cursor: pointer; transition: fill .2s, stroke .2s; outline: none; }
.sg-spots polygon.on, .sg-spots polygon:focus-visible { fill: #ffffff2e; stroke: #fff; stroke-dasharray: 8 6; }
.sg-tip { position: absolute; z-index: 5; width: 270px; padding: 12px 14px; border-radius: 14px; background: #fffffff2; color: #2b2b2b; box-shadow: 0 14px 34px #0003; font-size: 14px; line-height: 1.45; }
.sg-tip strong { display: block; font-size: 16px; color: #16243d; }
.sg-tip .sg-vi { display: block; color: #a5461f; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.sg-tip p { margin: 0 0 8px; }
.sg-say { border: 0; border-radius: 99px; padding: 4px 10px; background: #e3ecfb; color: #2f6fdb; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
@media (max-width: 600px) { .city-hero { height: min(calc(100svh - 150px), 118vw); min-height: 0; padding-bottom: 30px; } .sg-tip { width: 220px; font-size: 13px; } }
.sg-tip p { color: #333; }
/* Home: four other cities as small floating postcards in the corners of the first screen */
.postcard { position: absolute; z-index: 3; width: clamp(110px, 13vw, 210px); padding: 6px 6px 8px; border-radius: 14px; background: #fff; box-shadow: 0 14px 30px #1d3a5c33; color: #2b2b2b; transition: box-shadow .25s; }
.postcard img { width: 100%; aspect-ratio: 1; border-radius: 9px; display: block; }
.postcard span { display: block; margin-top: 6px; text-align: center; font-size: 12.5px; font-weight: 800; color: #2b4a73; }
.postcard:hover { box-shadow: 0 20px 40px #1d3a5c55; color: #2b2b2b; }
.pc-tl { left: 3%; top: 7%; --r: -6deg; animation: pc-float 7s ease-in-out infinite; }
.pc-bl { left: 4%; bottom: 9%; --r: 5deg; animation: pc-float 8s ease-in-out -2s infinite; }
.pc-tr { right: 3%; top: 8%; --r: 6deg; animation: pc-float 7.5s ease-in-out -4s infinite; }
.pc-br { right: 4%; bottom: 8%; --r: -5deg; animation: pc-float 8.5s ease-in-out -1s infinite; }
.postcard { transform: rotate(var(--r)); }
@keyframes pc-float { 0%, 100% { transform: translateY(0) rotate(var(--r)); } 50% { transform: translateY(-10px) rotate(calc(var(--r) * -.4)); } }
.postcard:hover { animation-play-state: paused; transform: scale(1.06) rotate(0deg); }
@media (prefers-reduced-motion: reduce) { .postcard { animation: none; } }
@media (max-width: 600px) { .postcard { width: 78px; padding: 4px 4px 5px; border-radius: 10px; } .postcard span { display: none; } .pc-tl, .pc-tr { top: 3%; } .pc-bl, .pc-br { bottom: 12%; } }
/* The menu drops to its own row only when it doesn't fit beside the logo and buttons (class set by the check after the header in layout.php) */
@media (min-width: 601px) {
  .site-header.nav-wrap { flex-wrap: wrap; row-gap: 0; padding-top: 8px; padding-bottom: 2px; }
  .site-header.nav-wrap .site-nav { order: 3; flex-basis: 100%; }
}
/* Nha Trang picture is wider (984 × 700) */
.saigon.scene-nt { aspect-ratio: 1004 / 720; }
.sg-name .sg-country { font-size: 19px; letter-spacing: 6px; fill: #3d5a80; }
.city-hero .saigon.scene-nt { height: min(100%, 72vw); }

/* Sea touches: sea-creature icons, soft sea colours that change from tile to tile, a wave-coloured stripe under the header */
:root { --sea-1: #dcf3ef; --sea-2: #e0ecfc; --sea-3: #fde4d9; --sea-4: #fcefd0; --sea-5: #ebe4fb; }
body { background: var(--bg) linear-gradient(180deg, #e3f3f8 0, rgba(246, 248, 251, 0) 460px) no-repeat; }
.site-header { background: #fff; border-bottom: 3px solid transparent; border-image: linear-gradient(90deg, #2bb3c0, #4f8df7, #9b7be8, #f4a261, #e76f51) 1; }
.site-footer { max-width: none; background: #e8f4f8; border-top: 3px solid transparent; border-image: linear-gradient(90deg, #e76f51, #f4a261, #9b7be8, #4f8df7, #2bb3c0) 1; }
.sea-ico { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; font-size: 22px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.logo > span { background: linear-gradient(135deg, #dcf3ef, #e0ecfc); }
.logo .sea-ico { font-size: 24px; }
.site-footer .sea-ico { font-size: 18px; }
.nav-dropdown .sea-ico { font-size: 19px; }
.icon-box .sea-ico { font-size: 22px; }
.icon-box:has(.sea-ico) { padding: 10px; }
.nav-dropdown a:nth-child(5n+1) .icon-box, .exercise-card:nth-child(5n+1) .icon-box, .benefit-grid article:nth-child(5n+1) .icon-box, .listening-banner:nth-of-type(2n+1) .icon-box { background: var(--sea-1); }
.nav-dropdown a:nth-child(5n+2) .icon-box, .exercise-card:nth-child(5n+2) .icon-box, .benefit-grid article:nth-child(5n+2) .icon-box, .listening-banner:nth-of-type(2n) .icon-box { background: var(--sea-2); }
.nav-dropdown a:nth-child(5n+3) .icon-box, .exercise-card:nth-child(5n+3) .icon-box, .benefit-grid article:nth-child(5n+3) .icon-box { background: var(--sea-3); }
.nav-dropdown a:nth-child(5n+4) .icon-box, .exercise-card:nth-child(5n+4) .icon-box { background: var(--sea-4); }
.nav-dropdown a:nth-child(5n+5) .icon-box, .exercise-card:nth-child(5n+5) .icon-box { background: var(--sea-5); }
.nav-dropdown a:hover, .nav-dropdown a:focus-visible { background: #eef8fa; }
.site-nav a.active, .nav-menu.active > .nav-menu-btn { color: #0e7c86; box-shadow: inset 0 -3px 0 #2bb3c0; border-radius: 8px 8px 0 0; }
.exercise-card { border-left: 4px solid var(--sea-1); }
.exercise-card:nth-child(5n+2) { border-left-color: #b9d4f7; } .exercise-card:nth-child(5n+3) { border-left-color: #f7c6b2; }
.exercise-card:nth-child(5n+4) { border-left-color: #f2d898; } .exercise-card:nth-child(5n+5) { border-left-color: #d3c6f4; }
.exercise-card:nth-child(5n+1) { border-left-color: #9fdcd3; }
.benefit-grid article:nth-child(1) { border-top: 4px solid #9fdcd3; } .benefit-grid article:nth-child(2) { border-top: 4px solid #b9d4f7; } .benefit-grid article:nth-child(3) { border-top: 4px solid #f7c6b2; }
.outline-button:hover { border-color: #2bb3c0; color: #0e7c86; }
h1 span { color: #0e7c86; }
@media (min-width: 601px) { .city-hero .saigon.scene-nt { transform: translateX(-3vw); } }
.steps { background: linear-gradient(120deg, #e1f3f4, #ecebfb); }

/* "Ai nhanh hơn?" – teacher-led class game (assets/quick-race.js) */
.qr { --p0: #14a3a8; --p1: #3b7ddd; --p2: #e2683c; --p3: #d99a12; --p4: #8b5cf6; --p5: #db4f8f; --p6: #2f9e57; --p7: #5a6b85; }
.qr .c0 { --pc: var(--p0); } .qr .c1 { --pc: var(--p1); } .qr .c2 { --pc: var(--p2); } .qr .c3 { --pc: var(--p3); }
.qr .c4 { --pc: var(--p4); } .qr .c5 { --pc: var(--p5); } .qr .c6 { --pc: var(--p6); } .qr .c7 { --pc: var(--p7); }
.qr-h { margin: 18px 0 8px; font-size: 16px; } .qr-h small { font-weight: 400; color: var(--muted); }
.qr-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.qr-mode { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--ink); }
.qr-mode small { color: var(--muted); font-size: 12.5px; }
.qr-mode.on { border-color: #2bb3c0; background: #e8f7f8; }
.qr-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-bottom: 10px; }
.qr-name { display: flex; align-items: center; gap: 8px; }
.qr-name input { flex: 1; min-width: 0; min-height: 42px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--field); font-size: 16px; }
.qr-dot { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--pc); color: #fff; font-size: 13px; font-weight: 800; }
.qr-del { border: 0; background: none; color: var(--muted); font-size: 16px; padding: 6px; }
.qr-err { color: var(--danger); font-weight: 700; min-height: 1.5em; margin: 8px 0 4px; }
.qr-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.qr-info { font-weight: 800; color: var(--muted); font-size: 14px; }
.qr-tools { display: flex; gap: 8px; }
.qr-players { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.qr-player { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 128px; padding: 10px 16px 12px; border-radius: 16px; border: 3px solid var(--pc); background: color-mix(in srgb, var(--pc) 10%, #fff); color: var(--ink); transition: transform .15s; }
.qr-player:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--pc) 18%, #fff); }
.qr-player strong { font-size: 17px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-score { font-size: 30px; line-height: 1; color: var(--pc); }
.qr-key { position: absolute; top: 4px; left: 8px; font-size: 11px; font-weight: 800; color: var(--pc); }
.qr-dots { display: flex; gap: 4px; }
.qr-dots i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--pc); }
.qr-dots i.on { background: var(--pc); }
.qr-player.flash { animation: qr-flash .6s; }
@keyframes qr-flash { 40% { transform: scale(1.12); box-shadow: 0 0 0 8px color-mix(in srgb, var(--pc) 30%, transparent); } }
.qr-card { position: relative; margin: 16px auto; max-width: 820px; min-height: 280px; padding: 30px 24px 22px; border-radius: 22px; background: linear-gradient(160deg, #f2fbfc, #eef2fd); border: 2px solid #cfe9ee; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.qr-card.pop { animation: qr-pop .35s ease-out; }
@keyframes qr-pop { from { transform: scale(.96); opacity: .3; } }
.qr-card.done { border-color: #9fdcd3; }
.qr-count { position: absolute; top: 10px; right: 16px; font-size: 13px; font-weight: 700; color: var(--muted); }
.qr-emoji { font-size: clamp(90px, 16vw, 170px); line-height: 1.1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.qr-pos { display: block; color: var(--muted); font-size: 16px; }
.qr-text { font-size: clamp(22px, 3.2vw, 34px); line-height: 1.4; color: var(--ink); font-weight: 600; max-width: 720px; }
.qr-gap { color: #0e7c86; font-weight: 800; }
.qr-hint { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: 2px; color: #b26a00; font-family: ui-monospace, Menlo, monospace; }
.qr-hint small { font: 600 14px Literata, Georgia, serif; letter-spacing: 0; color: var(--muted); }
.qr-answer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; padding: 12px 18px; border-radius: 14px; background: #fff; box-shadow: 0 4px 16px #1b2a4115; }
.qr-answer strong { font-size: clamp(26px, 4vw, 40px); color: #0e7c86; }
.qr-answer small { flex-basis: 100%; color: var(--text); font-size: 16px; }
.qr-answer .vc-ipa { font-size: 16px; color: #2457b3; }
.qr-say { border: 0; background: #e8f7f8; border-radius: 50%; width: 38px; height: 38px; font-size: 18px; }
.qr-got { flex-basis: 100%; font-weight: 800; font-size: 18px; color: var(--pc); }
.qr-ctrl { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.qr-ctrl kbd { margin-left: 4px; }
.qr-ctrl .button kbd { background: #ffffff33; color: #fff; border-color: #ffffff55; }
.qr-tip { text-align: center; }
.qr-win { position: relative; overflow: hidden; text-align: center; padding: 30px 16px; border-radius: 22px; background: linear-gradient(160deg, #fff8e6, #e8f7f8); }
.qr-trophy { font-size: 90px; line-height: 1; display: block; animation: qr-pop .6s; }
.qr-win h2 { font-size: clamp(30px, 5vw, 46px); color: #0e7c86; margin: 10px 0 14px; }
.qr-rank { max-width: 360px; margin: 0 auto 20px; text-align: left; }
.qr-rank li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; font-size: 18px; font-weight: 700; }
.qr-rank li:first-child { background: #fff3c4; }
.qr-rank b { margin-left: auto; font-size: 22px; }
.qr-confetti { position: absolute; inset: 0; pointer-events: none; }
.qr-confetti i { position: absolute; top: -40px; font-style: normal; font-size: 26px; animation: qr-fall 2.6s ease-in forwards; }
@keyframes qr-fall { to { transform: translateY(520px) rotate(320deg); opacity: 0; } }
.qr:fullscreen, .qr.qr-full { margin: 0; border-radius: 0; overflow-y: auto; padding: 24px 32px; background: var(--bg); }
.qr.qr-full { position: fixed; inset: 0; z-index: 1000; }
.qr:fullscreen .qr-card, .qr.qr-full .qr-card { max-width: 1100px; min-height: 46vh; }
.qr:fullscreen .qr-player, .qr.qr-full .qr-player { min-width: 160px; }
@media (max-width: 600px) { .qr-player { min-width: 0; flex: 1 1 40%; } .qr-card { min-height: 220px; padding: 26px 14px 16px; } .qr-ctrl kbd { display: none; } }
@media (prefers-reduced-motion: reduce) { .qr-card.pop, .qr-player.flash, .qr-trophy, .qr-confetti i { animation: none; } .qr-confetti { display: none; } }
/* "Ai nhanh hơn?" online rooms: join box, lobby, red buzzer light, the teacher's list of who pressed */
.qr-joinbox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 4px; padding: 10px 14px; border-radius: 12px; background: #fff7e6; border: 1px dashed #f2d898; }
.qr-joinbox input { width: 130px; min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fff; font: 800 18px ui-monospace, Menlo, monospace; letter-spacing: 3px; text-transform: uppercase; }
.qr-bigcode { display: inline-block; padding: 1px 10px; border-radius: 8px; background: #1b2a41; color: #ffd23f; font-family: ui-monospace, Menlo, monospace; letter-spacing: .15em; }
.qr-join { max-width: 420px; margin: 10px auto; text-align: center; }
.qr-join .qr-trophy { font-size: 64px; }
.qr-join input { width: 100%; min-height: 48px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line-strong); font-size: 18px; text-align: center; margin-top: 8px; }
.qr-linkbtn { border: 0; background: none; color: var(--muted); text-decoration: underline; }
.qr-lobby { text-align: center; padding: 10px 0; }
.qr-howto { font-size: 18px; line-height: 1.9; color: var(--ink); }
.qr-howto .qr-bigcode { font-size: 26px; }
.qr-roster { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 18px; }
.qr-chip { padding: 6px 14px; border-radius: 99px; background: color-mix(in srgb, var(--pc) 14%, #fff); border: 2px solid var(--pc); font-weight: 700; animation: qr-pop .3s; }
.qr-chip.me, .qr-player.me { box-shadow: 0 0 0 3px #ffd23f; }
.qr-players.qr-many .qr-player { min-width: 104px; padding: 8px 10px 10px; }
.qr-players.qr-many .qr-score { font-size: 24px; }
.qr-player.away { opacity: .5; }
.qr-fix { display: flex; gap: 4px; }
.qr-fix button { width: 24px; height: 22px; border-radius: 6px; border: 1px solid var(--line-strong); background: #fff; font-weight: 800; line-height: 1; padding: 0; }
.qr-stage { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 16px; align-items: start; margin: 14px 0; }
.qr-stage .qr-card { margin: 0; max-width: none; }
.qr-side { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.qr-light { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; background: #eef2f7; font-weight: 800; font-size: 18px; color: var(--muted); }
.qr-light i { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #c8d2df; box-shadow: inset 0 -4px 0 #0000001a; }
.qr-light.on { background: #fde4e1; color: #b3261e; font-size: 22px; }
.qr-light.on i { background: radial-gradient(circle at 35% 35%, #ff8a80, #e53935 60%, #b71c1c); box-shadow: 0 0 18px 6px #ff52525c; animation: qr-blink .8s infinite alternate; }
.qr-light.ok { background: #e3f4ea; color: #1f7a48; }
.qr-light.ok i { background: radial-gradient(circle at 35% 35%, #a5e8b8, #2f9e57 60%, #1f6e3c); box-shadow: 0 0 14px 4px #2f9e5744; }
@keyframes qr-blink { to { box-shadow: 0 0 6px 2px #ff52522e; filter: brightness(.85); } }
.qr-buzzes { display: flex; flex-direction: column; gap: 6px; }
.qr-buzzes li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.qr-buzzes li.active { border: 2px solid #e53935; background: #fff5f4; }
.qr-buzzes li.wrong { opacity: .55; }
.qr-rankno { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #1b2a41; color: #fff; font-weight: 800; font-size: 13px; }
.qr-buzzes li.active .qr-rankno { background: #e53935; }
.qr-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qr-who small { color: var(--muted); font-size: 12px; }
.qr-who em { font-style: normal; color: #2457b3; font-weight: 700; }
.qr-judge { display: flex; gap: 6px; }
.qr-judge button { border: 0; border-radius: 10px; padding: 8px 10px; font-weight: 800; font-size: 14px; }
.qr-ok { background: #2f9e57; color: #fff; } .qr-no { background: #fbe6e4; color: #b3261e; }
.qr-x { font-size: 13px; font-weight: 700; color: #b3261e; }
.qr-buzzer { align-self: center; width: min(240px, 70vw); aspect-ratio: 1; border-radius: 50%; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: radial-gradient(circle at 35% 30%, #ffb199, #f4743b 55%, #c4572b); color: #fff; box-shadow: 0 10px 0 #9c4322, 0 16px 30px #c4572b55; transition: transform .08s, box-shadow .08s; -webkit-tap-highlight-color: transparent; }
.qr-buzzer span { font-size: 64px; line-height: 1; }
.qr-buzzer b { font-size: 26px; }
.qr-buzzer:active:not(:disabled) { transform: translateY(8px); box-shadow: 0 2px 0 #9c4322, 0 6px 14px #c4572b55; }
.qr-buzzer.lit { background: radial-gradient(circle at 35% 30%, #ff8a80, #e53935 55%, #b71c1c); box-shadow: 0 4px 0 #8e1515, 0 0 40px 10px #ff525266; transform: translateY(6px); animation: qr-blink .8s infinite alternate; }
.qr-buzzer:disabled:not(.lit) { filter: grayscale(.8); opacity: .55; cursor: default; }
.qr-status { text-align: center; font-weight: 800; font-size: 17px; color: var(--ink); min-height: 1.6em; }
.qr-typed { display: flex; gap: 8px; }
.qr-typed input { flex: 1; min-width: 0; min-height: 42px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line-strong); font-size: 16px; }
.qr-rank li.me { outline: 3px solid #ffd23f; }
@media (max-width: 760px) { .qr-stage { grid-template-columns: 1fr; } .qr-howto { font-size: 15px; } }
/* "Ai nhanh hơn?": the Nha Trang scene, dimmed, behind the game; the teacher's own word list */
.rules.qr { background: linear-gradient(180deg, rgba(255, 255, 255, .80), rgba(244, 250, 252, .88)), url(/assets/nhatrang.webp?v=3) center 55% / cover no-repeat; border-color: #cfe9ee; }
.qr:fullscreen, .qr.qr-full { background: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(244, 250, 252, .86)), url(/assets/nhatrang.webp?v=3) center / cover no-repeat #f6f8fb; }
.qr .qr-card { background: linear-gradient(160deg, rgba(242, 251, 252, .93), rgba(238, 242, 253, .93)); backdrop-filter: blur(2px); }
.qr .qr-mode, .qr .qr-buzzes li, .qr .qr-light { backdrop-filter: blur(2px); }
.qr .qr-mode:not(.on) { background: rgba(255, 255, 255, .9); }
.qr-custom { width: 100%; margin-top: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; font: 15px/1.6 ui-monospace, Menlo, monospace; resize: vertical; }
.qr-cnote { margin-top: 4px; font-weight: 700; }
.qr-secret { margin: 0; padding: 8px 12px; border-radius: 10px; background: #fff7d6; border: 1px dashed #e0a83a; font-size: 14px; color: #6b4e00; }
.qr-secret b { font-size: 17px; color: #1b2a41; }

/* Plans: Free / Pro / Premium badges, the plan menu, the "Gói học" page and the manager's level tab */
.tier-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 800; border: 1px solid transparent; }
.tier-free { background: #e7f6ed; color: #1f7a48; border-color: #b9e6c9; }
.tier-pro { background: #e3ecfb; color: #2457b3; border-color: #b9d0f4; }
.tier-premium { background: #f1e8fb; color: #6b3fa0; border-color: #d8c4f2; }
.tier-select { min-height: 36px; padding: 4px 8px; border-radius: 9px; font-weight: 700; }
.tier-select.changed { outline: 3px solid #ffd23f; }
.plan-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.plan-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.plan-form p { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.plan-form input[type="date"] { min-height: 36px; padding: 4px 8px; border-radius: 9px; border: 1px solid var(--line-strong); }
.tier-help p { margin: 4px 0; }
.tier-section { margin-top: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 6px 16px 12px; }
.tier-section summary { cursor: pointer; list-style: none; }
.tier-section summary h2 { display: inline; font-size: 20px; }
.tier-group { margin-top: 12px; }
.tier-group-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.tier-group-head h3 { margin: 0; font-size: 16px; }
.tier-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.tier-bulk button { cursor: pointer; }
.tier-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 18px; margin-top: 6px; }
.tier-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.tier-title { min-width: 0; font-size: 14px; }
.tier-title small { color: var(--muted); }
.tier-save { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 16px; border-radius: 14px; background: #ffffffee; box-shadow: 0 -4px 18px #1b2a4114; }
.tier-changed { font-weight: 700; color: var(--muted); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
.plan-card { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 20px; border: 2px solid var(--line); background: var(--card); }
.plan-card.current { box-shadow: 0 0 0 4px #ffd23f66; }
.plan-free { border-color: #b9e6c9; } .plan-pro { border-color: #b9d0f4; } .plan-premium { border-color: #d8c4f2; background: linear-gradient(160deg, #fff, #f6f0fd); }
.plan-icon { font-size: 40px; line-height: 1; }
.plan-card h2 { margin: 0; }
.plan-card ul { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.plan-count { font-size: 13px; color: var(--muted); }

/* Student list: one compact row per account, class chips, ticks and a bulk bar */
.st-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 8px; }
.st-top input[type="search"] { flex: 1 1 280px; min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--field); }
.st-top .plan-summary { margin: 0; }
.st-classes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.st-classes .chip b { margin-left: 4px; font-size: 12px; opacity: .75; }
.st-wrap { overflow: visible; }
.st-table { font-size: 14px; }
.st-table th { padding: 8px 6px; font-size: 11.5px; }
.st-table td { padding: 6px; vertical-align: middle; }
.st-table td:first-child, .st-table th:first-child { width: 28px; text-align: center; }
.st-who { min-width: 190px; line-height: 1.3; }
.st-who strong { font-size: 14.5px; }
.st-who small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.st-who .status { font-size: 11px; padding: 1px 7px; margin-left: 4px; }
.st-table input:not([type="checkbox"]), .st-table select { min-height: 34px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--field); font-size: 13.5px; }
.st-class { width: 110px; }
.st-note { width: 100%; min-width: 120px; }
.st-plan { white-space: nowrap; }
.st-plan select { width: 118px; margin-right: 4px; }
.st-plan input[type="date"] { width: 132px; }
.st-save { min-height: 34px; padding: 4px 12px; }
.st-more { position: relative; }
.st-more summary { list-style: none; cursor: pointer; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line-strong); font-weight: 800; }
.st-more summary::-webkit-details-marker { display: none; }
.st-menu { position: absolute; right: 0; top: 40px; z-index: 20; width: 240px; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 28px #1b2a4126; }
.st-menu form { display: flex; flex-direction: column; gap: 6px; }
.st-menu small { color: var(--muted); font-size: 12px; }
.st-bulk { position: sticky; bottom: 0; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 10px; padding: 12px 16px; border-radius: 14px; background: #fff; border: 2px solid #9fdcd3; box-shadow: 0 -6px 20px #1b2a4118; }
.st-bulk label { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; }
.st-bulk input, .st-bulk select { min-height: 36px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line-strong); }
.st-count { color: #0e7c86; }
@media (max-width: 900px) {
  .st-table thead { display: none; }
  .st-table tr { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .st-table td { padding: 0; border: 0; }
  .st-table td:nth-child(3), .st-table td:nth-child(4), .st-table td:nth-child(5) { grid-column: 2 / -1; }
  .st-class, .st-note { width: 100%; }
}
/* Level menus on the "Gói & nội dung" tab: small and fixed on the right, so titles get the room */
.tier-list li { gap: 8px; }
.tier-list .tier-title { flex: 1 1 auto; }
.tier-list .tier-select { flex: 0 0 auto; width: 104px; min-height: 30px; padding: 2px 6px; font-size: 12.5px; }
/* Add-student forms: the plan menu and the date box are the same height as the other boxes */
.manager-form .form-row .tier-select, .manager-form .form-row input[type="date"] { width: 100%; min-height: 48px; }
.manager-form .form-row input, .manager-form .form-row select { height: 48px; min-height: 48px; box-sizing: border-box; }
.mail-ok { color: #1f7a48 !important; font-weight: 700; } .mail-bad { color: #b3261e !important; font-weight: 700; } .st-menu .check-row { font-size: 13px; margin: 0; }
/* Classes: "＋ Tạo lớp" chip and the bar for the selected class */
.st-newclass { position: relative; display: inline-block; }
.st-newclass summary { list-style: none; cursor: pointer; border-style: dashed; color: #0e7c86; }
.st-newclass summary::-webkit-details-marker { display: none; }
.st-newclass form { position: absolute; z-index: 20; top: 42px; left: 0; display: flex; gap: 6px; padding: 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 28px #1b2a4126; }
.st-newclass input { width: 220px; min-height: 38px; padding: 4px 10px; border-radius: 9px; border: 1px solid var(--line-strong); }
.st-newclass .button { min-height: 38px; padding: 6px 16px; }
.st-classbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; background: #e8f7f8; border: 1px solid #b9e3e6; }
.st-classbar .outline-button { min-height: 34px; padding: 4px 12px; font-size: 13.5px; }
.st-classname { font-size: 15px; margin-right: 6px; }
/* The plan badge in the header account button (replaces the arrow for students) */
.header-plan { padding: 2px 8px; font-size: 12px; line-height: 1.4; white-space: nowrap; }
/* IELTS skill pages (Listening / Writing / Speaking) */
.ielts-soon { margin: 18px 0 6px; padding: 14px 18px; border-radius: 14px; background: #fff7e6; border: 1px dashed #f2d898; }
.ielts-soon p { margin: 4px 0 0; }

/* The account and language buttons never wrap; a long student name is shortened */
.header-right { flex-shrink: 0; }
.header-login, .lang-switch { white-space: nowrap; flex-shrink: 0; }
.header-login { gap: 8px; }
.header-login .header-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
/* Student list: the "Lưu" button reports a background save; other actions show their message as a toast */
.st-save.st-ok { border-color: #2f9e57; color: #1f7a48; background: #e7f6ed; }
.st-save.st-bad { border-color: #d0453a; color: #b3261e; background: #fbe6e4; }
.mgr-toast { position: fixed; left: 50%; bottom: 20px; z-index: 2000; transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px)); margin: 0; box-shadow: 0 10px 30px #1b2a412e; transition: opacity .4s, transform .4s; }
.mgr-toast.gone { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
/* Manager tables for listening exercises and tests: one compact row per item */
.cm-table { font-size: 14px; }
.cm-table th { padding: 8px 8px; font-size: 11.5px; }
.cm-table td { padding: 8px; vertical-align: middle; }
.cm-table td strong { font-size: 14.5px; }
.cm-table td small { display: block; color: var(--muted); font-size: 12px; }
.cm-table .status { font-size: 11.5px; padding: 1px 8px; }
.cm-nowrap, .cm-num { white-space: nowrap; }
.cm-num { text-align: center; }
.cm-form { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.cm-form select { width: auto; min-height: 34px; padding: 3px 8px; border-radius: 8px; font-size: 13.5px; }
.cm-form .tier-select { width: 108px; }
.cm-check { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.cm-actions { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; }
.cm-actions form { margin: 0; }
.cm-table .outline-button { min-height: 34px; padding: 4px 11px; font-size: 13px; white-space: nowrap; gap: 5px; }
@media (max-width: 1100px) { .cm-form, .cm-actions { flex-wrap: wrap; } }
.cm-check input[type="checkbox"], td input[type="checkbox"] { width: 18px; min-width: 0; height: 18px; min-height: 0; padding: 0; margin: 0; flex: none; }
/* Content tab: "Hiện" switch beside each level menu; IELTS rows show their fixed level */
.tier-pub { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 2px 6px; border-radius: 8px; }
.tier-pub input[type="checkbox"] { width: 16px; height: 16px; min-width: 0; min-height: 0; margin: 0; }
.tier-pub.changed { outline: 3px solid #ffd23f; }
.tier-fixed { flex: none; width: 104px; justify-content: center; font-size: 12px; }
.tier-teacher { background: #fff1e6; color: #a5461f; border-color: #f7c6b2; }

/* "Lớp & chương trình": one card per class, program switches, students' extra programs */
.pg-card { margin-top: 16px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.pg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pg-head h2 { margin: 0; font-size: 19px; }
.pg-head h2 small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.pg-save { min-height: 38px; padding: 6px 16px; }
.pg-programs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 6px; }
.pg-label { font-weight: 800; font-size: 14px; margin-right: 4px; }
.pg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 2px solid var(--line-strong); background: #fff; font-weight: 700; font-size: 14px; cursor: pointer; }
.pg-chip input, .pg-mini input { width: 16px; height: 16px; min-width: 0; min-height: 0; margin: 0; }
.pg-chip:has(input:checked) { border-color: #2bb3c0; background: #e8f7f8; color: #0e7c86; }
.pg-students { width: 100%; margin-top: 8px; font-size: 13.5px; }
.pg-students th { font-size: 11.5px; padding: 6px; }
.pg-students td { padding: 6px; vertical-align: middle; }
.pg-who { white-space: nowrap; }
.pg-who .tier-pill { font-size: 11.5px; padding: 1px 8px; }
.pg-warn { color: #b26a00; font-weight: 700; }
.pg-extra { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.pg-mini { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px; border: 1px solid var(--line); font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.pg-mini:has(input:checked) { background: #eef8fa; border-color: #9fdcd3; }
.pg-mini.from-class { opacity: .6; cursor: default; }
/* IELTS overview (/ielts) */
.ih-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.ih-card { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--ink); transition: transform .15s, box-shadow .15s; }
.ih-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px #1b2a4114; color: var(--ink); }
.ih-icon { font-size: 30px; }
.ih-card strong { font-size: 17px; }
.ih-card small { color: var(--muted); }
.ih-stat { margin-top: 6px; font-size: 13px; color: #0e7c86; }

/* "Lớp của tôi" learning dashboard and the teacher's class overview */
.db-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 6px 0 18px; padding: 22px 24px; border-radius: 22px;
  background: linear-gradient(120deg, #e1f3f4 0%, #e9eefc 55%, #fdf0e6 100%); border: 1px solid #d5e8ee; }
.db-avatar { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #2bb3c0, #4f8df7); box-shadow: 0 6px 18px #2bb3c044; }
.db-hello { flex: 1; min-width: 220px; }
.db-hello h1 { margin: 0 0 4px; font-size: clamp(24px, 3vw, 32px); }
.db-hello p { margin: 0; color: var(--text); font-size: 14px; }
.db-hello .tier-pill { font-size: 12px; padding: 1px 8px; }
.db-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.db-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.db-kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.db-kpi-label { font-size: 12.5px; font-weight: 800; letter-spacing: .02em; color: var(--muted); text-transform: uppercase; }
.db-kpi-num { font-size: 34px; line-height: 1.05; color: var(--ink); }
.db-kpi-num small { font-size: 16px; color: var(--muted); font-weight: 700; }
.db-kpi-num.good { color: #1f7a48; } .db-kpi-num.mid { color: #b26a00; } .db-kpi-num.low { color: #b3261e; }
.db-kpi-prog { font-size: 15px; line-height: 1.5; color: var(--ink); }
.db-delta { font-size: 12.5px; color: var(--muted); }
.db-delta.up { color: #1f7a48; font-weight: 700; } .db-delta.down { color: #b3261e; font-weight: 700; }
.db-bar { display: block; height: 8px; border-radius: 99px; background: #e8edf3; overflow: hidden; }
.db-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2bb3c0, #4f8df7); }
.db-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; }
.db-panel { padding: 16px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.db-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.db-panel-head h2, .db-h { margin: 0; font-size: 18px; }
.db-h { margin: 26px 0 12px; }
.db-cal { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.db-cal-days, .db-cal-col { display: grid; grid-template-rows: 16px repeat(7, 14px); gap: 3px; }
.db-cal-days span { font-size: 10px; color: var(--muted); line-height: 14px; padding-right: 4px; }
.db-cal-month { font-size: 10px; color: var(--muted); white-space: nowrap; line-height: 16px; width: 14px; overflow: visible; }
.db-day { display: block; width: 14px; height: 14px; border-radius: 3px; background: #e8edf3; }
.db-day.l1 { background: #bfe7e3; } .db-day.l2 { background: #7dd0c7; } .db-day.l3 { background: #2bb3c0; } .db-day.l4 { background: #0e7c86; }
.db-day.future { background: transparent; }
.db-legend { display: flex; align-items: center; gap: 3px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.db-legend .db-day { width: 11px; height: 11px; }
.db-spark { width: 100%; height: auto; display: block; }
/* "Lớp của tôi" with the classroom card: the calendar and the recent scores share the left panel */
.db-cal-split { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; }
.db-cal-split > div { min-width: 0; }
.db-cal-scores { border-left: 1px solid var(--line); padding-left: 16px; }
.db-cal-scores .db-panel-head { margin-bottom: 6px; }
.db-cal-scores .db-h { font-size: 15px; }
.db-pg-panel { padding: 12px 14px; }
.db-pg-wide { margin-bottom: 16px; }
/* with the classroom: left half = the four numbers and the calendar, right half = the classroom, top to bottom */
.db-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.db-split-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.db-split-main > .db-kpis { margin: 0; }
.db-split-main > .db-row { grid-template-columns: 1fr; flex: 1; margin: 0; }
.db-split .db-pg-panel { display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 1500px) { .db-split-main > .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .db-split { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .db-cal-split { grid-template-columns: 1fr; } .db-cal-scores { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; } }
.db-spark .db-grid { stroke: #e8edf3; stroke-width: 1; }
.db-spark .db-line { fill: none; stroke: #2bb3c0; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.db-spark .db-dot { fill: #fff; stroke: #0e7c86; stroke-width: 2; }
.db-spark-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.db-empty { color: var(--muted); font-size: 14px; margin: 18px 0; }
.db-programs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.db-program { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 16px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid #9fdcd3; }
.db-program:nth-child(4n+2) { border-top-color: #b9d4f7; } .db-program:nth-child(4n+3) { border-top-color: #f7c6b2; } .db-program:nth-child(4n+4) { border-top-color: #d3c6f4; }
.db-program-top { display: flex; align-items: flex-start; gap: 12px; }
.db-program-top > div { flex: 1; min-width: 0; }
.db-program-icon { font-size: 30px; line-height: 1; }
.db-program h3 { margin: 0 0 4px; font-size: 17px; }
.db-program h3 a { color: var(--ink); }
.db-program small { display: block; color: var(--muted); font-size: 13px; }
.db-ring { position: relative; flex: none; width: 54px; height: 54px; }
.db-next { font-size: 13.5px; font-weight: 700; color: #0e7c86; }
.db-none strong { display: block; margin-bottom: 4px; }
.db-none p { margin: 0; }
.db-feed { display: flex; flex-direction: column; gap: 6px; }
.db-feed li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.db-feed-icon { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--sea-1); font-size: 19px; }
.db-feed li:nth-child(3n+2) .db-feed-icon { background: var(--sea-2); } .db-feed li:nth-child(3n) .db-feed-icon { background: var(--sea-3); }
.db-feed-main { flex: 1; min-width: 0; color: var(--ink); }
.db-feed-main strong { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-feed-main small { color: var(--muted); font-size: 12.5px; }
.db-score { flex: none; padding: 3px 10px; border-radius: 99px; font-weight: 800; font-size: 13px; background: #eef2f7; color: var(--ink); }
.db-score.good { background: #e3f4ea; color: #1f7a48; } .db-score.mid { background: #fdf3dc; color: #8a5a00; } .db-score.low { background: #fbe6e4; color: #b3261e; }
.db-table .tier-pill { font-size: 11px; padding: 1px 7px; }
.db-progs span { font-size: 18px; }
.db-idle td { background: #fffaf0; }
.st-classes a.chip { text-decoration: none; }
@media (max-width: 900px) { .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .db-row { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .db-kpi-num { font-size: 28px; } .db-hero { padding: 18px; } .db-avatar { width: 52px; height: 52px; font-size: 22px; } }
.db-spark .db-axis { font-size: 10px; fill: #8a97a8; }
.db-program-top .db-ring { position: relative; inset: auto; top: auto; right: auto; bottom: auto; left: auto; transform: none; margin-left: auto; }
.st-classes a.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; }
.st-classes a.chip.active { background: #e8f7f8; border-color: #2bb3c0; color: #0e7c86; }

/* "Lớp trực tiếp" (class mode): teacher's screen and students' screens */
.lv-start { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 10px 0 16px; padding: 14px 18px; border-radius: 16px;
  background: linear-gradient(120deg, #e1f3f4, #e9eefc); border: 1px solid #cfe4ea; }
.lv-start small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.lv-join { max-width: 480px; text-align: center; }
.lv-big { font-size: 64px; display: block; }
.lv-join-form { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.lv-join-form input { width: 200px; min-height: 52px; padding: 6px 14px; border-radius: 12px; border: 2px solid var(--line-strong); font: 800 26px ui-monospace, Menlo, monospace; letter-spacing: 4px; text-align: center; text-transform: uppercase; }
.lv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.lv-top h1 { margin: 4px 0 10px; font-size: clamp(22px, 3vw, 30px); }
.lv-codebox { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; color: var(--muted); text-align: right; }
.lv-code { font: 800 34px ui-monospace, Menlo, monospace; letter-spacing: 6px; padding: 2px 14px; border-radius: 12px; background: #1b2a41; color: #ffd23f; }
.lv-online { font-weight: 700; color: #0e7c86; }
.lv-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.lv-pill { position: relative; min-width: 46px; height: 46px; padding: 0 10px; border-radius: 12px; border: 2px solid var(--line-strong); background: #fff; font-weight: 800; font-size: 17px; color: var(--ink); cursor: pointer; }
.lv-pill small { position: absolute; top: -8px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: #2bb3c0; color: #fff; font-size: 11px; line-height: 20px; }
.lv-pill small.ok { background: #2f9e57; } .lv-pill small.no { background: #d0453a; }
.lv-pill.now { border-color: #2bb3c0; box-shadow: 0 0 0 3px #2bb3c033; }
.lv-pill.view { background: #e8f7f8; }
.lv-pill.done { border-style: solid; color: #0e7c86; }
.lv-pill:disabled { opacity: .45; cursor: default; }
.lv-card { padding: 20px 22px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 6px 20px #1b2a410d; }
.lv-qhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lv-qn { font-weight: 800; color: #0e7c86; font-size: 15px; letter-spacing: .03em; }
.lv-secret { padding: 4px 10px; border-radius: 10px; background: #fff7d6; border: 1px dashed #e0a83a; font-size: 13px; color: #6b4e00; }
.lv-prompt { margin: 10px 0 14px; font-size: clamp(19px, 2.6vw, 25px); line-height: 1.4; }
.lv-options { display: flex; flex-direction: column; gap: 10px; }
.lv-opt { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line-strong); background: #fff; color: var(--ink); font-size: 17px; cursor: pointer; overflow: hidden; }
.lv-opt:disabled { cursor: default; }
.lv-letter { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #eef2f7; font-weight: 800; }
.lv-text { flex: 1; position: relative; z-index: 1; }
.lv-opt.picked { border-color: #4f8df7; background: #eef4ff; } .lv-opt.picked .lv-letter { background: #4f8df7; color: #fff; }
.lv-opt.right { border-color: #2f9e57; background: #e7f6ed; } .lv-opt.right .lv-letter { background: #2f9e57; color: #fff; }
.lv-opt.wrong { border-color: #d0453a; background: #fdecea; } .lv-opt.wrong .lv-letter { background: #d0453a; color: #fff; }
.lv-bar { position: absolute; inset: 0 auto 0 0; width: 100%; pointer-events: none; }
.lv-bar i { display: block; height: 100%; background: #2bb3c01f; transition: width .4s; }
.lv-n { position: relative; z-index: 1; font-size: 18px; color: #0e7c86; min-width: 24px; text-align: right; }
.lv-status { margin: 12px 0 0; font-weight: 700; font-size: 16px; }
.lv-status.good { color: #1f7a48; } .lv-status.bad { color: #b3261e; }
.lv-audio-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 4px; padding: 10px 12px; border-radius: 14px; background: #eef8fa; }
.lv-audio-box [data-play].on { box-shadow: 0 0 0 3px #2bb3c055; }
.lv-time { margin-left: auto; font: 700 15px ui-monospace, Menlo, monospace; color: #0e7c86; }
.lv-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: 13.5px; }
.lv-chip { padding: 3px 10px; border-radius: 99px; background: #eef2f7; font-weight: 700; }
.lv-chip.ok { background: #e3f4ea; color: #1f7a48; } .lv-chip.no { background: #fbe6e4; color: #b3261e; }
.lv-wait { color: var(--muted); }
.lv-ctrl { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.lv-why { margin-top: 16px; padding: 12px 16px; border-radius: 14px; background: #fff; border: 1px solid #b9e6c9; }
.lv-why p { margin: 4px 0; font-size: 15px; line-height: 1.6; }
.lv-script { margin-top: 14px; padding: 12px 16px; border-radius: 14px; background: #f7fbfc; border: 1px solid #d5e8ee; }
.lv-script p { margin: 6px 0; font-size: 16px; line-height: 1.7; }
.lv-sp { color: #0e7c86; }
.lv-ev { background: #b9e6c9; color: #111; border-radius: 3px; padding: 0 2px; }
.lv-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.lv-sec-head h3, .lv-vocab h3 { margin: 0; font-size: 16px; }
.lv-vocab { margin-top: 14px; }
.lv-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 8px; }
.lv-word { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.lv-word strong { font-size: 16px; }
.lv-word small { display: block; margin-top: 2px; font-size: 14px; color: var(--text); }
.lv-word .vc-ipa { display: block; font-size: 12.5px; color: #2457b3; }
.lv-say { border: 0; background: none; font-size: 15px; padding: 0 2px; cursor: pointer; }
.lv-save { flex: none; border: 1px solid #e0a83a; background: #fff; color: #8a5a00; border-radius: 99px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.lv-save.on { background: #fff7d6; }
.lv-notes { display: block; margin-top: 14px; }
.lv-notes textarea { width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-strong); font: inherit; font-size: 15px; }
.lv-notes small { color: var(--muted); font-size: 12px; }
.lv-endrow { text-align: center; margin-top: 14px; }
@media (max-width: 600px) { .lv-codebox { align-items: flex-start; text-align: left; } .lv-card { padding: 16px; } .lv-opt { font-size: 16px; } }
/* Class mode: names of who has answered (no counts), and the class scoreboard */
.lv-who { display: block; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #f7fbfc; border: 1px dashed #b9e3e6; }
.lv-who-head { font-weight: 800; margin-bottom: 8px; color: var(--ink); }
.lv-names { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.lv-names .lv-chip { padding: 5px 12px; font-size: 15px; background: #fff; border: 1px solid var(--line-strong); animation: qr-pop .3s; }
.lv-names .lv-chip.ok { background: #e3f4ea; border-color: #9fdcd3; } .lv-names .lv-chip.no { background: #fbe6e4; border-color: #f3c2bc; }
.lv-who > .lv-wait { margin-top: 8px; font-size: 13px; }
.lv-board { margin-top: 16px; padding: 14px 18px; border-radius: 18px; background: linear-gradient(160deg, #fffaf0, #f2fbfc); border: 1px solid #f2d898; }
.lv-board ol { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.lv-board li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.lv-board li.top { border-color: #f2d898; }
.lv-board li.me { outline: 3px solid #ffd23f; }
.lv-rank { flex: none; width: 30px; text-align: center; font-weight: 800; font-size: 18px; color: var(--muted); }
.lv-bname { flex: 1; min-width: 0; font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-bname small { color: var(--muted); font-weight: 600; }
.lv-cells { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.lv-cells i { width: 16px; height: 16px; border-radius: 4px; background: #e8edf3; }
.lv-cells i.ok { background: #2f9e57; } .lv-cells i.no { background: #d0453a; }
.lv-score { flex: none; min-width: 34px; text-align: right; font-size: 20px; color: #0e7c86; }
/* Lớp trực tiếp: sharing the room (link, copy, QR), the teacher's audio bar, the two-column revealed card */
.lv-share { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 20px #1b2a410d; max-width: 100%; }
.lv-qr { flex: none; width: 108px; height: 108px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: zoom-in; overflow: hidden; }
.lv-qr svg, .lv-qr-big svg { display: block; width: 100%; height: 100%; }
.lv-share-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lv-code-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lv-share .lv-code { font-size: 26px; letter-spacing: 5px; }
.lv-mode { padding: 3px 10px; border-radius: 99px; background: #eef2f7; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.lv-mode.guest { background: #e6f6f7; color: #0e7c86; }
.lv-link { display: flex; min-width: 0; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; }
.lv-link input { flex: 1; min-width: 0; width: 290px; border: 0; padding: 7px 10px; font: 600 14px ui-monospace, Menlo, monospace; color: var(--ink); background: #f7fbfc; }
.lv-copy { flex: none; border: 0; border-left: 1px solid var(--line-strong); background: #fff; padding: 0 12px; font-weight: 700; font-size: 14px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.lv-copy:hover { background: #eef8fa; } .lv-copy.done { background: #e3f4ea; color: #1f7a48; }
.lv-share-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.lv-qr-pop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: #0f1a2bcc; }
.lv-qr-pop[hidden] { display: none; }
.lv-qr-big { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(92vw, 78vh, 560px); padding: 22px; border-radius: 24px; background: #fff; text-align: center; }
.lv-qr-big svg { width: 100%; height: auto; }
.lv-qr-big .lv-code { font-size: 34px; }
.lv-qr-big p { margin: 0; font: 600 15px ui-monospace, Menlo, monospace; color: var(--muted); word-break: break-all; }
.lv-start { align-items: center; }
.lv-who-opt { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; border: 0; font-size: 14px; font-weight: 600; }
.lv-who-opt label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.lv-who-opt input { width: 16px; min-width: 0; height: 16px; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: #0e7c86; }
.lv-who-opt label { white-space: nowrap; }
.lv-name-form input { width: 240px; font-family: inherit; font-weight: 700; font-size: 18px; letter-spacing: 0; text-transform: none; }

.lv-player { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 12px 0 4px; padding: 10px 14px; border-radius: 16px; background: #eef8fa; border: 1px solid #cfe9ee; }
.lv-pp { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #0e7c86; color: #fff; font-size: 18px; cursor: pointer; box-shadow: 0 3px 10px #0e7c8644; }
.lv-player.playing .lv-pp { background: #e0573a; box-shadow: 0 3px 10px #e0573a44; }
.lv-skip { flex: none; height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid #b9e3e6; background: #fff; font-weight: 700; font-size: 13px; color: #0e7c86; cursor: pointer; }
.lv-t, .lv-dur { flex: none; font: 700 14px ui-monospace, Menlo, monospace; color: #0e7c86; min-width: 34px; }
.lv-dur { color: var(--muted); }
.lv-track { position: relative; flex: 1 1 180px; display: flex; align-items: center; height: 30px; }
.lv-player input.lv-seek { -webkit-appearance: none; appearance: none; width: 100%; min-width: 0; height: 8px; min-height: 0; margin: 0; padding: 0; border: 0; box-shadow: none; border-radius: 99px; cursor: pointer;
    background: linear-gradient(to right, #2bb3c0 var(--p, 0%), #cfe3e8 var(--p, 0%)); }
.lv-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #0e7c86; box-shadow: 0 1px 4px #0003; }
.lv-seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #0e7c86; }
.lv-tick { position: absolute; top: 3px; bottom: 3px; width: 2px; margin-left: -1px; background: #e0a83a; border-radius: 2px; pointer-events: none; }
.lv-jumps { display: flex; gap: 6px; }
.lv-jumps button { height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid #b9e3e6; background: #fff; font-weight: 700; font-size: 13px; color: var(--ink); cursor: pointer; }
.lv-jumps button.on { background: #0e7c86; border-color: #0e7c86; color: #fff; }

.lv-card.revealed .lv-ctrl { margin: 8px 0 4px; }
.lv-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 12px; }
.lv-col-script { order: -1; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.lv-col-script .lv-script { margin-top: 0; }
.lv-col-q .lv-prompt { margin-top: 0; }
.lv-col-q .lv-why { margin-top: 12px; }
.lv-opt.has-ev { cursor: pointer; }
.lv-opt.has-ev:hover { box-shadow: 0 0 0 3px #e0a83a33; }
.lv-find { flex: none; font-size: 14px; opacity: .55; }
.lv-script mark { border-radius: 4px; padding: 1px 3px; color: #111; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.lv-ev { background: #b9e6c9; }
.lv-trap { background: #ffe2a8; }
.lv-tag { display: inline-block; margin-right: 4px; padding: 0 5px; border-radius: 6px; font: 800 11px/1.6 system-ui, sans-serif; vertical-align: 2px; color: #fff; background: #2f9e57; }
.lv-trap .lv-tag { background: #c77d00; }
.lv-legend .lv-tag { display: none; }
.lv-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px !important; font-size: 12.5px !important; color: var(--muted); }
.lv-script mark.flash { animation: lv-flash 1.2s ease 2; }
@keyframes lv-flash { 50% { box-shadow: 0 0 0 4px #e0a83a88; } }
@media (max-width: 860px) {
    .lv-cols { grid-template-columns: 1fr; }
    .lv-col-script { order: 0; position: static; max-height: none; overflow: visible; }
}
@media (max-width: 600px) {
    .lv-share { flex-direction: column; align-items: stretch; }
    .lv-qr { width: 140px; height: 140px; align-self: center; }
    .lv-link input { width: auto; }
}
.lv-qimg { display: block; width: 100%; max-width: 760px; margin: 0 auto 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
/* Lớp trực tiếp, presenting ("Trình chiếu"): the teacher's screen in full screen for the projector – no answer badge,
   no trap highlights, only the room code and a small QR left of the sharing box. */
.lv-top .lv-tools { margin-bottom: 10px; }
.lv-page:fullscreen, .lv-page.fs-fallback { max-width: none; width: 100%; margin: 0; padding: 16px var(--gutter) 40px; overflow-y: auto; background: var(--bg); }
.lv-page.fs-fallback { position: fixed; inset: 0; z-index: 1000; }
.lv-present .lv-top { align-items: center; }
.lv-present .lv-top h1 { margin-bottom: 6px; }
.lv-present .lv-secret, .lv-present .lv-legend, .lv-present .lv-link, .lv-present .lv-mode, .lv-present .lv-share-foot .qr-linkbtn { display: none; }
.lv-present mark.lv-trap { background: none; color: inherit; padding: 0; }
.lv-present mark.lv-trap .lv-tag { display: none; }
.lv-present .lv-share { padding: 8px 10px; }
.lv-present .lv-qr { width: 72px; height: 72px; }
/* Header: compact language and Quản lý buttons, so the whole menu fits on the logo's row on laptop screens */
@media (min-width: 601px) {
  .site-header { gap: 10px; }
  .header-right { gap: 6px; }
  .lang-switch { min-height: 36px; padding: 4px 9px; gap: 5px; font-size: 12.5px; border-radius: 8px; }
  .lang-switch span { font-size: 15px; }
  .header-login { min-height: 36px; padding: 6px 11px; gap: 5px; font-size: 13.5px; border-radius: 8px; }
  .header-login svg { width: 15px; height: 15px; }
  .logo { gap: 9px; }
  .logo > span { width: 38px; height: 38px; }
}
@media (max-width: 1500px) and (min-width: 601px) {
  .site-header .site-nav { gap: 0; }
  .site-header .nav-menu-btn, .site-header .site-nav > a { padding: 12px 5px; }
  .site-header .logo { font-size: 16px; }
}
/* Lớp trực tiếp, PET Part 2: the situation line above each question, and the class's progress when answering all together */
.lv-context { margin: 10px 0 -6px; font-size: 15px; font-style: italic; color: var(--muted); }
.lv-progress { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #b9e3e6; }
.q-context { display: block; margin-bottom: 4px; font-style: italic; font-weight: 400; color: var(--muted); }
/* Lớp trực tiếp, "▶▶ Tự động": while the whole test plays by itself the screen keeps only the questions and the player */
.lv-auto .lv-share, .lv-auto .lv-who, .lv-auto .lv-boardwrap, .lv-auto .lv-endrow { display: none; }
.lv-jumps [data-jump="auto"] { font-weight: 800; }
/* Lớp trực tiếp, PET Part 3: the notes as one sheet with a box in each gap */
.lv-sheet { margin-top: 14px; padding: 16px 20px; border-radius: 16px; background: #fff; border: 2px solid #b9e3e6; }
.lv-sheet-h { margin: 0 0 10px; text-align: center; color: #0e7c86; font-size: clamp(20px, 2.6vw, 26px); }
.lv-line { margin: 0; padding: 10px 0; font-size: 18px; line-height: 1.6; color: var(--ink); border-bottom: 1px solid #e3eef2; }
.lv-line:last-child { border-bottom: 0; }
.lv-num { display: inline-grid; place-items: center; min-width: 30px; height: 26px; margin-right: 6px; border-radius: 8px; background: #e6f6f7; color: #0e7c86; font-size: 15px; }
.lv-gap { width: 190px; max-width: 60vw; margin: 0 6px; padding: 4px 10px; border: 0; border-bottom: 2px solid #0e7c86; border-radius: 6px 6px 0 0; background: #f2fafb; font: inherit; font-weight: 700; color: var(--ink); }
.lv-gap:focus { outline: 0; background: #fff7d6; border-color: #e0a83a; }
.lv-gap:disabled { opacity: .75; }
.lv-gapslot { color: var(--muted); margin: 0 6px; letter-spacing: 1px; }
.lv-cnt { margin-right: 6px; padding: 1px 8px; border-radius: 99px; background: #eef2f7; color: var(--muted); font-weight: 700; font-size: 13px; }
.lv-gapans { display: inline-block; margin: 0 6px; padding: 1px 10px; border-radius: 8px; font-weight: 800; }
.lv-gapans.key, .lv-gapans.ok { background: #e3f4ea; color: #1f7a48; }
.lv-gapans.no { background: #fbe6e4; color: #b3261e; text-decoration: line-through; text-decoration-thickness: 1px; }
.lv-gapkey { padding: 1px 8px; border-radius: 8px; background: #e3f4ea; color: #1f7a48; font-weight: 800; }
.lv-gchips { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 0 8px 36px; }
.lv-gchips .lv-chip { font-size: 13px; }
.lv-sheetcard .lv-why { margin-top: 10px; }
@media (max-width: 600px) { .lv-line { font-size: 16px; } .lv-gap { width: 140px; } }
.lv-sub { margin: 14px 0 2px; font-size: 16px; color: #0e7c86; }
/* "Mở lớp trực tiếp": who can join, and whole test or question by question – one option row each */
.lv-opts { display: grid; grid-template-columns: max-content max-content; gap: 10px 18px; align-items: center; }
.lv-opts .lv-who-opt { display: contents; }   /* the two rows share columns, so the options line up */
@media (max-width: 600px) { .lv-opts { grid-template-columns: 1fr; } }
.lv-gapcard { border-bottom: 0; font-size: clamp(18px, 2.2vw, 22px); }
/* Lớp trực tiếp, "Nghe cả bài": the whole part on one sheet, like the mock tests */
.lv-group + .lv-group { margin-top: 18px; padding-top: 14px; border-top: 2px solid #e3eef2; }
.lv-gtitle { margin: 4px 0 2px; font-size: 17px; color: var(--ink); }
.lv-ginstr { margin: 0 0 8px; font-size: 15px; font-style: italic; color: var(--text); }
.lv-box { list-style: none; margin: 6px 0 10px; padding: 10px 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fbfdfe; columns: 2; column-gap: 24px; font-size: 15px; }
.lv-box li { break-inside: avoid; padding: 2px 0; }
.lv-box b { display: inline-block; min-width: 20px; }
.lv-qline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.lv-qline .lv-qtext { flex: 1 1 200px; }
.lv-qblock .lv-qtext { margin: 0 0 6px; }
.lv-qblock .lv-qimg { margin: 4px 0 8px; }
.lv-lts { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.lv-lts-col { display: flex; flex-direction: column; gap: 6px; padding-left: 36px; }
.lv-lt { display: inline-flex; align-items: center; gap: 10px; min-width: 38px; min-height: 36px; padding: 4px 10px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: #fff; font: inherit; font-size: 16px; color: var(--ink); text-align: left; cursor: pointer; }
.lv-lt b { display: inline-grid; place-items: center; min-width: 18px; }
.lv-lt.picked { border-color: #4f8df7; background: #eef4ff; }
.lv-lt.right { border-color: #2f9e57; background: #e7f6ed; }
.lv-lt.wrong { border-color: #d0453a; background: #fdecea; }
.lv-lt:disabled { cursor: default; }
/* answers stay in full dark ink even when they can't be clicked (the teacher's screen, after collecting) */
.lv-lt:disabled, .lv-opt:disabled, .lv-opt.locked { color: var(--ink); opacity: 1; }
.lv-lt span, .lv-opt .lv-text { color: var(--ink); }
.lv-shr { border: 0; border-top: 1px dashed #d5e8ee; margin: 10px 0; }
@media (max-width: 600px) { .lv-box { columns: 1; } .lv-lts-col { padding-left: 0; } }
.lv-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lv-zoom { display: inline-flex; gap: 4px; }
.lv-zoom .outline-button { min-width: 44px; padding-left: 10px; padding-right: 10px; font-weight: 800; }

/* Class mode: the podium shown to everyone when the teacher ends the class */
.lv-pod-pop { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 16px; background: #0f1a2bdd; }
.lv-pod-pop[hidden] { display: none; }
.lv-pod { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(100%, 820px); max-height: calc(100vh - 32px); overflow-y: auto; padding: 26px 22px 22px; border-radius: 26px; background: linear-gradient(170deg, #fffaf0, #f2fbfc); text-align: center; }
.lv-pod h2 { position: relative; margin: 0; font-size: clamp(28px, 5vw, 44px); color: var(--ink); }
.lv-pod-test { position: relative; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.lv-pod-none { position: relative; margin: 24px 0; color: var(--text); font-size: 18px; }
.lv-pod > .button { position: relative; margin-top: 18px; }
.lv-steps { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: clamp(6px, 2vw, 16px); width: 100%; margin-top: 10px; }
.lv-step { flex: 1 1 0; min-width: 0; max-width: 240px; display: flex; flex-direction: column; justify-content: flex-end; }
.lv-step-who { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 2px 10px; animation: lv-pop-in .5s ease-out both; }
.lv-step1 .lv-step-who { animation-delay: 1.1s; }
.lv-step2 .lv-step-who { animation-delay: .7s; }
.lv-step3 .lv-step-who { animation-delay: .3s; }
.lv-medal { font-size: clamp(34px, 6vw, 54px); line-height: 1.1; }
.lv-step-who ul { margin: 0; padding: 0; list-style: none; }
.lv-step-who li { font-weight: 800; color: var(--ink); font-size: clamp(16px, 2.6vw, 26px); line-height: 1.2; overflow-wrap: anywhere; }
.lv-step1 .lv-step-who li { font-size: clamp(18px, 3.2vw, 32px); }
.lv-step-who li.me { color: var(--orange-ink); }
.lv-step-who li small { font-weight: 600; font-size: .6em; }
.lv-step-score { margin-top: 2px; font-size: 14px; font-weight: 700; color: var(--muted); }
.lv-block { display: grid; place-items: center; border-radius: 14px 14px 4px 4px; color: #fff; font-size: clamp(30px, 5vw, 48px); font-weight: 900; text-shadow: 0 2px 0 #0003; transform-origin: bottom; animation: lv-rise .6s ease-out both; }
.lv-step1 .lv-block { height: 170px; background: linear-gradient(#ffd23f, #e0a800); animation-delay: .8s; }
.lv-step2 .lv-block { height: 120px; background: linear-gradient(#cfd8e3, #93a1b3); animation-delay: .4s; }
.lv-step3 .lv-block { height: 86px; background: linear-gradient(#e7a46b, #b86b34); }
.lv-step.empty .lv-block { opacity: .45; }
.lv-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.lv-confetti i { position: absolute; top: -14px; width: 9px; height: 14px; border-radius: 2px; opacity: .9; animation: lv-fall 3s linear infinite; }
@keyframes lv-fall { from { transform: translateY(0) rotate(0); } to { transform: translateY(760px) rotate(540deg); } }
@keyframes lv-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes lv-pop-in { from { opacity: 0; transform: translateY(14px) scale(.9); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lv-confetti { display: none; } .lv-block, .lv-step-who { animation: none; } }
@media (max-width: 560px) { .lv-step1 .lv-block { height: 120px; } .lv-step2 .lv-block { height: 86px; } .lv-step3 .lv-block { height: 62px; } .lv-pod { padding: 20px 12px 16px; } }
.lv-board .lv-sec-head .lv-podbtn { margin-left: auto; }
/* Phones: the menu items wrap onto a second centred row instead of running off the right edge */
@media (max-width: 600px) {
  .site-header .site-nav { flex-wrap: wrap; justify-content: center; row-gap: 0; }
  .site-header .nav-menu-btn, .site-header .site-nav > a { padding: 10px 7px; }
  .site-nav .nav-dropdown a, .site-nav .nav-dropdown a * { white-space: normal; }
}
/* Test lists: the top three of the test's latest live class */
.lv-last { display: flex; flex-direction: column; gap: 4px; padding: 8px 14px; border-radius: 14px; background: linear-gradient(160deg, #fffaf0, #f2fbfc); border: 1px solid #f2d898; font-size: 14px; }
.lv-last-head { font-size: 12px; font-weight: 800; color: var(--orange-ink); letter-spacing: .2px; }
.lv-last ol { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.lv-last li { display: flex; align-items: baseline; gap: 6px; color: var(--ink); min-width: 0; }
.lv-last li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lv-last li small { color: var(--muted); font-weight: 700; flex-shrink: 0; }
.lv-last-medal { flex-shrink: 0; }
.as-list .lv-last { flex: 0 1 250px; min-width: 170px; }
.as-list .exercise-card:has(.lv-last) .ex-main { min-width: 220px; }
.as-list .exercise-card:has(.lv-last) .ex-stats { width: auto; flex: 0 1 260px; }
@media (max-width: 1000px) { .as-list .exercise-card:has(.lv-last) { flex-wrap: wrap; } .as-list .exercise-card:has(.lv-last) .ex-main { flex-basis: calc(100% - 300px); } }
@media (max-width: 760px) { .as-list .lv-last { flex-basis: 100%; } }
/* Lớp trực tiếp: dictation (Nghe chép chính tả) – type the sentence, then see it marked word by word */
.lv-dictprompt { font-size: clamp(18px, 2.2vw, 22px); }
.lv-dictprompt small { font-size: 14px; font-weight: 600; color: var(--muted); }
.lv-stars { color: #e0a83a; letter-spacing: 1px; font-size: .9em; }
textarea.lv-dictbox { display: block; width: 100%; min-height: 96px; margin: 6px 0 4px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line-strong); font: 500 19px/1.5 inherit; font-family: inherit; color: var(--ink); background: #fff; resize: vertical; }
textarea.lv-dictbox:focus { outline: none; border-color: #2bb3c0; box-shadow: 0 0 0 3px #2bb3c033; }
.lv-dictsecret { display: block; margin: 8px 0; font-size: 17px; line-height: 1.5; }
.lv-dictkey { margin: 10px 0; padding: 12px 16px; border-radius: 14px; background: #e7f6ed; border: 1px solid #b9e6c9; font-size: 20px; line-height: 1.5; color: #134d2c; }
.lv-dictres { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.lv-dictrow { display: flex; gap: 10px; align-items: baseline; margin: 0; padding: 10px 14px; border-radius: 14px; background: #f7fbfc; border: 1px solid #d5e8ee; font-size: 18px; line-height: 1.7; }
.lv-dictrow > b { flex: none; min-width: 58px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dw.ok { color: #1f7a48; }
.dw.no { color: #b3261e; text-decoration: line-through; text-decoration-thickness: 2px; }
.dw.miss { color: #8a4b00; background: #ffe2a8; border-radius: 4px; padding: 0 3px; text-decoration: underline; text-decoration-thickness: 2px; }
.lv-dictscore { margin: 0; font-weight: 700; font-size: 16px; }
.lv-dictvi { margin: 0; color: var(--muted); font-size: 15px; }
.lv-dictres .lv-replay { align-self: flex-start; }
.lv-dictplayer .lv-rate.on { background: #0e7c86; border-color: #0e7c86; color: #fff; }
/* Sổ từ: the teacher's review sets ("Bộ ôn tập") and the bar for saving ticked words as a set */
.ws-box { margin-top: 18px; padding: 16px 18px; border-radius: 18px; background: linear-gradient(160deg, #fffaf0, #f2fbfc); border: 1px solid #f2d898; }
.ws-box .hint { margin: 6px 0 0; }
.ws-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.ws-set { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.ws-set.on { border-color: #9bd3b0; }
.ws-set.flash { animation: ws-flash 1.6s ease-out; }
@keyframes ws-flash { 0%, 40% { box-shadow: 0 0 0 4px #ffd23f; } 100% { box-shadow: 0 0 0 0 transparent; } }
.ws-main { flex: 1 1 320px; min-width: 0; }
.ws-main h3 { margin: 0; font-size: 17px; }
.ws-main h3 small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.ws-terms { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.ws-term { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 10px; border-radius: 99px; background: var(--surface); font-size: 14px; color: var(--ink); }
.ws-term:not(:has(.ws-x)) { padding-right: 10px; }
.ws-x { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 6px; cursor: pointer; border-radius: 99px; }
.ws-x:hover { color: var(--danger); background: #fde8e6; }
.ws-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ws-actions .button, .ws-actions .outline-button { height: 40px; min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; box-sizing: border-box; }
.ws-del { color: var(--danger); }
.ws-col { width: 34px; text-align: center; }
.ws-col input { width: 18px; height: 18px; accent-color: var(--button); cursor: pointer; }
.ws-bar { position: sticky; bottom: 12px; z-index: 30; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px auto 0; padding: 10px 14px; max-width: 900px; border-radius: 16px; background: var(--ink); color: #fff; box-shadow: 0 10px 30px #0f1a2b44; }
.ws-bar[hidden] { display: none; }
.ws-bar .ws-count { white-space: nowrap; }
.ws-bar .ws-name { flex: 1 1 200px; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; border: 0; font: inherit; }
.ws-bar .ws-into { height: 40px; border-radius: 10px; border: 0; padding: 0 8px; font: inherit; max-width: 220px; }
.ws-bar .button, .ws-bar .outline-button { height: 40px; min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; box-sizing: border-box; }
.ws-bar .outline-button, .ws-bar .ws-into, .ws-bar .ws-name { background: #fff; color: var(--ink); }
.ws-bar .ws-or { opacity: .75; font-size: 14px; }
.ws-clear { border: 0; background: none; color: #fff; font-size: 18px; cursor: pointer; padding: 4px 8px; margin-left: auto; }
.game-sets { margin: 6px 0 22px; }
.game-sets h2 { margin: 0 0 10px; font-size: 18px; }
.game-set { background: linear-gradient(160deg, #fffaf0, #f2fbfc); border-color: #f2d898; }
.ws-notice { margin: 8px 0 0; padding: 10px 14px; border-radius: 12px; background: #fff7d1; border: 1px solid #f2d898; color: var(--ink); }
.ws-bar .ws-name, .ws-bar .ws-into { height: 40px; min-height: 40px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; margin: 0; }
/* Class mode: a map or plan to label (IELTS Part 2), shown once above its questions */
.lv-map { display: block; width: 100%; max-width: 720px; height: auto; margin: 10px auto 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
/* Class mode, teacher: the player stays at the top of the screen while scrolling the sheet and the script */
.lv-host .lv-card > .lv-player { position: sticky; top: 8px; z-index: 25; box-shadow: 0 6px 18px #1b2a411f; }
.lv-host .lv-col-script { top: 84px; max-height: calc(100vh - 96px); }
/* the script after the reveal: click a sentence to hear it; the sentence playing is highlighted */
.lv-script p.lv-playable { cursor: pointer; border-radius: 8px; }
.lv-script p.lv-playable:hover { background: #f4f9fb; }
::highlight(lv-say) { background-color: #ffe27a; color: inherit; }
.lv-script p.lv-saying { background: #fff4c2; }
.lv-script .lv-sec-head .hint { font-size: 13px; }
.lv-evplay { height: 36px; min-height: 36px; padding: 0 12px; display: inline-flex; align-items: center; font-size: 14px; }
/* dictation: hold to peek at the sentence */
.lv-dictpeek { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lv-peek { border: 0; background: #ffe9a8; color: #6b4e00; font: inherit; font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 99px; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }
.lv-peek.on { background: #ffd23f; }
.lv-peektext { font-size: 15px; color: var(--ink); }
.cam-card .status { align-self: flex-start; }
/* IELTS pages for visitors without the IELTS program: lessons locked, one sample free */
.ielts-sample { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 12px 0 18px; padding: 14px 18px; border-radius: 16px; background: #f3efff; border: 1px solid #d8ccff; }
.ielts-sample-icon { font-size: 30px; }
.ielts-sample > div { flex: 1 1 260px; }
.ielts-sample strong { display: block; color: var(--ink); }
.ielts-sample p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

/* Bài về nhà */
.hw-give { background: linear-gradient(120deg, #fdf3e6, #fbeee9); border-color: #f1dccb; }
.hw-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14px; font-weight: 600; }
.hw-opts label, .hw-due label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.hw-opts select, .hw-opts input[type="date"], .hw-due input[type="date"] { min-height: 38px; padding: 4px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--field); font: inherit; }
.hw-opts .hw-whole input { width: 16px; height: 16px; min-height: 0; accent-color: #0e7c86; }
.hw-given { flex-basis: 100%; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.hw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px 0 8px; }
.hw-actions form { margin: 0; }
.hw-due { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.hw-feed .hw-go { flex: none; min-height: 36px; padding: 6px 16px; }
.hw-feed .hw-late { border-color: #f2c4bf; background: #fff7f6; }
.hw-wait .result-summary { margin-top: 18px; }

/* Listening parts: play / pause only, no skipping */
.la-player { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; width: min(100%, 520px); padding: 10px 14px; border-radius: 16px; background: #eef8fa; border: 1px solid #cfe9ee; }
.la-play { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #0e7c86; color: #fff; font-size: 17px; cursor: pointer; box-shadow: 0 3px 10px #0e7c8644; display: grid; place-items: center; }
.la-play svg { margin-left: 2px; }
.la-bar { flex: 1 1 140px; height: 8px; border-radius: 99px; background: #d6e9ed; overflow: hidden; }
.la-bar span { display: block; height: 100%; width: 0; background: #0e7c86; border-radius: 99px; transition: width .25s linear; }
.la-time { font: 700 14px ui-monospace, Menlo, monospace; color: var(--ink); white-space: nowrap; }
.la-count { font-size: 13.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.la-count b { color: #0e7c86; }
.la-note { margin: 6px 0 0; font-size: 13px; }
.la-ask { border: 0; border-radius: 20px; padding: 24px 24px 16px; max-width: min(92vw, 420px); box-shadow: 0 20px 60px #1b2a4133; text-align: center; color: var(--ink); background: var(--card); }
.la-ask::backdrop { background: #1b2a4166; }
.la-ask-title { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.la-ask-text { margin: 0 0 16px; color: var(--muted); }
.la-ask-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.la-ask-later { margin-top: 12px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
.hw-redo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); }
.hw-redo-note { margin-top: 18px; }
.hw-old { color: var(--muted); }
.hw-redo-tag { color: var(--orange-ink); }
.hw-card-redo { flex: none; margin: 0; } .hw-card-redo .outline-button { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.hw-first-tip { margin: 10px 0; padding: 10px 14px; border-radius: 10px; background: #fdf3dc; color: #6b4600; border: 1px solid #f2dca6; }
.hw-try2 { color: var(--muted); }
.dare-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 22px; padding: 12px 16px; border-radius: 12px; background: #fff8e6; border: 1px solid #f2dca6; }
.dare-box > span { flex: 1 1 260px; }
.dare-box select { min-height: 38px; border-radius: 8px; padding: 4px 8px; }
.dare-msg { flex-basis: 100%; color: var(--muted); }
.dare-msg:empty { display: none; }
.hw-row-actions { white-space: nowrap; } .hw-row-actions form { display: inline-block; margin: 0 0 0 6px; }

/* Home hero sky: sun by day, moon and stars by night, on Vietnam time (assets/nt-sky.js). The island picture has a see-through background. */
.city-hero { --sky-top: #a4cff4; --sky-bot: #e2f0fb; --lx: 50%; --ly: 10%; --light: #fff6d64d; --light-soft: #fff6d622; background: linear-gradient(180deg, var(--sky-top), var(--sky-bot)); }
.city-hero .saigon { z-index: 1; }
.city-hero .saigon > img { filter: var(--scene-filter, drop-shadow(0 18px 18px #0c1c3c29)); }
.city-hero .saigon > svg { filter: var(--scene-tone, none); }
.city-hero-down { z-index: 4; }
.nt-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.nt-sky::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at var(--lx) var(--ly), var(--light) 0, var(--light-soft) 14%, transparent 42%); }
.nt-bodies { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.nt-sun, .nt-moon { position: absolute; left: 0; top: 0; border-radius: 50%; will-change: transform; }
.nt-sun { width: clamp(54px, 6.5vw, 104px); aspect-ratio: 1; background: radial-gradient(circle, #fffef6 0 30%, #ffe680 52%, #ffc93c 70%, #ffb12c 100%);
  box-shadow: 0 0 30px 12px #ffe58a99, 0 0 90px 40px #ffd56b55, 0 0 180px 90px #fff0b833; }
.nt-sun i { position: absolute; inset: -95%; border-radius: 50%; pointer-events: none; opacity: .55;
  background: repeating-conic-gradient(from 0deg, #fff3b0aa 0 4deg, transparent 4deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 0 24%, #000 30%, transparent 70%); mask: radial-gradient(circle, transparent 0 24%, #000 30%, transparent 70%);
  animation: nt-rays 70s linear infinite; }
@keyframes nt-rays { to { transform: rotate(360deg); } }
.nt-moon { width: clamp(40px, 4.6vw, 74px); aspect-ratio: 1; background: #ffffff10; opacity: 0; }
.nt-stars { position: absolute; inset: 0; opacity: 0; }
.sky-on .nt-sun, .sky-on .nt-moon { transition: transform 1.5s ease-out, opacity 1.5s; }
.sky-on .nt-stars, .sky-on .saigon > img, .sky-on .saigon > svg { transition: opacity 2s, filter 2s; }
.nt-stars i { position: absolute; border-radius: 50%; background: #fff; box-shadow: 0 0 4px #fff; animation: nt-twinkle 4s ease-in-out infinite; }
@keyframes nt-twinkle { 50% { opacity: .35; } }
/* the light falling on the island from the sun (or the moon) */
.nt-light { position: absolute; inset: 0; z-index: 2; pointer-events: none; mix-blend-mode: soft-light;
  background: radial-gradient(circle at var(--lx) var(--ly), var(--light) 0, var(--light-soft) 30%, transparent 75%); }
.city-hero.is-night .postcard { box-shadow: 0 14px 30px #00000055; }
@media (prefers-reduced-motion: reduce) { .nt-sun i, .nt-stars i { animation: none; } }
.cam-views { margin-top: 18px; }
.cam-count { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.rd-tool button.rd-word { background: #fff; }
.rd-tool .rd-msg { color: #fff; font-size: 14px; font-weight: 700; padding: 6px 8px; }
.rd-tool-form { align-items: center; max-width: calc(100vw - 16px); }
.rd-tool-form b { color: #ffe14d; font-size: 14px; padding: 0 4px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-tool-form input { width: 190px; min-width: 0; border: 0; border-radius: 7px; padding: 7px 9px; font: inherit; font-size: 14px; }

/* IELTS Writing Task 1 (app/writing.php) */
.wr-tabs a span { margin-left: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.wr-group h2 small { font-size: 15px; font-weight: 600; color: var(--muted); }
.wr-card { text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.wr-card:hover { border-color: var(--orange); transform: translateY(-2px); }
.wr-card { flex-direction: row; align-items: stretch; gap: 16px; }
.wr-card-text { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.wr-thumb { flex: 0 0 44%; max-width: 44%; height: 150px; object-fit: contain; align-self: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.wr-prompt { display: block; margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink); flex: 1; }
.wr-go { font-size: 13px; font-weight: 700; color: var(--orange-ink); }
.wr-task { font-size: 17px; color: var(--ink); max-width: 980px; }
.wr-task em { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
.wr-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 18px; }
.wr-sheet { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.wr-sheet img, .wr-guide img { display: block; width: 100%; height: auto; border-radius: 8px; }
.wr-sheet figcaption { font-size: 12px; color: var(--muted); text-align: center; margin-top: 6px; }
.wr-write { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 8px; }
.wr-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wr-bar strong { flex: 1; color: var(--ink); }
.wr-count { font-size: 14px; color: var(--muted); }
.wr-count b { font-size: 18px; color: var(--danger); }
.wr-count.ok b { color: var(--ok); }
.wr-timer.running { background: var(--peach); border-color: var(--orange); }
.wr-write textarea { width: 100%; min-height: 420px; padding: 14px; font: 16px/1.6 inherit; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--field); color: var(--ink); resize: vertical; }
.wr-guide { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 4px 14px; }
.wr-guide summary { cursor: pointer; padding: 12px 0; font-weight: 800; color: var(--ink); }
.wr-guide[open] { padding-bottom: 14px; }
.wr-guide img { max-width: 900px; margin: 0 auto 12px; border: 1px solid var(--line); }
.wr-extra-img { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wr-extra-text { max-width: 820px; margin-top: 12px; line-height: 1.7; color: var(--ink); }
.wr-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
@media (max-width: 900px) {
  .wr-layout { grid-template-columns: 1fr; }
  .wr-write { position: static; }
  .wr-write textarea { min-height: 280px; }
  .wr-extra-img { grid-template-columns: 1fr; }
  .wr-thumb { flex-basis: 38%; max-width: 38%; height: 110px; }
}

/* IELTS Writing 2022 tests as text (views/writing_test.php) */
.wr-task-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 6px; max-width: 620px; }
.wr-task-switch a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-decoration: none; color: var(--ink); }
.wr-task-switch a strong { font-size: 18px; }
.wr-task-switch a span { font-size: 13px; color: var(--muted); }
.wr-task-switch a.selected { border-color: var(--orange); background: var(--peach); }
.wr-card-t2 .wr-prompt { font-size: 14.5px; }
.wr-sheet-text { padding: 16px 18px; }
.wr-q { margin: 0 0 6px; font-size: 17px; line-height: 1.55; font-weight: 600; color: var(--ink); }
.wr-q-hint { margin: 0 0 12px; font-size: 14px; font-style: italic; color: var(--muted); }
.wr-sheet-text img { display: block; width: 100%; height: auto; border-radius: 8px; margin-top: 8px; }
.wr-sheet-text figcaption a { font-weight: 700; color: var(--orange-ink); }
.wt-table-wrap { overflow-x: auto; }
.wt-data { border-collapse: collapse; width: 100%; font-size: 14.5px; color: var(--ink); }
.wt-data th, .wt-data td { border: 1px solid var(--line-strong); padding: 6px 9px; text-align: center; }
.wt-data th { background: var(--surface); font-weight: 700; text-transform: none; letter-spacing: normal; font-size: 14.5px; color: var(--ink); }
.wt-data tr > th:first-child { text-align: left; }
.wt-body { max-width: 920px; color: var(--ink); line-height: 1.65; font-size: 15.5px; }
.wt-body p { margin: 0 0 10px; }
.wt-body ul, .wt-related { margin: 0 0 10px; padding-left: 22px; list-style: disc; }
.wt-body li { margin-bottom: 4px; }
.wt-body h4 { margin: 14px 0 6px; font-size: 15px; color: var(--orange-ink); }
.wt-rows { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.wt-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); border-top: 1px solid var(--line); }
.wt-row:first-child { border-top: 0; }
.wt-lab { padding: 10px 12px; background: var(--surface); font-weight: 700; font-size: 14px; }
.wt-cell { padding: 10px 14px; }
.wt-cell > :last-child { margin-bottom: 0; }
.wt-flow { margin: 6px 0; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); }
.wt-flow.l2 { margin-left: 28px; border-style: dashed; }
.wt-flow.l3 { margin-left: 56px; border-style: dashed; }
.wt-flow.l4 { margin-left: 84px; border-style: dashed; }
.wt-flow-h { display: inline-block; margin: 16px 0 4px !important; padding: 3px 12px; border-radius: 999px; background: var(--peach); color: var(--orange-ink) !important; }
.wt-flow-img { display: block; max-width: 100%; margin: 0 auto 10px; border: 1px solid var(--line); border-radius: 8px; }
.wt-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; }
.wt-col { padding: 10px 14px; border-radius: 12px; background: var(--surface); }
.wt-col h4 { margin-top: 0 !important; }
.wt-sample { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; align-items: start; }
.wt-essay p { text-align: justify; }
.wt-essay sup { color: var(--orange-ink); font-weight: 700; font-size: 11px; }
.wt-vocab { position: sticky; top: 90px; padding: 12px 14px; border-radius: 12px; background: var(--surface); font-size: 13.5px; line-height: 1.5; }
.wt-vocab p { margin: 0 0 7px; }
.wt-wc { text-align: right; color: var(--muted); font-size: 13px; }
.wt-band { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.wt-band span { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; }
.wt-band-pill { margin-left: 6px; padding: 2px 9px; border-radius: 999px; background: var(--peach); color: var(--orange-ink); font-size: 12.5px; }
.wt-related { margin: 0 0 6px; padding-left: 22px; line-height: 1.6; color: var(--ink); }
.wt-related li { margin-bottom: 6px; }
.wt-source { margin-top: 14px; }
@media (max-width: 900px) {
  .wt-sample { grid-template-columns: 1fr; }
  .wt-vocab { position: static; }
  .wt-cols { grid-auto-flow: row; }
  .wt-row { grid-template-columns: 1fr; }
  .wt-flow.l2 { margin-left: 14px; } .wt-flow.l3 { margin-left: 28px; } .wt-flow.l4 { margin-left: 42px; }
}

/* group headings inside a header menu ("For teachers": Class games / Class activities) */
.nav-dropdown .nav-group { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 2px; }
.nav-dropdown .nav-group:not(:first-child) { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
.lv-tv-opt { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.lv-tv-opt select { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line-strong); font: inherit; }

/* "Nộp bài cho teacher" under the writing box (views/_essay_send.php) */
.wr-send { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 4px; }
.wr-send-msg { font-size: 14px; color: var(--muted); }
.wr-send.sent .wr-send-msg { color: var(--ok); font-weight: 600; }
.wt-locked summary { color: var(--muted); }
.wt-locked .wt-body p { margin: 0 0 12px; }
/* Lớp trực tiếp for a listening mock test: whole test, or one part (1–4) */
.lv-part-pick { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lv-part-pick > span { margin-right: 2px; }
.lv-part-pick label input { position: absolute; opacity: 0; pointer-events: none; }
.lv-part-pick label b { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; border: 1.5px solid #b9e3e6; background: #fff; color: #0e7c86; font-size: 15px; }
.lv-part-pick label input:checked + b { background: #0e7c86; border-color: #0e7c86; color: #fff; }
.lv-part-pick label input:focus-visible + b { outline: 2px solid #e0573a; outline-offset: 2px; }
/* Tiến độ các lớp: "Cần chú ý tuần này" and "Bảng kỹ năng" (views/_class_skills.php) */
.sk-attn, .sk-panel { margin-top: 18px; }
.sk-attn h2, .sk-panel h2 { margin: 0 0 10px; font-size: 20px; }
.sk-attn h2 small, .sk-panel h2 small { margin-left: 8px; font: 500 13px/1.4 inherit; color: var(--muted); }
.sk-attn { border-color: #f3c9b8; background: linear-gradient(180deg, #fff8f4, var(--card)); }
.sk-attn-list { list-style: none; margin: 0; padding: 0; }
.sk-attn-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.sk-attn-list li:first-child { border-top: 0; }
.sk-attn-name { min-width: 150px; font-weight: 700; color: var(--ink); }
.sk-reasons { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.sk-reason { padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid #f0d6c9; font-size: 13px; font-weight: 600; }
.sk-remind { position: relative; }
.sk-remind summary { list-style: none; cursor: pointer; min-height: 34px; padding: 4px 12px; font-size: 13px; }
.sk-remind summary::-webkit-details-marker { display: none; }
.sk-remind[open] form { position: absolute; right: 0; top: 40px; z-index: 30; width: min(360px, 86vw); display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line-strong); box-shadow: 0 12px 30px #0f2a3a22; }
.sk-remind textarea { width: 100%; font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-strong); resize: vertical; }
.sk-table td { vertical-align: top; }
.sk-cell small { display: block; }
.sk-main { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 9px; font-weight: 800; font-size: 15px; text-decoration: none; }
.sk-good { background: #e3f5ea; color: #1f7a48; } .sk-mid { background: #fdf2d8; color: #9a6400; } .sk-low { background: #fde5e2; color: #b3261e; }
.sk-tr { font-style: normal; font-size: 11px; } .sk-tr.up { color: #1f7a48; } .sk-tr.down { color: #b3261e; }
.sk-none { color: var(--muted); font-size: 13px; }
.sk-due { color: #b3261e; font-weight: 700; }
.sk-key { margin: 10px 0 0; font-size: 12.5px; } .sk-key .sk-main { font-size: 12px; padding: 1px 7px; }
@media (max-width: 600px) { .sk-attn-name { min-width: 0; width: 100%; } .sk-remind[open] form { right: auto; left: 0; } }
/* Tiến độ các lớp: "Lịch sử bài làm" by skill (views/_class_history.php) */
.hs-panel { margin-top: 18px; }
.hs-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.hs-head h2 { margin: 0; font-size: 20px; }
.hs-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.hs-filter select { width: auto; min-height: 38px; padding: 4px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--field); font: inherit; font-size: 14px; font-weight: 600; }
.hs-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 8px; }
.hs-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; }
.hs-tab b { min-width: 22px; padding: 0 6px; border-radius: 999px; background: #eef4f7; font-size: 12px; text-align: center; }
.hs-tab.active { background: #0e7c86; border-color: #0e7c86; color: #fff; }
.hs-tab.active b { background: #ffffff33; }
.hs-sum { margin: 4px 0 10px; font-size: 14px; color: var(--text); }
.hs-date { white-space: nowrap; font-weight: 700; }
.hs-date small, .hs-res small { display: block; }
.hs-res { white-space: nowrap; }
/* "Bài đã học trên lớp" (views/_class_lessons.php): what the class learned with the teacher, one notebook block per skill –
   lined paper with a margin, unlike the white "Chương trình học" cards (material for self-study) */
.db-h-sub { margin-left: 8px; font: 500 13px/1.4 inherit; color: var(--muted); }
.cl-panel { margin-top: 18px; border-color: #e6d9b8; background: #fffdf6; }
.cl-head h2 { margin: 0; font-size: 20px; }
.cl-head h2 small { margin-left: 8px; font: 500 13px/1.4 inherit; color: var(--muted); }
.cl-head .hint { margin: 4px 0 14px; }
.cl-blocks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.cl-block { --cl: #0e7c86; --cl-soft: #e3f4f2; position: relative; padding: 0 0 10px; border-radius: 6px 14px 14px 6px; border: 1px solid #e8dfc8; border-left: 6px solid var(--cl);
  background: repeating-linear-gradient(180deg, transparent 0 29px, #efe7d3 29px 30px), #fffef9; box-shadow: 0 2px 0 #eadfc4; }
.cl-block::before { content: ""; position: absolute; top: 0; bottom: 0; left: 30px; border-left: 1.5px solid #f2b8ae; }
.cl-reading { --cl: #2f6fc0; --cl-soft: #e4eefb; } .cl-speaking { --cl: #c4572b; --cl-soft: #fdece3; }
.cl-writing { --cl: #7a4fc6; --cl-soft: #eee7fb; } .cl-vocab { --cl: #9a6a00; --cl-soft: #fbf0d3; }
.cl-block-head { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px 40px; background: var(--cl-soft); border-radius: 0 13px 0 0; border-bottom: 2px solid var(--cl); }
.cl-icon { position: absolute; left: 6px; font-size: 20px; }
.cl-block-head h3 { flex: 1; margin: 0; font-size: 16px; color: var(--cl); }
.cl-count { min-width: 26px; padding: 1px 8px; border-radius: 99px; background: var(--cl); color: #fff; font-weight: 800; font-size: 12.5px; text-align: center; }
.cl-empty { margin: 10px 12px 2px 40px; color: var(--muted); font-size: 13.5px; font-style: italic; }
.cl-list { list-style: none; margin: 0; padding: 4px 8px 0 0; }
.cl-list li { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 6px 0 6px 40px; border-bottom: 1px dashed #eadfc8; }
.cl-list li:last-child { border-bottom: 0; }
.cl-date { position: absolute; left: 2px; top: 8px; width: 34px; font-size: 10.5px; font-weight: 800; color: var(--cl); text-align: center; line-height: 1.1; }
.cl-main { flex: 1; min-width: 0; font-size: 14px; line-height: 1.35; }
.cl-main > a, .cl-title { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.cl-main > a:hover { color: var(--cl); }
.cl-tag { margin-left: 4px; font-size: 12px; }
.cl-note { display: block; margin-top: 2px; color: var(--text); font-size: 12.5px; }
.cl-done { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cl-done .db-score { padding: 1px 8px; font-size: 11.5px; }
.cl-chip { padding: 1px 8px; border-radius: 99px; background: var(--cl-soft); color: var(--cl); font-weight: 700; font-size: 11.5px; }
.cl-more { margin: 2px 0 0 40px; font-size: 13px; }
.cl-more > summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cl-more .cl-list { margin-left: -40px; }
.cl-add { margin: 8px 8px 0; }
.cl-add > summary { margin-left: 32px; }
.cl-add > summary { display: inline-block; cursor: pointer; padding: 4px 12px; border-radius: 99px; border: 1.5px dashed var(--cl); color: var(--cl); font-weight: 700; font-size: 13px; list-style: none; }
.cl-add > summary::-webkit-details-marker, .cl-edit > summary::-webkit-details-marker { display: none; }
.cl-edit { flex: none; }
.cl-edit > summary { cursor: pointer; list-style: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.cl-edit > summary:hover { background: var(--cl-soft); color: var(--cl); }
.cl-edit[open] { position: static; }
.cl-edit[open] .cl-form { position: absolute; left: 0; right: -8px; top: 100%; z-index: 30; }
.cl-form { position: relative; z-index: 2; display: grid; gap: 8px; margin-top: 8px; padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line-strong); box-shadow: 0 12px 30px #0f2a3a22; }
.cl-form label { display: grid; gap: 3px; font-size: 12.5px; font-weight: 700; color: var(--text); }
.cl-form input, .cl-form select, .cl-form textarea { width: 100%; min-width: 0; font: inherit; font-size: 14px; font-weight: 400; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--field); color: var(--ink); }
.cl-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.cl-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-form-actions .button, .cl-form-actions .outline-button { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.cl-del { color: var(--danger); }
@media (max-width: 1100px) { .cl-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .cl-blocks { grid-template-columns: 1fr; } }
/* only the 3 newest lessons show; the block title toggles the rest (2026-11-09) */
.cl-block { display: flex; flex-direction: column; }
.cl-toggle { width: 100%; border: 0; border-bottom: 2px solid var(--cl); font: inherit; text-align: left; cursor: pointer; color: inherit; }
.cl-toggle:hover { filter: brightness(.97); }
.cl-chev { color: var(--cl); font-size: 14px; transition: transform .15s; }
.cl-block.open .cl-chev { transform: rotate(180deg); }
.cl-extra { display: none !important; }
.cl-block.open .cl-extra { display: flex !important; }
.cl-more-hint { margin: 4px 12px 2px 40px; font-size: 12px; color: var(--muted); }
.cl-block.open .cl-more-hint { display: none; }
.cl-add { margin-top: auto; padding-top: 8px; }
/* Lịch sử bài làm, whole class: lesson by lesson (views/_class_history.php) */
.hs-lessons { display: grid; gap: 8px; }
.hs-lesson { border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.hs-lesson[open] { border-color: #9fd3d6; box-shadow: 0 6px 18px #0f2a3a14; }
.hs-lesson > summary { color: var(--ink); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 14px; cursor: pointer; list-style: none; }
.hs-lesson > summary::-webkit-details-marker { display: none; }
.hs-lesson > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.hs-lesson[open] > summary::after { transform: rotate(180deg); }
.hs-lesson > summary:hover { background: #f4fafa; border-radius: 14px; }
.hs-lesson .hs-date { flex: none; width: 46px; font-weight: 800; }
.hs-lesson .hs-date small { display: block; font-weight: 500; color: var(--muted); }
.hs-l-title { flex: 1 1 260px; min-width: 0; font-weight: 700; }
.hs-l-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13.5px; }
.hs-l-done { padding: 2px 9px; border-radius: 99px; background: #fdf2d8; color: #8a5a00; font-weight: 700; }
.hs-l-done.full { background: #e3f4ea; color: #1f7a48; }
.hs-l-avg .db-score { padding: 1px 8px; font-size: 12.5px; }
.hs-l-top b { color: #0e7c86; }
.hs-lesson .table-wrap { margin: 0 14px; }
.hs-missing { margin: 8px 14px 12px; font-size: 13.5px; color: var(--muted); }
.hs-missing b { color: #b3261e; }
.hs-lessons.hs-extra { margin-top: 8px; }
.hs-morebtn { display: block; margin: 12px auto 0; min-height: 38px; padding: 6px 18px; font-size: 14px; }
/* Nghe chép chính tả in folders (app/dict_folders.php, views/dict_folders.php, views/_dict_matrix.php) */
.df-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; margin-top: 24px; }
.df-folder { display: flex; align-items: center; gap: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.df-folder:hover { transform: translateY(-2px); box-shadow: 0 10px 26px #0f2a3a18; }
.df-ficon { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: #fdf3d6; font-size: 34px; }
.df-fbody { display: grid; gap: 5px; flex: 1; min-width: 0; }
.df-fbody strong { font-size: 20px; }
.df-fbody small { color: var(--text); font-size: 14px; }
.df-fmeta { color: var(--muted); font-size: 13px; font-weight: 600; }
.df-fgo { flex: none; color: #0e7c86; }
.df-matrix { margin-top: 22px; padding: 18px; border-radius: 18px; border: 1px solid #cfe9ee; background: linear-gradient(180deg, #f0fafb, var(--card)); }
.df-mhead { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; margin-bottom: 14px; }
.df-mstat { display: grid; }
.df-mstat b { font-size: 30px; line-height: 1; color: #0e7c86; } .df-mstat b small { font-size: 16px; color: var(--muted); }
.df-mstat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.df-mgoal { flex: 1; min-width: 240px; padding: 10px 14px; border-radius: 12px; background: #fff7e6; border: 1px solid #f5dfae; font-size: 15px; }
.df-mgoal small { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.df-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.df-group { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #e3f2f4; }
.df-group.locked { background: #eef0f3; }
.df-tile { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 9px; border: 1.5px solid #b9e3e6; background: #fff; color: #0e7c86; text-decoration: none; font-weight: 800; }
.df-tile .df-tn { font-size: 15px; line-height: 1; }
.df-tile .df-tm { position: absolute; right: 2px; bottom: 1px; font-size: 9px; font-weight: 700; }
.df-tile.done { background: #2f9e5f; border-color: #2f9e5f; color: #fff; }
.df-tile.doing { background: #fdf2d8; border-color: #f0c96a; color: #9a6400; }
.df-tile.lock { background: #f1f3f6; border-color: #dde2e8; color: #a3adb9; }
.df-tile:hover { transform: translateY(-1px); }
.df-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.df-key .df-tile { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.df-n { color: #0e7c86; }
.exercise-card.df-closed { opacity: .55; filter: grayscale(1); background: #f1f3f6; }
.df-tile .df-tp { position: absolute; top: -7px; right: -7px; min-width: 22px; padding: 1px 4px; border-radius: 999px; background: #0e7c86; color: #fff; font-size: 9.5px; font-weight: 800; line-height: 1.35; box-shadow: 0 1px 3px #0f2a3a33; }
.df-tile.done .df-tp { background: #fff; color: #1f7a48; border: 1px solid #2f9e5f; }
.df-tile.doing .df-tp { background: #e0a419; }
.df-group { padding: 7px 4px 4px; }
.exercise-card.df-done { border-color: #bfe5cd; }
.df-wait { cursor: default; color: var(--muted); }
@media (max-width: 600px) { .df-tile { width: 38px; height: 38px; } .df-mstat b { font-size: 24px; } }

/* dashboard (2026-11-09): calendar in the hero, "Bài cần làm" blocks in two columns, narrower page margins */
.workspace.db-mine { padding-left: calc(var(--gutter) / 2); padding-right: calc(var(--gutter) / 2); }
.db-h-sm { margin: 0 0 -4px; font-size: 16px; }
.db-hero-cal { flex: 0 1 360px; min-width: 280px; padding: 8px 12px 8px; border-radius: 14px; background: rgba(255, 255, 255, .72); border: 1px solid #d5e8ee; --c: 14px; }
.db-hero-cal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 14px; }
.db-hero-cal-head .db-legend { margin: 0; font-size: 10.5px; }
.db-hero-cal-head .db-legend .db-day { width: 10px; height: 10px; }
.db-hero-cal .db-cal { gap: 3px; overflow: hidden; padding: 0; }
.db-hero-cal .db-cal-days, .db-hero-cal .db-cal-col { grid-template-rows: 14px repeat(7, var(--c)); gap: 3px; align-items: center; }
.db-hero-cal .db-cal-days { flex: none; }
.db-hero-cal .db-cal-days span { line-height: 1; padding-right: 5px; }
.db-hero-cal .db-cal-col { flex: 1 1 0; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.db-hero-cal .db-cal-month { line-height: 14px; width: 0; overflow: visible; white-space: nowrap; }
.db-hero-cal .db-day { width: 100%; height: var(--c); }
.db-mine .db-hero .db-cta { flex-direction: column; align-items: stretch; }
.hw-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.hw-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hw-skill { flex: 1; display: flex; flex-direction: column; padding: 14px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid #9fdcd3; min-width: 0; }
.hw-skill-reading { border-top-color: #b9d4f7; } .hw-skill-speaking { border-top-color: #f7c6b2; } .hw-skill-writing { border-top-color: #d3c6f4; } .hw-skill-vocab { border-top-color: #f2dca6; }
.hw-skill header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hw-skill header span { font-size: 26px; line-height: 1; }
.hw-skill h3 { margin: 0; font-size: 18px; flex: 1; }
.hw-skill header b { font-size: 13px; min-width: 26px; text-align: center; padding: 2px 9px; border-radius: 999px; background: var(--sea-1); color: var(--ink); }
.hw-skill header b.due { background: #fbe3df; color: #b3402f; }
.hw-skill ul { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hw-skill li a { display: block; color: var(--ink); }
.hw-skill li strong { display: block; font-size: 12.5px; line-height: 1.3; }
.hw-skill li small { display: block; font-size: 11.5px; color: var(--muted); }
.hw-skill li.late small { color: #b3402f; }
.hw-skill-empty, .hw-skill-more { margin: 0; font-size: 12.5px; color: var(--muted); }
.hw-skill-more { margin-top: 8px; font-size: 11.5px; }
.hw-vocab-line { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.hw-vocab-line b { font-size: 15px; color: var(--ink); } .hw-vocab-line b.due { color: #b3402f; }
.hw-vocab-go { align-self: flex-start; min-height: 34px; padding: 5px 14px; font-size: 13px; margin-top: auto; }
@media (max-width: 640px) { .hw-cols { grid-template-columns: 1fr; } }
.hw-feed li { flex-wrap: wrap; }
.hw-done { flex: 0 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 0 50px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.hw-done b { color: #1f7a4c; font-size: 12.5px; }
.hw-dict a { font-weight: 700; color: #0e7c86; }
.db-split-main > .hw-cols { flex: 1; }
/* homework kind: Bắt buộc (required) / Tùy chọn (optional) */
.hw-kind { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 800; line-height: 1.5; white-space: nowrap; }
.hw-kind.req { background: #fde7d9; color: #b5481a; }
.hw-kind.opt { background: #e3f0fb; color: #1d5f9c; }
.db-feed-main strong .hw-kind { overflow: visible; }

/* Teacher's folder cards on the exam pages: which classes did this test (newest first) and, for the picked class,
   the parts it did with its top two beside each part. */
.cls-runs { position: relative; font-size: 14px; }
.comp-card.comp-folder { overflow: visible; }   /* the class menu drops below the card */
.comp-folder:has(.cls-menu:not([hidden])) { position: relative; z-index: 20; }
.cls-none { color: var(--muted); font-size: 13px; }
.cls-toggle { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.cls-toggle:hover, .cls-toggle[aria-expanded="true"] { border-color: var(--orange); background: var(--peach); }
.cls-head { font-size: 12px; font-weight: 800; color: var(--orange-ink); }
.cls-caret { display: inline-block; transition: transform .15s; }
.cls-toggle[aria-expanded="true"] .cls-caret { transform: rotate(180deg); }
.cls-current { display: flex; align-items: baseline; gap: 6px; max-width: 100%; }
.cls-current b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cls-current small, .cls-menu small { color: var(--muted); font-weight: 700; }
.cls-menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 100%; max-width: 320px; margin: 0; padding: 4px; list-style: none; background: var(--card); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 10px 28px rgba(27, 42, 65, .16); }
.cls-menu button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.cls-menu button:hover { background: var(--surface); }
.cls-menu button[aria-pressed="true"] { background: var(--peach); }
.cls-set { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 3px 12px; align-items: baseline; font-size: 14px; }
.cls-set[hidden] { display: none; }
.cls-part { font-weight: 800; color: var(--ink); white-space: nowrap; }
.cls-part small { font-weight: 400; }
.cls-top { display: flex; align-items: baseline; gap: 5px; min-width: 0; color: var(--ink); }
.cls-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cls-top small { flex-shrink: 0; color: var(--muted); font-weight: 700; }
.comp-folder .cls-runs, .comp-folder .cls-parts { margin-top: 8px; }
.as-list .comp-folder .ex-main { flex: 0 1 230px; min-width: 170px; }
.as-list .comp-folder .cls-runs { flex: 0 0 210px; margin: 0; }
.as-list .comp-folder .cls-parts { flex: 1 1 340px; min-width: 0; margin: 0; }
.as-list .comp-folder .ex-stats { width: auto; flex: 0 0 auto; }
@media (max-width: 1000px) { .as-list .comp-folder { flex-wrap: wrap; } .as-list .comp-folder .cls-parts { flex-basis: 100%; } }
@media (max-width: 760px) { .as-list .comp-folder .cls-runs { flex-basis: 100%; } }

/* Writing Task 2 cards: subject tags beside "Luyện viết" */
.wr-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.wr-subjects { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.wr-subject { font-size: 12px; font-weight: 600; line-height: 1; padding: 5px 10px; border-radius: 999px;
    background: var(--orange-soft, #fdf0e7); color: var(--orange-ink); border: 1px solid rgba(181, 83, 30, .18); white-space: nowrap; }


/* Reading in a live class, and reading assigned to students: the passage beside the questions on wide screens, pinned above them on phones */
@media (min-width: 901px) {
  .lv-card:has(> .lv-psgslot) { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 18px; align-items: start; }
  .lv-card:has(> .lv-psgslot) > * { grid-column: 2; }
  .lv-card:has(> .lv-psgslot) > .lv-psgslot { grid-column: 1; grid-row: 1 / span 40; position: sticky; top: 12px; }
  .lv-card .lv-psg { margin: 0; }
  .lv-card .lv-psg-body { max-height: calc(100vh - 150px); }
}
@media (max-width: 900px) {
  .lv-card > .lv-psgslot { position: sticky; top: 0; z-index: 20; margin: 0 0 10px; }
  .lv-card .lv-psg { margin: 0; box-shadow: 0 6px 16px #1b2a411f; }
  .lv-card .lv-psg > summary { padding: 8px 12px; }
  .lv-card .lv-psg-body { max-height: 38vh; padding: 0 12px 10px; font-size: 1em; line-height: 1.6; }
}
.ct-psg-toggle { display: none; }
@media (max-width: 860px) {
  .ct-part.has-passage { display: block; }
  .ct-part.has-passage > .ct-passage { position: sticky; top: 0; z-index: 15; max-height: 38vh; margin: 0 -4px 12px; padding: 6px 12px 10px; background: #fff; box-shadow: 0 6px 14px #0000001f; font-size: 16px; line-height: 1.6; }
  .ct-part.has-passage.psg-off > .ct-passage { max-height: 46px; overflow: hidden; }
  .ct-psg-toggle { display: inline-flex; position: sticky; top: 0; z-index: 2; margin: 0 0 6px; padding: 6px 12px; font-size: 14px; }
  .ct-q, .ct-stem { scroll-margin-top: 42vh; }
}


/* Reading assigned to students, on phones: questions full screen, a floating "Passage" button opens the passage as a bottom sheet (highlighter, text size, Close) */
.ct-psg-head, .ct-psg-tools, .ct-psg-fab, .ct-psg-dim { display: none; }
.ct-psg-body { display: contents; }
.ct-hl { color: inherit; border-radius: 3px; padding: 0 1px; }
@media (max-width: 860px) {
  .ct-part.has-passage { display: block; }
  .ct-part.has-passage > .ct-passage { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 90; height: 76vh; max-height: none; margin: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden; border: 0; border-radius: 20px 20px 0 0; background: #fff; box-shadow: 0 -12px 34px #00000055; transform: translateY(108%); transition: transform .22s ease; font-size: var(--rd-size, 17px); line-height: 1.7; visibility: hidden; }
  .ct-part.has-passage.psg-open > .ct-passage { transform: none; visibility: visible; }
  .ct-psg-head { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; padding: 12px 14px 8px; font-family: inherit; }
  .ct-psg-head strong { flex: 1; font-size: 17px; }
  .ct-psg-size button, .ct-psg-close, .ct-psg-tools button { border: 1px solid #c9c9c9; background: #fff; color: #2b2b2b; border-radius: 12px; padding: 7px 12px; font-size: 14px; font-weight: 700; }
  .ct-psg-size { display: inline-flex; gap: 6px; }
  .ct-psg-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; padding: 8px 14px 10px; border-top: 1px solid #e4e4e4; border-bottom: 1px solid #e4e4e4; background: #fafafa; font-family: inherit; font-size: 13px; }
  .ct-psg-tools .lbl { font-weight: 800; letter-spacing: .04em; color: #555; }
  .ct-psg-tools .dot { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px #bbb; }
  .ct-psg-tools .dot[aria-pressed="true"], .ct-psg-tools .eraser[aria-pressed="true"] { box-shadow: 0 0 0 3px #222; }
  .ct-psg-tools .eraser[aria-pressed="true"] { background: #eee; }
  .ct-psg-tools .hint { flex-basis: 100%; color: #666; }
  .ct-psg-body { display: block; flex: 1 1 auto; overflow-y: auto; padding: 8px 16px 30px; -webkit-overflow-scrolling: touch; }
  .ct-psg-dim { display: block; position: fixed; inset: 0; z-index: 85; background: #0000005c; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.ct-psg-on .ct-psg-dim { opacity: 1; pointer-events: auto; }
  body.ct-psg-on { overflow: hidden; }
  .ct-psg-fab { display: block; position: fixed; right: 12px; bottom: 150px; z-index: 70; padding: 11px 16px; border: 0; border-radius: 14px; background: #f9a8c0; color: #3b0d1c; font-size: 16px; font-weight: 800; box-shadow: 0 4px 0 #e68aa6, 0 8px 18px #00000030; }
  body.ct-psg-on .ct-psg-fab { display: none; }
  .ct-q, .ct-stem { scroll-margin-top: 70px; }
}


/* IELTS reading on phones: questions full screen; a floating "Passage" button opens the passage as a bottom sheet (Close goes back to the questions) */
.rd-sheet-head, .rd-sheet-fab, .rd-sheet-dim { display: none; }
@media (max-width: 900px) {
  .rd-tabs.rd-sheet-tabs { display: none; }
  .reading-split.rd-sheet[data-tab="passage"] .reading-questions { display: block; }
  .reading-split.rd-sheet[data-tab="passage"] > .reading-passage { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 90; height: 78vh; max-height: none; margin: 0; padding: 0 16px 30px; overflow-y: auto; -webkit-overflow-scrolling: touch; border: 0; border-radius: 20px 20px 0 0; background: #fff; box-shadow: 0 -12px 34px #00000055; animation: rd-sheet-up .22s ease; }
  @keyframes rd-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
  .reading-split.rd-sheet > .reading-passage .rd-sheet-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 3; margin: 0 -16px 6px; padding: 12px 16px 8px; background: #fff; border-bottom: 1px solid #e4e4e4; }
  .rd-sheet-head strong { font-size: 17px; }
  .rd-sheet-head button { border: 1px solid #c9c9c9; background: #fff; color: #2b2b2b; border-radius: 12px; padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 700; }
  .reading-split.rd-sheet > .reading-passage .rd-psize { top: 54px; }
  .rd-sheet-dim { display: block; position: fixed; inset: 0; z-index: 85; background: #0000005c; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.rd-sheet-on .rd-sheet-dim { opacity: 1; pointer-events: auto; }
  body.rd-sheet-on { overflow: hidden; }
  .rd-sheet-fab { display: block; position: fixed; right: 12px; bottom: 150px; z-index: 70; padding: 11px 16px; border: 0; border-radius: 14px; background: #f9a8c0; color: #3b0d1c; font-size: 16px; font-weight: 800; box-shadow: 0 4px 0 #e68aa6, 0 8px 18px #00000030; }
  body.rd-sheet-on .rd-sheet-fab { display: none; }
}


/* Reading Lab on phones (also the lab homework): no site header, a slim title, and the lab itself fills the screen right away; teacher panels go below it */
@media (max-width: 900px) {
  body:has(.rl-page) .site-header { display: none; }
  .rl-page { display: flex; flex-direction: column; padding: 8px 0 0; }
  .rl-page .workspace-heading { order: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; padding: 0 12px; }
  .rl-page .workspace-heading h1 { margin: 0; font-size: 17px; line-height: 1.25; }
  .rl-page .workspace-heading .eyebrow { font-size: 11px; }
  .rl-page .heading-actions { display: none; }
  .rl-page .rl-frame { order: 1; width: 100% !important; height: calc(100vh - 64px) !important; height: calc(100dvh - 64px) !important; min-height: 0 !important; border-radius: 0 !important; border-left: 0 !important; border-right: 0 !important; }
  .rl-page .db-panel, .rl-page .lv-start { order: 2; margin: 12px 10px 0 !important; }
}


/* Phones: practice tests and exercises of "Lớp của tôi" (answer rows were overlapping, the bar took a quarter of the screen) */
.ct-opt{position:relative;min-width:0;overflow-wrap:anywhere}
.ct-opt>*:not(.ct-bub):not(input){min-width:0}
.ct-main{overflow-wrap:anywhere}
@media (max-width:600px){
  .ct-q{gap:6px;padding:12px 2px}
  .ct-n{min-width:1.7em}
  .ct-opts,.ct-opts.c2,.ct-opts.c4{grid-template-columns:minmax(0,1fr);gap:4px}
  .ct-opt{padding:8px 10px 8px 6px;min-height:44px;align-items:center}
  .ct-bub{font-size:.85em}
  .ct-fb{font-size:.95em;line-height:1.55}
  .ct-fb *{max-width:100%;overflow-wrap:anywhere}
  .ct-inst,.ct-sec{font-size:1.02em;line-height:1.35}
  .reading-mode .test-bar,.test-bar{padding:6px 8px;gap:4px 8px;font-size:13px}
  #ct-count-label{display:none}
  .test-bar .qnav{order:5;flex:1 1 100%}
  .test-bar .button{margin-left:auto;min-height:38px;padding:8px 14px}
  .qn{min-width:34px;min-height:34px}
}
@media (max-width:420px){
  .ct-opt{padding:9px 8px 9px 4px}
}

/* After checking, the test disables the radios and ".reading-mode input:disabled" made them visible (big grey circles) */
.ct-opt input,.reading-mode .ct-opt input,.reading-mode .ct-opt input:disabled,.ct-opt input:disabled{position:absolute!important;opacity:0!important;width:1px!important;height:1px!important;min-height:0!important;padding:0!important;margin:0!important;border:0!important;pointer-events:none!important;-webkit-appearance:none;appearance:none}

/* nav dropdown must stay above sticky test headers (fix: menu cut by section head) */
.site-header{position:relative;z-index:300}
.nav-dropdown{z-index:300}

/* notice pictures in reading tests (PET Part 1): keep them a sensible size */
.reading-questions .q-image,.q-image{display:block;width:auto;height:auto;max-width:min(100%,460px);max-height:300px;object-fit:contain;margin:8px 0 12px}

/* reading tests: use the screen better on desktop and phone */
.reading-mode h1{font-size:clamp(20px,2.3vw,27px);margin:2px 0 6px;line-height:1.2}
.reading-mode .eyebrow{display:block;margin:4px 0 0;padding:0;line-height:1.3}
.reading-mode > .q-instructions{font-size:13px;line-height:1.4;margin:0 0 6px}
.reading-mode .pre-vocab-mini{margin:6px 0}
.reading-mode .pre-vocab-mini > summary{padding:8px 12px}
.reading-mode .test-section-head{padding-top:8px;padding-bottom:8px}
.reading-mode .test-section-head h2{font-size:18px;margin:0}
.reading-split{margin-top:10px;gap:16px}
.reading-passage{padding:12px 16px;max-height:calc(100vh - 140px)}
.reading-passage h3{font-size:19px}
.reading-passage p{margin:0 0 10px;line-height:1.6}
.reading-questions .q-group{margin-top:14px}
/* one short instruction instead of a passage (PET Part 1 pictures): hide the empty panel, show the pictures in a grid */
.reading-split:has(.reading-passage p:only-of-type){grid-template-columns:1fr}
.reading-split:has(.reading-passage p:only-of-type) .reading-passage{display:none}
.reading-split:has(.reading-passage p:only-of-type) .reading-questions{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr));gap:6px 22px;align-items:start}
.reading-split:has(.reading-passage p:only-of-type) .reading-questions .q-group{margin-top:8px}
.test-section:has(.reading-passage p:only-of-type) .rd-tabs{display:none}
@media (max-width:760px){
.reading-mode h1{font-size:19px}
.reading-mode .test-section-head h2{font-size:16px}
.reading-passage{padding:10px 12px}
.reading-passage h3{font-size:17px}
.reading-split{gap:10px;margin-top:6px}
.reading-mode .q-image{max-height:210px}
}

.workspace:has(.reading-split .reading-passage p:only-of-type) .rd-tool{display:none}

/* live class: pictures keep their shape and a sensible size (PET Reading Part 1 notices, maps) */
.lv-map{width:auto;height:auto;max-width:min(100%,520px);max-height:min(44vh,360px);object-fit:contain}
.lv-qimg{width:auto;max-width:min(100%,520px);max-height:min(44vh,360px);object-fit:contain}

/* live sheet: the group picture is already shown above its questions - do not repeat it under each question */
.lv-sheet .lv-qblock > .lv-map{display:none}

.workspace:has(.reading-split .reading-passage p:only-of-type) .rd-sheet-fab{display:none}

@media (max-width:760px){.reading-mode .q-image,.reading-questions .q-image{max-height:none;max-width:min(100%,380px)}}

body:has(.reading-split .reading-passage p:only-of-type) .rd-sheet-fab{display:none}

@media (max-width:760px){.reading-mode .q-image,.reading-questions .q-image{max-height:340px;max-width:100%}}

/* live class, reading with one passage: passage on the left, its questions on the right (phones: stacked, passage scrolls) */
@media (min-width:900px){
.lv-sheet:has(> .lv-psgslot:only-of-type){display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:0 22px;align-items:start}
.lv-sheet:has(> .lv-psgslot:only-of-type) > .lv-psgslot{grid-column:1;grid-row:1 / span 60;position:sticky;top:12px;max-height:calc(100vh - 24px);overflow:auto}
.lv-sheet:has(> .lv-psgslot:only-of-type) > .lv-group{grid-column:2;margin-top:0}
}
@media (max-width:899px){
.lv-psg-body{max-height:44vh;overflow:auto}
.lv-psg > summary{position:sticky;top:0}
}

@media (min-width:900px){
.lv-sheet:has(> .lv-psgslot):not(:has(> .lv-psgslot ~ .lv-psgslot)){display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:0 22px;align-items:start}
.lv-sheet:has(> .lv-psgslot):not(:has(> .lv-psgslot ~ .lv-psgslot)) > .lv-psgslot{grid-column:1;grid-row:1 / span 60;position:sticky;top:12px;max-height:calc(100vh - 24px);overflow:auto}
.lv-sheet:has(> .lv-psgslot):not(:has(> .lv-psgslot ~ .lv-psgslot)) > .lv-group{grid-column:2;margin-top:0}
}

/* questions with many short choices (PET Reading Part 4, A-H): show the choices as a compact grid */
.q-choice:has(> label:nth-of-type(6)){display:grid;grid-template-columns:repeat(auto-fill,minmax(168px,1fr));gap:6px 10px;align-items:stretch}
.q-choice:has(> label:nth-of-type(6)) > label{margin:0}
.lv-lts:has(> :nth-child(6)){display:grid;grid-template-columns:repeat(auto-fill,minmax(168px,1fr));gap:6px 10px}
@media (max-width:600px){.q-choice:has(> label:nth-of-type(6)),.lv-lts:has(> :nth-child(6)){grid-template-columns:repeat(2,minmax(0,1fr))}}

.q-choice:has(> label:nth-of-type(6)),.lv-lts:has(> :nth-child(6)){grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:4px 8px;font-size:.93em}
@media (max-width:600px){.q-choice:has(> label:nth-of-type(6)),.lv-lts:has(> :nth-child(6)){grid-template-columns:repeat(2,minmax(0,1fr))}}

@media (max-width:899px){
.lv-psgslot.lv-psg-sheet{display:none}
body.lv-psg-open .lv-psgslot.lv-psg-sheet{display:block;position:fixed;left:0;right:0;bottom:0;top:auto;z-index:1250;max-height:78vh;overflow:auto;margin:0;padding:0 0 64px;background:#fff;border-radius:18px 18px 0 0;box-shadow:0 -8px 30px #0003}
body.lv-psg-open::after{content:'';position:fixed;inset:0;z-index:1240;background:#0000005c}
.lv-psg-fab{position:fixed;right:14px;bottom:20px;z-index:1300;padding:11px 18px;border:0;border-radius:14px;background:#f9a8c0;color:#3b0d1c;font:inherit;font-weight:800;font-size:15px;box-shadow:0 4px 14px #0003}
}
@media (min-width:900px){.lv-psg-fab{display:none}}

@media (max-width:899px){.lv-psgslot.lv-psg-sheet .lv-psg-body{max-height:none;overflow:visible}.lv-psgslot.lv-psg-sheet .lv-psg{box-shadow:none}.lv-psgslot.lv-psg-sheet .lv-psg>summary{position:sticky;top:0;background:#fff;z-index:2}}

/* many full-sentence choices (PET Reading Part 4): two columns on wide screens, one on phones */
.q-choice:has(> label:nth-of-type(6)),.lv-lts:has(> :nth-child(6)){grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:6px 10px;font-size:1em}
@media (max-width:600px){.q-choice:has(> label:nth-of-type(6)),.lv-lts:has(> :nth-child(6)){grid-template-columns:1fr}}

/* a one-line placeholder passage (idiom tests, PET Part 1) is not worth a panel in the live room */
.lv-psgslot:has(.lv-psg-body p:only-of-type){display:none}

/* idiom/puzzle live: no passage -> single column, compact picture */
.lv-card:has(> .lv-psgslot .lv-psg-body p:only-of-type){grid-template-columns:minmax(0,1fr)!important}
.lv-card:has(> .lv-psgslot .lv-psg-body p:only-of-type)>*{grid-column:1/-1!important}
.lv-card:has(> .lv-psgslot .lv-psg-body p:only-of-type)>.lv-map{width:auto;max-width:100%;max-height:min(21vh,180px);object-fit:contain;justify-self:center}
.lv-card:has(> .lv-psgslot .lv-psg-body p:only-of-type):has(> .lv-map) .lv-options{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media(max-width:700px){.lv-card:has(> .lv-psgslot .lv-psg-body p:only-of-type):has(> .lv-map) .lv-options{grid-template-columns:1fr}}

/* app tabs (Phrasal Verbs / Idioms): learn in the app, assigned work, teacher tracking */
.app-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 16px;align-items:center}
.app-tab{border:1px solid rgba(128,128,128,.35);background:transparent;padding:9px 16px;border-radius:999px;font:inherit;font-weight:700;cursor:pointer;color:inherit;text-decoration:none;line-height:1.2}
.app-tab[aria-selected="true"]{background:#c4521f;border-color:#c4521f;color:#fff}
.app-tab-right{margin-left:auto}
#hoc-pane iframe{display:block;width:100%;height:calc(100vh - 230px);min-height:560px;border:1px solid rgba(128,128,128,.25);border-radius:14px;background:#fff}
.workspace[data-tab="hoc"]>:not(.workspace-heading):not(.app-tabs):not(#hoc-pane){display:none!important}
.workspace[data-tab="hoc"] .heading-actions{display:none}
.workspace[data-tab="giao"] #hoc-pane{display:none}
.ap-wrap{overflow-x:auto}
.ap-table{width:100%;border-collapse:collapse;font-size:.95rem}
.ap-table th,.ap-table td{padding:10px 12px;border-bottom:1px solid rgba(128,128,128,.25);text-align:left;vertical-align:middle}
.ap-table th{font-size:.8rem;text-transform:uppercase;letter-spacing:.04em;opacity:.7}
.ap-idle{opacity:.55}
.ap-bar{display:inline-block;width:70px;height:8px;border-radius:99px;background:rgba(128,128,128,.25);vertical-align:middle;overflow:hidden}
.ap-bar i{display:block;height:100%;background:#2fbf8a}
.ap-chip{display:inline-block;margin:2px 6px 2px 0;padding:2px 8px;border-radius:99px;background:rgba(128,128,128,.14);font-size:.82rem;white-space:nowrap}

/* class book: folders */
.cb-folder{border:1px solid rgba(128,128,128,.3);border-radius:16px;margin:0 0 12px;background:rgba(255,255,255,.55)}
.cb-folder>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:12px;padding:16px 18px;font-weight:800;font-size:1.12rem}
.cb-folder>summary::-webkit-details-marker{display:none}
.cb-folder>summary::after{content:"▸";margin-left:6px;opacity:.6;transition:transform .15s}
.cb-folder[open]>summary::after{transform:rotate(90deg)}
.cb-f-icon{font-size:1.5rem;line-height:1}
.cb-f-meta{margin-left:auto;font-weight:600;font-size:.85rem;opacity:.7}
.cb-folder-body{padding:0 18px 18px}
.cb-folder-body .cb-sub{font-size:1.02rem;margin:20px 0 10px}
.cb-folder-body .cb-sub small{opacity:.6;font-weight:600}

/* pick a word into Sổ từ */
.pw-btn{position:fixed;z-index:9999;background:#c4521f;color:#fff;border:0;border-radius:999px;padding:8px 14px;font:700 .9rem/1 inherit;box-shadow:0 6px 18px rgba(0,0,0,.25);cursor:pointer}
.pw-btn[hidden]{display:none}
.pw-hint{font-size:.85rem;opacity:.75;margin:6px 0}

/* short passage: full width above the questions */
.ct-part.has-passage.ct-short{grid-template-columns:1fr}
.ct-part.ct-short .ct-passage{position:static;max-height:none}
.ct-part.ct-short .ct-psg-fab,.ct-part.ct-short .ct-psg-dim{display:none!important}

/* passage text size: follows its own A-/A+ */
.ct-passage p,.ct-passage .ct-p-p,.ct-passage .ct-p-h{font-size:var(--psg-size,19px)!important;line-height:1.7}
.ct-szbar{display:flex;gap:6px;align-items:center;justify-content:flex-end;margin:-4px 0 8px;font:600 .8rem/1 inherit;opacity:.85}
.ct-szbar button{border:1px solid rgba(128,128,128,.45);background:transparent;border-radius:8px;padding:5px 10px;font:700 .9rem/1 inherit;cursor:pointer;color:inherit}

/* short passage on phones: show inline (not the hidden bottom sheet) */
@media (max-width:860px){
.ct-part.has-passage.ct-short>.ct-passage{position:static!important;transform:none!important;visibility:visible!important;height:auto!important;max-height:none!important;display:block!important;overflow:visible!important;border:1px solid #dcdcdc!important;border-radius:12px!important;box-shadow:none!important;padding:10px 14px!important;margin:0 0 14px!important;z-index:auto!important;transition:none!important}
.ct-part.has-passage.ct-short>.ct-passage .ct-psg-head{display:none!important}
.ct-part.has-passage.ct-short>.ct-passage .ct-psg-body{overflow:visible!important;height:auto!important;max-height:none!important;padding:0!important}
}

@media (max-width:860px){body:has(.ct-part.has-passage.ct-short):not(:has(.ct-part.has-passage:not(.ct-short))) .ct-psg-fab{display:none!important}}

/* FCE: short answer options sit side by side */
.q-choice.q-short{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:6px 10px}
.q-choice.q-short>legend{grid-column:1/-1}
.q-choice.q-short>label{margin:0;display:flex;align-items:center;gap:6px;padding:8px 10px;border:1px solid #e0dccf;border-radius:10px;min-width:0}
@media (max-width:560px){.q-choice.q-short{grid-template-columns:repeat(2,1fr)}.q-choice.q-short>label{padding:10px 8px}}

/* FCE Part 2: answers typed inside the passage */
.test-section.fce-inline .rd-tabs{display:none}
.test-section.fce-inline .reading-split{display:block}
.test-section.fce-inline .reading-passage{max-width:none;width:auto;height:auto;max-height:none;overflow:visible;position:static}
.test-section.fce-inline .q-group{display:none}
.fi-slot{white-space:nowrap}
.fi-box{display:inline-block}
.fi-box .q-input{width:7.5em;min-width:0;padding:2px 8px;margin:0 2px;font:inherit;font-size:.92em;border:1px solid #b9b3a3;border-radius:8px;background:#fff;vertical-align:baseline}
@media (max-width:560px){.fi-box .q-input{width:6.5em}}

@media (max-width:860px){.test-section.fce-inline .reading-split.rd-sheet{position:static!important;transform:none!important;visibility:visible!important;height:auto!important;max-height:none!important;display:block!important;overflow:visible!important;box-shadow:none!important;border:0!important;padding:0!important;margin:0!important;z-index:auto!important;transition:none!important}
body:has(.test-section.fce-inline) .rd-sheet-fab{display:none!important}
.test-section.fce-inline .reading-passage{display:block!important;padding:12px 14px;line-height:2}}

@media (max-width:860px){.test-section.fce-inline .rd-sheet-head{display:none!important}
.test-section.fce-inline .reading-passage{font-size:16.5px!important;line-height:2.1!important}
.test-section.fce-inline .reading-passage h3{font-size:20px!important;line-height:1.3!important;margin:0 0 8px}
.test-section.fce-inline .reading-questions{display:none!important}}

@media (max-width:860px){.test-section.fce-inline .rd-psize{position:static!important;display:flex;justify-content:flex-end;margin:0 0 6px}
.test-section.fce-inline .reading-passage{padding:10px 10px!important}}

/* links page to external practice tests */
.xl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px;margin:18px 0}
.xl-card{display:flex;flex-direction:column;gap:4px;padding:14px 16px;border:1px solid #e0dccf;border-radius:14px;background:#fff;text-decoration:none;color:inherit;transition:transform .12s,box-shadow .12s}
.xl-card:hover{transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,.08)}
.xl-num{font-size:12px;font-weight:700;letter-spacing:.04em;color:#a9461f;text-transform:uppercase}
.xl-card small{color:#7a7468}
@media (max-width:560px){.xl-grid{grid-template-columns:1fr 1fr;gap:10px}.xl-card{padding:12px}}

.xl-h{margin:26px 0 4px;font-size:1.25rem}

.xl-sub{font-size:.8rem;font-weight:400;color:#7a7468}

/* FCE Part 4: instructions on top, then each item stacked (sentence, KEY WORD, gap sentence) */
.test-section.fce-stacked .rd-tabs{display:none}
.test-section.fce-stacked .reading-split{display:block}
.test-section.fce-stacked .reading-passage{max-width:none;width:auto;height:auto;max-height:none;overflow:visible;position:static;display:block!important;margin-bottom:14px}
.test-section.fce-stacked .reading-questions{display:block!important;max-width:none;width:auto}
.q-kt{margin:0 0 6px}
.q-kt-stem{margin:0 0 2px;font-size:1.05em}
.q-kt-key{margin:0 0 4px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}
.test-section.fce-stacked .q-gap .q-input{width:min(100%,22em);margin:0 4px}
@media (max-width:860px){.test-section.fce-stacked .reading-split.rd-sheet{position:static!important;transform:none!important;visibility:visible!important;height:auto!important;max-height:none!important;display:block!important;overflow:visible!important;box-shadow:none!important;border:0!important;padding:0!important;margin:0!important;z-index:auto!important;transition:none!important}
body:has(.test-section.fce-stacked) .rd-sheet-fab{display:none!important}
.test-section.fce-stacked .rd-sheet-head{display:none!important}
.test-section.fce-stacked .reading-passage{font-size:16px!important;line-height:1.8!important;padding:10px!important}
.test-section.fce-stacked .rd-psize{position:static!important;display:flex;justify-content:flex-end}}

.test-section.fce-stacked .q-item{display:grid;grid-template-columns:auto 1fr;column-gap:12px;align-items:start;margin-bottom:22px}
.test-section.fce-stacked .q-item>.q-num{grid-column:1;grid-row:1/span 2}
.test-section.fce-stacked .q-item>.q-kt,.test-section.fce-stacked .q-item>.q-gap{grid-column:2;display:block}
.test-section.fce-stacked .q-gap{line-height:2.3}

@media (max-width:560px){.test-section.fce-stacked .q-gap .q-input{width:8.5em!important}.test-section.fce-stacked .q-item{column-gap:8px;margin-bottom:18px}}

.fi-key{font-weight:800;letter-spacing:.03em;font-size:.88em;color:#a9461f}

@media (max-width:560px){.fi-slot{white-space:normal}.fi-slot>strong,.fi-box{white-space:nowrap}.fi-key{font-size:.78em;white-space:nowrap}.test-section.fce-inline .reading-passage{overflow-wrap:anywhere}}

.fi-nb{white-space:nowrap}

/* Vocabulary topic cards: scalable text (--vc set by vocab-fs.js, default 1.3) */
.vt-cards{--vc:1.3;grid-template-columns:repeat(auto-fill,minmax(calc(190px*var(--vc)),1fr))}
.vt-cards .vc-head strong{font-size:calc(1.05em*var(--vc))}
.vt-cards .vc-emoji{font-size:calc(20px*var(--vc))}
.vt-cards .vc-ipa{font-size:calc(13px*var(--vc))}
.vt-cards .vc-pos{font-size:calc(12px*var(--vc))}
.vt-cards .vc-mean{font-size:calc(14px*var(--vc))}
.vt-cards .vc-ex{font-size:calc(12.5px*var(--vc))}
.vt-cards .vocab-card{padding:calc(10px*var(--vc)) calc(12px*var(--vc))}
.vt-fs{display:inline-flex;gap:6px;margin-left:12px}
.vt-fs button{min-width:44px;padding:8px 12px;border:1px solid var(--line,#ddd);border-radius:10px;background:#fff;font:inherit;font-weight:700;cursor:pointer}
.vt-fs button:disabled{opacity:.4;cursor:default}
@media (max-width:560px){.vt-cards{grid-template-columns:repeat(auto-fill,minmax(calc(150px*var(--vc)),1fr))}.vt-cards{--vc:1.1}}

.fi-box select.q-input{min-width:5.5em;max-width:11em;padding:3px 24px 3px 8px;margin:0 2px;font:inherit;font-size:.92em;border:1px solid #b9b3a3;border-radius:8px;background-color:#fff;vertical-align:baseline;cursor:pointer}
@media (max-width:560px){.fi-box select.q-input{max-width:8.5em;font-size:.88em}}
