/* EduQuiz Sinh Viên's look on the web: the app's page grey, white cards on a soft edge, its teal with a darker lip under
   the buttons, amber for the accent, Be Vietnam Pro (UniTheme). */
:root {
  --teal: #0E8068; --teal-dark: #0A6552; --teal-soft: #E4F4EF; --teal-line: #A9DCCB;
  --amber: #F2A33A; --amber-soft: #FFF3E0; --amber-ink: #8A5300;
  --good: #1F9D55; --good-ink: #177A42; --good-soft: #E3F6EA; --bad: #D64545; --bad-ink: #B83232; --bad-soft: #FDE7E5;
  --ink: #18212F; --soft: #5E6B7A; --page: #F4F7F6; --card: #FFFFFF; --edge: #D5DDD9; --border: #E2E8E5; --track: #E7EDEB;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.55 "Be Vietnam Pro", "Noto Sans", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--teal-dark); }
h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: 1.8rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 800; margin-top: 28px; }
h3 { font-size: 1.05rem; font-weight: 800; }
p { margin: 6px 0; }
.soft { color: var(--soft); }
.small { font-size: .9rem; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* The bar on top */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 20px; padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--teal); color: #fff; box-shadow: 0 3px 0 var(--teal-dark); }
.brand-sub { color: var(--teal); font-weight: 700; }
.nav { margin-left: auto; display: flex; gap: 6px; }
.nav a { padding: 8px 14px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: .95rem; }
.nav a.on { background: var(--teal-soft); color: var(--teal-dark); }
.dev { background: var(--amber); color: #fff; font-size: .75rem; font-weight: 800; padding: 3px 8px; border-radius: 8px; }
/* The account's round button at the end of the bar: a person, or the account's first letter */
.me { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--edge); color: var(--teal-dark);
  background: #fff; text-decoration: none; font-weight: 800; font-size: 1rem; }
.me.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.me.here { box-shadow: 0 0 0 3px var(--teal-soft); }
/* Signed out: a pill saying Đăng nhập (only the person on a phone) */
.me.out { display: inline-flex; align-items: center; gap: 6px; width: auto; padding: 0 16px 0 12px; border-radius: 999px; font-size: .92rem; border-color: var(--teal-line); }
.me.out:hover { background: var(--teal-soft); }
@media (max-width: 640px) { .me.out { width: 38px; padding: 0; justify-content: center; } .me-label { display: none; } }
.card-title { margin: 0 0 4px; font-size: 1.1rem; }
.account-actions { margin-top: 14px; }
.danger-zone { box-shadow: none; }

.main { width: 100%; max-width: 780px; margin: 0 auto; padding: 24px 16px 48px; flex: 1; }
body[data-side="teacher"] .main { max-width: 1040px; }
.foot { text-align: center; padding: 18px 16px 28px; font-size: .85rem; color: var(--soft); }
.foot a { color: var(--soft); }

/* Cards, rows, lists */
.card { display: block; background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius); padding: 18px; margin: 12px 0; box-shadow: 0 3px 0 var(--edge); color: inherit; text-decoration: none; }
.card.soft { color: var(--soft); box-shadow: none; }
.card.warn { background: var(--amber-soft); border-color: #F5D9A6; box-shadow: none; }
.list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.list .card { margin: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
button.row, a.row { width: 100%; text-align: left; font: inherit; color: inherit; background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: 0 3px 0 var(--edge); cursor: pointer; text-decoration: none; flex-wrap: nowrap; }
button.row:hover, a.row:hover { border-color: var(--teal-line); }
.row-icon { font-size: 1.3rem; width: 42px; height: 42px; display: grid; place-items: center; background: var(--teal-soft); border-radius: 50%; flex: none; }
.row-icon.done { background: var(--good-soft); color: var(--good); font-weight: 800; }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-text b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text small { color: var(--soft); }
.chev { color: var(--teal-dark); font-weight: 700; white-space: nowrap; font-size: .9rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 10px 0; }
.grid .card { margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.columns { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 760px) { .two, .columns { grid-template-columns: 1fr; } }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.section-head h2 { margin-top: 24px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent;
  font: 800 .98rem/1 "Be Vietnam Pro", "Noto Sans", "Noto Sans Thai", system-ui, sans-serif; cursor: pointer; text-decoration: none; transition: transform .06s; }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn.primary { background: var(--teal); color: #fff; box-shadow: 0 4px 0 var(--teal-dark); }
.btn.secondary { background: #fff; color: var(--teal-dark); border-color: var(--edge); box-shadow: 0 4px 0 var(--edge); }
.btn.danger { background: var(--bad-ink); color: #fff; box-shadow: 0 4px 0 #8E2424; }
.btn.ghost { background: transparent; color: var(--teal-dark); box-shadow: none; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn.wide { width: 100%; margin-top: 14px; }
.btn:disabled { background: #E5E9EE; color: #A4ADBA; box-shadow: 0 4px 0 #CDD3DB; border-color: transparent; cursor: default; }
.link { background: none; border: none; color: var(--teal-dark); font: 700 .95rem "Be Vietnam Pro", "Noto Sans", "Noto Sans Thai", system-ui, sans-serif; cursor: pointer; padding: 8px; }
.link.inline { padding: 0; font-size: inherit; }
.link.center { display: block; margin: 18px auto 0; }
.link.soft { color: var(--soft); font-weight: 600; }
.icon { background: none; border: none; font-size: 1.3rem; color: var(--soft); cursor: pointer; width: 40px; height: 40px; border-radius: 10px; }
.icon.small { width: 30px; height: 30px; font-size: 1rem; }
.icon:hover { background: var(--track); }
.back { display: inline-block; color: var(--soft); font-weight: 700; text-decoration: none; margin-bottom: 6px; }

/* Forms */
label { display: block; font-weight: 700; color: var(--ink); margin: 14px 0 6px; }
label.inline { display: inline; margin: 0; font-weight: 600; }
.text, .code-input, .message { width: 100%; font: 600 1rem "Be Vietnam Pro", "Noto Sans", "Noto Sans Thai", system-ui, sans-serif; color: var(--ink); background: #FBFCFC; border: 1px solid var(--edge);
  border-radius: 10px; padding: 12px 14px; outline: none; }
.text:focus, .code-input:focus, .message:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px var(--teal-soft); }
.code-input { font-size: 1.25rem; letter-spacing: .18em; text-transform: uppercase; flex: 1; min-width: 0; }
.message { font-weight: 500; line-height: 1.5; resize: vertical; margin: 12px 0 0; white-space: pre-wrap; }
pre.message { font: 500 .92rem/1.55 "Be Vietnam Pro", "Noto Sans", "Noto Sans Thai", system-ui, sans-serif; background: var(--page); }
.note { font-size: .88rem; color: var(--soft); margin: 8px 0 0; }
.code-box .row { flex-wrap: nowrap; }
.check-line { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; font-size: .92rem; margin-top: 16px; }
.check-line input { margin-top: 4px; }
.drop { border: 2px dashed var(--teal-line); border-radius: 12px; padding: 14px; background: var(--teal-soft); }
.picked-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pages { margin-top: 10px; gap: 8px; }
.text.page { width: 84px; padding: 8px 10px; }

/* Heads */
.hero { padding: 6px 0 10px; }
.hero.front { text-align: center; padding: 24px 0 8px; }
.hero.front h1 { font-size: 2.2rem; }
.hero.front > p { font-size: 1.1rem; max-width: 600px; margin: 8px auto 18px; color: var(--soft); }
.hero.small h1 { font-size: 1.55rem; }
.eyebrow, .kicker { color: var(--teal); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; margin-bottom: 4px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.center-row { justify-content: center; }
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 640px; margin: 0 auto; }
@media (max-width: 520px) { .roles { grid-template-columns: 1fr; } }
.role { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; }
.role:hover { border-color: var(--teal-line); }
.role b { font-size: 1.15rem; color: var(--ink); }
.role-icon { font-size: 2.6rem; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 18px; }
.feature { margin: 0; }
.feature-icon { font-size: 1.7rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
@media (max-width: 680px) { .steps { grid-template-columns: 1fr; } }
.step { margin: 0; }
.step-n { width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 800; display: grid; place-items: center; margin-bottom: 8px; box-shadow: 0 3px 0 var(--teal-dark); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { background: var(--teal-soft); color: var(--teal-dark); border-radius: 999px; padding: 3px 12px; font-size: .85rem; font-weight: 700; }
.tag.late { background: var(--amber-soft); color: var(--amber-ink); }
.store-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* Classes and codes */
.class-card { display: flex; flex-direction: column; gap: 2px; }
.class-card:hover { border-color: var(--teal-line); }
.class-name { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.code-card { background: var(--teal-soft); border-color: var(--teal-line); box-shadow: 0 3px 0 var(--teal-line); text-align: center; margin: 0; }
.give-card { margin: 0; display: flex; flex-direction: column; }
.give-card .btn { margin-top: auto; }
.big-code { font-size: 2.5rem; font-weight: 800; letter-spacing: .14em; color: var(--teal-dark); margin: 4px 0; }
.people { padding: 6px 14px; margin: 10px 0; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.person:last-child { border-bottom: none; }
.names { display: flex; flex-wrap: wrap; gap: 8px; }
.name-chip { background: var(--card); border: 1px solid var(--edge); border-radius: 999px; padding: 6px 14px; font-weight: 700; color: var(--ink); }
.name-chip small { color: var(--soft); font-weight: 500; }

/* Giving */
.stepper { display: flex; gap: 8px; margin: 10px 0 14px; }
.stepper-item { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--soft); font-size: .92rem; border-bottom: 4px solid var(--track); padding-bottom: 8px; }
.stepper-item span { width: 26px; height: 26px; border-radius: 50%; background: var(--disabled, #CDD5D2); color: #fff; display: grid; place-items: center; font-size: .8rem; flex: none; }
.stepper-item.on { color: var(--teal-dark); border-color: var(--teal); }
.stepper-item.on span, .stepper-item.done span { background: var(--teal); }
.stepper-item.done { border-color: var(--teal-line); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 8px; overflow-x: auto; }
.tab { font: 700 .95rem "Be Vietnam Pro", "Noto Sans", "Noto Sans Thai", system-ui, sans-serif; background: none; border: none; border-bottom: 3px solid transparent; padding: 10px 14px; color: var(--soft); cursor: pointer; white-space: nowrap; }
.tab.on { color: var(--teal-dark); border-color: var(--teal); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chips.tight { margin: 0; }
.chip { font: 700 .92rem "Be Vietnam Pro", "Noto Sans", "Noto Sans Thai", system-ui, sans-serif; background: #fff; color: var(--ink); border: 1px solid var(--edge); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.course { padding: 0; overflow: hidden; }
.course-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; background: none; border: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.course-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.course .list { padding: 0 14px 14px; }
.picked-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--edge);
  border-radius: var(--radius); padding: 12px 14px; margin: 16px 0 0; box-shadow: 0 -6px 18px rgba(24,33,47,.06); }
.preview { padding-left: 22px; }
.preview > li { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; }
.preview > li.off { background: none; }
.keep { display: flex; gap: 6px; align-items: center; margin: 0 0 6px; font-size: .88rem; color: var(--soft); font-weight: 600; }
.thumb { max-width: 220px; max-height: 160px; object-fit: contain; display: block; margin: 6px 0; }

/* Marks */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { text-align: center; margin: 0; }
.stat-n { font-size: 2rem; font-weight: 800; color: var(--ink); }
.band-bar { display: flex; height: 28px; border-radius: 8px; overflow: hidden; gap: 2px; }
.band-bar span { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .85rem; min-width: 26px; }
.band-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: .9rem; }
.band-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.b0 { background: var(--good); } .b2 { background: var(--amber); } .b3 { background: var(--bad); }
.score { font-weight: 800; font-size: 1.1rem; min-width: 38px; text-align: right; }
.score.good { color: var(--good-ink); } .score.mid { color: var(--amber-ink); } .score.low { color: var(--bad-ink); } .score.muted { color: var(--soft); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--edge); border-radius: var(--radius); }
table.scores { width: 100%; border-collapse: collapse; font-size: .93rem; }
.scores th { text-align: left; color: var(--soft); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.scores td { padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.scores tr:last-child td { border-bottom: none; }
.scores .score { text-align: left; }

/* The exam */
body.playing .main, body.playing .top, body.playing .foot { display: none; }
#stage:empty { display: none; }
.exam { max-width: 760px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; padding: 0 16px 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.exam-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; position: sticky; top: 0; background: var(--page); z-index: 3; }
.clock { font-weight: 800; font-size: 1.15rem; background: #fff; border: 1px solid var(--edge); border-radius: 999px; padding: 6px 18px; font-variant-numeric: tabular-nums; }
.clock.late { color: #fff; background: var(--bad); border-color: var(--bad); }
.exam-head b { font-size: 1.05rem; }
.exam-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--soft); font-weight: 700; font-size: .9rem; margin: 10px 0 6px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin: 6px 0 10px; }
.cell { height: 40px; border-radius: 8px; border: 1px solid var(--edge); background: #fff; font: 700 .95rem "Be Vietnam Pro", "Noto Sans", "Noto Sans Thai", system-ui, sans-serif; color: var(--ink); cursor: pointer; }
.cell.done { background: var(--teal-soft); border-color: var(--teal-line); color: var(--teal-dark); }
.cell.now { outline: 2px solid var(--teal); }
.exam-body { flex: 1; padding: 6px 0 16px; }
.kind { color: var(--teal); font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.prompt { font-size: 1.2rem; font-weight: 700; color: var(--ink); margin: 8px 0 14px; }
.passage { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--teal-line); border-radius: 10px; padding: 12px 14px; margin: 8px 0; white-space: pre-wrap; }
.passage.small { font-size: .9rem; }
.picture { display: block; max-width: 100%; max-height: 360px; margin: 8px auto 12px; object-fit: contain; border-radius: 8px; background: #fff; }
.picture.small { max-height: 200px; margin: 6px 0; }
iframe.figure { display: block; width: 100%; height: 280px; border: 1px solid var(--border); border-radius: 10px; background: #fff; margin: 8px 0 12px; }
audio { width: 100%; margin: 8px 0; }
.hint { color: var(--soft); font-size: .92rem; margin: -6px 0 10px; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: 500 1.02rem "Be Vietnam Pro", "Noto Sans", "Noto Sans Thai", system-ui, sans-serif; color: var(--ink);
  background: #fff; border: 1px solid var(--edge); border-radius: 12px; padding: 12px 14px; box-shadow: 0 3px 0 var(--edge); cursor: pointer; }
.choice:hover { border-color: var(--teal-line); }
.choice.on { background: var(--teal-soft); border-color: var(--teal); box-shadow: 0 3px 0 var(--teal-line); }
.letter { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--edge); display: grid; place-items: center; font-weight: 800; color: var(--soft); flex: none; background: #fff; }
.choice.on .letter { background: var(--teal); border-color: var(--teal); color: #fff; }
.choice-text { flex: 1; }
.exam-foot { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 0 4px; background: var(--page); }
.result-card { background: #fff; border: 1px solid var(--edge); border-radius: var(--radius); text-align: center; padding: 24px 18px; box-shadow: 0 3px 0 var(--edge); margin-top: 20px; }
.result-score { font-size: 3.2rem; font-weight: 800; }
.result-score small { font-size: 1rem; color: var(--soft); }
.result-score.good { color: var(--good-ink); } .result-score.mid { color: var(--amber-ink); } .result-score.low { color: var(--bad-ink); }
.result-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.status { font-weight: 600; color: var(--soft); }
.status.ok { color: var(--good-ink); }
.status.bad { color: var(--bad-ink); }
.review { display: flex; flex-direction: column; gap: 12px; }
.review-item { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--good); border-radius: 12px; padding: 12px 14px; }
.review-item.bad { border-left-color: var(--bad); }
.review-head { display: flex; align-items: center; gap: 8px; }
.review-mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .85rem; background: var(--good); }
.review-item.bad .review-mark { background: var(--bad); }
.review-q { font-weight: 700; margin: 6px 0; }
.review-choices { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.review-choices li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; }
.review-choices .letter { width: 26px; height: 26px; font-size: .8rem; }
.review-choices li.right { background: var(--good-soft); }
.review-choices li.right .letter { background: var(--good); border-color: var(--good); color: #fff; }
.review-choices li.wrong { background: var(--bad-soft); }
.review-choices li.wrong .letter { background: var(--bad); border-color: var(--bad); color: #fff; }
.mark-tag { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--soft); }
.explain { background: var(--amber-soft); border-radius: 8px; padding: 8px 12px; margin-top: 8px; font-size: .93rem; }
.explain.small { font-size: .85rem; }

/* Boxes over the page, waiting, messages */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(7,28,31,.45); display: grid; place-items: center; padding: 16px; }
.modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: 86vh; overflow: auto; padding: 20px 22px; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 18px; }
.waiting { padding: 30px 0; }
.spinner { width: 34px; height: 34px; border: 4px solid var(--teal-soft); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; margin: 6px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 60; background: #1F2933; color: #fff; padding: 12px 18px; border-radius: 12px;
  font-weight: 600; max-width: calc(100% - 32px); transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.wrong { background: var(--bad-ink); }

@media (max-width: 520px) {
  .top { padding: 10px 12px; gap: 8px; }
  .brand-sub { display: none; }
  .nav { gap: 2px; }
  .nav a { padding: 8px 9px; white-space: nowrap; font-size: .9rem; }
  h1 { font-size: 1.5rem; }
  .hero.front h1 { font-size: 1.8rem; }
  .big-code { font-size: 2rem; }
  .stats { gap: 8px; }
  .stat-n { font-size: 1.5rem; }
  .prompt { font-size: 1.08rem; }
}
@media (max-width: 420px) { .brand-word { display: none; } .me, .me.out { width: 34px; height: 34px; } }
@media (max-width: 370px) { .nav a { padding: 8px 6px; } }

/* The editor */
.editor-head .title-input { font-size: 1.15rem; font-weight: 700; }
.editor-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; margin-top: 12px; }
.editor-tools > .soft { margin-right: auto; }
.editor-list { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.q-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.q-card.lacking { border-color: #F5D9A6; background: #FFFBF3; }
.q-card.editing { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.q-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.q-actions .icon:disabled { opacity: .3; cursor: default; }
.preview-math { min-height: 1.2em; padding: 6px 2px; font-size: .95rem; white-space: pre-wrap; }
.choice-edit { display: flex; flex-direction: column; gap: 8px; }
.choice-row { display: flex; align-items: center; gap: 8px; }
.choice-row input[type=radio], .choice-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--teal); flex: none; }
.choice-row .text { padding: 9px 12px; }
.form-actions { margin-top: 14px; gap: 10px; }
.import { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9rem; }
.import-status { margin-top: 10px; }
.problems { margin: 4px 0 0; padding-left: 20px; color: var(--amber-ink); font-size: .9rem; }
.drop.over { background: #d3eee6; border-color: var(--teal); }

/* Bộ đề của tôi */
.roles.three { grid-template-columns: repeat(3, 1fr); max-width: 860px; }
@media (max-width: 720px) { .roles.three { grid-template-columns: 1fr; } }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 14px 0; }
.action { margin: 0; text-align: left; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.action:hover:not(:disabled) { border-color: var(--teal-line); }
.action:disabled { opacity: .45; cursor: default; }
.action b { color: var(--ink); }
.action-icon { font-size: 1.5rem; }
.with-tools { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Practice and cards */
.practice .progress { margin: 0 0 8px; }
.progress { height: 10px; background: var(--track); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--teal); border-radius: 99px; transition: width .3s; }
.count { font-weight: 800; color: var(--soft); }
.count.good { color: var(--good-ink); }
.choice.right { background: var(--good-soft); border-color: var(--good); box-shadow: 0 3px 0 #b5e3c6; }
.choice.right .letter { background: var(--good); border-color: var(--good); color: #fff; }
.choice.wrong { background: var(--bad-soft); border-color: var(--bad); box-shadow: 0 3px 0 #f2b8b8; }
.choice.wrong .letter { background: var(--bad); border-color: var(--bad); color: #fff; }
.choice:disabled { cursor: default; }
.practice-foot { position: sticky; bottom: 0; padding: 10px 0 4px; background: var(--page); }
.practice-foot.flow { position: static; }
.practice-foot > .btn { width: 100%; }
.banner { border-radius: var(--radius); padding: 14px 16px; }
.banner.ok { background: var(--good-soft); }
.banner.bad { background: var(--bad-soft); }
.banner-title { font-weight: 800; font-size: 1.2rem; color: var(--good-ink); }
.banner.bad .banner-title { color: var(--bad-ink); }
.banner-line { margin: 4px 0 6px; }
.banner .btn { width: 100%; margin-top: 10px; }
.banner.help { background: #FFF3E0; }
.banner.help .banner-title { color: #8A5300; }
.banner .btn.ghost { margin-top: 6px; }
.help-step { margin: 6px 0; }
.help-step .kicker { color: #8A5300; font-weight: 800; font-size: .8rem; letter-spacing: .04em; }
.help-step ol { margin: 4px 0 0; padding-left: 1.3em; }
.choice.struck { opacity: .55; text-decoration: line-through; }
.flashcard { display: block; width: 100%; min-height: 300px; margin: 14px 0; padding: 22px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: #fff; border: 1px solid var(--edge); border-radius: 18px; box-shadow: 0 4px 0 var(--edge); }
.flashcard.back { background: var(--teal-soft); border-color: var(--teal-line); box-shadow: 0 4px 0 var(--teal-line); }
.card-choices { padding-left: 22px; list-style: upper-alpha; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-emoji { font-size: 3rem; }

/* Classes: homework rows with two buttons, the hardest questions, the gradebook */
.work-row { flex-wrap: wrap; }
.work-actions { display: flex; gap: 8px; margin-left: auto; }
div.row.static { width: 100%; background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 3px 0 var(--edge); }
@media (max-width: 560px) { .work-actions { width: 100%; } .work-actions .btn { flex: 1; } }
.hard-q { margin: 0; }
.hard-bar { height: 8px; background: var(--bad-soft); border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.hard-bar span { display: block; height: 100%; background: var(--good); }
.gradebook th a { color: inherit; }
.gradebook td, .gradebook th { text-align: center; }
.gradebook td:nth-child(2), .gradebook th:nth-child(2) { text-align: left; }
.gradebook-key { margin-top: 10px; }

/* The paper to print */
.print-bar { position: sticky; top: 0; display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: var(--page); z-index: 3; max-width: 860px; margin: 0 auto; }
.print-bar .soft { margin-right: auto; }
.paper { max-width: 860px; margin: 0 auto 40px; background: #fff; padding: 32px 40px; border: 1px solid var(--border); border-radius: 8px; color: #111; }
.paper-title { font-size: 1.4rem; font-weight: 800; text-align: center; }
.paper-head { text-align: center; margin-bottom: 18px; }
.paper-fill { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 12px; font-size: .95rem; }
.paper-questions { padding-left: 24px; }
.paper-questions > li { margin: 0 0 14px; break-inside: avoid; }
.paper-q { font-weight: 600; margin-bottom: 4px; }
.paper-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.paper-choices.one-column { grid-template-columns: 1fr; }
.paper-picture { max-width: 60%; max-height: 220px; display: block; margin: 6px 0; }
.paper:not(.with-answers) .paper-key { display: none; }
.paper-key { break-before: page; margin-top: 24px; }
.key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 4px 10px; margin-bottom: 14px; }
.key-explain { font-size: .9rem; padding-left: 24px; }
@media print {
  body { background: #fff; }
  .top, .main, .foot, .toast, .no-print { display: none !important; }
  #stage { display: block !important; }
  .paper { border: none; padding: 0; margin: 0; max-width: none; }
}

/* The 2025 exam's kinds */
.statements { display: flex; flex-direction: column; gap: 8px; }
.statement { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--edge); border-radius: 12px; padding: 10px 12px; }
.statement.right { background: var(--good-soft); border-color: var(--good); }
.statement.wrong { background: var(--bad-soft); border-color: var(--bad); }
.statement-text { flex: 1; }
.judge { display: flex; gap: 6px; flex: none; }
.judge-btn { font: 700 .92rem "Be Vietnam Pro", "Noto Sans", "Noto Sans Thai", system-ui, sans-serif; border: 1px solid var(--edge); background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.judge-btn.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.judge-btn:disabled { cursor: default; }
@media (max-width: 520px) { .statement { flex-direction: column; align-items: stretch; } .judge { justify-content: flex-end; } }
.short { display: flex; flex-direction: column; gap: 6px; max-width: 360px; }
.short-input { font-size: 1.15rem; }
.short-review { margin: 6px 0; }
.review-item.part { border-left-color: var(--amber); }
.review-item.part .review-mark { background: var(--amber); }
.review-choices li.wrong-soft .letter { background: #fff; }
.leave-note { background: var(--amber-soft); color: var(--amber-ink); border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: .9rem; margin: 6px 0; }
.card-statements { padding-left: 22px; list-style: lower-alpha; }
.tick-label { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: .85rem; white-space: nowrap; }
.warn-note { color: var(--amber-ink); }
.when-input { max-width: 260px; }

/* Class list, score spread */
.roster-card { margin: 10px 0; }
.roster-card .row { justify-content: space-between; }
.roster-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; max-height: 260px; overflow: auto; }
.roster-list .name-chip { font-size: .85rem; padding: 4px 10px; font-weight: 600; color: var(--soft); }
.roster-list .name-chip.in { background: var(--good-soft); border-color: #b5e3c6; color: var(--good-ink); }
.histogram { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; align-items: end; height: 140px; margin-top: 16px; }
.hist-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; }
.hist-bar { width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--track); }
.hist-bar.good { background: var(--good); } .hist-bar.mid { background: var(--amber); } .hist-bar.low { background: var(--bad); }
.hist-n { font-size: .75rem; font-weight: 700; color: var(--soft); }
.hist-k { font-size: .8rem; color: var(--soft); }

/* Several mã đề */
.variant-select { width: auto; padding: 6px 10px; font-size: .9rem; }
.paper + .paper { margin-top: 24px; }
.paper-code { font-weight: 800; margin-top: 4px; }
.paper-statements { display: flex; flex-direction: column; gap: 2px; }
.paper-box { color: #555; margin-left: 8px; white-space: nowrap; }
.paper-short { color: #555; }
@media print { .paper + .paper { break-before: page; margin-top: 0; } }

/* Mời sinh viên: the class's QR in the invite, and over the whole screen to project in class */
.invite-qr { display: flex; gap: 16px; align-items: center; margin: 14px 0 2px; }
.invite-qr p { margin: 4px 0; }
.qr-box { flex: none; width: 128px; height: 128px; display: grid; place-items: center; border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; background: #fff; }
.qr-box canvas, .present-qr canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.row-links { display: flex; flex-wrap: wrap; gap: 0 6px; margin-left: -8px; }
.present { position: fixed; inset: 0; z-index: 60; background: #fff; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 20px; text-align: center; }
.present-close { position: absolute; top: 16px; right: 16px; }
.present h1 { font-size: clamp(1.6rem, 4vw, 3rem); margin: 2px 0 20px; }
.present-main { display: flex; gap: clamp(20px, 5vw, 64px); align-items: center; justify-content: center; flex-wrap: wrap; }
.present-qr { width: min(58vh, 44vw); height: min(58vh, 44vw); display: grid; place-items: center; }
.present-steps { text-align: left; font-size: clamp(1rem, 2.2vw, 1.6rem); line-height: 1.5; max-width: 26em; margin: 0; padding-left: 1.3em; }
.present-steps li { margin: 6px 0; }
.huge-code { font-size: clamp(2.6rem, 7vw, 5.6rem); font-weight: 800; letter-spacing: .14em; color: var(--teal-dark); line-height: 1.15; margin: 4px 0 6px; }
.joined { margin-top: 24px; font-size: clamp(1.05rem, 2vw, 1.5rem); font-weight: 800; color: var(--teal-dark); }
.joined-names { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 1100px; margin-top: 12px; }
@media (max-aspect-ratio: 1/1) { .present-qr { width: min(78vw, 44vh); height: min(78vw, 44vh); } }
@media (max-width: 520px) { .invite-qr { flex-direction: column; align-items: flex-start; } }

/* Inside the app's WebView (?app=1): the app's own top bar is above; only the page's content shows. */
body.in-app .top, body.in-app .foot { display: none; }
body.in-app .main { padding-top: 12px; }

/* KaTeX gives \text{…} in a formula the class "text", the same as the text boxes above: undo their look inside math
   (units, "khi", "và" otherwise show as full-width input boxes). */
.katex .text { width: auto; font: inherit; color: inherit; background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; }

/* ------------------------------------------------------------------ Editor: formulas, the paper beside, find */
.tex-bar { border: 1px solid var(--edge, #E3E8EE); border-radius: 10px; padding: 6px; margin: 10px 0 4px; background: #FAFCFB; }
.tex-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.tex-tab { border: 0; background: none; font: 600 .82rem inherit; padding: 4px 8px; border-radius: 6px; color: #5B6B66; cursor: pointer; }
.tex-tab.on { background: #fff; color: inherit; box-shadow: 0 0 0 1px var(--edge, #E3E8EE); }
.tex-keys { display: flex; gap: 4px; flex-wrap: wrap; }
.tex-key { min-width: 38px; height: 38px; padding: 0 8px; border: 1px solid var(--edge, #E3E8EE); border-radius: 8px; background: #fff; cursor: pointer; font-size: .9rem; }
.tex-key:hover { border-color: currentColor; }
.tex-key .katex { font-size: .95em; }
.tex-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.choice-row { align-items: flex-start; }
.choice-row > input[type=radio], .choice-row > input[type=checkbox], .choice-row > .letter, .choice-row > .tick-label { margin-top: 10px; }
.tex-wrap .preview-math { font-size: .9rem; padding: 4px 2px 0; }
.tex-problems { margin: 4px 0 0; padding-left: 18px; color: #A1491D; font-size: .82rem; }
.tex-problems:empty { display: none; }
.q-card.tex-bad { border-color: #F2C3A6; }
.find-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.find-row .text { flex: 1 1 200px; width: auto; }
.editor-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 42%); gap: 16px; align-items: start; }
.source-pane { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; background: #fff; border: 1px solid var(--edge, #E3E8EE); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.source-head { display: flex; align-items: baseline; gap: 8px; } .source-head .link { margin-left: auto; }
.source-img { width: 100%; border-radius: 6px; cursor: zoom-in; }
.source-img.zoom { width: 220%; max-width: none; cursor: zoom-out; }
.source-pdf { width: 100%; height: calc(100vh - 150px); min-height: 420px; border: 0; }
@media (max-width: 900px) {
  .editor-split { grid-template-columns: 1fr; }
  .source-pane { position: static; max-height: 55vh; order: -1; }
  .source-pdf { height: 50vh; min-height: 300px; }
}

/* Fields that show their formulas (editor.js richField): words typed as they are, each formula drawn in its place; a tap
   on one opens it in MathLive under the field */
.rich { width: 100%; min-height: 46px; font: 500 1rem/1.7 "Be Vietnam Pro", "Noto Sans", "Noto Sans Thai", system-ui, sans-serif; color: var(--ink); background: #FBFCFC;
  border: 1px solid var(--edge); border-radius: 10px; padding: 9px 14px; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
.rich.multi { min-height: 84px; }
.rich:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px var(--teal-soft); }
.rich:empty::before { content: attr(data-placeholder); color: var(--soft); pointer-events: none; }
.rich.disabled { background: var(--page); color: var(--soft); cursor: default; }
.mx { display: inline-block; padding: 1px 4px; margin: 0 1px; border-radius: 6px; background: var(--teal-soft); cursor: pointer; line-height: 1.25;
  vertical-align: middle; user-select: none; -webkit-user-select: none; }
.mx:hover { box-shadow: 0 0 0 1px var(--teal-line); }
.mx.editing { box-shadow: 0 0 0 2px var(--teal); background: #fff; }
.mx.empty { color: var(--soft); min-width: 1.4em; text-align: center; }
.mx.display { display: block; margin: 6px 0; text-align: center; }
.rich.disabled .mx { background: none; cursor: default; }
.mx-pop { margin: 6px 0 2px; padding: 10px; border: 1px solid var(--teal-line); border-radius: 12px; background: #fff; box-shadow: 0 6px 18px rgba(24,33,47,.08); }
.mx-field math-field { display: block; width: 100%; font-size: 1.35rem; padding: 6px 10px; border: 1px solid var(--edge); border-radius: 10px; }
.mx-field math-field:focus-within { border-color: var(--teal); }
.mx-raw { margin-top: 8px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9rem; }
.mx-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.mx-actions .btn { margin-left: 6px; }


/* The language list at the foot of the page */
.lang-pick { display: inline-flex; align-items: center; margin-left: 10px; }
.lang-pick select { font: 600 .85rem "Be Vietnam Pro", "Noto Sans", "Noto Sans Thai", system-ui, sans-serif; color: var(--soft); background: transparent;
  border: 1px solid var(--edge); border-radius: 8px; padding: 4px 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Lỗ hổng kiến thức: under the slip of a wrong pick, and the list at the end of a run. */
details.gap { margin: 6px 0 8px; background: #fff; border: 1px solid #F0C98A; border-radius: 10px; padding: 8px 12px; }
details.gap summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
details.gap summary::-webkit-details-marker { display: none; }
.gap-kicker { color: #8A5200; font-size: .85rem; }
.gap-open { margin-left: auto; color: var(--good-ink); font-weight: 700; font-size: .9rem; }
details.gap[open] .gap-open { display: none; }
.gap-explain { margin-top: 6px; line-height: 1.55; }
.help-step.essence { background: #fff; border-radius: 10px; padding: 8px 12px; margin-top: 8px; }
.gaps { text-align: left; margin: 16px 0 6px; }
.gap-item { background: #FFF4E0; border-radius: 12px; padding: 12px 14px; margin-top: 8px; }
.gap-count { color: #5E6B7A; font-size: .9rem; }
.btn.small { padding: 8px 12px; font-size: .9rem; margin-top: 8px; width: auto; }

/* Sign-in (#/tai-khoan): what an account gives on the left, the card on the right; on a phone the card comes first */
body[data-side="account"] .main { max-width: 1000px; }
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); grid-template-areas: "head card" "points card"; grid-template-rows: auto 1fr; column-gap: 64px;
  align-items: start; padding-top: 32px; }
.auth-head { grid-area: head; padding-top: 24px; }
.auth-head h1 { font-size: 2.1rem; margin-bottom: 10px; }
.auth-head > .soft { font-size: 1.05rem; }
.auth-move { display: inline-block; margin-top: 14px; padding: 8px 14px; border-radius: 10px; background: var(--amber-soft); color: var(--amber-ink); font-size: .9rem; font-weight: 600; }
.auth-points { grid-area: points; list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
.auth-tick { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); }
.auth-main { grid-area: card; }
.auth-card { margin: 0; padding: 28px; }
.auth-card[aria-busy] .auth-google, .auth-card[aria-busy] .auth-submit { opacity: .6; }
.auth-title { margin: 0; font-size: 1.45rem; }
.auth-lead { color: var(--soft); margin: 4px 0 20px; font-size: .95rem; }
.auth-google { width: 100%; gap: 12px; background: #fff; color: var(--ink); border-color: var(--edge); box-shadow: 0 3px 0 var(--edge); }
.auth-google:hover { border-color: #B6C2BD; }
.auth-g { display: grid; place-items: center; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; color: var(--soft); font-size: .85rem; font-weight: 600; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--track); border-radius: 12px; }
.auth-tab { border: 0; border-radius: 9px; padding: 9px 8px; background: transparent; color: var(--soft); cursor: pointer;
  font: 700 .92rem "Be Vietnam Pro", "Noto Sans", "Noto Sans Thai", system-ui, sans-serif; }
.auth-tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(24, 33, 47, .14); }
.auth-form label { margin-top: 16px; }
.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.auth-forgot { font-size: .88rem; }
.auth-password { position: relative; }
.auth-password .text { padding-right: 50px; }
.auth-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 8px; background: none; color: var(--soft); cursor: pointer; }
.auth-eye:hover { color: var(--ink); }
.auth-hint { margin: 6px 0 0; font-size: .85rem; color: var(--soft); }
.auth-submit { width: 100%; margin-top: 20px; }
.auth-switch { margin: 18px 0 0; text-align: center; color: var(--soft); font-size: .92rem; }
.auth-error { margin-top: 16px; padding: 10px 14px; border-radius: 10px; background: var(--bad-soft); color: var(--bad-ink); font-size: .9rem; font-weight: 600; }
.auth-error .link { margin-left: 6px; color: var(--bad-ink); text-decoration: underline; }
.auth-sent { margin: 18px 0 10px; }
.auth-code { font-size: 1.6rem; letter-spacing: .5em; text-align: center; padding-left: calc(14px + .5em); }
.auth-again { margin: 14px 0 0; text-align: center; color: var(--soft); font-size: .9rem; }
.auth-again .link:disabled { color: var(--soft); font-weight: 600; cursor: default; }
.auth-fine { margin: 14px 4px 0; font-size: .82rem; line-height: 1.5; color: var(--soft); }
.btn.busy { position: relative; pointer-events: none; }
.btn.busy > *, .btn.busy { color: transparent !important; }
.btn.busy > * { visibility: hidden; }
.btn.busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn.primary.busy:disabled { background: var(--teal); box-shadow: 0 4px 0 var(--teal-dark); }
.auth-google.busy:disabled { background: #fff; border-color: var(--edge); box-shadow: 0 3px 0 var(--edge); }
.auth-google.busy::after { border-color: var(--teal-soft); border-top-color: var(--teal); }
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "card" "points"; grid-template-rows: none; padding-top: 4px; }
  .auth-head { padding-top: 0; margin-bottom: 18px; }
  .auth-head h1 { font-size: 1.6rem; }
  .auth-points { margin-top: 26px; padding: 0 4px; }
}
@media (max-width: 520px) { .auth-card { padding: 22px 18px; } }
/* Signed in */
.auth-account { max-width: 640px; margin: 0 auto; padding-top: 12px; }
.auth-profile { display: flex; align-items: center; gap: 18px; }
.auth-profile h1 { margin: 0; font-size: 1.5rem; overflow-wrap: anywhere; }
.auth-who { min-width: 0; }
.auth-avatar { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--teal); color: #fff;
  font-size: 1.6rem; font-weight: 800; box-shadow: 0 3px 0 var(--teal-dark); }
.auth-avatar svg { width: 30px; height: 30px; }

/* Asking to sign in, on the class lists */
.signin-callout { display: flex; align-items: center; gap: 14px; max-width: 720px; margin: 18px 0 0; padding: 14px 16px; background: var(--teal-soft);
  border-color: var(--teal-line); box-shadow: 0 3px 0 var(--teal-line); }
.signin-callout:hover { border-color: var(--teal); }
.signin-callout-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fff; color: var(--teal); }
.signin-callout-text { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.signin-callout-text b { color: var(--ink); }
.signin-callout .btn { flex: none; pointer-events: none; }
@media (max-width: 520px) { .signin-callout { flex-wrap: wrap; } .signin-callout .btn { flex: 1 0 100%; } }

/* Grey cards while a list loads */
.skeleton { pointer-events: none; box-shadow: none; }
.sk { display: block; height: 12px; width: 60%; margin: 6px 0; border-radius: 6px; background: linear-gradient(90deg, var(--track) 25%, #F2F6F4 50%, var(--track) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sk-title { height: 18px; width: 75%; }
.sk-short { width: 35%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .sk, .btn.busy::after { animation: none; } }

/* Easier for teachers and students (2026-11-06): the bar's icon; on Lớp của tôi each class says what to do next; a new
   class's first steps, ticked as they are done; how many handed in, as a bar; the student's homework in groups. */
.brand-icon { display: block; width: 32px; height: 32px; border-radius: 9px; }
.class-card { position: relative; gap: 4px; }
.class-card .class-name { font-size: 1.12rem; font-weight: 800; color: var(--ink); }
.class-link { color: inherit; text-decoration: none; }
.class-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.class-link:focus-visible { outline: none; }
.class-link:focus-visible::after { box-shadow: 0 0 0 3px var(--teal-line); }
.class-next { display: flex; align-items: center; gap: 6px; color: var(--amber-ink); font-weight: 700; font-size: .88rem; margin-top: 4px; }
.class-next::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: none; }
.class-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.add-card { align-items: center; justify-content: center; text-align: center; min-height: 140px; border-style: dashed; box-shadow: none; background: transparent; color: var(--teal-dark); }
.add-card:hover { background: var(--teal-soft); }
.add-plus { font-size: 1.8rem; font-weight: 700; line-height: 1; }

.checklist { border-color: var(--teal-line); }
.check-steps { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.check-step { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--page); }
.check-step.done { background: var(--good-soft); }
.check-mark { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid var(--teal-line);
  color: var(--teal-dark); font-weight: 800; font-size: .9rem; }
.check-step.done .check-mark { background: var(--good); border-color: var(--good); color: #fff; }
.check-text { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; }
.check-step.done .check-text b { color: var(--good-ink); }
@media (max-width: 520px) { .check-step .btn { flex: 1 0 100%; } }

.source-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.source-chip { background: var(--teal-soft); color: var(--teal-dark); border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 700; text-decoration: none; border: 1px solid transparent; }
.source-chip:hover { border-color: var(--teal-line); background: #fff; }

.handed { display: block; height: 6px; margin-top: 6px; border-radius: 999px; background: var(--track); overflow: hidden; max-width: 320px; }
.handed > span { display: block; height: 100%; border-radius: 999px; background: var(--good); }

.work-summary { box-shadow: none; font-weight: 700; margin-top: 16px; }
.work-summary.left { background: var(--amber-soft); border-color: #F5D9A6; color: var(--amber-ink); }
.work-summary.clear { background: var(--good-soft); border-color: #b5e3c6; color: var(--good-ink); }
.work-row.todo { border-color: var(--teal-line); box-shadow: 0 3px 0 var(--teal-line); }
.work-row .tag.late { align-self: flex-start; margin-top: 4px; font-size: .78rem; }
.recent { margin: 0 0 8px; }
.recent h2 { margin-top: 4px; }

/* File templates and file buttons (Nhập đề có sẵn, Danh sách lớp): the browser's own file box is hidden in a button. */
.file-pick { position: relative; cursor: pointer; }
.file-pick input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.template-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 12px 0; padding: 10px 12px;
  border: 1px dashed var(--teal-line); border-radius: 12px; background: var(--teal-soft); font-size: .9rem; }
.template-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* The front page (#/), 2026-11-06: drawings in the app icon's style (/home/img/icons) in place of emoji; three roles,
   each with its next step; the class code on one line; six features in a 3 × 2 grid; the stores in one band. */
body[data-side="front"] .main { max-width: 1040px; }
img.art { display: block; width: 100%; height: auto; }
.hero.front { padding: 28px 0 4px; }
.hero.front h1 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); letter-spacing: -.01em; }
.hero.front .roles.three { max-width: none; gap: 16px; margin-top: 8px; }
.hero.front .role { position: relative; padding: 26px 20px 20px; gap: 6px; transition: transform .12s, box-shadow .12s, border-color .12s; }
.hero.front .role:hover { transform: translateY(-3px); border-color: var(--teal-line); box-shadow: 0 7px 0 var(--teal-line); }
.hero.front .role:active { transform: translateY(1px); box-shadow: 0 2px 0 var(--edge); }
.role-art { display: grid; place-items: center; width: 128px; height: 128px; margin: 0 auto 6px; border-radius: 32px;
  background: radial-gradient(circle at 50% 60%, #fff 0 45%, var(--teal-soft) 46% 100%); }
.role-art img { width: 104px; }
.hero.front .role b { font-size: 1.2rem; }
.role-go { margin-top: auto; padding-top: 10px; color: var(--teal-dark); font-weight: 800; font-size: .95rem; }

.front-code { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "art label" "art row" "art note"; column-gap: 16px; align-items: center;
  margin-top: 18px; border-color: var(--teal-line); box-shadow: 0 3px 0 var(--teal-line); }
.front-code-art { grid-area: art; width: 64px; height: 64px; border-radius: 18px; background: var(--teal-soft); display: grid; place-items: center; }
.front-code-art img { width: 52px; }
.front-code > label { grid-area: label; margin: 0 0 6px; }
.front-code > .row { grid-area: row; }
.front-code > .note { grid-area: note; }
@media (max-width: 520px) { .front-code { grid-template-columns: 1fr; grid-template-areas: "label" "row" "note"; } .front-code-art { display: none; } }

.front-title { margin: 36px 0 4px; font-size: 1.35rem; }
body[data-side="front"] .features { grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 10px; }
@media (max-width: 860px) { body[data-side="front"] .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { body[data-side="front"] .features { grid-template-columns: 1fr; } }
body[data-side="front"] .feature { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
.feature-art { flex: none; width: 60px; height: 60px; border-radius: 16px; background: var(--teal-soft); display: grid; place-items: center; }
.feature-art img { width: 50px; }
.feature-text { min-width: 0; }
.feature-text b { display: block; margin: 2px 0 2px; }
.feature-text p { margin: 0; }
.feature-link { display: inline-block; margin-top: 6px; font-weight: 800; font-size: .88rem; text-decoration: none; }

.store-band { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 28px; background: var(--teal-soft); border-color: var(--teal-line); box-shadow: none; }
.store-band-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; }
.store-row { display: flex; gap: 10px; flex-wrap: wrap; }
.store { display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border-radius: 12px; background: var(--ink); color: #fff; text-decoration: none; box-shadow: 0 4px 0 #000; }
.store:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.store-text { display: flex; flex-direction: column; font-weight: 800; line-height: 1.15; }
.store-text small { font-weight: 500; font-size: .7rem; opacity: .8; }
.store.soon { background: #fff; color: var(--soft); border: 1px dashed var(--edge); box-shadow: none; }
.row-icon.art-icon { background: var(--teal-soft); padding: 4px; }
.row-icon.art-icon img { width: 34px; }
@media (prefers-reduced-motion: reduce) { .hero.front .role { transition: none; } .hero.front .role:hover { transform: none; } }
