/* Extend the original site's tokens and components, without a second theme. */
.roster-tools{display:grid;grid-template-columns:minmax(160px,1fr) minmax(160px,1fr) auto 40px;gap:12px;align-items:end;margin-bottom:18px}
.roster-tools label{display:grid;gap:7px;font-size:13px;color:var(--ink2)}
.roster-tools input,.roster-tools select{width:100%;min-width:0;height:40px;padding:8px 10px;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--ink);font:inherit}
.roster-tools button{min-height:40px;justify-content:center}
.roster-tools svg,.imp-acts svg,.roster-action svg{width:16px;height:16px;flex-shrink:0}
.roster-input-label{display:block;margin:0 0 8px;color:var(--ink2);font-size:13px}
.roster-deleted{display:flex;gap:7px;align-items:center;margin-left:auto;font-size:12px;font-weight:400;white-space:nowrap}
.roster-action{padding:6px;width:34px;height:34px;justify-content:center;margin-left:6px;flex-shrink:0}
.roster-danger{color:#b43340}
#mg-imp .card-h{flex-wrap:wrap;gap:8px}
#rosterTable td{overflow-wrap:anywhere}
#rosterTable td:last-child>span{font-size:12px;color:var(--ink2)}
#impStat{overflow-wrap:anywhere}
@media(max-width:640px){.roster-tools{grid-template-columns:minmax(0,1fr) 40px;gap:10px}.roster-tools label{grid-column:1/-1}.roster-tools button{grid-row:3}.roster-deleted{margin-left:0}#rosterTable td:nth-child(4){flex-wrap:wrap}#rosterTable td:last-child>span{flex-basis:100%}}
.course-picker{padding:0 0 40px;min-height:70vh}
.course-picker-heading .tags span{display:inline-flex;align-items:center;gap:7px}
.course-picker-heading .tags svg{width:15px;height:15px;flex-shrink:0}
.course-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}
.course-choice{display:flex;flex-direction:column;align-items:flex-start;min-width:0;min-height:350px;text-align:left;color:#fff;border-radius:22px;background:linear-gradient(120deg,#0B3C4C 0%,#0E7490 55%,#14919B 100%);transition:transform .25s,box-shadow .25s,border-color .25s}
.course-choice .course-symbol{color:#fff;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.22);flex-shrink:0}
.course-choice .num{color:rgba(255,255,255,.16)}
.course-symbol svg{width:28px;height:28px;stroke-width:1.8}
.course-choice-name{font-size:24px;font-weight:700;line-height:1.5;margin-bottom:9px}
.course-description{font-size:13.5px;color:#CBEAF0;line-height:1.8;overflow-wrap:anywhere}
.course-modules{display:flex;flex-wrap:wrap;gap:7px;margin-top:18px;max-width:100%}
.course-modules>span{font-size:11.5px;line-height:1.6;padding:4px 10px;border:1px solid rgba(255,255,255,.35);border-radius:99px;background:rgba(255,255,255,.08);color:#E2F4F8;white-space:nowrap}
.course-choice .course-access{margin-top:auto;padding-top:24px;min-height:46px;color:#fff}
.course-access svg{width:16px;height:16px;flex-shrink:0}
.course-choice:disabled{cursor:not-allowed;color:var(--ink2);background:#E8EEF0;border-color:var(--line);box-shadow:none}
.course-choice:disabled:hover{transform:none;box-shadow:none}
.course-choice:disabled .course-symbol{color:var(--mut);background:var(--bg)}
.course-choice:disabled .course-access{color:var(--mut)}
.course-choice:disabled .course-description{color:var(--ink2)}
.course-choice:disabled .course-modules>span{color:var(--ink2);border-color:#C6D4DB;background:rgba(255,255,255,.4)}
.course-choice:disabled .num{color:#C6D4DB}
.course-choice:focus-visible,#courseSwitcher:focus-visible{outline:3px solid var(--pri);outline-offset:4px}
.course-picker *{letter-spacing:0}
.choosing-course #nav{display:none!important}
.choosing-course .kg-ai-float{display:none}
.choosing-course #view-courses{display:block}

body[data-course="immunology"] [data-go="karyo"],
body[data-course="parasitology"] [data-go="karyo"],
body[data-course="immunology"] .mode-card[onclick="go('karyo')"],
body[data-course="parasitology"] .mode-card[onclick="go('karyo')"],
body:not([data-course="genetics"]) [data-rk="karyo"],
body:not([data-course="genetics"]) #trendTabKaryo,
body:not([data-course="genetics"]) #tpKaryo{display:none!important}
body[data-course="immunology"] .modes,
body[data-course="parasitology"] .modes{grid-template-columns:repeat(3,minmax(0,1fr))}

.topbar-in{gap:16px}
.topbar .logo,.topbar .mark,.topbar .avatar{flex-shrink:0}
.topbar .logo{white-space:nowrap}
.topbar-right{flex-shrink:0;gap:10px}
.topbar-right>.pill:first-child{display:none}
.topbar-right #uRole{min-width:0;max-width:164px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
.topbar-right #uRole::after{content:none}
.topbar-right #btnLogout{min-width:78px}
.topbar .nav{min-width:0;gap:3px;margin-left:0;scrollbar-width:none}
.topbar .nav::-webkit-scrollbar{display:none}
.topbar .nav button{padding:8px 10px;font-size:13px}
#courseSwitcher{display:inline-flex;align-items:center;justify-content:center;gap:6px;margin-right:5px;color:var(--pri-d);background:var(--pri-l)}
#courseSwitcher svg{width:14px;height:14px;flex-shrink:0}
.hero h1,.logo small{letter-spacing:0}
#coursePreviewNotice{padding:6px 16px;background:var(--pri-l);color:var(--pri-d);font-size:11px;text-align:center;border-bottom:1px solid var(--line)}
body.kg-wide main{height:calc(100dvh - var(--course-shell-height,62px))}
.gate{align-items:safe center}
.gate::before,.gate::after{pointer-events:none}

.kg-library{grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:20px}
.kg-module{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto 1fr auto auto;gap:12px;min-height:230px;padding:24px;border:1px solid #fff;border-right-color:#E0E8ED;border-bottom-color:#D6E1E7;border-radius:18px;background:linear-gradient(145deg,#FFFFFF 62%,#F7FAFC);color:var(--ink);box-shadow:inset 1px 1px 0 #fff,inset -1px -1px 0 #E7EFF3,0 3px 5px rgba(18,35,46,.04),0 12px 24px rgba(18,35,46,.08);transition:transform .2s,box-shadow .2s,border-color .2s}
.kg-module h3{grid-column:1;grid-row:1;font-size:18px;line-height:1.55;margin:0;overflow-wrap:anywhere}
.kg-module p{grid-column:1/-1;grid-row:2;font-size:14px;line-height:1.8;color:var(--ink2)}
.kg-module .kg-state{position:static;grid-column:2;grid-row:1;align-self:start;font-size:12px;line-height:1.6;padding:4px 9px;border-radius:99px;background:#EDF2F5;color:#596E79;white-space:nowrap}
.kg-module.available .kg-state{background:var(--green-l);color:var(--green)}
.kg-module .kg-module-icon{grid-column:2;grid-row:3;width:38px;height:38px;margin:0;border-radius:11px;background:#E3F3F7;color:var(--pri-d);box-shadow:inset 1px 1px 1px #fff,inset -2px -2px 3px #BFD9E1,0 2px 3px rgba(14,116,144,.1)}
.kg-module .kg-meta{grid-column:1;grid-row:3;align-self:center;gap:6px;margin:0;padding:0}
.kg-module .kg-meta span{font-size:12px;padding:4px 9px;background:#EDF3F6;color:var(--ink2)}
.kg-enter{grid-column:1/-1;grid-row:4;justify-self:end;display:inline-flex;align-items:center;gap:7px;color:var(--pri-d);font-size:14px;font-weight:600}
.kg-enter svg{width:16px;height:16px}
.kg-module.available:hover{transform:translateY(-4px);border-color:#B5D7E1;box-shadow:inset 1px 1px 0 #fff,inset -1px -1px 0 #DBEAF0,0 5px 9px rgba(18,35,46,.05),0 18px 30px rgba(14,80,100,.14)}
.kg-module.available:active{transform:translateY(-1px);box-shadow:inset 1px 2px 4px rgba(18,35,46,.08),0 4px 10px rgba(18,35,46,.06)}
.kg-module.available:focus-visible{outline:3px solid var(--pri);outline-offset:4px}
.kg-module:disabled{opacity:1;cursor:not-allowed;color:#4A606C;background:linear-gradient(145deg,#FFFFFF 50%,#F4F7F9)}
.kg-module:disabled .kg-module-icon{color:#5C7D8A;background:#EBF2F5}
.kg-workspace-head{padding:13px 18px;border-radius:16px;background:linear-gradient(120deg,#0B3C4C 0%,#0E7490 55%,#14919B 100%);color:#fff}
.kg-workspace-head h2{font-size:22px;line-height:1.45}
.kg-workspace-head p{font-size:14px;line-height:1.7;color:#CBEAF0}
.kg-workspace-head .back{font-size:14px;color:#E2F4F8}
.kg-workspace-head .chip{font-size:13px;background:rgba(255,255,255,.1);color:#fff;border:1px solid rgba(255,255,255,.3)}
.kg-tool-shell{border-radius:12px;border-color:var(--line);box-shadow:var(--shadow)}
.kg-ai-tutor-head b{font-size:16px}
.kg-ai-tutor-head small,.kg-ai-context small{font-size:12px}
.kg-ai-context b,.kg-ai-send{font-size:14px}
.kg-ai-msg,.kg-ai-compose textarea{font-size:16px;line-height:1.8}
.kg-ai-msg .kg-ai-source{font-size:12px}
.kg-ai-nudge{font-size:14px;max-width:220px}
/* The graph is a working surface: keep the site context in a compact title strip. */
body.kg-wide main{padding:8px 12px 12px}
body.kg-wide .topbar-in{max-width:none}
body.kg-wide .kg-workspace-head{min-height:44px;padding:6px 4px;margin-bottom:6px;gap:10px 16px;flex-wrap:nowrap;border-radius:0;background:none;color:var(--ink);align-items:center}
body.kg-wide .kg-workspace-head .back{flex-basis:auto;flex-shrink:0;font-size:12px;color:var(--pri-d)}
body.kg-wide .kg-title{min-width:0}
body.kg-wide .kg-workspace-head h2{font-size:18px;line-height:1.5;overflow-wrap:anywhere}
body.kg-wide .kg-workspace-head p{display:none}
body.kg-wide .kg-workspace-head .chip{flex-shrink:0;font-size:12px;background:var(--pri-l);color:var(--pri-d);border:0}
body.kg-wide .kg-tool-shell{border-radius:8px;box-shadow:0 3px 12px rgba(18,35,46,.08)}
@media(min-width:1000px){
  body.kg-wide .topbar-in{display:flex;height:54px;min-height:54px;padding:0 16px;gap:14px}
  body.kg-wide .logo{font-size:16px;gap:8px}
  body.kg-wide .logo small{display:none}
  body.kg-wide .mark{width:30px;height:30px}
  body.kg-wide .topbar .nav{flex:1;grid-column:auto;grid-row:auto;overflow-x:auto;padding:0;gap:2px}
  body.kg-wide .topbar .nav button{font-size:12px;min-height:34px;padding:7px 9px}
  body.kg-wide .topbar-right{gap:7px}
  body.kg-wide .topbar-right .avatar{display:none}
  body.kg-wide .topbar-right #btnLogout{min-width:0;padding:6px 10px;font-size:12px}
}
@media(max-width:999px){body.kg-wide .topbar-in{min-height:82px;gap:3px 8px}body.kg-wide .topbar .logo small{display:none}}
@media(max-width:640px){
  body.kg-wide main{padding:4px 6px 6px}
  body.kg-wide .kg-workspace-head{min-height:40px;gap:8px;padding:4px 2px;margin-bottom:4px}
  body.kg-wide .kg-workspace-head h2{font-size:14px}
  body.kg-wide .kg-workspace-head .back{font-size:11px;max-width:66px;line-height:1.5}
}
@media(max-width:640px){
  .kg-library{grid-template-columns:minmax(0,1fr);gap:16px}
  .kg-module{padding:22px;border-radius:16px;min-height:230px}
  .kg-workspace-head{padding:10px 12px;border-radius:12px;gap:5px 10px}
  body.kg-wide .kg-workspace-head h2{font-size:14px}
  .kg-workspace-head p{font-size:13px}
  .kg-workspace-head .chip{display:none}
  .kg-ai-nudge{font-size:13px;max-width:170px}
}
@media(prefers-reduced-motion:reduce){.kg-module.available:hover{transform:none}.kg-module{transition:none}}

@media(max-width:1279px){
  .topbar-in{height:auto;min-height:94px;padding:8px 28px 5px;display:grid;grid-template-columns:auto minmax(0,1fr);gap:7px 12px}
  .topbar .logo{grid-column:1;grid-row:1;font-size:16px}
  .topbar-right{grid-column:2;grid-row:1;margin:0;justify-content:flex-end}
  .topbar .nav{grid-column:1/-1;grid-row:2;width:auto;margin:0;overflow-x:auto;padding:0 0 3px}
  .topbar .nav button{min-height:36px;flex-shrink:0}
  .choosing-course .topbar-in{min-height:62px}
}
@media(min-width:1280px){
  .topbar .nav{flex:1;overflow:visible}
  .topbar-right .avatar{display:none}
}
@media(max-width:1000px){
  .course-choices{gap:16px}
  .course-choice{padding:24px;min-height:350px}
  .course-choice-name{font-size:20px}
  body[data-course="immunology"] .modes,
  body[data-course="parasitology"] .modes{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  .course-picker{padding:0 0 24px}
  .course-choices{grid-template-columns:1fr;gap:14px}
  .course-choice{display:grid;grid-template-columns:52px minmax(0,1fr);gap:8px 16px;min-height:242px;padding:22px;border-radius:12px}
  .course-choice .course-symbol{grid-column:1;grid-row:1/3;margin:0}
  .course-choice .num{font-size:32px;top:auto;bottom:12px;right:16px;line-height:1;pointer-events:none}
  .course-choice-name{grid-column:2;font-size:20px;margin:0}
  .course-description{grid-column:2;font-size:12.5px}
  .course-modules{grid-column:1/-1;margin-top:8px;align-self:start}
  .course-choice .course-access{grid-column:1/-1;padding-top:9px;padding-right:30px;min-height:30px;font-size:13px}
  body[data-course="immunology"] .modes,
  body[data-course="parasitology"] .modes{grid-template-columns:1fr}
}
@media(max-width:640px){
  .topbar-in{padding:8px 14px 5px;gap:7px 8px}
  .topbar .logo{font-size:14px}
  .topbar-right{gap:6px}
  .topbar-right #uRole{font-size:11px;max-width:110px;padding:4px 9px}
  .topbar .nav{margin:0 -14px;padding:0 14px 3px}
  .topbar .nav button{font-size:12.5px;padding:7px 11px}
  .topbar-right #btnLogout{min-width:0}
}
@media(prefers-reduced-motion:reduce){
  .course-choice{transition:none}
  .course-choice:hover{transform:none}
}
/* Ranking summary and teacher directory share the existing course surfaces. */
.rank-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;align-items:stretch;margin-bottom:18px}
.rank-summary .podium{grid-column:span 3;grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:0}
.rank-summary:has(.my-rank[hidden]){grid-template-columns:repeat(3,minmax(0,1fr))}
.my-rank{min-width:0}.my-rank[hidden]{display:none}
.my-rank .pd-medal{display:flex;justify-content:center;align-items:center;gap:6px;min-height:33px;font-size:12px;color:var(--pri-d);flex-wrap:wrap}
.my-rank .pd-sub{overflow-wrap:anywhere}
.student-directory{min-width:0;align-self:start;overflow:hidden}.student-directory .stu-list{border:0;box-shadow:none;max-height:65vh;overflow:auto}
.student-search{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:14px 16px;font-size:13px;color:var(--ink2);border-bottom:1px solid var(--line)}
.student-search input{flex:1 1 150px;width:100%;min-width:0;min-height:40px;padding:9px 12px;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--ink);font:inherit}
.student-search input:focus{outline:2px solid var(--pri);outline-offset:1px}
@media(max-width:640px){.rank-summary,.rank-summary:has(.my-rank[hidden]){grid-template-columns:1fr;gap:10px}.rank-summary .podium{grid-column:auto;grid-template-columns:1fr}.my-rank .pd-medal{grid-column:1/-1;justify-content:flex-start;min-height:24px}.student-directory .stu-list{max-height:320px}}
.roster-bulk-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:12px 14px; }
#rosterTable .roster-reset-count { width:auto; min-width:100px; height:36px; white-space:nowrap; padding:6px 10px; }
.roster-bulk-toolbar label { display:flex; align-items:center; gap:6px; }
.roster-bulk-toolbar input, #rosterTable td input[type="checkbox"] { width:18px; height:18px; flex:none; vertical-align:middle; margin-right:8px; }
.roster-bulk-toolbar .btn { min-height:40px; white-space:normal; }
@media(max-width:600px) { .roster-bulk-toolbar { gap:8px; } .roster-bulk-toolbar .btn { flex:1 1 145px; } }
