/* Elu platform — look C (ETP skin + StuMana-style structure). Colours come ONLY from shared/tokens.css. Light mode only. */
:root { --side-w: 232px; --top-h: 56px; --bar-h: 64px; --font-ui: var(--body); }
html { background: var(--bg); }
body { font: 14px/1.5 var(--body); color: var(--ink); background: var(--bg); background-image: var(--wash); background-attachment: fixed; min-height: 100vh; }
[hidden] { display: none !important; }
a { color: var(--accent-ink); }
svg.i { width: 20px; height: 20px; fill: currentColor; flex: none; }
svg.i.s { width: 16px; height: 16px; }
h1, h2, h3 { font-weight: 500; margin: 0; letter-spacing: var(--display-ls); }
.k { font-size: 11px; letter-spacing: var(--label-ls); text-transform: uppercase; color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); }
.sub { color: var(--sub); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }

/* ---------- frame ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side-bg); border-right: var(--side-border); padding: 14px 10px 18px; display: flex; flex-direction: column; gap: 2px; z-index: var(--z-nav); }
.side .org { display: flex; gap: 10px; align-items: center; padding: 6px 8px 12px; }
.side .org .lg { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.side .org b { display: block; font-weight: 600; font-size: 13px; line-height: 1.3; }
.side .org small { color: var(--muted); font-size: 11.5px; }
.side .grp { font-size: 11px; color: var(--muted); padding: 12px 10px 4px; letter-spacing: .04em; text-transform: uppercase; }
.side a.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 20px; margin-left: -10px; border-radius: var(--nav-radius); color: var(--ink); text-decoration: none; font-size: 13.5px; min-height: 40px; }
.side a.nav:hover { background: var(--neutral-soft); }
.side a.nav.on { background: var(--nav-on-bg); color: var(--nav-on-ink); font-weight: 500; }
.side a.nav.later { color: var(--muted); }
.side .owner-tag { margin-left: auto; font-size: 10.5px; border-radius: 999px; padding: 1px 7px; background: var(--neutral-soft); color: var(--muted); white-space: nowrap; }
.side .foot { margin-top: auto; padding: 14px 8px 0; display: grid; gap: 8px; border-top: 1px solid var(--line); }
.side .demo { font-size: 11px; color: var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 6px 8px; font-weight: 500; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 26px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.75); position: sticky; top: 0; z-index: var(--z-nav); backdrop-filter: blur(6px); }
.top .crumb { color: var(--muted); font-size: 14px; display: flex; gap: 6px; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top .crumb a { color: var(--muted); text-decoration: none; }
.top .crumb b { color: var(--ink); font-weight: 500; }
.top .sp { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.lang { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.lang button { border: 0; background: var(--surface); color: var(--sub); min-height: 32px; font-size: 12px; padding: 0 10px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.content { padding: 22px 26px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; max-width: 1240px; width: 100%; }

/* phone bar */
.bar { display: none; }
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: var(--z-panel); }

/* ---------- blocks ---------- */
.box { background: var(--surface); border: var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.box > h3 { margin: 0 0 10px; font-size: var(--h2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.box > h3 .cnt { margin-left: auto; font-size: 11px; letter-spacing: var(--label-ls); text-transform: uppercase; color: var(--muted); font-weight: 500; }
.greet small { display: block; font-size: 11px; letter-spacing: var(--label-ls); text-transform: uppercase; color: var(--muted); font-weight: 500; }
.greet h1 { font-size: var(--h1); font-weight: var(--display-w); margin: 2px 0 0; text-wrap: balance; }
.head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.daynav { display: inline-flex; gap: 4px; align-items: center; }
.daynav a { color: var(--accent-ink); text-decoration: none; font-size: 12px; text-transform: none; letter-spacing: 0; }
.row { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: var(--card-border); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: inherit; }
.stat b { display: block; font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; }
.list { display: grid; }
.li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; min-width: 0; }
.li:first-child { border-top: 0; }
a.li:hover .t b { color: var(--accent-ink); }
.li .t { min-width: 0; flex: 1; }
.li .t b { display: block; font-weight: 500; overflow-wrap: anywhere; }
.li .t span { color: var(--muted); font-size: 12.5px; }
.av { width: 34px; height: 34px; border-radius: var(--av-radius); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; background: var(--accent-soft); color: var(--accent-ink); }
.av.w { background: var(--warn-soft); color: var(--warn); } .av.g { background: var(--alt-soft); color: var(--alt-ink); } .av.n { background: var(--neutral-soft); color: var(--sub); }
.chip { font-size: 12px; border-radius: var(--chip-radius); padding: 3px 10px; white-space: nowrap; font-weight: 500; display: inline-block; }
.c-warn { background: var(--warn-soft); color: var(--warn); } .c-ok { background: var(--alt-soft); color: var(--alt-ink); } .c-blue { background: var(--accent-soft); color: var(--accent-ink); } .c-grey { background: var(--neutral-soft); color: var(--sub); }
.empty { color: var(--muted); padding: 10px 0; }
.next small { font-size: 11px; letter-spacing: var(--label-ls); text-transform: uppercase; color: var(--accent-ink); font-weight: 500; }
.next b { display: block; font-size: 20px; font-weight: 500; margin: 4px 0 2px; }
.next p { margin: 0; color: var(--sub); }
.pbar { height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.pbar.big { height: 8px; margin: 12px 0 6px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: var(--btn-border); background: var(--accent); color: var(--on-accent); border-radius: var(--btn-radius); padding: 0 16px; font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; min-height: 40px; white-space: nowrap; }
.btn:hover { filter: brightness(.95); }
.btn.ghost { background: var(--surface); color: var(--accent-ink); border: var(--ghost-border); }
.btn.warn { background: var(--surface); color: var(--warn); border: 1px solid var(--warn); }
.btn.sm { min-height: 34px; font-size: 13px; padding: 0 12px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.classes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cls { background: var(--surface); border: var(--card-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); min-width: 0; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.cls img { display: block; width: 100%; aspect-ratio: 16/8; object-fit: cover; max-width: 100%; background: var(--neutral-soft); }
.cls .stripe { height: 4px; background: var(--accent); } .cls .stripe.g { background: var(--alt-ink); } .cls .stripe.n { background: var(--muted); } .cls .stripe.w { background: var(--warn); }
.cls .bd { padding: 10px 14px 12px; display: grid; gap: 2px; flex: 1; }
.cls b { font-weight: 500; font-size: 15px; }
.cls span { color: var(--muted); font-size: 12.5px; }
.cls .lp { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--sub); }
.cls .lp .pbar { flex: 1; height: 5px; }
.cls .act { padding: 0 14px 12px; }

/* tables */
.tbl-wrap { overflow-x: auto; border: var(--card-border); border-radius: var(--radius); background: var(--surface); }
table.tbl { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.tbl th, table.tbl td { border-bottom: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: middle; }
table.tbl th { font-size: 11px; letter-spacing: var(--label-ls); text-transform: uppercase; color: var(--muted); font-weight: 500; background: var(--surface); white-space: nowrap; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl td.r, table.tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl tr.dim td { color: var(--muted); }
table.tbl tr.hl td { background: var(--accent-soft); }

/* tabs + filters */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; color: var(--sub); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; font-size: 13.5px; }
.tabs a.on { color: var(--accent-ink); border-color: var(--accent); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills a, .pills button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--sub); border-radius: 999px; padding: 0 14px; text-decoration: none; font-size: 13px; min-height: 36px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.pills .on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pills .n { font-size: 11px; background: rgba(255,255,255,.25); border-radius: 99px; padding: 0 6px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .grow { flex: 1; min-width: 180px; }

/* forms */
.form { display: grid; gap: 12px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.f { display: grid; gap: 4px; min-width: 0; }
.f > span { font-size: 12.5px; color: var(--sub); font-weight: 500; }
.f > small { color: var(--muted); font-size: 12px; }
.f input, .f select, .f textarea, .inp { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); padding: 8px 12px; width: 100%; color: var(--ink); }
.f textarea { min-height: 72px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus, .inp:focus { border-color: var(--accent); box-shadow: var(--focus-ring); outline: none; }
.f.full { grid-column: 1 / -1; }
.req::after { content: " *"; color: var(--warn); }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; font-weight: 500; }
.days input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.days label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.days label:has(input:focus-visible) { box-shadow: var(--focus-ring); }

/* error + notes */
.errbox { border: 1px solid var(--warn); background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.errbox .x { margin-left: auto; background: none; border: 0; color: var(--warn); min-height: 28px; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }
.okbox { border: 1px solid var(--alt-ink); background: var(--alt-soft); color: var(--alt-ink); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; }
.okbox:not(:has(> svg)), .errbox:not(:has(> svg)) { display: block; }
.note { font-size: 12.5px; color: var(--muted); }
.demo-flag { font-size: 11px; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 2px 9px; font-weight: 500; letter-spacing: .04em; white-space: nowrap; }
.toast.ok { background: var(--alt-ink); color: var(--on-accent); }

/* sheet (modal) */
.sheet-wrap { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; background: var(--scrim); padding: 16px; }
.sheet { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-pop); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; display: grid; gap: 14px; padding: 20px; }
.sheet .sh { display: flex; align-items: center; gap: 10px; }
.sheet .sh h2 { font-size: 18px; flex: 1; }
.sheet .sh button { background: none; border: 0; cursor: pointer; color: var(--sub); min-height: 40px; min-width: 40px; }
.sheet .sh { align-items: flex-start; }
.sheet .sh .ttl { flex: 1; min-width: 0; }
.sheet .sh .ttl p { margin: 4px 0 0; color: var(--sub); font-size: 14px; }
/* wide sheet = StuMana-style add form: bigger title, boxed close, roomy two columns */
.sheet.wide { width: min(800px, 100%); padding: 24px 28px; gap: 16px; }
.sheet.wide .sh h2 { font-size: 22px; font-weight: 600; }
.sheet.wide .sh button { border: 1px solid var(--line-strong); border-radius: 8px; min-height: 36px; min-width: 36px; display: grid; place-items: center; }
.sheet.wide .form { gap: 16px; }
.sheet.wide .fgrid { gap: 16px 24px; }
.sheet.wide .f > span { font-size: 14px; color: var(--ink); }
.sheet.wide .f input, .sheet.wide .f select { min-height: 44px; }
.sheet.wide > .btns { justify-content: flex-start; flex-direction: row-reverse; }
.fsec { font-size: 15px; font-weight: 600; margin-top: 2px; }
.fsec .note { font-weight: 400; }
.tagbox { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); padding: 6px 10px; min-height: 44px; cursor: text; }
.tagbox:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.tagbox input#tag-in { border: 0; box-shadow: none; padding: 4px 2px; min-height: 30px; flex: 1; min-width: 140px; width: auto; }
.tag { display: inline-flex; align-items: center; gap: 2px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; font-weight: 500; }
.tag button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 16px; line-height: 1; min-width: 24px; min-height: 24px; border-radius: 999px; }
.tag button:hover { background: rgba(0,0,0,.06); }
.pcard { border: 1px solid var(--line); background: var(--bg); border-radius: 14px; padding: 18px 20px; display: grid; gap: 10px; }
.pcard > .note { margin: -4px 0 0; font-size: 14px; color: var(--sub); }
.sw { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; min-height: 32px; }
.sw b { font-weight: 500; font-size: 15px; }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw i { width: 40px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; transition: background .15s; }
.sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.sw input:checked + i { background: var(--accent); }
.sw input:checked + i::after { transform: translateX(18px); }
.sw input:focus-visible + i { box-shadow: var(--focus-ring); }
@media (prefers-reduced-motion: reduce) { .sw i, .sw i::after { transition: none; } }

/* record panel (phone-first) */
.rec { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 18px; align-items: start; }
.panel { background: var(--surface); border: var(--card-border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.panel .ph-h { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel .ph-h small { color: var(--muted); font-size: 12px; }
.panel .ph-h b { display: block; font-size: 17px; font-weight: 500; }
.panel .sec { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.who { display: flex; gap: 8px; flex-wrap: wrap; }
.who button { border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 14px; font-size: 14px; background: var(--surface); cursor: pointer; }
.who button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }
.st { display: flex; align-items: center; gap: 10px; padding: 4px 0; flex-wrap: wrap; }
.st .nm { flex: 1; min-width: 120px; }
.tog { display: flex; gap: 4px; }
.tog button { width: 44px; height: 44px; border-radius: 10px; font-size: 13px; font-weight: 600; border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface); cursor: pointer; padding: 0; }
.tog button.on.present { background: var(--alt-soft); border-color: var(--alt-ink); color: var(--alt-ink); }
.tog button.on.late { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.tog button.on.absent { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.tog button.on.excused { background: var(--neutral-soft); border-color: var(--sub); color: var(--sub); }
.score { width: 76px; text-align: center; }
.fbk { width: 100%; }
.save { margin: 14px 16px 18px; width: calc(100% - 32px); min-height: 48px; font-size: 15px; }
.after .li .chip { min-width: 74px; text-align: center; }

/* attendance grid (office) */
.gridw { overflow-x: auto; border: var(--card-border); border-radius: var(--radius); background: var(--surface); }
table.att { border-collapse: collapse; width: 100%; font-size: 13px; }
table.att th, table.att td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: center; white-space: nowrap; }
table.att th { font-weight: 500; color: var(--muted); font-size: 12px; }
table.att td:first-child, table.att th:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
table.att .cur { background: var(--accent-soft); }
table.att th.cancel, table.att td.cancel { background: repeating-linear-gradient(45deg, var(--neutral-soft) 0 6px, var(--surface) 6px 12px); }
table.att th.dirty { color: var(--warn); }
.cell { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; font-weight: 600; font-size: 12px; border: 1px solid transparent; cursor: pointer; background: none; min-height: 0; padding: 0; color: var(--line-strong); }
.cell:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.cell.present { background: var(--alt-soft); color: var(--alt-ink); } .cell.absent { background: var(--warn-soft); color: var(--warn); } .cell.late { background: var(--accent-soft); color: var(--accent-ink); } .cell.excused { background: var(--neutral-soft); color: var(--sub); }
.cell.gap { border-color: var(--warn); border-style: dashed; color: var(--warn); }
.keys { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--sub); }
.keys kbd { font: inherit; font-size: 11.5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--surface); }
table.att select { min-height: 32px; font-size: 12px; padding: 2px 4px; border: 1px solid var(--line-strong); border-radius: 8px; max-width: 110px; }

/* placeholder parts */
.ph { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; display: grid; gap: 12px; background: rgba(255,255,255,.7); }
.ph h3 { margin: 0; font-size: 18px; font-weight: 500; }
.ph ul { margin: 0; padding-left: 18px; color: var(--sub); display: grid; gap: 4px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .box { width: min(400px, 100%); padding: 26px 24px; display: grid; gap: 14px; }
.login .brand { display: flex; align-items: center; gap: 10px; }
.login .brand .lg { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 600; }
.login .brand b { font-size: 20px; font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .classes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) {
  .row, .row2, .rec { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-105%); transition: transform .2s; z-index: var(--z-modal); }
  .side.open { transform: none; box-shadow: var(--shadow-pop); }
  .top { padding: 0 16px; }
  .content { padding: 16px 16px calc(var(--bar-h) + 24px); }
  .bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--surface); border-top: 1px solid var(--line); z-index: var(--z-nav); }
  .bar a, .bar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--sub); text-decoration: none; background: none; border: 0; min-height: 0; padding: 4px 0; cursor: pointer; }
  .bar .on { color: var(--accent-ink); font-weight: 500; }
  .bar .on svg { background: var(--accent-soft); border-radius: 999px; padding: 2px 12px; width: 44px; box-sizing: content-box; height: 20px; }
  .fgrid { grid-template-columns: minmax(0, 1fr); }
  .classes { grid-template-columns: minmax(0, 1fr); }
  .greet h1 { font-size: 22px; }
  /* stacked cards instead of wide tables */
  table.tbl.stack thead { display: none; }
  table.tbl.stack, table.tbl.stack tbody, table.tbl.stack tr, table.tbl.stack td { display: block; width: 100%; }
  table.tbl.stack tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.tbl.stack td { border: 0; padding: 3px 12px; text-align: left !important; }
  table.tbl.stack td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 12px; }
  .top .who-name { display: none; }
}
@media (min-width: 821px) { .menu-btn { display: none !important; } }

/* import stepper */
.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 14px; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--sub); font-size: 13px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.steps li b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--ink); font-weight: 500; font-size: 12px; }
.steps li.on { border-color: var(--accent); color: var(--ink); }
.steps li.on b { background: var(--accent); color: var(--on-accent); }
.steps li.ok b { background: var(--alt-soft); color: var(--alt-ink); }
.ph-list { margin: 0 0 10px; padding-left: 20px; line-height: 1.6; }
.content code { font-size: 12.5px; background: var(--neutral-soft); border-radius: 4px; padding: 1px 5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip, td > .chip:not([class*="c-"]) { background: var(--neutral-soft); color: var(--sub); }

/* phone: every tap target at least 44px tall (recurring-bugs gate) */
@media (max-width: 820px) {
  .btn, .btn.sm, .pills a, .pills button, .lang button, .sheet .sh button, .days label, .inp, .f input, .f select { min-height: 44px; }
  .errbox .x { min-height: 44px; min-width: 44px; }
  table.att select { min-height: 44px; }
  .cell { width: 44px; height: 44px; }
}

/* Phone fixes, 26 Oct (Lucas screenshot): nothing may spill past its card */
*, *::before, *::after { box-sizing: border-box; }
input, select, textarea, .btn { max-width: 100%; }
.btn { white-space: normal; }
.login .brand > div:nth-child(2) { min-width: 0; }
.login .brand .lang { flex-shrink: 0; }
@media (max-width: 480px) {
  .demo-flag { display: none; }
  .login .box { padding: 22px 16px; }
}

/* v4 R3: phone panel extras: reason quick-pick, small tags, confirm line before the final tap */
.rec .st { flex-wrap: wrap; }
.rec .st .nm small { display: block; font-size: 11.5px; }
.rec .st .dots { background: none; border: 0; min-width: 44px; min-height: 44px; color: var(--muted); cursor: pointer; }
.rec .more { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 2px 0 6px 44px; }
.rec .more .reason { flex: 1 1 160px; min-width: 0; }
.rec .qp, .rec .tg { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 12px; min-height: 44px; font: inherit; font-size: 13px; cursor: pointer; color: inherit; }
.chip-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }
.tog button:disabled { opacity: .35; cursor: not-allowed; }
.confirm { display: flex; gap: 8px; align-items: flex-start; background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin: 0 16px 10px; font-size: 14px; }
.confirm[hidden] { display: none; }

/* v5 S1: setup checklist on Today */
.setup .setup-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.setup .setup-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.setup .setup-steps li.cur { border-color: var(--accent); background: var(--accent-soft); }
.setup .setup-steps li.done .t b { color: var(--sub); }
.setup .setup-steps .n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 500; background: var(--neutral-soft); color: var(--ink); }
.setup .setup-steps li.done .n { background: var(--accent); color: #fff; }
.setup .setup-steps li.done .n svg { width: 16px; height: 16px; }
.setup .setup-steps .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.setup .setup-steps .t span { font-size: 12.5px; color: var(--sub); }
.box.flash { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
@media (max-width: 600px) { .setup .setup-steps li { flex-wrap: wrap; } .setup .setup-steps li .btn { margin-left: 40px; } }

/* v5 G4: a voided payment stays in the history, crossed out */
.li.voided .t b, .li.voided .t > span:not(.void-note) { text-decoration: line-through; color: var(--muted); }
.void-note { display: block; font-size: 12.5px; color: var(--warn); }

/* v5 G6/G9: weekday picker and class photo picker */
.wdpick, .photopick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.wdpick label { position: relative; }
.wdpick input, .photopick input { position: absolute; opacity: 0; pointer-events: none; }
.wdpick span { display: grid; place-items: center; min-width: 48px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); font-weight: 500; cursor: pointer; }
.wdpick input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.wdpick input:focus-visible + span, .photopick input:focus-visible + img, .photopick input:focus-visible + .nophoto { outline: 2px solid var(--accent); outline-offset: 2px; }
.photopick label { cursor: pointer; }
.photopick img, .photopick .nophoto { display: grid; place-items: center; width: 96px; height: 64px; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); font-size: 12.5px; color: var(--sub); background: var(--neutral-soft); }
.photopick input:checked + img, .photopick input:checked + .nophoto { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* v5 round 13: attendance grid menu + legend */
.keys i.cell { width: 22px; height: 22px; font-style: normal; font-size: 11px; cursor: default; vertical-align: middle; }
.cellmenu { position: absolute; top: calc(100% - 4px); left: 50%; transform: translateX(-50%); z-index: 5; display: grid; gap: 2px; min-width: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); text-align: left; }
.cellmenu button { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.cellmenu button:hover, .cellmenu button:focus { background: var(--accent-soft); outline: none; }
.cellmenu button.on { font-weight: 600; }
.cellmenu button[disabled] { color: var(--muted); cursor: not-allowed; background: none; }
.cellmenu i.cell { width: 26px; height: 26px; font-style: normal; cursor: inherit; }
table.att tr.foot td, table.att tr.foot th { font-size: 12px; color: var(--sub); }
.gridw { max-width: 100%; }

/* v5 round 14: month calendars */
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.cal-wrap { overflow-x: auto; border: var(--card-border); border-radius: var(--radius); background: var(--surface); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(92px, 1fr)); min-width: 660px; }
.cal-h { padding: 8px; font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); text-align: center; }
.cal-d { min-height: 92px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d.out { background: var(--neutral-soft); }
.cal-n { font-size: 12.5px; color: var(--sub); width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 50%; }
.cal-d.today .cal-n { background: var(--accent); color: #fff; font-weight: 600; }
.cal-chip { display: block; font-size: 12px; font-style: normal; line-height: 1.3; padding: 4px 6px; border-radius: 6px; text-decoration: none; color: var(--accent-ink); background: var(--accent-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 24px; }
.cal-chip.taught { background: var(--alt-soft); color: var(--alt-ink); }
.cal-chip.cancelled { background: var(--neutral-soft); color: var(--muted); text-decoration: line-through; }
.cal-chip.cc0 { background: #e0ecff; color: #1d4ed8; } .cal-chip.cc1 { background: #dcfce7; color: #166534; } .cal-chip.cc2 { background: #fef3c7; color: #92400e; }
.cal-chip.cc3 { background: #fce7f3; color: #9d174d; } .cal-chip.cc4 { background: #ede9fe; color: #5b21b6; } .cal-chip.cc5 { background: #e0f2fe; color: #075985; }
.cal-chip.cancelled[class*="cc"] { opacity: .55; text-decoration: line-through; }
.keys i.cal-chip { display: inline-block; vertical-align: middle; min-height: 0; padding: 1px 6px; }
.fld-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); }
.fld-inline select { min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 8px; font: inherit; background: var(--surface); }
.later-box .owner-tag { margin-left: 6px; }
@media (max-width: 720px) { .cal-chip { min-height: 44px; display: flex; align-items: center; } .fld-inline select { min-height: 44px; font-size: 16px; } }
/* seven class tabs: one swipeable row on a phone instead of three lines */
@media (max-width: 720px) { nav.tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } nav.tabs a { flex: 0 0 auto; } }

/* v5 round 15: comments screen (left list · editor · parent preview) */
.cm { display: grid; grid-template-columns: 280px minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.cm .box { display: grid; gap: 10px; }
.cm-lesson select { max-width: 100%; }
.cm-prog { display: grid; gap: 6px; font-size: 13px; }
.cm-prog b { font-weight: 500; }
.cm-bar { display: block; height: 6px; border-radius: 99px; background: var(--neutral-soft); overflow: hidden; }
.cm-bar i { display: block; height: 100%; background: var(--accent); }
.cm-list { max-height: 520px; overflow-y: auto; }
.cm-list button.li { width: 100%; text-align: left; border: 0; background: none; font: inherit; cursor: pointer; border-radius: 10px; }
.cm-list button.li.on { background: var(--accent-soft); }
.cm-moods, .cm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-moods .chip-btn.on.mood-need_effort { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.cm-moods .chip-btn.on.mood-excellent, .cm-moods .chip-btn.on.mood-very_good { background: var(--alt-soft); color: var(--alt-ink); border-color: var(--alt-ink); }
.cm .k { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.cm-card { white-space: pre-wrap; font: inherit; font-size: 14px; line-height: 1.55; margin: 0; padding: 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); border: 1px solid var(--line); }
.cm .fld { display: grid; gap: 4px; }
.cm .fld small { justify-self: end; color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) { .cm { grid-template-columns: 1fr; } .cm-list { max-height: 260px; } }

/* v6 T1: the lesson number, small, after the lesson's name */
.lno { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 2px; white-space: nowrap; }

/* v6 T2/T3: where a student stopped; red only when behind */
.li .t .reached, .li .t .behind { display: block; }
.li .t .reached { color: var(--ink); }
.li .t .behind { color: var(--warn); font-weight: 500; }
/* long lesson names must never push the comments screen wider than a phone */
.cm > .box { min-width: 0; }
.cm-lesson { display: grid; grid-template-columns: auto minmax(0, 1fr); width: 100%; }
.cm-lesson select { width: 100%; min-width: 0; text-overflow: ellipsis; }
/* student page: on a phone the fee chip + buttons drop under the class line instead of squeezing it to one letter wide */
.li.enr { flex-wrap: wrap; } .li.enr .t { flex: 1 1 calc(100% - 56px); min-width: 0; }

/* v6 round 17: score grid + marks on the student page */
.sc-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.scgrid th[scope=row] { text-align: left; font-weight: 500; white-space: nowrap; text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--ink); }
.scgrid th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.scgrid td { padding: 6px 4px; }
.scgrid input.sc { width: 64px; min-width: 56px; text-align: center; padding: 6px 4px; }
.scgrid input.ov { font-weight: 600; }
.scgrid input.ov:disabled { background: var(--neutral-soft); color: var(--ink); opacity: 1; }
#tests-box h3 { display: flex; align-items: center; gap: 8px; }
#tests-box h3 .cnt { margin-left: 0; }
.sk { display: inline-block; margin: 0 10px 2px 0; white-space: nowrap; }
.sc-head .fld-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; max-width: 100%; }
#sc-lesson { max-width: 100%; min-width: 0; }

/* v6 round 18: latest test, level bar with target, one small chart per skill, notes box */
.lt { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.lt > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; display: grid; gap: 2px; }
.lt span { font-size: 12px; color: var(--muted); }
.lt b { font-size: 20px; }
.lt .ov { background: var(--accent-soft); border-color: transparent; }
.lt .ov b small { font-size: 12px; color: var(--muted); font-weight: 400; }
#progress-box h3 { display: flex; align-items: center; gap: 8px; }
.pb { margin-bottom: 14px; }
.pb-t { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 13.5px; }
.pb-t span { color: var(--sub); }
.lvbar { position: relative; height: 10px; border-radius: 99px; background: var(--track); margin: 14px 6px 8px; }
.lvbar .done { position: absolute; top: 0; height: 100%; background: var(--accent); border-radius: 99px; }
.lvbar .m { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.lvbar .entry { background: var(--muted); } .lvbar .now { background: var(--accent); } .lvbar .goal { background: var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.sparks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 0 0 12px; }
.spark { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; color: var(--accent); }
.spark figcaption { color: var(--ink); font-size: 13px; display: flex; gap: 6px; align-items: baseline; }
.spark small { font-size: 11.5px; color: var(--muted); } .spark small.up { color: var(--alt-ink); } .spark small.down { color: var(--warn); }
.fb-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.fb-form .fld-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.fb-form select { max-width: 100%; min-width: 0; flex: 1 1 200px; }

/* v6 round 19: parent report page + print view */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
a.chip-btn { display: inline-flex; align-items: center; text-decoration: none; }
.chip-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.rp header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--sub); font-size: 13px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.rp h2 { margin: 12px 0; font-size: 20px; }
.rp h3 { margin: 18px 0 8px; }
.rp-stats { margin-bottom: 4px; }
.rp-stats small { font-size: 12px; color: var(--muted); font-weight: 400; }
.rp-lessons { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 16px; font-size: 13.5px; }
.rp-lessons span { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 4px; }
.rp-lessons .miss { color: var(--sub); } .rp-lessons em { color: var(--warn); font-style: normal; font-size: 12px; }
.rp-fig { margin: 10px 0 0; color: var(--accent); max-width: 420px; }
@media print {
  .side, .top, .bar, .no-print, #page-err, .toast, .toasts { display: none !important; }
  body, .main, .content { background: #fff !important; padding: 0 !important; }
  .rp { box-shadow: none; border: 0; padding: 0; }
  .rp-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* v6 round 20: teacher profile */
.cal-chip.covered { background: var(--neutral-soft); color: var(--sub); font-style: italic; }
.cal-chip.unrecorded { background: var(--warn-soft); color: var(--warn); }
a.t-link { color: inherit; text-decoration: none; } a.t-link:hover b { color: var(--accent); text-decoration: underline; }
#tp-counts .stat span { font-size: 12.5px; }

/* v6 round 21: Hiệu suất */
.stars { color: var(--warn); letter-spacing: 1px; white-space: nowrap; } .stars i { color: var(--line-strong); font-style: normal; }
.rate { display: flex; gap: 6px; flex-wrap: wrap; }
.rate label { cursor: pointer; } .rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate span { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; font-weight: 500; }
.rate input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.rate input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 821px) { #perf td:nth-child(2) { white-space: nowrap; } #perf th, #perf td { padding-left: 8px; padding-right: 8px; } }

/* v6 round 22: Sheets copy preview */
.sheet-prev th, .sheet-prev td { white-space: nowrap; font-size: 12.5px; }

/* v7 parent contact panel: a side panel on wide screens, full screen on a phone */
.sheet-wrap:has(.sheet.sidepanel) { display: flex; justify-content: flex-end; align-items: stretch; padding: 0; }
.sheet.sidepanel { width: min(500px, 100%); min-width: 0; flex: 0 1 auto; max-height: 100vh; height: 100vh; border-radius: 16px 0 0 16px; align-content: start; }
.sheet.sidepanel .btns:last-child { position: sticky; bottom: -20px; background: var(--surface); padding: 10px 0 4px; margin: 0; }
@media (max-width: 560px) { .sheet.sidepanel { border-radius: 0; } }
.pc-parent { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--bg); }
.pc-parent span { color: var(--sub); }
#pc-text { width: 100%; font: inherit; line-height: 1.5; }
.pc-acts { flex-wrap: wrap; }
.pc-note { display: flex; gap: 8px; }
.pc-note input { flex: 1; min-width: 0; }
.pc-h .pc-txt { white-space: pre-line; }
.pc-tick { margin: 10px 0 0; }
.box.tpl textarea { width: 100%; font: inherit; }
#pc-text, #pc-note, .box.tpl textarea { font-size: 16px; }
/* v7 inbox: list + conversation side by side on a computer; one at a time on a phone */
.ib { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 16px; align-items: start; }
.ib-row { text-decoration: none; color: inherit; border-radius: 10px; }
.ib-row.on { background: var(--accent-soft); }
.ib-row .t span:not(.note) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ib-pane { display: grid; gap: 12px; min-width: 0; }
.ib-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.ib-msgs { display: grid; gap: 10px; }
.msg { max-width: 85%; padding: 10px 12px; border-radius: 14px; background: var(--bg); justify-self: start; }
.msg.reply { justify-self: end; background: var(--accent-soft); }
.msg.reply.draft, .msg.reply.copied { border: 1px dashed var(--accent); background: var(--surface); }
.msg p { margin: 0 0 4px; white-space: pre-line; }
.ib-child { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--warn-soft); }
#ib-text { width: 100%; font: inherit; font-size: 16px; }
.ib-back { display: none; }
@media (max-width: 820px) {
  .ib { grid-template-columns: 1fr; }
  .ib.has-thread .ib-list { display: none; }
  .ib:not(.has-thread) .ib-pane { display: none; }
  .ib-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }
}
/* team part pages: long event names (parent.inbox_received) wrap instead of pushing the phone screen sideways */
.row2 .chips .chip { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
/* v4 R7 R8: branch picker in the top bar, role switch in the menu */
.branch-pick select { min-height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; background: var(--surface); font: inherit; font-size: 14px; max-width: 46vw; }
@media (max-width: 820px) { .branch-pick select { font-size: 16px; max-width: 40vw; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.role-switch { margin: 0 8px 10px; justify-content: flex-start; }
.link-btn { background: none; border: 0; padding: 0 2px; color: var(--accent-ink); text-decoration: underline; cursor: pointer; font: inherit; min-height: 32px; }
/* v4 R9: the real-delete box and its red button */
.warnbox { border-color: #f1c8c8; background: #fff7f7; margin-top: 12px; }
.btn.danger { background: #c62828; border-color: #c62828; color: #fff; }
.btn.danger:hover { background: #a91f1f; }
@media (max-width: 820px) { .link-btn { min-height: 44px; display: inline-flex; align-items: center; padding: 0 6px; } }
/* v4 R11: download buttons wrap on phones */
.dl-btns { flex-wrap: wrap; }

/* ---------- v8 "Tập dùng Elu" tours (OB2 OB4 OB6): blue ring spotlight, bubble, checklist button + panel ---------- */
:root { --z-tour: calc(var(--z-modal) + 10); }
.tour-spot { position: fixed; z-index: var(--z-tour); pointer-events: none; border-radius: 10px; box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(31,35,40,.45); transition: left .15s, top .15s, width .15s, height .15s; }

.tour-bubble { position: fixed; z-index: calc(var(--z-tour) + 1); width: min(340px, calc(100vw - 16px)); background: var(--surface); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 14px 16px; border-top: 4px solid var(--accent); }
.tour-bubble h3 { font-size: 16px; margin: 2px 0 4px; }
.tour-bubble p { margin: 0 0 6px; color: var(--sub); }
.tour-bubble.dock { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto; border-radius: var(--radius) var(--radius) 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.tour-step { font-size: 12px; color: var(--muted); }
.tour-wait { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--accent-ink) !important; }
.tour-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tour-btns .btn { min-height: 44px; min-width: 44px; }
.tour-fab { position: fixed; right: 16px; bottom: 16px; z-index: var(--z-toast); display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 16px; border-radius: 24px; border: 0; background: var(--accent); color: var(--on-accent); font: 500 14px var(--body); box-shadow: var(--shadow-pop); cursor: pointer; }
.tour-panel { position: fixed; right: 16px; bottom: 76px; z-index: var(--z-modal); width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 640px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.tour-ph { display: flex; align-items: flex-start; gap: 8px; padding: 14px 16px 8px; }
.tour-ph > div { flex: 1; display: grid; }
.tour-ph small { color: var(--muted); }
.tour-ph .x { border: 0; background: none; min-width: 44px; min-height: 44px; cursor: pointer; color: var(--sub); }
.tour-bar { height: 6px; background: var(--accent-soft); border-radius: 3px; margin: 0 16px 8px; overflow: hidden; }
.tour-bar i { display: block; height: 100%; background: var(--accent); }
.box .tour-bar { margin: 8px 0 12px; }
.tour-body { overflow-y: auto; padding: 0 16px 8px; }
.tour-pf { padding: 8px 16px 14px; border-top: 1px solid var(--line); }
.tour-grp { padding: 8px 0; border-bottom: 1px solid var(--line); }
.tour-grp:last-child { border-bottom: 0; }
.tour-gh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tour-gh b { flex: 1; min-width: 140px; }
.tour-gh small { color: var(--muted); }
.tour-gh .btn, .tour-panel .btn, .tour-panel button, #guide-page .btn { min-height: 44px; }
.tour-li { display: flex; gap: 8px; align-items: center; padding: 4px 0 4px 4px; color: var(--sub); }
.tour-li .tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.tour-li.on { color: var(--ink); }
.tour-li.on .tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tour-offer { position: fixed; right: 16px; bottom: 76px; z-index: var(--z-modal); width: min(360px, calc(100vw - 32px)); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 16px; border-top: 4px solid var(--accent); }
.tour-offer h3 { font-size: 17px; margin-bottom: 4px; }
.tour-offer p { margin: 0; color: var(--sub); }
@media (max-width: 860px) {
  .tour-fab { bottom: calc(var(--bar-h) + 12px + env(safe-area-inset-bottom, 0px)); right: 12px; }
  .tour-panel, .tour-offer { right: 8px; left: 8px; width: auto; bottom: calc(var(--bar-h) + 70px); }
}
.tour-bubble.dock.dock-top { top: 0 !important; bottom: auto; border-radius: 0 0 var(--radius) var(--radius); border-top: 0; border-bottom: 4px solid var(--accent); padding-bottom: 14px; padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
html.tour-dock-b .sheet-wrap { padding-bottom: calc(var(--tour-h) + 8px); }
html.tour-dock-t .sheet-wrap { padding-top: calc(var(--tour-h) + 8px); }
html.tour-dock-b .sheet, html.tour-dock-t .sheet { max-height: calc(100vh - 24px - var(--tour-h)); }

/* v8 round 31: Sheet import preview lines: chip + one text block that wraps normally */
.sheet-sec .li > .grow { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.sheet-sec h4 { margin: 14px 0 6px; font-weight: 500; }

/* v8 Sổ tay (handbook): one card per task, steps + sample-centre picture + "Làm thử" */
.help-btn { min-width: 36px; padding: 0 8px; }
.help-btn svg { width: 20px; height: 20px; }
#handbook .toolbar { margin: 8px 0; }
#hb-areas { margin-bottom: 8px; }
.hb-grp h4 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hb-card { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 8px; background: var(--surface); }
.hb-card > summary { list-style: none; cursor: pointer; padding: 12px 14px; min-height: 44px; display: grid; gap: 2px; }
.hb-card > summary::-webkit-details-marker { display: none; }
.hb-card[open] > summary { border-bottom: 1px solid var(--line); }
.hb-t { font-weight: 600; color: var(--ink); }
.hb-m { font-size: 13px; color: var(--muted); }
.hb-body { padding: 10px 14px 14px; }
.hb-cols { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: start; }
.hb-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.hb-steps li { padding-left: 2px; overflow-wrap: anywhere; }
.hb-shot { width: 100%; border: 1px solid var(--line); border-radius: 10px; display: block; }
#guide-check > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
@media (max-width: 600px) {
  .hb-cols { grid-template-columns: 1fr; }
  .hb-shot { max-width: 260px; }
  .help-btn { min-width: 44px; }
}

/* q74 A: the required first tour says so under its buttons */
.tour-must { margin: 6px 0 0 !important; font-size: 12px; color: var(--muted) !important; }

/* v9 big web (W1 W2 W4): avatar menu in the top bar, section strip on list screens, 5 bottom buttons with two-line labels */
.am-wrap { position: relative; }
.avatar-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); font: 600 12px var(--body); cursor: pointer; display: grid; place-items: center; }
.avatar-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 6px; display: grid; gap: 2px; z-index: var(--z-modal); }
.am-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.am-who b { display: block; font-weight: 500; }
.am-who small { color: var(--muted); font-size: 12px; }
.am-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 8px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; font-size: 14px; text-align: left; cursor: pointer; width: 100%; }
.am-item:hover, .am-item:focus-visible { background: var(--neutral-soft); }
.role-switch.am-item { margin: 0; color: var(--accent-ink); }
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: -6px; overflow-x: auto; scrollbar-width: none; }
.subnav a { flex: 0 0 auto; padding: 10px 14px; color: var(--sub); text-decoration: none; border-bottom: 2px solid transparent; min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; }
.subnav a.on { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 500; }
.me-link { text-decoration: none; color: var(--ink); align-items: center; gap: 12px; min-height: 56px; }
.me-link .t { flex: 1; }
.me-link .t b { color: var(--ink); }
@media (max-width: 820px) {
  .bar a span { line-height: 1.15; text-align: center; padding: 0 2px; }
  .avatar-btn { width: 44px; height: 44px; }
  .avatar-menu { position: fixed; right: 8px; left: auto; top: calc(var(--top-h) + 4px); width: min(300px, calc(100vw - 16px)); }
}
@media (max-width: 480px) { .top:has(.branch-pick) .crumb { display: none; } }
/* v9 rounds 34–35: student rows + the class "Được giao" list */
.as-item > summary { display: flex; align-items: center; gap: 12px; list-style: none; cursor: pointer; width: 100%; }
.as-item > summary::-webkit-details-marker { display: none; }
.as-item { display: block; }
.as-item .as-count { margin-left: auto; flex: none; }
.as-results { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.as-row .chip, .as-row .btn { flex: none; }
@media (max-width: 600px) {
  .as-row { flex-wrap: wrap; }
  .as-row .t { flex: 1 1 100%; }
  .as-row .btn { margin-left: auto; }
}

/* v11 L3 (v9 MP2–MP4, MP11): the class "Tiến độ" strip + table; at phone width the table stacks into cards (tbl stack) */
.pg-strip { display: flex; flex-wrap: wrap; gap: 3px; margin: 6px 0 4px; }
.ps-cell { display: inline-block; width: 14px; height: 22px; border-radius: 3px; background: var(--track); position: relative; cursor: pointer; }
.ps-cell.ps-done { background: var(--accent); }
.ps-cell.ps-current { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.ps-cell.ps-test::after { content: ""; position: absolute; left: 3px; top: -5px; width: 8px; height: 8px; background: var(--warn); transform: rotate(45deg); border-radius: 1px; }
.ps-cell.ps-fee { box-shadow: inset 0 -4px 0 var(--alt-ink); }
.ps-cell:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.pg-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--sub); margin: 8px 0 0; }
.pg-legend span { display: inline-flex; align-items: center; gap: 6px; } .pg-legend .ps-cell { width: 10px; height: 14px; cursor: default; }
.pg-legend .ps-test::after { left: 1px; top: -4px; width: 7px; height: 7px; }
.trend { font-weight: 600; margin-left: 4px; } .trend.t-up { color: var(--alt-ink); } .trend.t-down { color: var(--warn); } .trend.t-same { color: var(--muted); }
.pg-note { max-width: 320px; }
.rp-list { margin: 4px 0 8px; padding-left: 18px; }
@media (max-width: 820px) { .ps-cell { width: 16px; height: 26px; } .pg-note { max-width: none; } }

/* v11 L5 library */
.hide { display: none !important; }
.chk { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink); min-height: 36px; }
.chk input { width: 18px; height: 18px; }
.lib-usage { display: grid; gap: 8px; }
.lib-usage.warn { border-color: var(--warn, #b45309); }
.lib-bar { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.lib-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.lib-filters { align-items: end; }
.lib-filters .f { min-width: 150px; flex: 1 1 150px; }
.lib-item .t { min-width: 0; }
.lib-item .t b { overflow-wrap: anywhere; }
.lib-item .chips { margin: 4px 0; }
.lib-item > .btns { flex-wrap: wrap; justify-content: flex-end; max-width: 46%; }
.lib-view { display: grid; gap: 10px; justify-items: center; max-height: 70vh; overflow: auto; }
.lib-view img, .lib-view video { max-width: 100%; max-height: 66vh; border-radius: 8px; }
.lib-view audio { width: 100%; }
.lib-pdf { display: grid; gap: 10px; width: 100%; justify-items: center; }
.lib-page { max-width: 100%; height: auto; box-shadow: var(--shadow); background: #fff; }
.lib-yt { position: relative; width: 100%; padding-top: 56.25%; }
.lib-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }
.lib-prog { display: grid; gap: 4px; margin-top: 8px; }
.lib-mon { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lib-mon > div { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.lib-mon b { font-size: 22px; }
.box.warn { border-left: 4px solid var(--warn, #b45309); }
#lib-zalo-text { width: 100%; font: inherit; padding: 10px; border: 1px solid var(--line-strong); border-radius: 8px; }
@media (max-width: 720px) {
  .lib-item { flex-wrap: wrap; }
  .lib-item > .btns { max-width: 100%; width: 100%; justify-content: flex-start; }
  .lib-filters .f { flex: 1 1 100%; }
  .lib-mon { grid-template-columns: 1fr; }
}
.lib-more { position: relative; display: inline-block; }
.lib-more > summary { list-style: none; cursor: pointer; }
.lib-more > summary::-webkit-details-marker { display: none; }
.lib-more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; display: grid; gap: 6px; padding: 8px; min-width: 200px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); }
.lib-more-menu .btn { justify-content: flex-start; width: 100%; }
@media (max-width: 720px) { .lib-more-menu { left: 0; right: auto; } }

/* v11 L6 homework */
.hw-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 99px; background: #d93025; color: #fff; font-size: 11px; font-weight: 600; line-height: 1; }
.bar .hw-badge, nav.bottom .hw-badge { position: absolute; top: 4px; margin-left: 18px; }
.hw-cards .li.hw-new { background: var(--accent-soft); border-radius: 8px; }
.hw-toast { position: fixed; right: 16px; bottom: 84px; z-index: 60; display: flex; gap: 10px; align-items: center; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--shadow); text-decoration: none; font-size: 14px; }
.hw-q { display: grid; gap: 10px; padding: 14px; }
.hw-q-head { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.hw-q-head b { flex: 1 1 200px; }
.hw-q-head .f { width: 90px; }
.hw-q textarea { width: 100%; }
.hw-addq { align-items: end; }
.hw-students { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; max-height: 260px; overflow: auto; }
.hw-mark-row .t { display: grid; gap: 4px; }
.hw-mark-row .f { max-width: 160px; }

/* v11 L7 test room */
.room { display: grid; gap: 14px; max-width: 860px; }
.room-top .row-between { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.room-title { font-size: 20px; margin: 2px 0; }
.room-meta { display: grid; justify-items: end; gap: 2px; }
.room-timer { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.room-timer.low { color: var(--warn); }
.room-bar { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; margin: 12px 0 4px; }
.room-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.room-passage summary { cursor: pointer; min-height: 32px; }
.room-passage p { margin: 8px 0; line-height: 1.7; }
.room-yt { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; }
.room-q { display: grid; gap: 10px; margin-top: 10px; }
.room-q .q-prompt { font-weight: 500; margin: 0; }
.room-q .opt { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 8px 12px; border: var(--opt-border); border-radius: var(--opt-radius); cursor: pointer; }
.room-q .opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.room-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.room-q .q-gap { line-height: 2.4; margin: 0; }
.room-q input.gap { width: 9em; min-height: 36px; padding: 4px 8px; border: var(--opt-border); border-radius: 8px; font: inherit; }
.room-heads { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
.room-heads b { display: inline-block; min-width: 2em; }
.room-para { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; }
.room-para select { min-height: 40px; min-width: 6em; }
.room-order { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.room-order li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 8px; border: var(--opt-border); border-radius: 8px; }
.room-ord { display: flex; gap: 4px; flex: none; }
.room-essay { min-height: 260px; }
.room-pic { max-width: 100%; border-radius: 8px; }
.room-nav { margin-top: 14px; }
.room-nav #room-submit { margin-left: auto; }
.room-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.room-grid button { width: 40px; height: 40px; border-radius: 8px; border: var(--opt-border); background: var(--surface); font: inherit; cursor: pointer; }
.room-grid button.done { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.room-grid button.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.room-score { font-size: 44px; font-weight: 600; margin: 6px 0; }
.room-score small { font-size: 22px; color: var(--muted); }
.room-review { display: grid; gap: 10px; }
.room-rev { border: var(--card-border); border-left: 4px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; }
.room-rev.ok { border-left-color: var(--alt-ink); }
.room-rev.bad { border-left-color: var(--warn); }
.room-rev p { margin: 6px 0 0; }
@media (max-width: 640px) { .room-nav .btn { flex: 1 1 auto; } .room-nav #room-submit { flex-basis: 100%; } .room-meta { justify-items: start; } }

/* v11 L8 student portal */
.sp-focal { border-left: 4px solid var(--accent); }
.sp-focal-t { font-size: 19px; margin: 4px 0 8px; }
.sp-points { margin: 6px 0 10px; padding-left: 20px; display: grid; gap: 4px; }
.sp-words { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.sp-hw { margin: 6px 0 12px; }
.sp-sec { margin: 6px 2px 0; font-size: 15px; }
.sp-big b { display: block; font-size: 34px; font-weight: 600; line-height: 1.1; margin: 4px 0; }
.sp-big b small { font-size: 16px; color: var(--muted); font-weight: 400; }
.sp-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.sp-line { width: 100%; max-width: 560px; height: auto; display: block; }
.sp-path { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.sp-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.sp-target { stroke: var(--alt-ink); stroke-width: 1.5; stroke-dasharray: 5 4; }
.sp-val { font-size: 11px; fill: var(--ink); font-weight: 600; }
.sp-lbl { font-size: 10px; fill: var(--muted); }
nav.bar a { position: relative; }
@media (max-width: 640px) { #st-lessons .li .btn, #st-assigned .li .btn { min-height: 44px; } }

/* ---------- v12 round L: library like Google Drive (folders, chips, plain list, one more-menu, details panel, share box) ---------- */
.lib-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lib-top h1 { font-size: 22px; margin-right: 4px; }
.lib-new { border-radius: 16px; padding: 0 18px; min-height: 44px; box-shadow: var(--btn-shadow); }
.lib-search { flex: 1 1 260px; min-width: 0; }
.lib-search label { display: flex; align-items: center; gap: 8px; background: var(--neutral-soft); border-radius: 24px; padding: 0 16px; min-height: 44px; color: var(--sub); }
.lib-search input { border: 0; background: none; flex: 1; min-width: 0; font: inherit; color: var(--ink); min-height: 42px; outline: none; }
.lib-search label:focus-within { background: var(--surface); box-shadow: var(--focus-ring); }
.lib-body { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.lib-folders { display: grid; gap: 2px; }
.lib-folders a { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 0 20px 20px 0; color: var(--ink); text-decoration: none; min-height: 40px; font-size: 13.5px; }
.lib-folders a:hover { background: var(--neutral-soft); }
.lib-folders a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.lib-folders .n { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lib-main { padding: 12px 0 6px; min-width: 0; }
.lib-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 10px; align-items: center; }
.lib-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; font: inherit; font-size: 13px; min-height: 34px; padding: 0 10px; color: inherit; cursor: pointer; }
.lib-chip select { border: 0; background: none; font: inherit; font-size: 13px; color: inherit; min-height: 32px; cursor: pointer; max-width: 180px; }
.lib-chip.on { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); }
.lib-filter-btn { display: none; }
.lib-sort { margin-left: auto; }
.lib-h { padding: 4px 16px 8px; font-size: 14px; }
.lib-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 96px 84px 84px; gap: 10px; align-items: center; padding: 6px 16px; border-bottom: 1px solid var(--line); }
.lib-row.lib-srow { grid-template-columns: minmax(0, 1fr) 96px 84px; }
.lib-head { font-size: 12.5px; color: var(--sub); font-weight: 500; padding-block: 8px; }
.lib-item { cursor: pointer; min-height: 52px; }
.lib-item:hover { background: var(--neutral-soft); }
.lib-item:focus-visible { background: var(--neutral-soft); border-radius: 0; box-shadow: inset 0 0 0 2px var(--accent); }
.lib-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lib-name b { font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.lib-star { color: var(--warn); display: inline-flex; }
.lib-row .c-by, .lib-row .c-date, .lib-row .c-size { color: var(--sub); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-acts { display: flex; justify-content: flex-end; gap: 2px; }
.lib-acts .ib { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; border-radius: 50%; color: var(--sub); cursor: pointer; grid-template-columns: none; gap: 0; }
.lib-acts .ib:hover { background: var(--line); color: var(--ink); }
.lib-more svg { transform: rotate(90deg); }
.lib-kind { width: 32px; height: 26px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 9.5px; font-weight: 600; letter-spacing: .02em; color: #fff; flex: none; }
.k-pdf { background: #D93025; } .k-yt { background: #C5221F; } .k-drv { background: #188038; } .k-url { background: #5F6B7A; } .k-img { background: #00796B; } .k-aud { background: #B45309; } .k-vid { background: #7B1FA2; } .k-doc { background: #1A73E8; }
.lib-pop { position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 6px 0; min-width: 230px; }
.lib-pop button { display: flex; width: 100%; gap: 10px; align-items: center; border: 0; background: none; padding: 0 16px; min-height: 40px; text-align: left; font: inherit; color: var(--ink); cursor: pointer; white-space: nowrap; }
.lib-pop button:hover, .lib-pop button:focus-visible { background: var(--neutral-soft); box-shadow: none; border-radius: 0; }
.lib-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.lib-info { position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 100%); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-pop); padding: 20px; z-index: 60; overflow-y: auto; }
.lib-info h2 { font-size: 17px; margin: 0 44px 10px 0; overflow-wrap: anywhere; }
.lib-info .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-info dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; margin: 14px 0; font-size: 13.5px; }
.lib-info dt { color: var(--muted); }
.lib-info dd { margin: 0; overflow-wrap: anywhere; }
.lib-info-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.lib-usage small { color: var(--sub); }
.sheet.shr { width: min(540px, 100%); }
.shr-h { display: flex; align-items: center; gap: 8px; }
.shr-h h2 { font-size: 20px; font-weight: 400; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.shr-h .ib { width: 40px; height: 40px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--sub); grid-template-columns: none; gap: 0; }
.shr-add { margin-top: 14px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 8px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; position: relative; }
.shr-add:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.shr-add input { border: 0; flex: 1 1 160px; min-width: 0; font: inherit; padding: 8px 4px; outline: none; background: none; }
.shr-pchip { background: var(--neutral-soft); border-radius: 16px; padding: 2px 4px 2px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 2px; }
.shr-pchip button { border: 0; background: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--sub); }
.shr-sugg { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-pop); z-index: 5; padding: 4px 0; max-height: 280px; overflow-y: auto; }
.shr-sugg button { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 6px 12px; text-align: left; font: inherit; cursor: pointer; color: var(--ink); }
.shr-sugg button span { display: grid; }
.shr-sugg small { color: var(--muted); }
.shr-sugg button:hover, .shr-sugg button.hi { background: var(--neutral-soft); }
.shr-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 500; color: #fff; flex: none; }
.shr-addrow { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.shr-addrow .sp { flex: 1; }
.shr-sec { font-size: 14.5px; margin: 18px 0 6px; }
.shr-people { display: grid; gap: 2px; }
.shr-person, .shr-ga { display: flex; gap: 12px; align-items: center; padding: 6px 0; flex-wrap: wrap; }
.shr-person .t, .shr-ga .t { flex: 1 1 180px; min-width: 0; display: grid; }
.shr-person .t b { font-weight: 400; overflow-wrap: anywhere; }
.shr-person .t span, .shr-ga .t span { font-size: 12.5px; color: var(--muted); }
.shr-fixed { color: var(--muted); font-size: 13px; padding-right: 6px; }
.shr select { font: inherit; border: 0; background: none; padding: 0 6px; min-height: 40px; border-radius: 6px; color: var(--ink); max-width: 100%; cursor: pointer; }
.shr select:hover { background: var(--neutral-soft); }
.shr-ga .t select { justify-self: start; font-weight: 500; padding-left: 0; }
.shr-circ { width: 32px; height: 32px; border-radius: 50%; background: var(--neutral-soft); display: grid; place-items: center; flex: none; color: var(--sub); }
.shr-circ.on { background: var(--alt-soft); color: var(--alt-ink); }
.shr-f { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .lib-body { grid-template-columns: minmax(0, 1fr); }
  .lib-folders { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .lib-folders a { border-radius: 18px; border: 1px solid var(--line-strong); background: var(--surface); white-space: nowrap; min-height: 40px; padding: 0 12px; flex: none; }
  .lib-folders .n { margin-left: 2px; }
  .lib-chips > label.lib-chip { display: none; }
  .lib-filter-btn { display: inline-flex; }
  .lib-row, .lib-row.lib-srow { grid-template-columns: minmax(0, 1fr) auto; padding: 6px 10px 6px 12px; }
  .lib-row .c-by, .lib-row .c-date, .lib-row .c-size { display: none; }
  .lib-new span { display: none; }
  .lib-new { padding: 0 14px; }
}

/* ---------- v12 H1: the teacher's Elu AI tab (4 sections) ---------- */
.ai-hub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ai-card { display: grid; gap: 8px; align-content: start; }
.ai-card h3 { display: flex; gap: 8px; align-items: center; font-size: 17px; }
.ai-card h3 svg { color: var(--accent); }
.ai-card p { margin: 0; color: var(--sub); }
.ai-opts { margin: 4px 0 0; flex-wrap: wrap; }
.ai-prev { display: grid; gap: 6px; padding: 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--line); }
.ai-prev span { background: var(--surface); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; color: var(--sub); box-shadow: var(--shadow); }
.ai-prev span.b { font-weight: 600; color: var(--accent-ink); }
.ai-prev.big { margin: 8px 0; }
@media (max-width: 820px) { .ai-hub { grid-template-columns: minmax(0, 1fr); } }

/* ---------- v12b X10 Kết nối ---------- */
.mock-chip{display:inline-flex;align-items:center;gap:4px;text-decoration:none;font-size:12px}
.cn-imp{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:10px}
.cn-tile{display:flex;flex-direction:column;gap:4px;padding:14px;border:1px solid var(--line,#E3E8EF);border-radius:12px;background:#fff;color:inherit;text-decoration:none;transition:transform .15s ease-out,box-shadow .15s ease-out}
.cn-tile:hover{transform:translateY(-2px);box-shadow:0 4px 14px rgba(26,115,232,.12)}
.cn-tile b{font-size:15px}.cn-tile span{font-size:12px;color:var(--muted,#5F6B7A)}
.cn-tile .i{color:#1A73E8}
.cn-row summary{display:flex;align-items:center;gap:12px;cursor:pointer;list-style:none;width:100%}
.cn-row summary::-webkit-details-marker{display:none}
.cn-row{display:block}.cn-row.hl{outline:2px solid #1A73E8;border-radius:10px}
.cn-form{padding:10px 0 4px 52px}
#st-connect{display:flex;align-items:center;gap:12px;text-decoration:none;color:inherit;margin-bottom:14px}
@media (max-width:640px){.cn-imp{grid-template-columns:repeat(2,minmax(0,1fr))}.cn-form{padding-left:0}}

/* ---------- v12b X7 score line (q141 A) ---------- */
.sc{position:relative;margin:8px 0 0;max-width:620px}
.sc svg{width:100%;height:auto;display:block;overflow:visible}
.sc-grid{stroke:#E3E8EF;stroke-width:1}
.sc-ax,.sc-date{font:500 10px Lexend,system-ui,sans-serif;fill:#5F6B7A}
.sc-target{stroke:#5F6B7A;stroke-width:1.5;stroke-dasharray:6 5}
.sc-tl{font:600 11px Lexend,system-ui,sans-serif;fill:#5F6B7A}
.sc-line{fill:none;stroke:#1A73E8;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1;animation:sc-draw .7s cubic-bezier(.23,1,.32,1) .05s forwards}
.sc-dot circle{fill:#fff;stroke:#1A73E8;stroke-width:2.5;opacity:0;animation:sc-in .25s ease-out .45s forwards}
.sc-dot.last circle{fill:#1A73E8}
.sc-dot .hit{fill:transparent;stroke:none;opacity:1;animation:none;cursor:pointer}
.sc-dot:focus{outline:none}.sc-dot.on circle:first-child,.sc-dot:focus circle:first-child{stroke-width:4}
.sc-lastv{font:700 14px Lexend,system-ui,sans-serif;fill:#1A73E8;opacity:0;animation:sc-in .25s ease-out .6s forwards}
.sc-tip{position:absolute;z-index:2;background:#1F2937;color:#fff;font-size:12px;padding:6px 10px;border-radius:8px;white-space:nowrap;pointer-events:none;animation:sc-pop .15s ease-out}
.sc-one{display:flex;flex-direction:column;gap:4px;padding:10px 0}
.sc-big{font:700 40px Lexend,system-ui,sans-serif;color:#1A73E8;line-height:1}.sc-big small{font-size:16px;color:#5F6B7A}
.sc-goal{font-size:14px}.sc-empty{padding:8px 0}
@keyframes sc-draw{to{stroke-dashoffset:0}}
@keyframes sc-in{to{opacity:1}}
@keyframes sc-pop{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:none}}
/* Windows "reduce animations" ON (Lucas's PC): keep the draw-in and fades, just shorter (V12B-4) */
@media (prefers-reduced-motion:reduce){.sc-line{animation-duration:.3s}.sc-dot circle,.sc-lastv{animation-delay:.2s}}
@media print{.sc-line{animation:none;stroke-dashoffset:0}.sc-dot circle,.sc-lastv{animation:none;opacity:1}}

/* v12 X5 Xem trước */
.pv-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border: 1px solid #C6DAFC; background: #EEF4FE; animation: sc-in .35s ease both; }
.pv-bar .pv-eye { width: 40px; height: 40px; border-radius: 50%; background: #1A73E8; color: #fff; display: grid; place-items: center; flex: none; }
.pv-bar .t { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; }
.pv-bar .t span { color: #5F6B7A; font-size: .9rem; }
.pv-switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; padding: 8px 12px; border-radius: 999px; background: #fff; border: 1px solid #C6DAFC; min-height: 44px; }
.pv-switch input { width: 20px; height: 20px; accent-color: #1A73E8; }
.pv-key { margin-top: 12px; padding: 10px 12px; border-left: 4px solid #188038; background: #E6F4EA; border-radius: 8px; animation: sc-in .3s ease both; }
.room-pv #room-item :disabled { cursor: not-allowed; }

/* v12 X6 Canvas flow */
.hw-gsum { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.hw-g { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #F1F3F6; font-size: .9rem; }
.hw-g b { font-size: 1.1rem; }
.g-missing { --g: #5F6B7A; } .g-handed { --g: #1A73E8; } .g-late { --g: #B3261E; } .g-marked { --g: #188038; }
.hw-g b { color: var(--g); }
.hw-grid th.c, .hw-grid td.c { text-align: center; }
.hw-dot { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--g); color: #fff; font-weight: 700; font-size: .85rem; animation: sc-pop .35s ease both; }
.hw-cell small { display: block; color: #B3261E; font-size: .75rem; }
.hw-nudge-text textarea { width: 100%; font: inherit; border: 1px solid #DADCE0; border-radius: 8px; padding: 8px; background: #fff; }
.hw-queue { display: inline-block; margin: 0 0 8px; }
.hw-due-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tm-box { animation: sc-in .35s ease both; }
.as-pts { font-weight: 600; }
@media (max-width: 700px) {
  .hw-grid td.hw-cell:empty { display: none; }
  .hw-grid td.c { text-align: left; }
}

/* v12 X4 AI from a file */
.ai-steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 14px; flex-wrap: wrap; }
.ai-steps li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: #fff; border: 1px solid #DADCE0; color: #5F6B7A; }
.ai-steps li b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #F1F3F6; font-size: .85rem; }
.ai-steps li.on { border-color: #1A73E8; color: #1A73E8; font-weight: 600; } .ai-steps li.on b { background: #1A73E8; color: #fff; }
.ai-steps li.done b { background: #188038; color: #fff; }
.ai-card { animation: sc-in .3s ease both; }
.ai-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; border: 2px dashed #A8C7FA; border-radius: 14px; background: #F6F9FF; cursor: pointer; text-align: center; }
.ai-drop .i { width: 34px; height: 34px; color: #1A73E8; } .ai-drop span { color: #5F6B7A; font-size: .9rem; }
.ai-drop:hover { background: #EEF4FE; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ai-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid #DADCE0; background: #fff; cursor: pointer; min-height: 44px; }
.ai-chip input { accent-color: #1A73E8; width: 18px; height: 18px; }
.seg { display: inline-flex; border: 1px solid #DADCE0; border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 10px 18px; font: inherit; cursor: pointer; min-height: 44px; }
.seg button.on { background: #1A73E8; color: #fff; font-weight: 600; }
.ai-bar { height: 10px; border-radius: 999px; background: #E8EAED; overflow: hidden; } .ai-bar i { display: block; height: 100%; width: 0; background: #1A73E8; transition: width .2s ease-out; }
.ai-q { align-items: flex-start; animation: sc-in .25s ease both; } .ai-q.kept { background: #F0F8F2; } .ai-q.dropped { opacity: .55; }
.ai-q .t b.ai-qtext { font-weight: 500; }
.ai-acts { flex-wrap: wrap; justify-content: flex-end; }
.hw-ai-link { float: right; }
.okcard { border-left: 4px solid #188038; }
@media (max-width: 700px) { .ai-q { flex-direction: column; } .ai-acts { justify-content: flex-start; } .hw-ai-link { float: none; display: inline-flex; margin-top: 6px; } }

/* v12 X1 Elu AI hub: 3 big cards */
.hub3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.hub-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; padding: 16px; transition: transform .18s ease-out, box-shadow .18s ease-out; animation: sc-in .35s ease-out both; animation-delay: var(--d, 0ms); }
.hub-card:hover, .hub-card:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(26, 115, 232, .16); }
.hub-card h2 { display: flex; align-items: center; gap: 8px; font-size: 20px; margin: 4px 0 0; }
.hub-card h2 .i { color: #1A73E8; }
.hub-card p { margin: 0; color: #5F6B7A; flex: 1; }
.hub-btn { align-self: flex-start; }
.hub-pic { height: 150px; border-radius: 14px; background: linear-gradient(135deg, #E8F0FE, #F6F8FB); border: 1px solid #DADCE0; display: grid; place-items: center; overflow: hidden; }
.hp-slide { width: 78%; height: 74%; background: #fff; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.08); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.hp-slide b { color: #1A73E8; font-size: 14px; } .hp-slide i { display: block; height: 7px; border-radius: 4px; background: #E8EAED; } .hp-slide i.s { width: 60%; }
.hp-thumbs { position: absolute; right: -6px; bottom: -6px; display: flex; gap: 4px; } .hp-thumbs em { width: 26px; height: 18px; border-radius: 3px; background: #C6DAFC; border: 2px solid #fff; animation: sc-pop .4s ease-out both; }
.hp-thumbs em:nth-child(2) { animation-delay: .1s; } .hp-thumbs em:nth-child(3) { animation-delay: .2s; }
.hp-video { height: 80%; width: auto; max-width: 88%; aspect-ratio: 16 / 9; border-radius: 10px; background: linear-gradient(160deg, #1A73E8, #0B57D0); position: relative; display: grid; place-items: center; color: #fff; }
.hp-play { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.95); color: #1A73E8; display: grid; place-items: center; font-size: 18px; animation: sc-pop .45s ease-out both; }
.hp-cap { position: absolute; left: 10px; bottom: 14px; font-size: 11px; background: rgba(0,0,0,.35); padding: 2px 6px; border-radius: 4px; }
.hp-prog { position: absolute; left: 10px; right: 10px; bottom: 6px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.35); } .hp-prog i { display: block; height: 100%; width: 40%; background: #fff; border-radius: 2px; }
.hp-game { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 78%; }
.hp-game span { background: #fff; border-radius: 10px; padding: 10px 6px; text-align: center; font-weight: 600; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.hp-game span.ok { background: #188038; color: #fff; animation: sc-pop .45s ease-out .15s both; }
.hub-row { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.hub-row .t { flex: 1; }
.sl-door h3 { display: flex; gap: 8px; align-items: center; } .sl-door h3 .i { color: #B06000; }
.sl-deck { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 6px 0 10px; }
.sl-mini { aspect-ratio: 16 / 9; border-radius: 10px; border: 1px solid #DADCE0; background: #fff; padding: 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.05); animation: sc-in .35s ease-out both; animation-delay: var(--d, 0ms); }
.sl-mini small { color: #5F6B7A; } .sl-mini b { color: #1A73E8; } .sl-mini span { color: #3C4043; font-size: .9rem; }
@media (max-width: 900px) { .hub3, .sl-deck { grid-template-columns: minmax(0, 1fr); } .hub-pic { height: 130px; } }

/* v12 X2/X3: Elu Video / Elu Game feel like their own sites (V12B-7) */
body.elu-site .app { grid-template-columns: minmax(0, 1fr); }
body.elu-site .side, body.elu-site .top, body.elu-site .bar, body.elu-site .subnav { display: none !important; }
body.elu-site .content { padding-top: 0; padding-bottom: 24px; }
.site-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 0; margin: 0 0 12px; background: #F6F8FB; border-bottom: 1px solid #DADCE0; }
.site-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: #1A73E8; font-size: 19px; }
.site-brand .i { width: 26px; height: 26px; padding: 4px; border-radius: 8px; background: #1A73E8; color: #fff; }
.site-sp { flex: 1; }
.site-body { animation: sc-in .3s ease-out both; }
.site-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.site-hero h1 { margin: 0; } .site-hero .sub { margin: 4px 0 0; }
.vd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.vd-card { display: flex; flex-direction: column; gap: 10px; animation: sc-in .3s ease-out both; }
.vd-meta { display: flex; flex-direction: column; gap: 6px; }
.vd-acts { margin: 0; align-items: center; }
.vd-player { position: relative; border-radius: 12px; overflow: hidden; background: #0B1B33; aspect-ratio: 16 / 9; }
.vd-player.r-tall { aspect-ratio: 9 / 16; max-height: 420px; margin: 0 auto; }
.vd-player.big { max-width: 760px; } .vd-player.r-tall.big { max-height: 560px; }
.vd-player video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vd-cc { position: absolute; left: 8%; right: 8%; bottom: 48px; text-align: center; color: #fff; font-size: 15px; line-height: 1.35; text-shadow: 0 1px 3px rgba(0,0,0,.8); pointer-events: none; }
.vd-sample { position: absolute; top: 8px; left: 8px; }
.vd-src { margin-bottom: 12px; flex-wrap: wrap; } .vd-src-body { margin-bottom: 8px; }
.vd-looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.vd-look { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 10px; border-radius: 12px; border: 2px solid #DADCE0; background: #fff; cursor: pointer; font: inherit; text-align: left; transition: transform .15s ease-out; }
.vd-look i { display: block; width: 100%; height: 54px; border-radius: 8px; }
.look-clean i { background: linear-gradient(#fff, #E8F0FE); border: 1px solid #DADCE0; } .look-cartoon i { background: radial-gradient(circle at 30% 40%, #FDD663 0 14px, transparent 15px), #A8DAB5; } .look-board i { background: #2E4D3A; box-shadow: inset 0 0 0 3px #8D6E63; }
.vd-look span { color: #5F6B7A; font-size: .85rem; }
.vd-look.on { border-color: #1A73E8; transform: translateY(-2px); }
.vd-voices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.vd-voice { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 2px solid #DADCE0; background: #fff; cursor: pointer; min-height: 48px; }
.vd-voice b { flex: 1; } .vd-voice input { accent-color: #1A73E8; } .vd-voice.on { border-color: #1A73E8; }
.vd-progress { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; animation: sc-in .25s ease-out both; }
.vd-watch h2 { margin: 12px 0 4px; } .vd-script p { margin: 4px 0; }
details.more { position: relative; } details.more > summary { list-style: none; cursor: pointer; } details.more > summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 6; min-width: 190px; background: #fff; border: 1px solid #DADCE0; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; display: flex; flex-direction: column; animation: sc-in .18s ease-out both; }
.more-menu a, .more-menu button { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; border: 0; background: none; font: inherit; color: inherit; text-decoration: none; cursor: pointer; text-align: left; min-height: 44px; }
.more-menu a:hover, .more-menu button:hover { background: #F1F3F6; }
@media (max-width: 700px) { .vd-looks, .vd-voices { grid-template-columns: minmax(0, 1fr); } .vd-grid { grid-template-columns: minmax(0, 1fr); } }

/* v12 X3: Elu Game (4 real games + 4 "Sắp có") */
.gm-games { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.gm-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 10px; border-radius: 14px; border: 2px solid #DADCE0; background: #fff; font: inherit; text-align: left; cursor: pointer; animation: sc-in .3s ease-out both; animation-delay: var(--d, 0ms); transition: transform .15s ease-out, border-color .15s; }
.gm-card:hover:not([disabled]):not(.soon) { transform: translateY(-2px); }
.gm-card.on { border-color: #1A73E8; box-shadow: 0 0 0 3px #E8F0FE; }
.gm-card span { color: #5F6B7A; font-size: .85rem; }
.gm-card[disabled], .gm-card.soon { opacity: .55; cursor: not-allowed; background: #F8F9FA; }
.gp { width: 100%; height: 78px; border-radius: 10px; background: #E8F0FE; display: grid; place-items: center; gap: 4px; padding: 8px; overflow: hidden; }
.gp i { font-style: normal; font-size: .75rem; background: #fff; border-radius: 6px; padding: 2px 6px; border: 1px solid #DADCE0; }
.gp i.ok { background: #E6F4EA; border-color: #34A853; }
.gp-quiz { grid-template-columns: 1fr 1fr; } .gp-quiz b { grid-column: 1 / -1; color: #1A73E8; }
.gp-match { grid-template-columns: 1fr 1fr; }
.gp-cards { grid-template-columns: 1fr 1fr; } .gp-cards i { height: 46px; display: grid; place-items: center; } .gp-cards i.back { background: #1A73E8; color: #fff; }
.gp-wheel i { width: 58px; height: 58px; border-radius: 50%; padding: 0; background: conic-gradient(#1A73E8 0 25%, #34A853 0 50%, #FBBC04 0 75%, #EA4335 0); animation: gm-turn 6s linear infinite; }
.gp-soon { background: #F1F3F6; color: #9AA0A6; }
@keyframes gm-turn { to { transform: rotate(360deg); } }
.gm-thumb { display: block; text-decoration: none; color: inherit; } .gm-thumb .gp { height: 120px; }
.gm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.gm-head h1 { margin: 0; } .gm-head .sub { margin: 4px 0 0; } .gm-tools { margin: 0; align-items: center; }
.gm-mode { margin-bottom: 12px; flex-wrap: wrap; }
.gm-stage { min-height: 380px; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px; animation: sc-in .3s ease-out both; }
.gm-top { align-self: stretch; display: flex; justify-content: space-between; gap: 8px; }
.gm-q { font-size: clamp(28px, 5vw, 48px); font-weight: 700; color: #1A73E8; text-align: center; padding: 18px 0; animation: sc-in .3s ease-out both; }
.gm-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 720px; }
.gm-opt { min-height: 64px; padding: 12px; border-radius: 14px; border: 0; color: #fff; font: inherit; font-size: 1.05rem; font-weight: 600; cursor: pointer; transition: transform .12s ease-out; }
.gm-opt.c0 { background: #1A73E8; } .gm-opt.c1 { background: #188038; } .gm-opt.c2 { background: #E37400; } .gm-opt.c3 { background: #A142F4; }
.gm-opt:active { transform: scale(.97); } .gm-opt.ok { box-shadow: 0 0 0 4px #34A853; animation: gm-pop .3s ease-out; } .gm-opt.bad { opacity: .45; animation: gm-shake .35s; }
@keyframes gm-pop { 50% { transform: scale(1.06); } } @keyframes gm-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.gm-match { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; max-width: 720px; }
.gm-col { display: flex; flex-direction: column; gap: 10px; }
.gm-w, .gm-m { min-height: 52px; padding: 10px; border-radius: 12px; border: 2px solid #DADCE0; background: #fff; font: inherit; cursor: pointer; transition: transform .12s, opacity .25s; }
.gm-w.sel { border-color: #1A73E8; background: #E8F0FE; } .gm-w.done, .gm-m.done { border-color: #34A853; background: #E6F4EA; opacity: .6; cursor: default; }
.gm-m.bad { border-color: #D93025; animation: gm-shake .35s; }
.gm-flip { position: relative; width: min(100%, 420px); height: 240px; border: 0; background: none; perspective: 900px; cursor: pointer; font: inherit; }
.gm-flip span { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; border-radius: 18px; font-size: clamp(24px, 4vw, 36px); font-weight: 700; backface-visibility: hidden; transition: transform .45s ease-out; box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.gm-flip .f1 { background: #fff; color: #1A73E8; border: 2px solid #DADCE0; } .gm-flip .f2 { background: #1A73E8; color: #fff; transform: rotateY(180deg); }
.gm-flip.flipped .f1 { transform: rotateY(180deg); } .gm-flip.flipped .f2 { transform: rotateY(360deg); }
.gm-hint { margin: 0; } .gm-nav { justify-content: center; }
.gm-wheel { position: relative; width: min(100%, 340px); aspect-ratio: 1; }
.gm-wheel svg { width: 100%; height: 100%; } .gm-wheel svg.spin { transition: transform 2.4s cubic-bezier(.17,.67,.21,1); }
.gm-wheel text { fill: #fff; font-size: 9px; font-weight: 700; }
.gm-pin { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 22px solid #202124; z-index: 2; }
.gm-picked { min-height: 10px; } .gm-pick-card { text-align: center; animation: gm-pop .35s ease-out; } .gm-pick-card b { display: block; font-size: 30px; color: #1A73E8; } .gm-pick-card span { color: #5F6B7A; }
.gm-end { text-align: center; padding: 30px 0; animation: sc-in .3s ease-out both; } .gm-star .i { width: 56px; height: 56px; color: #FBBC04; animation: gm-pop .6s ease-out; }
.gm-qr { display: grid; place-items: center; } .gm-qr svg { width: 220px; height: 220px; }
.gm-exit { display: none; }
body.gm-fullscreen .site-head, body.gm-fullscreen .gm-head, body.gm-fullscreen .gm-mode, body.gm-fullscreen .crumbs { display: none !important; }
body.gm-fullscreen .gm-stage { position: fixed; inset: 0; z-index: 50; margin: 0; border-radius: 0; justify-content: center; min-height: 100vh; }
body.gm-fullscreen .gm-exit { display: inline-flex; position: fixed; top: 12px; right: 12px; z-index: 51; }
body.gm-fullscreen .gm-q { font-size: clamp(40px, 8vw, 80px); }
@media (max-width: 700px) { .gm-games { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gm-opts { grid-template-columns: minmax(0, 1fr); } .gm-stage { padding: 12px; min-height: 320px; } }
.gp-quiz, .gp-match { gap: 3px 8px; padding: 6px; place-content: center; } .gp-quiz b { font-size: .85rem; line-height: 1.1; } .gp-quiz i, .gp-match i { padding: 1px 6px; }

/* v12 X8: login tabs Nhân viên / Học viên */
.login-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: #F1F3F6; margin: 4px 0 2px; }
.login-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; border: 0; border-radius: 999px; background: none; font: inherit; color: #5F6B7A; cursor: pointer; transition: background .2s, color .2s; }
.login-tabs button.on { background: #fff; color: #1A73E8; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.login-who { margin: 0; }

/* v12 X9: Học liệu & AI */
.mt-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.mt-tabs { flex-wrap: wrap; } .mt-pick { margin: 0; min-width: 200px; } .mt-pick select { min-height: 42px; }
.mt-row { text-decoration: none; color: inherit; animation: sc-in .25s ease-out both; } .mt-row:hover { background: #F1F3F6; }
.mt-note { margin: 0 0 8px; }
@media (max-width: 700px) { .mt-pick { min-width: 0; width: 100%; } }

/* ---------- v12b round L: library = Google Drive's layout (Lucas's screenshots 5 + 6) ---------- */
.drv { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 18px; align-items: start; }
.drv-side { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 10px; }
.drv-new { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; min-height: 56px; padding: 0 22px 0 16px; border: 0; border-radius: 16px; background: #fff; color: var(--ink);
  font: inherit; font-weight: 500; font-size: 14.5px; cursor: pointer; box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15); transition: box-shadow .2s, background .2s; }
.drv-new:hover { background: #F6F9FE; box-shadow: 0 2px 4px rgba(60,64,67,.3), 0 6px 12px 4px rgba(60,64,67,.15); }
.drv-new .i { width: 26px; height: 26px; }
.drv-nav { display: grid; gap: 1px; }
.drv-nav a { display: flex; align-items: center; gap: 14px; padding: 0 14px; min-height: 36px; border-radius: 18px; color: var(--ink); text-decoration: none; font-size: 14px; }
.drv-nav a:hover { background: #E9EEF6; }
.drv-nav a.on { background: #C2E7FF; color: #001D35; font-weight: 600; }
.drv-nav .n { margin-left: auto; font-size: 12px; color: var(--muted); }
.drv-storage { padding: 6px 14px; display: grid; gap: 6px; font-size: 13px; color: var(--sub); }
.drv-storage span { display: inline-flex; gap: 10px; align-items: center; }
.drv-storage .bar { height: 4px; border-radius: 2px; background: #E3E3E3; overflow: hidden; }
.drv-storage .bar i { display: block; height: 100%; background: #1A73E8; } .drv-storage .bar i.warn { background: #D93025; }
.drv-main { min-width: 0; display: grid; gap: 12px; }
.drv-search label { min-height: 48px; border-radius: 28px; background: #E9EEF6; padding: 0 18px; }
.drv-search { flex: none; }
.drv-bar { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.drv-chips { padding: 0; flex: 1; min-width: 0; }
.drv-chips > label.lib-chip { display: inline-flex !important; }
.drv-chip { border-radius: 8px; }
.drv-sel { flex: 1; display: flex; align-items: center; gap: 4px; background: #E9EEF6; border-radius: 22px; padding: 2px 8px; min-height: 40px; animation: sc-in .18s ease-out both; }
.drv-sel[hidden] { display: none; }
.drv-sel b { font-weight: 500; margin: 0 10px 0 2px; }
.drv-sel .ib, .drv-toggle button, .drv-card .ib { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; background: none; border-radius: 50%; color: var(--ink); cursor: pointer; text-decoration: none; grid-template-columns: none; gap: 0; }
.drv-sel .ib:hover { background: rgba(0,0,0,.08); }
.drv-sel [data-sel="more"] svg, .drv-card .lib-more svg { transform: rotate(90deg); }
.drv-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 18px; overflow: hidden; flex: none; margin-left: auto; }
.drv-toggle button { border-radius: 0; width: 44px; }
.drv-toggle button[aria-pressed="true"] { background: #C2E7FF; }
.drv-crumbs { font-size: 20px; font-weight: 400; margin: 2px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drv-crumbs a { color: var(--ink); text-decoration: none; padding: 2px 8px; margin-left: -8px; border-radius: 16px; } .drv-crumbs a:hover { background: #E9EEF6; }
.drv-crumbs b { font-weight: 400; }
.drv-h { font-size: 14px; font-weight: 500; margin: 4px 0 0; }
.drv-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.drv-folder { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 48px; border-radius: 12px; background: #F0F4F9; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14px; animation: sc-in .25s ease-out both; animation-delay: var(--d, 0ms); }
.drv-folder:hover { background: #DDE3EA; }
.drv-folder span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drv-folder .n { font-size: 12px; color: var(--muted); font-weight: 400; }
.drv-folder .i { color: #5F6368; }
.drv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.drv-card { display: flex; flex-direction: column; gap: 0; padding: 4px 4px 10px; border-radius: 12px; background: #F0F4F9; cursor: pointer; min-height: 0; animation: sc-in .25s ease-out both; animation-delay: var(--d, 0ms); outline: none; user-select: none; }
.drv-card:hover { background: #DDE3EA; }
.drv-card-h { display: flex; align-items: center; gap: 10px; padding: 4px 2px 6px 10px; min-width: 0; }
.drv-card-h b { flex: 1; min-width: 0; font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drv-card-h .lib-kind { width: 22px; height: 18px; font-size: 7.5px; border-radius: 4px; }
.drv-thumb { margin: 0 6px; height: 140px; border-radius: 8px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.drv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-kind.big { width: 64px; height: 52px; font-size: 15px; border-radius: 10px; }
.drv-card-f { display: flex; align-items: center; gap: 6px; padding: 8px 10px 0; min-width: 0; }
.drv-card-f small { color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drv-card-f .chip { font-size: 11px; }
.lib-item.sel, .drv-card.sel, .drv-card.sel:hover { background: #C2E7FF; }
.lib-item.sel .drv-thumb { box-shadow: 0 0 0 2px #1A73E8; }
.drv-card:focus-visible { box-shadow: 0 0 0 2px #1A73E8; }
.drv-rows { background: var(--surface); border-radius: 12px; }
.drv.is-list .lib-head { padding: 8px 16px; border-bottom: 1px solid var(--line); }
.lib-star.on { color: #5F6368; }
.drv-move { display: grid; gap: 4px; }
.drv-move-row { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 10px; border-radius: 10px; cursor: pointer; }
.drv-move-row:hover { background: var(--neutral-soft); } .drv-move-row small { margin-left: auto; color: var(--muted); }
.drv-student .drv-bar .sp { flex: 1; }
@media (max-width: 820px) {
  .drv { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .drv-side { position: static; }
  .drv-nav { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 2px; scrollbar-width: none; }
  .drv-nav a { flex: none; border: 1px solid var(--line-strong); background: var(--surface); white-space: nowrap; min-height: 40px; }
  .drv-nav a.on { border-color: #C2E7FF; }
  .drv-storage { display: none; }
  /* the Drive app: "+ Mới" floats bottom-right above the bar */
  .drv-new { position: fixed; right: 16px; bottom: calc(var(--bar-h, 64px) + 16px + env(safe-area-inset-bottom)); z-index: 30; min-height: 56px; padding: 0 18px 0 14px; background: #C2E7FF; }
  .drv-new span { display: inline !important; }
  .drv-chips { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .drv-chips > label.lib-chip { flex: none; }
  .drv-folders, .drv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .drv-folder { padding: 0 12px; gap: 8px; font-size: 13px; }
  .drv-thumb { height: 104px; }
  .drv-main { padding-bottom: 72px; }
}
.drv-thumb { position: relative; } .drv-thumb img { position: absolute; inset: 0; }
.drv-main { grid-template-columns: minmax(0, 1fr); } .drv-card, .drv-folder { min-width: 0; }
.drv-card { align-items: stretch; overflow: hidden; } .drv-card > * { min-width: 0; max-width: 100%; }

/* v12b X11 (rule V12B-3): "Xem trước" is a quiet link, so a row keeps at most 2 buttons */
.pv-link { display: inline-flex; align-items: center; gap: 4px; padding: 6px 6px; color: var(--blue, #1A73E8); font-size: 13px; text-decoration: none; border-radius: 6px; white-space: nowrap; }
.pv-link:hover { background: #E8F0FE; }
@media (max-width: 600px) {
  #hw-list .li, #hw-sets .li { flex-wrap: wrap; }
  #hw-list .li > .btns, #hw-sets .li > .btns { flex-basis: 100%; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
}
/* v12b finish (30-second gate): phone tap targets >= 44px and 16px text, so a tap never zooms */
@media (max-width: 600px) {
  .drv-search input, .drv-chips select, .drv-chips .lib-chip { font-size: 16px; min-height: 44px; }
}
/* v12b: documents, sheets and Google previews open inside the viewer */
.lib-frame { width: 100%; height: 66vh; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; background: #fff; }
.drv-thumb img { object-fit: cover; object-position: top; }

/* Lucas 5 Nov: "+ Mới" menu like Google Drive (coloured Google squares) */
.lib-pop .g-ic { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; color: #fff; font-size: 10px; font-weight: 700; flex: none; }
#lib-new-menu { min-width: 260px; }

/* Lucas 5 Nov: loading screen — blue bar on top, old page dimmed, grey placeholder rows; a waiting button shows a spinner and ignores taps */
#elu-load { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity .2s; }
#elu-load.on { opacity: 1; }
#elu-load i { display: block; height: 100%; width: 40%; background: #1A73E8; border-radius: 0 3px 3px 0; animation: elu-load 1.1s ease-in-out infinite; }
@keyframes elu-load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
#content.is-loading { opacity: .55; transition: opacity .2s; pointer-events: none; }
.skel-rows { display: grid; gap: 10px; margin: 0 0 14px; }
.skel-rows i { display: block; height: 44px; border-radius: 10px; background: linear-gradient(90deg, #E8EDF4 25%, #F1F4F9 50%, #E8EDF4 75%); background-size: 200% 100%; animation: skel 1.2s linear infinite; }
@keyframes skel { to { background-position: -200% 0; } }
button.is-busy { pointer-events: none; position: relative; opacity: .8; }
button.is-busy::after { content: ''; display: inline-block; width: 14px; height: 14px; margin-left: 8px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 6 Nov: the bar shows on every page change and finishes with a full-width fill */
#elu-load.done i { animation: none; width: 100%; transform: none; transition: width .25s ease-out; }
