/* Lớp học trực tuyến: trang chính và phòng học (dùng chung common.css) */
.wrap { max-width: 900px; }
.wrap.narrow { max-width: 420px; margin-top: 8vh; }
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.top h1 { margin: 0; font-size: 1.4rem; }
.tabrow { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.tabrow > button { margin: 0; padding: 9px 14px; background: transparent; color: inherit; border: 1px solid var(--line); }
.tabrow > button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tablewrap { overflow-x: auto; }
.atable { width: 100%; border-collapse: collapse; }
.atable th, .atable td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.atable tr.off { opacity: .55; }
.atable tr.live td { font-weight: 600; }
.acts > * { margin: 2px 4px 2px 0; }
.acts select { width: auto; min-width: 8em; padding: 5px 8px; }
input.num { width: 7em; }
input[type=datetime-local], input[type=month] { width: 100%; padding: 10px 14px; font: inherit; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: inherit; }
details > summary { cursor: pointer; margin: 8px 0; }
.warn { color: var(--warn); }
.pre { white-space: pre-wrap; }
.code { font: 600 1.2rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .12em; }
.agree { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 8px 0; }
.agree input { margin-top: 5px; flex: none; width: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.stat { padding: 10px 12px; border-radius: 12px; background: var(--soft); }
.statn { font-size: 1.3rem; font-weight: 700; }
.wrapRow { flex-wrap: wrap; }
@media print { body > main > *:not(#view), #view > *:not(.codes), .codes .row, .codes .muted { display: none; } .card { border: 0; box-shadow: none; } }

/* ---------- phòng học ---------- */
body.room { margin: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: #10151c; color: #eef2f6; }
body.room .muted { color: #a9b4c0; }
.rTop { display: flex; gap: 12px; align-items: center; padding: 8px 12px; flex-wrap: wrap; }
.rRec { color: #ff6b6b; font-weight: 700; }
body.room .msg { margin: 0 12px 6px; }
.rMain { flex: 1; min-height: 0; display: flex; gap: 8px; padding: 0 8px; }
.rStage { flex: 1; min-width: 0; position: relative; background: #000; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.rStage video { width: 100%; height: 100%; object-fit: contain; }
.stScreen, .stCam { position: absolute; inset: 0; }
.stScreen:empty, .stCam:empty { display: none; }
.rStage.hasScreen .stCam { inset: auto 10px 10px auto; width: 22%; min-width: 120px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px #000a; z-index: 2; }
.rStage.hasScreen .stCam video { object-fit: cover; }
.rNote { position: relative; z-index: 1; margin: 0; padding: 12px; text-align: center; color: #c8d1db; }
.rSide { width: 300px; flex: none; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
body.teacher .rSide { width: 46%; max-width: 720px; }
.rSelf, .rTile { position: relative; background: #1d2530; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; }
.rSelf { width: 160px; flex: none; }
body.teacher .rSelf { display: none; }
.rSelf video, .rTile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rSelf video { transform: scaleX(-1); }
.rName { position: absolute; left: 4px; bottom: 3px; padding: 1px 6px; border-radius: 6px; background: #000a; font-size: .78rem; max-width: 94%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rTiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; overflow-y: auto; flex: none; max-height: 40%; }
body.teacher .rTiles { grid-template-columns: repeat(4, 1fr); max-height: none; flex: 1 1 auto; align-content: start; }
.rTiles:empty, .rHands:empty, .rPager:empty { display: none; }
.rHands { max-height: 24%; overflow-y: auto; flex: none; }
.rHands p { margin: 4px 0; }
.rChat { flex: 1 1 80px; min-height: 60px; overflow-y: auto; background: #1d2530; border-radius: 10px; padding: 6px 10px; font-size: .92rem; }
.rChat p { margin: 3px 0; overflow-wrap: anywhere; }
.rChat .mine { color: #9fd3ff; }
body.room input[type=text] { background: #1d2530; color: inherit; border-color: #3a4656; margin: 0; }
body.room form.row { margin: 0; align-items: center; }
.rBar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 8px; }
.rBar button, .rBar .btn { margin: 0; width: auto; }
@media (max-width: 760px) {
  .rMain { flex-direction: column; }
  .rStage { flex: 1 1 45%; }
  .rSide, body.teacher .rSide { width: auto; max-width: none; flex: 1 1 55%; }
  body.teacher .rTiles { grid-template-columns: repeat(3, 1fr); }
  .rTiles { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- buổi phát trực tiếp, ý kiến, bài tập ---------- */
.wrap.wide { max-width: 1100px; }
.ytWrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.ytFrame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.qRow { margin: 6px 0; padding: 6px 10px; border-radius: 8px; background: var(--soft); overflow-wrap: anywhere; }
.qRow.picked { outline: 2px solid var(--accent); }
.qCard { margin: 8px 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.qCard.picked { border-color: var(--accent); background: var(--soft); }
.qCard.answered, .qCard.hidden { opacity: .7; display: block; }
.qCard p { margin: 2px 0; }
.qLine { font-size: .92rem; }
.qCount { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .8rem; font-weight: 600; vertical-align: middle; }
.hwBox { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; align-items: start; margin: 8px 0; }
.hwPic { position: relative; line-height: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.hwPic img { width: 100%; height: auto; display: block; }
.hwLine { position: absolute; height: 0; border-top: 3px solid #d92d20; border-radius: 2px; pointer-events: none; }
.hwTag { position: absolute; transform: translate(-110%, -55%); min-width: 1.5em; padding: 0 4px; border-radius: 999px; background: #d92d20; color: #fff; font: 700 .8rem/1.5 system-ui, sans-serif; text-align: center; pointer-events: none; }
.hwNotes { margin: 0; padding-left: 1.4em; }
.hwNotes li { margin: 6px 0; overflow-wrap: anywhere; }
.hwNotes li::marker { color: #d92d20; font-weight: 700; }
.hwNotes textarea { margin-bottom: 4px; }
.hwScore { font-size: 1.3rem; font-weight: 700; }
@media (max-width: 760px) { .hwBox { grid-template-columns: 1fr; } }
.qCard.top { border-color: #d92d20; border-width: 2px; }
.qTop { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px; background: #d92d20; color: #fff; font-size: .8rem; font-weight: 600; vertical-align: middle; }
.feelRow { align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.feelRow button { margin: 0; width: auto; }
.pollCard { border: 2px solid var(--accent); }
.pollCard.right { border-color: var(--ok); }
.pollText { font-size: 1.1rem; font-weight: 600; }
.pollOpts { display: grid; gap: 8px; }
.pollOpts button { margin: 0; width: 100%; text-align: left; white-space: normal; }
.pollBar { margin: 2px 0; }
.pollBar.right { color: var(--ok); font-weight: 600; }
.qCard input, .qCard select { margin-bottom: 6px; }

/* nhật ký học tập */
.dDay { border-left: 5px solid var(--soft); }
.dDay.good { border-left-color: var(--ok); }
.dDay.warn { border-left-color: var(--warn); }
.dDay.off { border-left-color: #98a2b3; }
.dHead { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.dBadge { padding: 3px 10px; border-radius: 999px; background: var(--soft); font-weight: 600; font-size: .9rem; }
.dBadge.good { background: var(--ok); color: #fff; }
.dBadge.warn { background: var(--warn); color: #fff; }
.dBadge.off { background: #667085; color: #fff; }
.dLine { margin: 4px 0; overflow-wrap: anywhere; }
.dList { margin: 2px 0 6px 20px; padding: 0; }
.dList li { overflow-wrap: anywhere; }
.dNote { margin: 4px 0 4px 12px; padding-left: 10px; border-left: 3px solid var(--soft); }
.dStars { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; }
.dStar { color: #667085; }
.dStar.got { color: inherit; font-weight: 600; }

/* ---------- trang hướng dẫn ---------- */
.guide li { margin: 4px 0; }
.guide code { font: .92em ui-monospace, Consolas, monospace; background: var(--soft); padding: 1px 5px; border-radius: 6px; }
.gFlow { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 12px 0; }
.gStage { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--soft); }
.gStage.now { border-color: var(--accent); border-width: 2px; }
.gStage h3 { margin: 0 0 6px; }
.gStage p { margin: 4px 0; }
.gToc a { white-space: nowrap; }
/* đầu trang giống Gro1.net: logo, chữ Gro1.net, khẩu hiệu rộng đúng bằng chữ (static/js/brand.js chép từ Gro1) */
.gHead { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.gLogo { display: inline-flex; align-items: center; gap: clamp(10px, 2.5vw, 16px); font-weight: 800; font-size: clamp(1.9rem, 8vw, 2.8rem); line-height: 1;
  color: var(--accent); text-decoration: none; letter-spacing: -.01em; min-width: 0; }
.gLogo img { width: 1.6em; height: 1.6em; flex: none; display: block; }
.gBrand { display: flex; flex-direction: column; gap: .12em; width: min-content; }
.gHead .slogan { width: 0; min-width: 100%; white-space: nowrap; font-size: .32em; text-align: justify; text-align-last: justify; font-weight: 600; color: var(--muted); letter-spacing: 0; line-height: 1.2; }
.gTitle h1 { font-size: 1.3rem; }
.gHead.gCenter { justify-content: center; }
.gLoginTitle { font-size: 1.3rem; margin: 0 0 4px; }
.subRow { display: flex; align-items: center; gap: 6px; }
.subRow input { flex: 1; min-width: 0; }
.subRow span { color: var(--muted); white-space: nowrap; }
.plink { word-break: break-all; font-size: .85rem; }
/* trang phụ huynh: học phí */
.feeDue { border-color: var(--warn); }
/* ô ẩn của mẫu đăng ký học thử: người thật không thấy, máy tự điền thì bị bỏ */
.hpot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: normal; }
label.check input { width: auto; margin-top: 4px; }
.lateNote { border-left: 4px solid var(--warn); }
/* mã quét chuyển khoản học phí: nền trắng quanh mã để máy quét đọc được cả khi trang tối */
.qrBox { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.qrImg { width: 240px; max-width: 100%; height: auto; background: #fff; padding: 6px; border-radius: 10px; border: 1px solid var(--line, #ddd); image-rendering: pixelated; }
.qrInfo { flex: 1 1 240px; min-width: 0; }
.qrInfo .dLine { overflow-wrap: anywhere; }
.qrInfo .dLine button { margin-left: 8px; }
