:root {
  --bg: #f4f6fb; --card: #fff; --ink: #1e1b4b; --muted: #667085; --line: #e4e7ef;
  --pri: #3a22a6; --pri-d: #2b1985; --pri-l: #efebfd; --brand-y: #fdbf34; --brand-c: #fe6a5a; --ok: #138a55; --ok-l: #e7f6ee;
  --warn: #b26a00; --warn-l: #fff4e0; --bad: #c2352b; --bad-l: #fdecea; --r: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--pri); }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.hidden { display: none !important; }

.topbar { background: var(--ink); color: #fff; display: flex; align-items: center; gap: 12px; padding: 10px 20px; position: sticky; top: 0; z-index: 20; }
.topbar .brand { font-weight: 700; letter-spacing: .2px; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .9rem; opacity: .85; }
.topbar button { background: transparent; color: #fff; border: 1px solid #ffffff55; }

.wrap { max-width: 1150px; margin: 0 auto; padding: 22px 18px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
@media (max-width: 600px) { .stat { padding: 10px 12px; } .stat .v { font-size: 1.3rem; } .modal { padding: 16px; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat .v { font-size: 1.6rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .85rem; }

button, .btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: #c5cad8; }
button.pri, .btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; }
button.pri:hover { background: var(--pri-d); }
button.danger { color: var(--bad); border-color: #f0c4c0; }
button.sm, .btn.sm { padding: 4px 9px; font-size: .82rem; }
button:disabled { opacity: .55; cursor: not-allowed; }

label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { font: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pri-l); border-color: var(--pri); }
textarea { min-height: 110px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.field { margin-bottom: 12px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: .95rem; }
.check input { width: auto; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .3px; background: #fafbfe; position: sticky; top: 0; }
.tablewrap { overflow: auto; max-height: 560px; border: 1px solid var(--line); border-radius: 8px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eef0f5; color: #475467; white-space: nowrap; }
.b-ok { background: var(--ok-l); color: var(--ok); } .b-warn { background: var(--warn-l); color: var(--warn); }
.b-bad { background: var(--bad-l); color: var(--bad); } .b-pri { background: var(--pri-l); color: var(--pri); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: none; background: none; padding: 10px 14px; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); white-space: nowrap; }
.tabs button.on { color: var(--pri); border-bottom-color: var(--pri); font-weight: 600; }

.bar { height: 8px; background: #eceff5; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--pri); }
.bar.ok > i { background: var(--ok); } .bar.warn > i { background: #e39a1a; } .bar.bad > i { background: var(--bad); }
.barrow { display: grid; grid-template-columns: minmax(140px, 1.3fr) 3fr 70px; gap: 10px; align-items: center; margin: 6px 0; font-size: .9rem; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 1000; box-shadow: 0 6px 24px #0003; max-width: 90vw; }
.toast.err { background: var(--bad); color: #fff; }
.modal-bg { position: fixed; inset: 0; background: #0f172a99; display: flex; align-items: flex-start; justify-content: center; padding: 40px 14px; z-index: 500; overflow: auto; }
.modal { background: #fff; border-radius: 12px; max-width: 900px; width: 100%; padding: 22px; position: relative; }
.modal .x { position: absolute; top: 12px; right: 12px; }

/* auth pages */
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.authbox { width: 100%; max-width: 400px; }
.authbox .logo { text-align: center; margin-bottom: 18px; }
.authbox .logo .mark { width: 52px; height: 52px; border-radius: 14px; background: var(--pri); color: #fff; font-weight: 800; font-size: 1.4rem; display: inline-flex; align-items: center; justify-content: center; }
.err { color: var(--bad); font-size: .9rem; min-height: 1.2em; }

/* exam */
.exam-body { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.exam-top { background: var(--ink); color: #fff; padding: 10px 18px; display: flex; gap: 14px; align-items: center; position: sticky; top: 0; z-index: 30; flex-wrap: wrap; }
.exam-top .timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.2rem; background: #ffffff1a; padding: 4px 12px; border-radius: 8px; }
.exam-top .timer.low { background: var(--bad); }
.progress { height: 4px; background: #ffffff25; position: absolute; left: 0; right: 0; bottom: 0; }
.progress > i { display: block; height: 100%; background: #7ee2a8; }
.exam-main { max-width: 1100px; margin: 0 auto; padding: 22px 16px 80px; position: relative; }
.exam-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.exam-grid.with-passage { grid-template-columns: 1fr 1fr; }
@media (max-width: 820px) { .exam-grid.with-passage { grid-template-columns: 1fr; } }
.passage { max-height: 65vh; overflow: auto; white-space: pre-line; line-height: 1.65; }
.qtext { font-size: 1.08rem; white-space: pre-line; margin-bottom: 14px; }
.opt { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; background: #fff; }
.opt:hover { border-color: #b9c0f5; }
.opt.sel { border-color: var(--pri); background: var(--pri-l); }
.opt .k { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #c5cad8; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex: none; }
.opt.sel .k { background: var(--pri); border-color: var(--pri); color: #fff; }
.watermark { position: fixed; inset: 0; pointer-events: none; z-index: 10; opacity: .07; background-repeat: repeat; }
.shield { position: fixed; inset: 0; background: #0f172af2; color: #fff; z-index: 900; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.shield .box { max-width: 520px; }
.shield h2 { color: #fff; }
.blurred .exam-main { filter: blur(8px); }
@media print { body { display: none !important; } }

/* review */
.opt.right { border-color: var(--ok); background: var(--ok-l); }
.opt.right .k { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrongpick { border-color: var(--bad); background: var(--bad-l); }
.opt.wrongpick .k { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt.right .small { color: var(--ok); } .opt.wrongpick .small { color: var(--bad); }
.explain { margin-top: 12px; background: #f6f7fd; border-left: 4px solid var(--pri); border-radius: 8px; padding: 10px 14px; white-space: pre-line; font-size: .93rem; }
.explain b { display: block; color: var(--pri); margin-bottom: 4px; }

/* create-test form */
.fsec { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 4px; margin-bottom: 14px; background: #fcfcfe; }
.fhead { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 12px; }
.fnum { width: 24px; height: 24px; border-radius: 50%; background: var(--pri); color: #fff; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.fgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; align-items: end; }
.fgrid .span2 { grid-column: span 2; } .fgrid .span4 { grid-column: 1 / -1; }
.fgrid label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint { color: #98a2b3; font-size: .8rem; }
.check.toggle { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fff; white-space: normal; margin: 0; }
@media (max-width: 820px) { .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .fgrid .span2 { grid-column: 1 / -1; } .fgrid label { white-space: normal; } .fsec { padding: 12px 12px 2px; } }

/* data-interpretation tables */
.ditable { border-collapse: collapse; margin: 8px 0; font-size: .92rem; width: auto; }
.ditable th, .ditable td { border: 1px solid var(--line); padding: 5px 12px; text-align: center; position: static; }
.ditable th { background: #f1f3fa; text-transform: none; letter-spacing: 0; color: var(--ink); font-size: .85rem; }

/* coding */
.code-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .code-grid { grid-template-columns: 1fr; } }
.pstmt { white-space: pre-line; line-height: 1.6; }
.code-grid h4, .card h4 { margin: 14px 0 4px; font-size: .9rem; }
pre { background: #f6f7fb; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin: 4px 0; font: .85rem/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; overflow: auto; max-height: 260px; }
pre.err { background: var(--bad-l); border-color: #f0c4c0; color: #8f1d14; }
.editor { width: 100%; min-height: 360px; font: .9rem/1.5 ui-monospace, Menlo, Consolas, monospace; tab-size: 4; background: #1e2230; color: #e6e9f2; border: 1px solid #1e2230; border-radius: 8px; padding: 12px; resize: vertical; user-select: text; -webkit-user-select: text; }
.editor:focus { outline: 2px solid var(--pri); }
.cgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cgrid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) { .cgrid { grid-template-columns: 1fr; } }
.runout { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; }
.runout.bad { background: var(--bad-l); color: var(--bad); }
.case { border-left: 4px solid var(--line); padding: 6px 10px; margin-top: 8px; }
.case.ok { border-color: var(--ok); } .case.no { border-color: var(--bad); }
.verdicts { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.trow { display: grid; grid-template-columns: 1fr 1fr 70px 40px; gap: 8px; align-items: start; margin-bottom: 8px; }
.trow textarea { min-height: 60px; }
@media (max-width: 600px) { .trow { grid-template-columns: 1fr 1fr; } }

/* progress */
.fb { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; border-left: 4px solid var(--pri); background: var(--pri-l); }
.fb.good { border-color: var(--ok); background: var(--ok-l); } .fb.warn { border-color: #e39a1a; background: var(--warn-l); }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; font-size: .85rem; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 6px; }

.qtext pre.qcode { white-space: pre; max-height: none; font-size: .92rem; margin: 8px 0; user-select: none; }

/* ---- Placify brand ---- */
.topbar .brand { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-size: 1.08rem; }
.topbar .brand img { width: 30px; height: 30px; background: #fff; border-radius: 8px; padding: 3px; }
.topbar .brand small { font-weight: 500; opacity: .75; font-size: .9rem; }
.authbox .brandlogo { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto; }
.authbox .brandlogo.sm { max-width: 220px; }
.authbox .slogan { color: var(--muted); font-size: .95rem; margin-top: 4px; letter-spacing: .2px; }
.authbox .slogan::after { content: ""; display: block; width: 90px; height: 3px; border-radius: 3px; background: var(--brand-y); margin: 8px auto 0; }
.sitefoot { text-align: center; font-size: .82rem; color: var(--muted); padding: 18px 12px 22px; }
.sitefoot a { color: var(--pri); font-weight: 600; text-decoration: none; }
.sitefoot a:hover { text-decoration: underline; }
.sitefoot .dot { margin: 0 6px; color: var(--brand-c); }
.center:has(+ .sitefoot) { min-height: calc(100vh - 64px); }

/* ---- institution (client) branding ---- */
.inst-pill { display: inline-flex; align-items: center; background: #fff; border-radius: 8px; padding: 3px 8px; height: 36px; }
.inst-pill img { height: 30px; width: auto; display: block; }
.topbar .brand-sep { width: 1px; height: 26px; background: #ffffff40; margin: 0 4px; }
.authbox .instlogo { width: 100%; max-width: 360px; height: auto; display: block; margin: 0 auto; }
.authbox .instlogo.sm { max-width: 260px; }
.authbox .inst-name { font-size: .85rem; margin-top: 6px; }
.authbox .inst-name:empty { display: none; }
.poweredby { text-align: center; margin-top: 18px; }
.poweredby img { display: block; width: 170px; height: auto; margin: 4px auto 0; }
.poweredby .slogan { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.exam-top .inst-pill { height: 32px; padding: 2px 6px; margin-right: 4px; }
.exam-top .inst-pill img { height: 26px; }
@media (max-width: 640px) { .topbar .inst-pill img { height: 24px; } .topbar .brand > span:not(.inst-pill):not(.brand-sep), .topbar .brand small { display: none; } }

/* ---- exam: question palette, flags, notes ---- */
.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
.palette { position: sticky; top: 74px; max-height: calc(100vh - 90px); overflow: auto; padding: 14px; }
.pgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.pn { position: relative; padding: 0; height: 38px; font-weight: 700; border-radius: 8px; background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.pn i { position: absolute; bottom: 1px; right: 3px; font-style: normal; font-size: .55rem; opacity: .7; }
.pn.ans { background: var(--ok); border-color: var(--ok); color: #fff; }
.pn.flg::after { content: ""; position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand-y); border: 2px solid #fff; }
.pn.cur { outline: 3px solid var(--pri); outline-offset: 1px; }
.plegend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; color: var(--muted); }
.plegend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid var(--line); background: #fff; vertical-align: -2px; margin-right: 4px; }
.plegend .lg.ans { background: var(--ok); border-color: var(--ok); }
.plegend .lg.flg { background: var(--brand-y); border-color: var(--brand-y); border-radius: 50%; }
.qtools { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.qtools #flagq.on { background: #fff7e0; border-color: var(--brand-y); color: #8a5a00; font-weight: 600; }
.qtools .notes { width: 100%; }
.qtools .notes summary { cursor: pointer; color: var(--pri); }
.qtools .notes textarea { margin-top: 6px; min-height: 70px; width: 100%; }
@media (max-width: 900px) {
  .exam-layout { grid-template-columns: 1fr; }
  .palette { position: static; order: -1; max-height: none; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
}
.shield .box .shield-logo { max-width: 220px; max-height: 80px; display: block; margin: 0 auto 8px; }
/* feedback */
.feedback .stars { display: flex; gap: 4px; }
.feedback .stars button { font-size: 1.8rem; line-height: 1; padding: 2px 6px; background: none; border: none; color: #d4d6e0; }
.feedback .stars button.on { color: var(--brand-y); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border-radius: 999px; }
.chips button.on { background: var(--pri); border-color: var(--pri); color: #fff; }
/* camera preview (nothing is recorded) */
.cam { position: fixed; right: 14px; bottom: 14px; z-index: 40; width: 168px; background: #000; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 20px #0004; }
.cam video { width: 100%; display: block; transform: scaleX(-1); aspect-ratio: 4 / 3; object-fit: cover; }
.camstate { font-size: .72rem; color: #fff; padding: 4px 8px; background: #333; }
.camstate.ok { background: var(--ok); }
.camstate.noface, .camstate.multi, .camstate.off { background: var(--bad); }
.camstate.loading { background: #555; }
@media (max-width: 640px) { .cam { width: 110px; right: 8px; bottom: 8px; } }
.shield .box .shield-logo { background: #fff; border-radius: 10px; padding: 6px 10px; }
.exam-main:has(.exam-layout) { max-width: 1320px; }
.shield ul { color: #e8e8f0; }

/* ---- login / forgot password ---- */
.auth-page { background: radial-gradient(1200px 600px at 10% -10%, #e9e3ff 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #e2f5ea 0%, transparent 55%), var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px 16px 8px; }
.login-card { width: 100%; max-width: 980px; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 24px 60px -18px #2b198540, 0 2px 6px #1e1b4b10; border: 1px solid #ebe7fb; }
.login-art { position: relative; padding: 30px 34px 28px; background: linear-gradient(160deg, #efeaff 0%, #e6e0ff 45%, #e3f3ea 100%); display: flex; flex-direction: column; align-items: center; text-align: center; }
.login-art::before { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: #ffffff70; top: -70px; left: -70px; }
.login-art .login-placify { width: 150px; height: auto; align-self: flex-start; position: relative; }
.login-art .login-illus { width: 100%; max-width: 400px; height: auto; margin: 6px 0 4px; position: relative; }
.login-art h2 { margin: 6px 0 2px; font-size: 1.35rem; color: var(--ink); letter-spacing: .2px; }
.login-art p { margin: 0; color: #4b4a6b; }
.login-points { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.login-points li { background: #ffffffc0; border: 1px solid #ddd5fb; color: var(--pri-d); font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.login-form { padding: 34px 40px 30px; display: flex; flex-direction: column; justify-content: center; }
.login-form .login-inst { width: 100%; max-width: 250px; height: auto; margin: 0 auto 18px; display: block; }
.login-form h1 { margin: 0; font-size: 1.6rem; }
.login-form .lead { margin: 4px 0 18px; }
.login-form .field { margin-bottom: 14px; }
.inwrap { position: relative; display: flex; align-items: center; }
.inwrap .ico { position: absolute; left: 12px; font-size: .95rem; opacity: .7; pointer-events: none; }
.inwrap input { padding-left: 38px; height: 46px; border-radius: 10px; }
.inwrap .eye { position: absolute; right: 6px; height: 34px; padding: 0 10px; font-size: .8rem; border: none; background: var(--pri-l); color: var(--pri-d); border-radius: 8px; }
button.big, .btn.big { height: 48px; font-size: 1rem; font-weight: 600; border-radius: 10px; }
.login-form .hint-first { margin: 12px 0 0; }
.linkbtn { background: none; border: none; padding: 0; color: var(--pri); cursor: pointer; }
.linkbtn:disabled { color: var(--muted); cursor: default; }
.steps { display: flex; gap: 8px; margin: -6px 0 16px; }
.steps span { flex: 1; text-align: center; font-size: .78rem; font-weight: 600; padding: 6px; border-radius: 8px; background: #f1f2f7; color: var(--muted); }
.steps span.on { background: var(--pri-l); color: var(--pri-d); }
input.otp { font-size: 1.6rem; letter-spacing: 12px; text-align: center; font-weight: 700; height: 56px; font-variant-numeric: tabular-nums; }
.auth-page .sitefoot { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.sitefoot img { vertical-align: -3px; }
@media (max-width: 820px) {
  .login-card { grid-template-columns: 1fr; max-width: 460px; }
  .login-form { order: -1; padding: 26px 22px 22px; }
  .login-art { padding: 18px 20px 20px; }
  .login-art .login-illus { max-width: 220px; }
  .login-art .login-placify { align-self: center; width: 130px; }
  .login-points { display: none; }
}

/* round institution emblem in headers */
.inst-pill.round { width: 38px; height: 38px; padding: 2px; border-radius: 50%; justify-content: center; }
.inst-pill.round img { width: 34px; height: 34px; }
.exam-top .inst-pill.round { width: 34px; height: 34px; padding: 2px; }
.exam-top .inst-pill.round img { width: 30px; height: 30px; }
/* admin dashboard welcome */
.welcome { display: flex; align-items: center; gap: 18px; background: linear-gradient(120deg, #ffffff 0%, #f3f0ff 55%, #e9f6ef 100%); border: 1px solid #e6e0fb; border-radius: 16px; padding: 18px 22px; margin-bottom: 16px; }
.welcome img { width: 84px; height: 84px; flex: none; }
.welcome h1 { margin: 0; font-size: 1.45rem; }
.welcome .inst { color: #0f7f44; font-weight: 600; }
@media (max-width: 640px) { .welcome img { width: 56px; height: 56px; } .welcome h1 { font-size: 1.15rem; } }
/* role-based visibility (the server enforces the same rules) */
body[data-role="hod"] .need-edit, body[data-role="coordinator"] .need-edit { display: none !important; }
body:not([data-role="admin"]) .need-admin { display: none !important; }
.badge.role { background: #efebfd; color: var(--pri-d); }

.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 820px) { .grid.g3 { grid-template-columns: 1fr; } }

/* ---- admin: batch comparison, approvals, notices ---- */
.bcbars { display: flex; align-items: flex-end; gap: 18px; height: 170px; padding: 10px 6px 0; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.bcbar { flex: 1; max-width: 90px; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bcfill { width: 100%; background: linear-gradient(180deg, #8d7be8, var(--pri)); border-radius: 8px 8px 0 0; position: relative; min-height: 4px; }
.bcfill.top { background: linear-gradient(180deg, #34c27a, #129a52); }
.bcfill span { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: .78rem; font-weight: 700; color: var(--ink); }
.bclabel { font-size: .8rem; margin-top: 4px; font-weight: 600; }
.apq { display: flex; gap: 12px; align-items: flex-start; border-top: 1px solid var(--line); padding: 12px 0; }
.apopts { margin: 6px 0; padding-left: 22px; font-size: .9rem; }
.apopts li.ok { color: var(--ok); font-weight: 600; }
.notice { display: flex; gap: 10px; align-items: flex-start; border-top: 1px solid var(--line); padding: 10px 0; }
.notices-s .notice:first-of-type { border-top: none; }
.notices-s .notice.remind b::before { content: "🔔 "; }
/* ---- student: streak, badges, leaderboard ---- */
.streak-n { font-size: 2.6rem; font-weight: 800; color: #e4554a; line-height: 1; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.bdg { border: 1px dashed var(--line); border-radius: 10px; padding: 8px; text-align: center; color: var(--muted); filter: grayscale(1); opacity: .65; }
.bdg .ico { font-size: 1.5rem; display: block; }
.bdg b { display: block; font-size: .82rem; }
.bdg .small { font-size: .68rem; display: block; line-height: 1.2; margin-top: 2px; }
.bdg.on { border: 1px solid #e0d8fb; background: #f7f4ff; color: var(--ink); filter: none; opacity: 1; }
.seg { display: flex; gap: 4px; }
.seg button.on { background: var(--pri); color: #fff; border-color: var(--pri); }
#lbox table tr.me td { background: #f3f0ff; }
.tabs .tablink { padding: 10px 14px; color: var(--pri); text-decoration: none; font-weight: 600; margin-left: auto; }
/* ---- resume builder ---- */
.resume-wrap { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 18px; padding: 18px; max-width: 1400px; margin: 0 auto; align-items: start; }
.resume-wrap.view { grid-template-columns: 1fr; }
.resume-form { max-height: calc(100vh - 100px); overflow: auto; position: sticky; top: 76px; }
.resume-form h3 { margin: 16px 0 6px; font-size: .95rem; color: var(--pri-d); }
.ritem { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; background: #fbfaff; }
.resume-preview { display: flex; justify-content: center; }
.paper { width: 210mm; min-height: 297mm; background: #fff; box-shadow: 0 8px 30px #1e1b4b22; padding: 16mm 15mm; color: #1d1d2b; font-size: 10.5pt; line-height: 1.45; }
.paper header { border-bottom: 3px solid #3a22a6; padding-bottom: 8px; margin-bottom: 10px; }
.paper h1 { margin: 0; font-size: 22pt; color: #1e1b4b; letter-spacing: .3px; }
.paper .sub { color: #555; margin-top: 2px; }
.paper .contact { margin-top: 6px; font-size: 9.5pt; }
.paper .contact a { color: #3a22a6; text-decoration: none; }
.paper .sep { margin: 0 6px; color: #bbb; }
.paper section { margin-top: 10px; break-inside: avoid; }
.paper h3 { margin: 0 0 4px; font-size: 10.5pt; text-transform: uppercase; letter-spacing: 1px; color: #3a22a6; border-bottom: 1px solid #e4e0f5; padding-bottom: 2px; }
.paper p { margin: 2px 0; }
.paper ul { margin: 2px 0; padding-left: 18px; }
.paper .ent { margin-bottom: 6px; }
.paper .row2 { display: flex; justify-content: space-between; gap: 10px; }
.paper .row2 span { color: #555; }
@media (max-width: 980px) { .resume-wrap { grid-template-columns: 1fr; } .resume-form { position: static; max-height: none; } .paper { width: 100%; min-height: auto; padding: 18px; } }
@media print {
  @page { size: A4; margin: 0; }
  body.resume-page { background: #fff; }
  .no-print, .sitefoot { display: none !important; }
  .resume-wrap { display: block; padding: 0; }
  .paper { box-shadow: none; width: 210mm; min-height: auto; padding: 14mm 15mm; }
}

/* ---------- aptitude practice ---------- */
.stars { color: #f5a623; letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: #d9dce5; }
.ptopics { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ptopic { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; font: inherit; color: inherit; }
.ptopic:hover { border-color: var(--pri); box-shadow: 0 2px 10px #3a22a61a; }
.pbar { width: 100%; height: 6px; background: #eceff5; border-radius: 4px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pri), #7b5cf0); border-radius: 4px; transition: width .3s; }
.psession { max-width: 760px; margin-left: auto; margin-right: auto; }
.pq { font-size: 1.08rem; line-height: 1.6; white-space: pre-line; margin-bottom: 14px; }
.popts { display: grid; gap: 8px; }
.popt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 11px 14px; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); font: inherit; color: inherit; cursor: pointer; }
.popt:hover:not(:disabled) { border-color: var(--pri); background: var(--pri-l); }
.popt:disabled { cursor: default; opacity: 1; }
.popt .pk { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--pri-l); color: var(--pri); font-weight: 700; font-size: .85rem; }
.popt.right { border-color: var(--ok); background: var(--ok-l); }
.popt.right .pk { background: var(--ok); color: #fff; }
.popt.wrong { border-color: var(--bad); background: var(--bad-l); }
.popt.wrong .pk { background: var(--bad); color: #fff; }
.pdays { display: flex; align-items: flex-end; gap: 2px; height: 90px; border-bottom: 1px solid var(--line); margin: 6px 0 4px; }
.pday { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.pday i { display: block; width: 100%; min-height: 1px; background: var(--pri); border-radius: 2px 2px 0 0; opacity: .85; }
@media (max-width: 600px) { .ptopics { grid-template-columns: 1fr; } .pstats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- own questions in the test form ---------- */
.ownq { border: 1.5px dashed #c9bff3; background: #faf9ff; border-radius: var(--r); padding: 12px 14px; }
.ownlist { margin-top: 10px; max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ownitem { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ownitem:last-child { border-bottom: 0; }
.ownright { color: var(--ok); font-weight: 700; }
.dim { opacity: .45; }

/* multi-select dropdown (batches) */
.msel { position: relative; }
.msel summary { list-style: none; cursor: pointer; padding: 10px 34px 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.msel summary::-webkit-details-marker { display: none; }
.msel summary::after { content: '▾'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.msel[open] summary { border-color: var(--pri); }
.msel-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px #1e1b4b22; padding: 6px 10px; max-height: 280px; overflow: auto; }
.msel-list .check { display: flex; padding: 6px 2px; margin: 0; }
/* sub-tabs (reports) */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.subtabs button { border-radius: 999px; background: #fff; }
.subtabs button.on { background: var(--pri); color: #fff; border-color: var(--pri); }

/* create-test wizard */
.wsteps { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.wsteps button { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; background: #fff; color: var(--muted); }
.wsteps button .fnum { width: 22px; height: 22px; font-size: .78rem; background: #e9e7f5; color: var(--muted); }
.wsteps button.on { border-color: var(--pri); color: var(--pri); font-weight: 600; }
.wsteps button.on .fnum { background: var(--pri); color: #fff; }
.wsteps button.done .fnum { background: var(--ok); color: #fff; }

/* searchable student picker */
.spick { position: relative; }
.spick input { padding-right: 32px; }
.spick-x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 4px 6px; cursor: pointer; }
.spick-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px #1e1b4b22; max-height: 320px; overflow: auto; }
.spick-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f1f2f6; }
.spick-item:hover, .spick-item.on { background: var(--pri-l); }
.spick-more { padding: 8px 12px; }
