/* Layout: sign-in is a split screen (teal hero | form). The app is a sticky top bar,
   a welcome band, then a class list on the left with the player on the right. */
:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #f7f9fa;
  --ink: #0f1b2d;
  --muted: #5b6b7c;
  --line: #e1e7ec;
  --brand: #0e8f7e;
  --brand-2: #19b79b;
  --brand-ink: #ffffff;
  --brand-soft: #def4ef;
  --amber: #f2b134;
  --danger: #c23b27;
  --ok: #1c8a4a;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 10px 30px rgba(15, 27, 45, .06);
  --c0-bg: #dff3ee; --c0-fg: #0b6b5d;
  --c1-bg: #fdf0d2; --c1-fg: #8a5a00;
  --c2-bg: #fde3e6; --c2-fg: #a3253a;
  --c3-bg: #dcecfb; --c3-fg: #1d5a94;
  --c4-bg: #ebe3fb; --c4-fg: #5b3ba6;
  --c5-bg: #e6f2d3; --c5-fg: #4a6b13;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Sinhala", "Noto Sans Tamil", sans-serif;
}
:root[data-theme="dark"] {
  --bg: #0b1218;
  --surface: #131c25;
  --surface-2: #18232e;
  --ink: #e8eff4;
  --muted: #93a4b3;
  --line: #24313d;
  --brand: #2fc7ad;
  --brand-2: #5be0c5;
  --brand-ink: #04211c;
  --brand-soft: #12332f;
  --danger: #ff8d79;
  --ok: #62d487;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
  --c0-bg: #133530; --c0-fg: #6fe0c9;
  --c1-bg: #3a2d10; --c1-fg: #f3c15e;
  --c2-bg: #3b1b21; --c2-fg: #ff9aa9;
  --c3-bg: #12293f; --c3-fg: #8dc4f5;
  --c4-bg: #2a2142; --c4-fg: #c1abf2;
  --c5-bg: #243312; --c5-fg: #b3d97a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 9px 16px; border-radius: 12px; cursor: pointer; min-height: 42px; font-weight: 600; transition: border-color .15s, background .15s, filter .15s; }
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.small { min-height: 34px; padding: 5px 12px; font-size: 13px; border-radius: 10px; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.toggle.done { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { border: 0; background: none; color: var(--brand); cursor: pointer; padding: 0; font-weight: 700; }
.linkbtn:hover { text-decoration: underline; }
.btn:focus-visible, .linkbtn:focus-visible, input:focus-visible, select:focus-visible, .vrow:focus-visible, .cls-head:focus-visible, .eyebtn:focus-visible, .tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=url], select {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-height: 44px;
}
input::placeholder { color: var(--muted); opacity: .7; }
input:focus { border-color: var(--brand); }
.pw { position: relative; }
.pw input { padding-right: 48px; }
.eyebtn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.eyebtn:hover { color: var(--ink); }
.codein { text-align: center; letter-spacing: .45em; font: 700 24px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding-left: .45em; }
.meter { display: flex; gap: 4px; margin: -4px 0 0; }
.meter i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.meter[data-level="1"] i:nth-child(-n+1) { background: var(--danger); }
.meter[data-level="2"] i:nth-child(-n+2) { background: var(--amber); }
.meter[data-level="3"] i:nth-child(-n+3) { background: var(--brand); }
.meter[data-level="4"] i:nth-child(-n+4) { background: var(--ok); }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 14px; min-height: 18px; }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--danger); }
.err { color: var(--danger); font-size: 14px; min-height: 20px; margin-bottom: 8px; }
.row-end { display: flex; justify-content: flex-end; margin: -4px 0 10px; font-size: 14px; }
.notice { background: var(--brand-soft); color: var(--brand); border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 500; margin-bottom: 16px; }

/* sign in / sign up */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.hero { position: relative; overflow: hidden; color: #eafaf6; padding: 48px clamp(24px, 5vw, 72px); display: flex; flex-direction: column; justify-content: center; gap: 22px;
  background: radial-gradient(800px 480px at 5% -10%, rgba(25, 183, 155, .38), transparent 60%), radial-gradient(640px 480px at 100% 100%, rgba(242, 177, 52, .16), transparent 55%), #0a2e31; }
.brandrow { display: flex; align-items: center; gap: 12px; }
.brandname { font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.logo { display: inline-grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); flex: none; }
.hero-title { font-size: clamp(30px, 4.2vw, 48px); line-height: 1.08; font-weight: 800; letter-spacing: -.03em; }
.hero-title span { display: block; color: #7fe6d1; }
.lead { color: #bfe3dc; font-size: 17px; max-width: 460px; }
.points { display: grid; gap: 14px; margin-top: 6px; }
.points li { display: flex; gap: 14px; align-items: flex-start; }
.pt-ico { width: 38px; height: 38px; border-radius: 11px; background: rgba(255, 255, 255, .1); display: grid; place-items: center; color: #7fe6d1; flex: none; }
.pt-t strong { display: block; font-size: 15px; }
.pt-t span { color: #a9d3cb; font-size: 14px; }
.mock { margin-top: 10px; max-width: 400px; border-radius: 20px; padding: 14px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); }
.mock-screen { aspect-ratio: 16 / 9; border-radius: 13px; background: linear-gradient(135deg, #13706a, #0b3f43); display: grid; place-items: center; }
.mock-play { width: 54px; height: 54px; border-radius: 50%; background: #fff; color: #0a2e31; display: grid; place-items: center; }
.mock-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .2); margin: 14px 2px 10px; overflow: hidden; }
.mock-bar i { display: block; height: 100%; width: 62%; background: var(--amber); }
.mock-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: #bfe3dc; padding: 0 2px; }
.auth-side { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 32px; box-shadow: var(--shadow); }
.auth-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.auth-sub { color: var(--muted); margin: 4px 0 22px; }
.switch { margin-top: 18px; text-align: center; font-size: 14px; color: var(--muted); }
.switch + .switch { margin-top: 8px; }

/* app shell */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-in { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.nav .brandname { font-size: 18px; margin-right: auto; }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; flex: none; }
.me-t { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.me-t strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.role { font-size: 12px; color: var(--muted); }
.shell { max-width: 1200px; margin: 0 auto; padding: 20px 16px 48px; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; margin-bottom: 18px; border-radius: 20px; color: #eafaf6; background: radial-gradient(500px 260px at 0% 0%, rgba(25, 183, 155, .4), transparent 60%), #0a2e31; }
.welcome h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.welcome p { color: #bfe3dc; margin-top: 2px; }
.ring { position: relative; width: 72px; height: 72px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 16px; }
.tab { border: 0; background: transparent; padding: 8px 18px; border-radius: 10px; cursor: pointer; color: var(--muted); font-weight: 700; }
.tab[aria-selected="true"] { background: var(--brand-soft); color: var(--brand); }

.grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.list-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.list-head h2 { font-size: 16px; margin-right: auto; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }

/* class cards */
.cls { border-bottom: 1px solid var(--line); }
.cls:last-child { border-bottom: 0; }
.cls-head { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: none; padding: 14px 16px; cursor: pointer; }
.cls-head:hover { background: var(--surface-2); }
.chip { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 17px; flex: none; }
.chip.c0 { background: var(--c0-bg); color: var(--c0-fg); } .chip.c1 { background: var(--c1-bg); color: var(--c1-fg); }
.chip.c2 { background: var(--c2-bg); color: var(--c2-fg); } .chip.c3 { background: var(--c3-bg); color: var(--c3-fg); }
.chip.c4 { background: var(--c4-bg); color: var(--c4-fg); } .chip.c5 { background: var(--c5-bg); color: var(--c5-fg); }
.cls-t { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.cls-t strong { font-size: 15px; overflow-wrap: anywhere; }
.cls-meta { color: var(--muted); font-size: 12.5px; }
.pbarx { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pbarx i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 3px; }
.chev { color: var(--muted); transition: transform .2s; transform: rotate(-90deg); display: grid; }
.chev.open { transform: none; }
.cls-body { padding: 0 8px 10px; }
.cls-desc { padding: 0 8px 8px; color: var(--muted); font-size: 13.5px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 8px 10px; }
.addrow { margin: 0 8px 10px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.vrow { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; cursor: pointer; min-width: 0; }
.vrow:hover { background: var(--surface-2); }
.vrow[aria-current="true"] { background: var(--brand-soft); }
.vrow .t { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.vnum { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.vnum.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.vrow[aria-current="true"] .vnum:not(.done) { border-color: var(--brand); color: var(--brand); }
.fcount { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; flex: none; }

/* player */
.player-wrap { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; max-width: 100%; }
.player-wrap iframe, .player-wrap .yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.shield { position: absolute; left: 0; right: 0; top: 0; height: 17%; z-index: 3; }
.mark { position: absolute; z-index: 4; pointer-events: none; color: rgba(255, 255, 255, .4); font-size: 13px; text-shadow: 0 0 3px rgba(0, 0, 0, .7); transition: top 1s, left 1s; user-select: none; }
.placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #9fb0bd; text-align: center; padding: 16px; z-index: 2; background: #000; }
.pbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pbar .grow { flex: 1; }
.pbar select { width: auto; min-height: 34px; padding: 4px 10px; border-radius: 10px; font-size: 13px; }
.vcrumb { padding: 16px 18px 0; color: var(--brand); font-size: 13px; font-weight: 700; }
.vtitle { padding: 2px 18px 0; font-size: 21px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.panel-body { padding: 16px 18px 18px; }
.sec-title { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.files { display: grid; gap: 8px; }
.files li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; min-width: 0; background: var(--surface-2); }
.files a { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--brand); font-weight: 700; text-decoration: none; }
.files a:hover { text-decoration: underline; }
.size { color: var(--muted); font-size: 12.5px; flex: none; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* students */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.bar { height: 8px; border-radius: 4px; background: var(--line); width: 120px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 12px; z-index: 20; max-width: 90vw; font-weight: 600; box-shadow: var(--shadow); }

@media (max-width: 900px) {
  .auth-page { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 24px 20px 28px; gap: 12px; }
  .hero .points, .hero .mock, .hero .lead { display: none; }
  .hero-title { font-size: 26px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .watch { order: -1; }
  .welcome { padding: 16px; }
  .welcome h1 { font-size: 20px; }
  .auth-card { padding: 24px 20px; }
  .me-t { display: none; }
}
@media (prefers-reduced-motion: reduce) { .mark, .chev { transition: none; } }

/* ---- sidebar layout (dashboard + pages) ---- */
.layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; gap: 8px; z-index: 30; }
.side-head { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.side-head .brandname { font-size: 18px; margin-right: auto; }
.side-nav { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-label { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 12px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600; border: 0; background: none; cursor: pointer; width: 100%; text-align: left; }
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.side-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sl-t { flex: 1; min-width: 0; }
.count { background: var(--danger); color: var(--brand-ink); font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; }
.side-foot { border-top: 1px solid var(--line); padding-top: 10px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); }
.page-title { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.topbar .grow, .rowitem .grow, .resume .grow { flex: 1; min-width: 0; }
.iconbtn { position: relative; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink); flex: none; }
.iconbtn:hover { border-color: var(--brand); }
.iconbtn .count { position: absolute; top: -6px; right: -6px; }
.burger, .side-x { display: none; }
a.me { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; padding: 3px 14px 3px 3px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
a.me:hover { border-color: var(--brand); }
.content { padding: 6px 24px 48px; max-width: 1240px; width: 100%; }
.scrim { display: none; }
.welcome h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.welcome { margin-bottom: 0; }
.stack { display: grid; gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); min-width: 0; }
.stat-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.stat-ico.t0 { background: var(--c0-bg); color: var(--c0-fg); } .stat-ico.t1 { background: var(--c3-bg); color: var(--c3-fg); }
.stat-ico.t2 { background: var(--c2-bg); color: var(--c2-fg); } .stat-ico.t3 { background: var(--c1-bg); color: var(--c1-fg); }
.stat-ico.t4 { background: var(--c4-bg); color: var(--c4-fg); }
.stat b { display: block; font-size: 22px; line-height: 1.15; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; align-items: start; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); gap: 20px; padding: 20px; }
.ccard { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); min-width: 0; }
.ccard .pbarx { width: 100%; }
.ccard-top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.ccard p { color: var(--muted); font-size: 13.5px; }
.resume { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.news-item { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: 0; }
.news-item h3 { font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.news-item p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.news-meta { color: var(--muted); font-size: 12.5px; margin-top: 6px; display: flex; gap: 12px; align-items: center; }
.tag-new { display: inline-block; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 99px; }
.danger-link { color: var(--danger); }
textarea { width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); resize: vertical; min-height: 96px; }
textarea:focus { border-color: var(--brand); outline: none; }
.rowitem { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.rowitem:last-child { border-bottom: 0; }
.rowitem strong { overflow-wrap: anywhere; }
.files.pad { padding: 0 18px 18px; }
.fi { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fi a { flex: none; }
.profile-head { display: flex; align-items: center; gap: 16px; padding: 20px; }
.avatar.big { width: 68px; height: 68px; font-size: 28px; }
.ph-name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 284px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side-open .side { transform: none; }
  .burger, .side-x { display: grid; }
  .side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 25; }
  .topbar { padding: 10px 14px; }
  .content { padding: 4px 14px 40px; }
  a.me { padding-right: 3px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

.theme-float { position: fixed; top: 14px; right: 14px; z-index: 40; }

/* Activate / Deactive toggle and live classes */
.btn.act { color: var(--muted); }
.btn.act.on { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.toolbar.actbar { align-items: center; }
.tag-new.gap { margin-left: 8px; }
.ccard .row { width: 100%; }
.live-edit .live-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.live-edit .grow { flex: 1; min-width: 0; }
a.btn { text-decoration: none; }

.ccard.pick { cursor: pointer; transition: border-color .15s, transform .15s; }
.ccard.pick:hover { border-color: var(--brand); }

.rowitem.vlink { cursor: pointer; }
.rowitem.vlink:hover { background: var(--surface-2); }
.cls-desc.pad { padding: 12px 18px 0; }

/* Timetable calendar */
input[type=date], input[type=time], input[type=number] { width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-height: 44px; }
.two-in { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.chk input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
.chk input[type=number] { width: 80px; min-height: 36px; padding: 4px 10px; }
.cal-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; }
.cal-head h2 { flex: 1; font-size: 18px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.cal .dow { background: var(--surface-2); padding: 8px 4px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; }
.cal .day { background: var(--surface); min-height: 100px; padding: 6px; border: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; font: inherit; color: inherit; }
.cal .day:hover { background: var(--surface-2); }
.cal .day.blank { background: var(--surface-2); cursor: default; }
.cal .day .n { font-weight: 700; font-size: 13px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 99px; flex: none; }
.cal .day.today .n { background: var(--brand); color: var(--brand-ink); }
.cal .day.sel { outline: 2px solid var(--brand); outline-offset: -2px; }
.cal .day:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ev { display: block; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev.c0 { background: var(--c0-bg); color: var(--c0-fg); } .ev.c1 { background: var(--c1-bg); color: var(--c1-fg); }
.ev.c2 { background: var(--c2-bg); color: var(--c2-fg); } .ev.c3 { background: var(--c3-bg); color: var(--c3-fg); }
.ev.c4 { background: var(--c4-bg); color: var(--c4-fg); } .ev.c5 { background: var(--c5-bg); color: var(--c5-fg); }
.cal .more { font-size: 11px; color: var(--muted); padding-left: 2px; }
@media (max-width: 700px) {
  .cal .day { min-height: 64px; padding: 3px; }
  .ev { font-size: 10px; padding: 1px 3px; }
  .two-in { grid-template-columns: 1fr; }
}

.top-out { flex: none; }
@media (max-width: 700px) { .top-out .lo-t { display: none; } .top-out { padding: 5px 10px; } }

/* Pink theme */
:root[data-theme="pink"] {
  --bg: #fff1f6; --surface: #ffffff; --surface-2: #fff7fa; --ink: #3a1226; --muted: #86596f; --line: #f6d5e3;
  --brand: #d6336c; --brand-2: #f06595; --brand-ink: #ffffff; --brand-soft: #fde3ed;
  --danger: #c0392b; --ok: #1c8a4a;
  --shadow: 0 1px 2px rgba(120, 20, 70, .06), 0 10px 30px rgba(120, 20, 70, .09);
  --c0-bg: #fde3ed; --c0-fg: #a61e4d;
  --c1-bg: #fdf0d2; --c1-fg: #8a5a00;
  --c2-bg: #ffe3e3; --c2-fg: #c92a2a;
  --c3-bg: #dcecfb; --c3-fg: #1d5a94;
  --c4-bg: #ebe3fb; --c4-fg: #5b3ba6;
  --c5-bg: #e6f2d3; --c5-fg: #4a6b13;
  color-scheme: light;
}
:root[data-theme="pink"] .hero { color: #fff0f6; background: radial-gradient(800px 480px at 5% -10%, rgba(240, 101, 149, .4), transparent 60%), radial-gradient(640px 480px at 100% 100%, rgba(242, 177, 52, .16), transparent 55%), #5c1235; }
:root[data-theme="pink"] .hero-title span { color: #ffb3cc; }
:root[data-theme="pink"] .lead, :root[data-theme="pink"] .mock-meta, :root[data-theme="pink"] .welcome p { color: #f8cfe0; }
:root[data-theme="pink"] .pt-ico { color: #ffb3cc; }
:root[data-theme="pink"] .pt-t span { color: #eab8cc; }
:root[data-theme="pink"] .mock-screen { background: linear-gradient(135deg, #c2255c, #7a1445); }
:root[data-theme="pink"] .mock-play { color: #5c1235; }
:root[data-theme="pink"] .welcome { color: #fff0f6; background: radial-gradient(500px 260px at 0% 0%, rgba(240, 101, 149, .45), transparent 60%), #5c1235; }

/* Theme picker */
.theme-menu { position: relative; }
.theme-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 160px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.theme-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-weight: 600; text-align: left; }
.theme-opt:hover { background: var(--surface-2); }
.theme-opt .tick { margin-left: auto; visibility: hidden; color: var(--brand); display: inline-flex; }
.theme-opt.on .tick { visibility: visible; }
.theme-opt:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.sw { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); flex: none; }
.sw-light { background: linear-gradient(135deg, #ffffff 50%, #0e8f7e 50%); }
.sw-dark { background: linear-gradient(135deg, #131c25 50%, #2fc7ad 50%); }
.sw-pink { background: linear-gradient(135deg, #fff1f6 50%, #d6336c 50%); }

/* ---- student course flow: class cards, course page, lesson page ---- */
.cover { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; display: flex; flex-direction: column; justify-content: flex-end; padding: 14px 16px; overflow: hidden; color: #fff; background: linear-gradient(135deg, var(--cv1), var(--cv2)); width: 100%; }
.cover.c0 { --cv1: #0b6b5d; --cv2: #19b79b; } .cover.c1 { --cv1: #8a5a00; --cv2: #f2b134; }
.cover.c2 { --cv1: #a3253a; --cv2: #ef6b82; } .cover.c3 { --cv1: #1d5a94; --cv2: #4a9be0; }
.cover.c4 { --cv1: #5b3ba6; --cv2: #9a7be8; } .cover.c5 { --cv1: #4a6b13; --cv2: #8cc23b; }
.cover-i { position: absolute; right: -6px; top: -30px; font-size: 150px; font-weight: 800; line-height: 1; opacity: .2; user-select: none; }
.cover-t { position: relative; font-weight: 800; font-size: 19px; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; text-shadow: 0 1px 8px rgba(0, 0, 0, .25); }
.cover.sm { width: 64px; height: 64px; aspect-ratio: auto; padding: 0; align-items: center; justify-content: center; flex: none; font-size: 28px; font-weight: 800; }

.cgrid.courses { grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); gap: 20px; }
.course { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.course:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.course h3 { font-size: 16px; overflow-wrap: anywhere; }
.course .btn { margin-top: 4px; }

.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; flex: none; }
.tcount { display: inline-block; margin-left: 8px; min-width: 22px; padding: 0 7px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; }
.tab[aria-selected="true"] .tcount { background: var(--brand); color: var(--brand-ink); }
.secpill[aria-pressed="true"] .tcount { background: rgba(255, 255, 255, .22); color: inherit; }

.course-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px; }
.course-head h2 { font-size: 20px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.course-head .grow, .lrow .grow, .tute .grow { flex: 1; min-width: 0; }
.secpills { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 18px; padding: 10px; border-radius: 14px; background: var(--surface-2); }
.secpill { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 99px; padding: 6px 14px; font-weight: 700; font-size: 13px; cursor: pointer; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secpill:hover { border-color: var(--brand); }
.secpill[aria-pressed="true"] {
  background: linear-gradient(135deg, #0b2447 0%, #19376d 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 16px -4px rgba(11, 36, 71, 0.35);
}
:root[data-theme="dark"] .secpill[aria-pressed="true"],
:root[data-theme="glass-dark"] .secpill[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-ink);
}
.secpill:focus-visible, .sec-head:focus-visible, .lrow:focus-visible, .ol-head:focus-visible, .ol-lesson:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.secs { display: grid; gap: 10px; padding: 16px 18px 18px; }
.secrow { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.sec-head { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: none; padding: 12px 14px; cursor: pointer; }
.sec-head:hover { background: var(--surface-2); }
.secnum { width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--muted); flex: none; }
.sec-name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.lrow { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.lrow:hover { background: var(--brand-soft); }
.lthumb { position: relative; width: 108px; height: 62px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: 1px solid var(--line); flex: none; box-shadow: 0 3px 10px rgba(15, 27, 45, 0.12); }
.lthumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s ease; }
.lrow:hover .lthumb-img { transform: scale(1.04); }
.lthumb-badge { position: relative; z-index: 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(15, 27, 45, 0.72); backdrop-filter: blur(4px); border: 1.5px solid rgba(255, 255, 255, 0.85); }
.lthumb.has-img .lthumb-badge { position: absolute; right: 6px; bottom: 6px; width: 26px; height: 26px; }
.lthumb.done .lthumb-badge { background: var(--ok); border-color: #fff; }
.lthumb .ico { color: #fff; }
.lrow-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.lrow-num { display: inline-flex; align-items: center; justify-content: center; padding: 1px 8px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; flex: none; }
.lstart-btn { border-radius: 999px; padding: 6px 16px; }
@media (max-width: 700px) { .lthumb { width: 84px; height: 48px; } }
.lrow strong { overflow-wrap: anywhere; }

.tutes { padding: 6px 18px 12px; }
.tute { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tute:last-child { border-bottom: 0; }
.tute strong { overflow-wrap: anywhere; }
.tute-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.tute-ico.k-pdf { background: var(--c4-bg); color: var(--c4-fg); }
.tute-ico.k-img { background: var(--c3-bg); color: var(--c3-fg); }
.tute-ico.k-doc { background: var(--c1-bg); color: var(--c1-fg); }
.tutes + *, .course-panel .tutes { margin-top: 10px; }

.lesson-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lesson-head .grow { flex: 1; }
.lesson-badge { background: var(--ink); color: var(--bg); border-radius: 99px; padding: 4px 12px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.lesson-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; min-width: 0; }
.btn.complete.done { background: var(--brand-soft); color: var(--brand); }

/* sidebar outline while a lesson is open */
.outline .side-group .side-group { gap: 2px; }
.ol-head .chev { margin-left: auto; }
.ol-lesson { padding: 8px 12px 8px 20px; font-size: 14px; font-weight: 500; }
.ol-lesson[aria-current="true"] { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.ol-lesson .sl-t { overflow-wrap: anywhere; }
.ol-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: #fff; }
.ol-lesson[aria-current="true"] .ol-dot:not(.done) { border-color: var(--brand); }
.ol-dot.done { background: var(--ok); border-color: var(--ok); }
@media (max-width: 700px) {
  .lthumb { width: 52px; height: 36px; }
  .lrow .btn { padding: 5px 10px; }
  .course-head .pill { display: none; }
}

/* profile pill with sign out inside */
.mepill { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); flex: none; min-width: 0; }
.mepill:hover { border-color: var(--brand); }
.mepill a.me { border: 0; background: none; padding: 3px 10px 3px 3px; min-width: 0; }
.pill-out { display: inline-flex; align-items: center; gap: 8px; align-self: stretch; border: 0; border-left: 1px solid var(--line); background: none; color: var(--ink); font-weight: 600; padding: 0 16px 0 12px; border-radius: 0 99px 99px 0; cursor: pointer; }
.pill-out:hover { background: var(--brand-soft); color: var(--brand); }
.pill-out:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
@media (max-width: 700px) { .pill-out .lo-t { display: none; } .pill-out { padding: 0 12px 0 10px; } }

/* class cover pictures */
.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.has-img { background: var(--surface-2); }
.ccard > .cover, .course > .cover { aspect-ratio: 1 / 1; border-radius: 14px; }

/* account menu in the top bar */
.user-menu { position: relative; flex: none; }
.user-btn { border: 0; background: none; padding: 0; border-radius: 50%; cursor: pointer; display: grid; }
.user-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.user-btn .avatar { width: 42px; height: 42px; font-size: 15px; }
.avatar { position: relative; }
.avatar .online { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid var(--surface); }
.avatar.big .online { width: 14px; height: 14px; }
.user-pop { position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; width: 300px; max-width: calc(100vw - 24px); padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.user-card { display: flex; align-items: center; gap: 14px; padding: 12px 12px 14px; }
.user-id { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.user-id strong { font-size: 16px; overflow-wrap: anywhere; }
.user-id span { font-size: 13.5px; color: var(--muted); }
.user-opt { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px; border: 0; border-radius: 10px; background: none; cursor: pointer; font-weight: 600; font-size: 15px; text-align: left; color: var(--ink); }
.user-opt:hover { background: var(--surface-2); }
.user-opt .ico { color: var(--muted); }
.user-opt:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.user-sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* ---- dashboard hero, tiles, chart, ID card ---- */
.hero-row { display: grid; grid-template-columns: minmax(0, 2.2fr) repeat(3, minmax(0, 1fr)); gap: 14px; }
.hero-card { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 22px 26px 0; min-height: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.hero-text { align-self: center; padding-bottom: 22px; min-width: 0; }
.hero-text h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.hero-text p { color: var(--muted); margin-top: 4px; font-weight: 500; }
.hero-art { width: 150px; height: auto; flex: none; display: block; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px 10px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); cursor: pointer; min-width: 0; transition: transform .15s, border-color .15s; }
.tile:hover { border-color: var(--brand); transform: translateY(-2px); }
.tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tile-ico { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 6px; }
.tile.t0 .tile-ico { background: var(--c0-bg); color: var(--c0-fg); }
.tile.t1 .tile-ico { background: var(--c2-bg); color: var(--c2-fg); }
.tile.t2 .tile-ico { background: var(--c3-bg); color: var(--c3-fg); }
.tile strong { font-size: 15px; letter-spacing: .02em; text-transform: uppercase; }
.tile-sub { color: var(--muted); font-size: 12.5px; }
.idcard { max-width: 420px; border-radius: 22px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.idc-top { display: flex; align-items: center; gap: 10px; padding: 14px 18px; color: #eafaf6; background: #0a2e31; }
:root[data-theme="pink"] .idc-top { background: #5c1235; }
.idc-role { margin-left: auto; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #7fe6d1; }
.idc-body { display: flex; align-items: center; gap: 16px; padding: 22px 18px; }
.idc-num { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 18px; border-top: 1px dashed var(--line); color: var(--muted); }
.idc-num b { font-size: 26px; letter-spacing: .12em; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) { .hero-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } .hero-card { grid-column: 1 / -1; } }
@media (max-width: 520px) { .tile { padding: 14px 6px; } .tile-ico { width: 52px; height: 52px; } .tile strong { font-size: 12px; } .tile-sub { display: none; } .hero-art { width: 110px; } .hero-card { padding: 18px 18px 0; min-height: 150px; } }

.tile-ico .ico { width: 34px; height: 34px; }
@media (max-width: 520px) { .tile-ico .ico { width: 26px; height: 26px; } }
.hero-pic { height: 178px; width: auto; flex: none; display: block; align-self: flex-end; }
@media (max-width: 520px) { .hero-pic { height: 140px; } }

.hero-pick { align-self: flex-end; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 12px; }
.pick-note { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pick-row { display: flex; gap: 6px; align-items: flex-end; }
.pick-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; padding: 0; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); }
.pick-btn img { height: 120px; width: auto; display: block; transition: transform .15s; }
.pick-btn:hover img { transform: translateY(-4px); }
.pick-btn:hover { color: var(--brand); }
.pick-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
@media (max-width: 520px) { .pick-btn img { height: 90px; } }

/* Exam countdown card */
.exam-card .exam-wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; flex-wrap: wrap; }
.exam-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.exam-info h2 { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.exam-badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 99px; }
.exam-sub { font-size: 13px; color: var(--muted); font-weight: 500; }
.cd-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.cd-unit { min-width: 68px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; }
.cd-unit b { display: block; font-size: 22px; line-height: 1.1; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.cd-unit span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
input[type=datetime-local] { width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-height: 44px; }

/* Resume timestamp banner */
.resume-banner { position: absolute; left: 14px; bottom: 14px; z-index: 5; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; background: rgba(15, 27, 45, .86); color: #fff; font-size: 13px; font-weight: 600; backdrop-filter: blur(6px); }
.resume-banner .linkbtn { color: #7fe6d1; font-size: 13px; }

/* Keyboard shortcuts modal */
.kb-modal-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .5); display: grid; place-items: center; padding: 16px; }
.kb-modal { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.kb-list { padding: 8px 18px 16px; display: grid; gap: 8px; }
.kb-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kb-row:last-child { border-bottom: 0; }
.kb-row kbd { padding: 3px 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); font: 700 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; }

/* ---- Liquid Glass themes (All Colours: Ice Blue, Midnight, Rose, Mint, Amber, Violet) ---- */
.sw-glass {
  background: linear-gradient(135deg, #ffffff 0%, #dbeafe 48%, #60a5fa 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(30, 58, 95, 0.14), inset 0 1px 1px #ffffff;
}
.sw-glass-dark {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 52%, #38bdf8 100%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.65);
}
.sw-glass-pink {
  background: linear-gradient(135deg, #ffffff 0%, #fce7f3 48%, #f472b6 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 1px #ffffff;
}
.sw-glass-emerald {
  background: linear-gradient(135deg, #ffffff 0%, #d1fae5 48%, #34d399 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 1px #ffffff;
}
.sw-glass-sunset {
  background: linear-gradient(135deg, #ffffff 0%, #fef3c7 48%, #fb923c 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 1px #ffffff;
}
.sw-glass-lavender {
  background: linear-gradient(135deg, #ffffff 0%, #ede9fe 48%, #a78bfa 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 1px #ffffff;
}

.theme-pop { min-width: 196px; }

/* 1. Liquid Ice Blue (ZenSwap Cool Mist) */
:root[data-theme="glass"] {
  color-scheme: light;
  --bg: #e3ecf5;
  --surface: rgba(255, 255, 255, 0.56);
  --surface-2: rgba(255, 255, 255, 0.42);
  --ink: #0f1c2e;
  --muted: #52657d;
  --line: rgba(255, 255, 255, 0.78);
  --brand: #1d6fe8;
  --brand-2: #3b8ef5;
  --brand-ink: #ffffff;
  --brand-soft: rgba(29, 111, 232, 0.12);
  --amber: #e59a16;
  --danger: #d63649;
  --ok: #158f58;
  --gl-grad:
    radial-gradient(780px 560px at 12% 8%, rgba(147, 197, 253, 0.62), transparent 62%),
    radial-gradient(680px 540px at 88% 12%, rgba(186, 230, 253, 0.68), transparent 60%),
    radial-gradient(760px 600px at 82% 88%, rgba(165, 196, 236, 0.54), transparent 64%),
    radial-gradient(640px 500px at 16% 86%, rgba(219, 234, 254, 0.74), transparent 60%),
    linear-gradient(155deg, #dce6f2 0%, #eaf0f7 48%, #d6e2ef 100%);
  --gl-btn-top: rgba(66, 146, 255, 0.92);
  --gl-btn-bot: rgba(24, 102, 224, 0.96);
  --gl-btn-glow: rgba(29, 111, 232, 0.42);
  --gl-active-fg: #1558bd;
  --gl-active-tint: rgba(224, 238, 255, 0.68);
  --c0-bg: rgba(20, 184, 166, 0.15); --c0-fg: #0b6e63;
  --c1-bg: rgba(245, 158, 11, 0.16); --c1-fg: #8c5800;
  --c2-bg: rgba(239, 68, 68, 0.14); --c2-fg: #a82436;
  --c3-bg: rgba(29, 111, 232, 0.14); --c3-fg: #1558bd;
  --c4-bg: rgba(124, 58, 237, 0.14); --c4-fg: #582ec2;
  --c5-bg: rgba(34, 197, 94, 0.15); --c5-fg: #196e38;
}

/* 2. Liquid Rose (Soft Pink & Blush Frosted Glass) */
:root[data-theme="glass-pink"] {
  color-scheme: light;
  --bg: #f9e4ee;
  --surface: rgba(255, 255, 255, 0.58);
  --surface-2: rgba(255, 255, 255, 0.42);
  --ink: #2c1020;
  --muted: #784f65;
  --line: rgba(255, 255, 255, 0.82);
  --brand: #db2777;
  --brand-2: #f43f5e;
  --brand-ink: #ffffff;
  --brand-soft: rgba(219, 39, 119, 0.12);
  --amber: #e59a16;
  --danger: #c81e3a;
  --ok: #158f58;
  --gl-grad:
    radial-gradient(780px 560px at 12% 8%, rgba(249, 168, 212, 0.65), transparent 62%),
    radial-gradient(680px 540px at 88% 12%, rgba(253, 186, 206, 0.68), transparent 60%),
    radial-gradient(760px 600px at 82% 88%, rgba(244, 114, 182, 0.34), transparent 64%),
    radial-gradient(640px 500px at 16% 86%, rgba(252, 231, 243, 0.78), transparent 60%),
    linear-gradient(155deg, #f6dce8 0%, #fdf0f6 48%, #f3d4e3 100%);
  --gl-btn-top: rgba(244, 63, 126, 0.92);
  --gl-btn-bot: rgba(205, 24, 96, 0.96);
  --gl-btn-glow: rgba(219, 39, 119, 0.4);
  --gl-active-fg: #be185d;
  --gl-active-tint: rgba(252, 231, 243, 0.72);
  --c0-bg: rgba(219, 39, 119, 0.14); --c0-fg: #9d174d;
  --c1-bg: rgba(245, 158, 11, 0.16); --c1-fg: #8c5800;
  --c2-bg: rgba(239, 68, 68, 0.14); --c2-fg: #a82436;
  --c3-bg: rgba(29, 111, 232, 0.14); --c3-fg: #1558bd;
  --c4-bg: rgba(124, 58, 237, 0.14); --c4-fg: #582ec2;
  --c5-bg: rgba(34, 197, 94, 0.15); --c5-fg: #196e38;
}

/* 3. Liquid Mint (Emerald & Seafoam Frosted Glass) */
:root[data-theme="glass-emerald"] {
  color-scheme: light;
  --bg: #dff2ec;
  --surface: rgba(255, 255, 255, 0.58);
  --surface-2: rgba(255, 255, 255, 0.42);
  --ink: #0c2620;
  --muted: #466b61;
  --line: rgba(255, 255, 255, 0.82);
  --brand: #0d9488;
  --brand-2: #10b981;
  --brand-ink: #ffffff;
  --brand-soft: rgba(13, 148, 136, 0.13);
  --amber: #e59a16;
  --danger: #d63649;
  --ok: #15803d;
  --gl-grad:
    radial-gradient(780px 560px at 12% 8%, rgba(110, 231, 183, 0.56), transparent 62%),
    radial-gradient(680px 540px at 88% 12%, rgba(153, 246, 228, 0.64), transparent 60%),
    radial-gradient(760px 600px at 82% 88%, rgba(94, 234, 212, 0.42), transparent 64%),
    radial-gradient(640px 500px at 16% 86%, rgba(209, 250, 229, 0.76), transparent 60%),
    linear-gradient(155deg, #d5eee6 0%, #e9f7f2 48%, #cde8df 100%);
  --gl-btn-top: rgba(20, 184, 152, 0.92);
  --gl-btn-bot: rgba(11, 132, 114, 0.96);
  --gl-btn-glow: rgba(13, 148, 136, 0.38);
  --gl-active-fg: #0f766e;
  --gl-active-tint: rgba(204, 251, 241, 0.72);
  --c0-bg: rgba(13, 148, 136, 0.15); --c0-fg: #0f766e;
  --c1-bg: rgba(245, 158, 11, 0.16); --c1-fg: #8c5800;
  --c2-bg: rgba(239, 68, 68, 0.14); --c2-fg: #a82436;
  --c3-bg: rgba(29, 111, 232, 0.14); --c3-fg: #1558bd;
  --c4-bg: rgba(124, 58, 237, 0.14); --c4-fg: #582ec2;
  --c5-bg: rgba(34, 197, 94, 0.15); --c5-fg: #196e38;
}

/* 4. Liquid Amber (Warm Peach, Gold & Sunset Frosted Glass) */
:root[data-theme="glass-sunset"] {
  color-scheme: light;
  --bg: #f8eadc;
  --surface: rgba(255, 255, 255, 0.6);
  --surface-2: rgba(255, 255, 255, 0.44);
  --ink: #29180b;
  --muted: #765840;
  --line: rgba(255, 255, 255, 0.84);
  --brand: #ea580c;
  --brand-2: #f59e0b;
  --brand-ink: #ffffff;
  --brand-soft: rgba(234, 88, 12, 0.12);
  --amber: #d97706;
  --danger: #c81e3a;
  --ok: #158f58;
  --gl-grad:
    radial-gradient(780px 560px at 12% 8%, rgba(253, 186, 116, 0.62), transparent 62%),
    radial-gradient(680px 540px at 88% 12%, rgba(253, 224, 71, 0.48), transparent 60%),
    radial-gradient(760px 600px at 82% 88%, rgba(251, 146, 60, 0.36), transparent 64%),
    radial-gradient(640px 500px at 16% 86%, rgba(254, 243, 199, 0.78), transparent 60%),
    linear-gradient(155deg, #f5e2cf 0%, #fcf4ec 48%, #f1dac4 100%);
  --gl-btn-top: rgba(249, 115, 22, 0.92);
  --gl-btn-bot: rgba(217, 78, 12, 0.96);
  --gl-btn-glow: rgba(234, 88, 12, 0.38);
  --gl-active-fg: #c2410c;
  --gl-active-tint: rgba(255, 237, 213, 0.75);
  --c0-bg: rgba(20, 184, 166, 0.15); --c0-fg: #0b6e63;
  --c1-bg: rgba(234, 88, 12, 0.15); --c1-fg: #9a3412;
  --c2-bg: rgba(239, 68, 68, 0.14); --c2-fg: #a82436;
  --c3-bg: rgba(29, 111, 232, 0.14); --c3-fg: #1558bd;
  --c4-bg: rgba(124, 58, 237, 0.14); --c4-fg: #582ec2;
  --c5-bg: rgba(34, 197, 94, 0.15); --c5-fg: #196e38;
}

/* 5. Liquid Violet (Soft Lavender & Iris Frosted Glass) */
:root[data-theme="glass-lavender"] {
  color-scheme: light;
  --bg: #eae4f8;
  --surface: rgba(255, 255, 255, 0.58);
  --surface-2: rgba(255, 255, 255, 0.42);
  --ink: #1b1330;
  --muted: #5d517a;
  --line: rgba(255, 255, 255, 0.82);
  --brand: #7c3aed;
  --brand-2: #8b5cf6;
  --brand-ink: #ffffff;
  --brand-soft: rgba(124, 58, 237, 0.12);
  --amber: #e59a16;
  --danger: #d63649;
  --ok: #158f58;
  --gl-grad:
    radial-gradient(780px 560px at 12% 8%, rgba(196, 181, 253, 0.65), transparent 62%),
    radial-gradient(680px 540px at 88% 12%, rgba(221, 214, 254, 0.72), transparent 60%),
    radial-gradient(760px 600px at 82% 88%, rgba(167, 139, 250, 0.42), transparent 64%),
    radial-gradient(640px 500px at 16% 86%, rgba(237, 233, 254, 0.78), transparent 60%),
    linear-gradient(155deg, #e2daf5 0%, #f3effb 48%, #dbd1f2 100%);
  --gl-btn-top: rgba(139, 92, 246, 0.92);
  --gl-btn-bot: rgba(109, 40, 217, 0.96);
  --gl-btn-glow: rgba(124, 58, 237, 0.4);
  --gl-active-fg: #6d28d9;
  --gl-active-tint: rgba(237, 233, 254, 0.74);
  --c0-bg: rgba(20, 184, 166, 0.15); --c0-fg: #0b6e63;
  --c1-bg: rgba(245, 158, 11, 0.16); --c1-fg: #8c5800;
  --c2-bg: rgba(239, 68, 68, 0.14); --c2-fg: #a82436;
  --c3-bg: rgba(29, 111, 232, 0.14); --c3-fg: #1558bd;
  --c4-bg: rgba(124, 58, 237, 0.16); --c4-fg: #5b21b6;
  --c5-bg: rgba(34, 197, 94, 0.15); --c5-fg: #196e38;
}

/* 6. Liquid Midnight (Deep Obsidian & Smoked Glass) */
:root[data-theme="glass-dark"] {
  color-scheme: dark;
  --bg: #08111f;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.05);
  --ink: #f1f6ff;
  --muted: rgba(214, 229, 250, 0.72);
  --line: rgba(255, 255, 255, 0.2);
  --brand: #38bdf8;
  --brand-2: #60a5fa;
  --brand-ink: #041324;
  --brand-soft: rgba(56, 189, 248, 0.18);
  --amber: #fbbf24;
  --danger: #fb7185;
  --ok: #34d399;
  --gl-grad:
    radial-gradient(820px 580px at 12% 8%, rgba(56, 189, 248, 0.34), transparent 62%),
    radial-gradient(720px 560px at 88% 12%, rgba(129, 140, 248, 0.32), transparent 60%),
    radial-gradient(780px 600px at 80% 90%, rgba(20, 184, 166, 0.24), transparent 64%),
    linear-gradient(155deg, #060d19 0%, #0d1b33 50%, #081223 100%);
  --gl-btn-top: rgba(56, 189, 248, 0.92);
  --gl-btn-bot: rgba(37, 99, 235, 0.96);
  --gl-btn-glow: rgba(56, 189, 248, 0.38);
  --gl-active-fg: #7dd3fc;
  --gl-active-tint: rgba(56, 189, 248, 0.22);
  --c0-bg: rgba(45, 212, 191, 0.2); --c0-fg: #5eead4;
  --c1-bg: rgba(251, 191, 36, 0.2); --c1-fg: #fde047;
  --c2-bg: rgba(244, 114, 182, 0.22); --c2-fg: #f9a8d4;
  --c3-bg: rgba(56, 189, 248, 0.22); --c3-fg: #7dd3fc;
  --c4-bg: rgba(167, 139, 250, 0.22); --c4-fg: #c4b5fd;
  --c5-bg: rgba(52, 211, 153, 0.2); --c5-fg: #6ee7b7;
}

/* Shared Liquid Glass geometry, specular refraction rims & blur across ALL Liquid Glass themes */
:root[data-theme^="glass"] body {
  background: var(--gl-grad);
  background-attachment: fixed;
}

:root[data-theme^="glass"] .panel,
:root[data-theme^="glass"] .stat,
:root[data-theme^="glass"] .tile,
:root[data-theme^="glass"] .hero-card,
:root[data-theme^="glass"] .course,
:root[data-theme^="glass"] .auth-card,
:root[data-theme^="glass"] .idcard,
:root[data-theme^="glass"] .kb-modal {
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  backdrop-filter: blur(28px) saturate(170%) contrast(102%);
  -webkit-backdrop-filter: blur(28px) saturate(170%) contrast(102%);
  border: 1.5px solid var(--line);
  border-radius: 24px;
  box-shadow:
    0 18px 40px -12px rgba(20, 46, 82, 0.14),
    0 4px 14px -2px rgba(20, 46, 82, 0.06),
    inset 0 2px 2px rgba(255, 255, 255, 0.92),
    inset 0 -2px 4px rgba(140, 174, 214, 0.22);
}

:root[data-theme="glass-dark"] .panel,
:root[data-theme="glass-dark"] .stat,
:root[data-theme="glass-dark"] .tile,
:root[data-theme="glass-dark"] .hero-card,
:root[data-theme="glass-dark"] .course,
:root[data-theme="glass-dark"] .auth-card,
:root[data-theme="glass-dark"] .idcard,
:root[data-theme="glass-dark"] .kb-modal {
  box-shadow:
    0 20px 46px rgba(2, 8, 23, 0.52),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.36),
    inset 0 -1px 2px rgba(255, 255, 255, 0.08);
}

:root[data-theme^="glass"] .side {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  backdrop-filter: blur(32px) saturate(175%);
  -webkit-backdrop-filter: blur(32px) saturate(175%);
  border-right: 1.5px solid var(--line);
  box-shadow: 8px 0 32px rgba(20, 46, 82, 0.06), inset -1.5px 0 1px rgba(255, 255, 255, 0.72);
}

:root[data-theme^="glass"] .topbar {
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border-bottom: 1px solid var(--line);
}

:root[data-theme^="glass"] .theme-pop,
:root[data-theme^="glass"] .user-pop {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.88) 0%, rgba(245, 249, 255, 0.76) 100%);
  backdrop-filter: blur(34px) saturate(185%);
  -webkit-backdrop-filter: blur(34px) saturate(185%);
  border: 1.5px solid rgba(255, 255, 255, 0.94);
  border-radius: 20px;
  box-shadow: 0 22px 48px -10px rgba(15, 38, 72, 0.18), inset 0 1.5px 1px #ffffff;
}
:root[data-theme="glass-dark"] .theme-pop,
:root[data-theme="glass-dark"] .user-pop {
  background: rgba(14, 25, 48, 0.82);
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: 0 22px 50px rgba(2, 6, 23, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

:root[data-theme^="glass"] .ccard,
:root[data-theme^="glass"] .secrow,
:root[data-theme^="glass"] .addrow,
:root[data-theme^="glass"] .files li,
:root[data-theme^="glass"] .cd-unit,
:root[data-theme^="glass"] .tabs,
:root[data-theme^="glass"] .secpills {
  background: var(--surface-2);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px -6px rgba(20, 46, 82, 0.08), inset 0 1.5px 1px rgba(255, 255, 255, 0.75);
}

:root[data-theme^="glass"] .btn,
:root[data-theme^="glass"] .iconbtn,
:root[data-theme^="glass"] .secpill,
:root[data-theme^="glass"] .pill {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.48) 100%);
  backdrop-filter: blur(16px) saturate(165%);
  -webkit-backdrop-filter: blur(16px) saturate(165%);
  border: 1.25px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  box-shadow: 0 6px 16px -4px rgba(18, 44, 80, 0.1), inset 0 1.5px 1px #ffffff;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
:root[data-theme="glass-dark"] .btn,
:root[data-theme="glass-dark"] .iconbtn,
:root[data-theme="glass-dark"] .secpill,
:root[data-theme="glass-dark"] .pill {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
:root[data-theme^="glass"] .iconbtn { border-radius: 14px; }

:root[data-theme^="glass"] input[type=text],
:root[data-theme^="glass"] input[type=email],
:root[data-theme^="glass"] input[type=password],
:root[data-theme^="glass"] input[type=url],
:root[data-theme^="glass"] input[type=date],
:root[data-theme^="glass"] input[type=time],
:root[data-theme^="glass"] input[type=number],
:root[data-theme^="glass"] input[type=datetime-local],
:root[data-theme^="glass"] select,
:root[data-theme^="glass"] textarea {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.25px solid var(--line);
  border-radius: 14px;
  box-shadow: inset 0 2px 5px rgba(20, 46, 82, 0.05), 0 1px 0 rgba(255, 255, 255, 0.65);
}

:root[data-theme^="glass"] .btn:hover,
:root[data-theme^="glass"] .iconbtn:hover,
:root[data-theme^="glass"] .tile:hover,
:root[data-theme^="glass"] .course:hover {
  transform: translateY(-1.5px);
  border-color: #ffffff;
  box-shadow: 0 14px 28px -8px var(--gl-btn-glow), inset 0 2px 1px rgba(255, 255, 255, 0.95);
}

:root[data-theme^="glass"] .btn.primary {
  background: linear-gradient(180deg, var(--gl-btn-top) 0%, var(--gl-btn-bot) 100%);
  color: #ffffff;
  border: 1.25px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px -6px var(--gl-btn-glow), inset 0 1.5px 1.5px rgba(255, 255, 255, 0.75);
}
:root[data-theme="glass-dark"] .btn.primary { color: #031521; }

:root[data-theme^="glass"] .side-link[aria-current="page"],
:root[data-theme^="glass"] .tab[aria-selected="true"],
:root[data-theme^="glass"] .vrow[aria-current="true"],
:root[data-theme^="glass"] .ol-lesson[aria-current="true"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, var(--gl-active-tint) 100%);
  color: var(--gl-active-fg);
  border: 1px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 16px -4px rgba(20, 46, 82, 0.12), inset 0 1.5px 1px #ffffff;
}
:root[data-theme="glass-dark"] .side-link[aria-current="page"],
:root[data-theme="glass-dark"] .tab[aria-selected="true"],
:root[data-theme="glass-dark"] .vrow[aria-current="true"],
:root[data-theme="glass-dark"] .ol-lesson[aria-current="true"] {
  background: var(--gl-active-tint);
  border-color: rgba(125, 211, 252, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

:root[data-theme^="glass"] .hero {
  color: var(--ink);
  background: var(--gl-grad);
  backdrop-filter: blur(24px);
}
:root[data-theme^="glass"] .hero-title span { color: var(--brand); }
:root[data-theme^="glass"] .lead,
:root[data-theme^="glass"] .pt-t span,
:root[data-theme^="glass"] .mock-meta { color: var(--muted); }
:root[data-theme^="glass"] .pt-ico {
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--line);
}
:root[data-theme^="glass"] .mock {
  background: var(--surface);
  border: 1.5px solid var(--line);
}
:root[data-theme^="glass"] .mock-screen {
  background: linear-gradient(135deg, var(--gl-btn-top), var(--gl-btn-bot));
}

:root[data-theme^="glass"] .cal { background: var(--line); }
:root[data-theme^="glass"] .cal .day { background: var(--surface); }
:root[data-theme^="glass"] .cal .day:hover { background: var(--surface-2); }
:root[data-theme^="glass"] .cal .dow,
:root[data-theme^="glass"] .cal .day.blank { background: var(--surface-2); }

:root[data-theme^="glass"] .toast {
  background: var(--surface);
  color: var(--ink);
  backdrop-filter: blur(26px) saturate(185%);
  border: 1.5px solid var(--line);
  box-shadow: 0 16px 36px rgba(18, 42, 74, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Large player */
.watch .player-wrap {
  /* Full-width 16:9 so the video fills the box with no black side bars */
  aspect-ratio: 16 / 9;
  height: auto;
  width: 100%;
}

/* Setup Profile enhancements */
.avatar.has-img { overflow: visible; }
.avatar .av-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
input[type=tel] { width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-height: 44px; }
:root[data-theme^="glass"] input[type=tel] { background: var(--surface); backdrop-filter: blur(14px); border: 1.25px solid var(--line); border-radius: 14px; }
.profile-head { flex-wrap: wrap; }
.prof-meter { padding: 14px 20px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }

/* Teacher inline video row section & file editor */
.vitem { border-radius: 14px; margin-bottom: 4px; transition: background .15s; }
.vitem.open { background: var(--surface-2); border: 1px solid var(--line); }
.vrow-panel { padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.vrow-panel select { min-height: 36px; padding: 4px 10px; font-size: 13px; border-radius: 10px; }
.vrow-panel input[type=text] { min-height: 36px; padding: 5px 10px; font-size: 13px; border-radius: 10px; }
:root[data-theme^="glass"] .vitem.open { background: var(--surface-2); border-color: var(--line); }

/* Daily Study Streak & Watch-Time Tracker card */
.study-card .study-wrap { display: flex; align-items: center; gap: 20px; padding: 18px 22px; flex-wrap: wrap; }
.streak-pill { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); flex: none; }
.streak-pill.lit { background: linear-gradient(135deg, rgba(245, 158, 11, .16), rgba(234, 88, 12, .12)); border-color: rgba(245, 158, 11, .4); }
.streak-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: rgba(245, 158, 11, .18); color: #ea580c; flex: none; }
.streak-pill.lit .streak-ico { background: linear-gradient(135deg, #f59e0b, #ea580c); color: #fff; box-shadow: 0 6px 16px rgba(234, 88, 12, .3); }
.streak-pill b { display: block; font-size: 20px; line-height: 1.1; font-weight: 800; }
.streak-pill span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.study-mid { flex: 1; min-width: 220px; }
.wk-row { display: flex; gap: 8px; flex-wrap: wrap; }
.wk-day { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 34px; }
.wk-dot { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface-2); display: grid; place-items: center; color: #fff; }
.wk-day.done .wk-dot { background: var(--ok); border-color: var(--ok); }
.wk-day.today .wk-dot { outline: 2px solid var(--brand); outline-offset: 2px; }
.wk-lbl { font-size: 11px; font-weight: 700; color: var(--muted); }
.study-best { display: flex; flex-direction: column; align-items: center; padding: 10px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); flex: none; }
.study-best b { font-size: 20px; font-weight: 800; color: var(--brand); }

/* Lessons grouped by section (teacher's All Classes) */
.secgroup { margin: 6px 0 12px; border-radius: 14px; transition: opacity .15s; }
.secgroup.dragging { opacity: .4; }
.secgroup.dragover { outline: 2px dashed var(--brand); outline-offset: 3px; }
.sechead { display: flex; align-items: center; gap: 4px; margin: 0 0 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); }
.sechead.drag { cursor: grab; }
.sechead.drag:active { cursor: grabbing; }
.sechead:hover { background: var(--brand-soft); }
.secgrip { padding: 0 4px 0 12px; color: var(--muted); font-weight: 800; letter-spacing: -2px; user-select: none; flex: none; }
.sechead-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: none; color: inherit; font: inherit; cursor: inherit; text-align: left; }
.sechead-btn:focus-visible, .secmove:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 10px; }
.sechead .secname { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.sechead .seccount { color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.secmove { flex: none; width: 30px; height: 30px; margin-right: 4px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); cursor: pointer; }
.secmove:hover:not(:disabled) { color: var(--brand); border-color: var(--brand); }
.secmove:disabled { opacity: .3; cursor: default; }
.secmove .arr-up { display: grid; transform: rotate(180deg); }
.secmove .arr-down { display: grid; }
.secbody { padding-left: 8px; border-left: 2px solid var(--line); margin-left: 14px; }

/* class categories */
.catgroup { margin-bottom: 6px; }
.cathead { display: flex; align-items: center; gap: 8px; margin: 18px 16px 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cathead .tcount { margin-left: 0; }
.catgroup:first-child .cathead { margin-top: 12px; }

/* edit pop-up */
.modal-scrim { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(8, 15, 28, .5); }
.modal { width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; padding: 22px; border-radius: 20px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.modal-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 16px; }

/* admin video downloader */
.dl-page { display: grid; gap: 18px; }
.dl-grid { display: grid; grid-template-columns: minmax(0, 1fr) 190px auto; gap: 12px; align-items: end; }
.dl-grid .field { margin-bottom: 8px; }
.dl-note { margin: 0; font-size: 13px; color: var(--muted); }
.dl-job { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.dl-job .bar { width: 160px; max-width: 100%; }
.dl-title { font-weight: 600; overflow-wrap: anywhere; }
.dl-meta { font-size: 13px; color: var(--muted); }
.dl-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.dl-badge.dl-done { background: var(--ok); color: #fff; }
.dl-badge.dl-failed { background: var(--danger); color: #fff; }
.dl-badge.dl-cancelled { background: var(--line); color: var(--muted); }
.dl-name { overflow-wrap: anywhere; min-width: 200px; }
a.btn { text-decoration: none; }
@media (max-width: 700px) { .dl-grid { grid-template-columns: 1fr; } }
.dl-job .grow { flex: 1; min-width: 0; }

.up-grid { grid-template-columns: minmax(0, 1fr) auto; }
.up-grid input[type=file] { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.dl-page .row[hidden] { display: none; }
@media (max-width: 700px) { .up-grid { grid-template-columns: 1fr; } }

/* Live class boxes */
.live-box { justify-content: space-between; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.live-box:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.live-pill { display: inline-flex; align-items: center; gap: 5px; width: fit-content; margin-top: 3px; padding: 2px 9px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 11.5px; font-weight: 700; }
.live-time-tag { display: inline-flex; align-items: center; gap: 7px; width: 100%; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 700; color: var(--ink); }
:root[data-theme^="glass"] .live-time-tag { background: var(--surface); border-color: var(--line); }

/* Green Activated indicator on Activate Classes cards */
.activated-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.14);
  border: 1px solid rgba(22, 163, 74, 0.35);
  color: #15803d;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}
:root[data-theme="dark"] .activated-badge,
:root[data-theme="glass-dark"] .activated-badge {
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.38);
  color: #4ade80;
}

/* Highlighted active/selected section container */
.secrow { transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.secrow.open {
  border: 1.5px solid #93c5fd;
  background: var(--surface);
  box-shadow: 0 10px 26px -8px rgba(29, 111, 232, 0.14);
}
.secrow.open .sec-head {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.72) 0%, rgba(255, 255, 255, 0.35) 100%);
}
.secrow.open .secnum {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}
:root[data-theme="dark"] .secrow.open,
:root[data-theme="glass-dark"] .secrow.open {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 10px 28px -8px rgba(56, 189, 248, 0.22);
}
:root[data-theme="dark"] .secrow.open .sec-head,
:root[data-theme="glass-dark"] .secrow.open .sec-head {
  background: rgba(56, 189, 248, 0.10);
}
:root[data-theme="dark"] .secrow.open .secnum,
:root[data-theme="glass-dark"] .secrow.open .secnum {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}
:root[data-theme^="glass"] .secpill[aria-pressed="true"] {
  background: linear-gradient(135deg, #0b2447 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 20px -4px rgba(11, 36, 71, 0.38);
}
:root[data-theme="glass-dark"] .secpill[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--gl-btn-top), var(--gl-btn-bot));
  color: #031521;
}
:root[data-theme^="glass"] .secrow.open {
  border: 1.5px solid rgba(59, 130, 246, 0.48);
  box-shadow: 0 12px 28px -8px rgba(29, 111, 232, 0.16), inset 0 1.5px 1px rgba(255, 255, 255, 0.9);
}

/* Beautiful ID Card (uses only real profile fields) */
.sid-stage {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 6px 0 12px;
}
.sid-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface);
  border: 1.5px solid var(--line);
  box-shadow: 0 18px 42px -12px rgba(15, 27, 45, 0.16), 0 4px 14px rgba(15, 27, 45, 0.06);
  display: flex;
  flex-direction: column;
}
.sid-ribbon {
  height: 7px;
  width: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), #16a34a);
  position: relative;
}
.sid-verified {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.16);
  border: 1px solid rgba(22, 163, 74, 0.35);
  color: #15803d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
}
:root[data-theme="dark"] .sid-verified,
:root[data-theme="glass-dark"] .sid-verified {
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.38);
  color: #4ade80;
}
.sid-brand-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  background: linear-gradient(135deg, var(--brand-soft), transparent);
  border-bottom: 1px solid var(--line);
}
.sid-brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.15;
}
.sid-card-sub {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--brand);
  margin-top: 2px;
}
.sid-body {
  display: flex;
  gap: 16px;
  padding: 20px;
  align-items: flex-start;
}
.sid-photo-box {
  width: 92px;
  height: 112px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--line);
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 6px 16px rgba(15, 27, 45, 0.08);
}
.sid-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sid-initial {
  font-size: 36px;
  font-weight: 800;
  color: var(--brand);
}
.sid-details {
  flex: 1;
  min-width: 0;
  padding-top: 14px;
}
.sid-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.sid-email {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}
.sid-meta-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.sid-meta-lbl {
  color: var(--muted);
  font-weight: 600;
  min-width: 54px;
}
.sid-meta-sep {
  color: var(--muted);
}
.sid-meta-val {
  color: var(--ink);
  font-weight: 700;
}
.sid-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px dashed var(--line);
  background: var(--surface-2);
}
.sid-id-lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.sid-id-val {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 480px) {
  .sid-body { flex-direction: column; align-items: center; text-align: center; }
  .sid-details { padding-top: 0; width: 100%; }
  .sid-meta-row { justify-content: center; }
  .sid-verified { top: 12px; right: 12px; }
}
