*{box-sizing:border-box}body{margin:0;font-family:Poppins,"Segoe UI",Arial,sans-serif;background:#faf5ff;color:#222}
header{display:flex;align-items:center;gap:14px;padding:8px 20px;background:#fff;border-bottom:4px solid #b01a9c}header img{height:58px}header b{flex:1;font-size:18px}
main{max-width:1200px;margin:20px auto;padding:0 14px}
button{padding:8px 14px;border:1px solid #7b2cbf;background:#fff;color:#7b2cbf;border-radius:8px;cursor:pointer}button.on,.pri{background:linear-gradient(90deg,#e6007e,#7b2cbf);color:#fff;border-color:transparent}.x{color:#c00;border-color:#c00}
nav{display:flex;gap:6px;flex-wrap:nowrap;margin-bottom:16px;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}nav button{flex:0 0 auto;white-space:nowrap;padding:8px 11px;font-size:14px}
input,select,textarea{padding:8px;border:1px solid #ccc;border-radius:6px;font:inherit}textarea{width:100%}
.card{background:#fff;border-radius:10px;padding:14px;margin:12px 0;box-shadow:0 1px 4px #0002}.click{cursor:pointer}.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:8px}.row input:not([type=number]){flex:1;min-width:140px}.chk{margin-right:12px}
#msg{color:#0a0;font-weight:600}
body:has(.split){background:#fff}
.split{display:flex;min-height:100vh;background:#fff}.poster{flex:none;width:min(75vh,48vw);height:100vh;position:sticky;top:0;background:#f6f0ff}.poster img{display:block;width:100%;height:100%;object-fit:contain;object-position:top}
.login{flex:1;max-width:520px;margin:auto;width:100%;padding:30px 44px;display:flex;flex-direction:column;gap:14px;text-align:center}.login h1{font-size:24px;margin:0;color:#4b1a8f}.login h2{font-size:18px;margin:0;color:#e6007e}.login a{color:#7b2cbf;font-size:14px}.err{color:#c00;margin:0}.mlogo{display:none;height:90px;margin:auto}
@media(max-width:800px){.poster{display:none}.mlogo{display:block}.login{padding:30px 20px}}
@media print{header,nav,.noprint,button{display:none}body{background:#fff}}
.bt td{padding:3px}.bt input{width:100%;min-width:120px;padding:5px}
.savebar{position:sticky;bottom:0;background:#faf5ffee;padding:10px 0;margin:0}
.gh{margin:22px 0 4px;color:#7b2cbf}.gh small{font-size:13px;color:#666;font-weight:400}
.tag{display:inline-block;background:#f3e8ff;color:#4b1a8f;border-radius:12px;padding:2px 10px;margin:2px 4px 2px 0}.tag small{color:#666}
.bt td:first-child{width:46px;font-weight:600}.bt td:nth-child(2) input{min-width:150px;font-weight:600}
.mt td.lt{text-align:left;min-width:200px}.mt td:nth-child(2) input{font-weight:600}
.sd td{font-size:14px;vertical-align:top}.sd td.lt{text-align:left}.sd td.wide{min-width:260px}
.pager{display:flex;align-items:center;justify-content:center;gap:14px;margin:10px 0}.pager button:disabled{opacity:.4;cursor:default}.pager span{color:#4b1a8f;font-weight:600}
.winbox select{min-width:220px}.winbox h3{margin:0 0 10px;color:#4b1a8f}.winbox label{font-weight:600}

/* ---- tables: compact, fit the page, purple header ---- */
table{border-collapse:separate;border-spacing:0;width:100%;background:#fff;margin:10px 0;border:1px solid #e0cdf3;border-radius:12px;overflow:hidden;box-shadow:0 2px 8px #7b2cbf1f}
th,td{padding:9px 10px;text-align:center;border-bottom:1px solid #eee2f8}
th{background:#6a22b5;color:#fff;font-weight:600;font-size:14px;border-bottom:0;-webkit-print-color-adjust:exact;print-color-adjust:exact}
th small{display:block;font-weight:400;opacity:.85;font-size:12px}
tbody tr:nth-child(even) td{background:#faf5ff}tbody tr:hover td{background:#f3e8ff}tbody tr:last-child td{border-bottom:0}
td:first-child{font-weight:600;color:#5b1a9e}
tbody th{border-radius:0}
.bt td:first-child,.mt td:first-child{width:50px}
/* pager */
.pager{display:flex;align-items:center;justify-content:center;gap:14px;margin:10px 0}.pager button:disabled{opacity:.4;cursor:default}.pager span{color:#4b1a8f;font-weight:600}
/* score sheet */
.bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px}.sv{flex:1;font-size:14px;font-weight:600}.sv.ok{color:#0a8a3a}.sv.wait{color:#b36b00}.sv.bad{color:#c00}
.sheet{background:#fff;border:1px solid #d9c2f0;border-radius:14px;overflow:hidden;margin-top:6px;box-shadow:0 2px 10px #7b2cbf22}
.top{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 18px;background:#fbf7ff;border-bottom:1px solid #e0cdf3;flex-wrap:wrap}
.top h1{font-size:26px;margin:0;color:#5b1a9e;letter-spacing:1px;flex:1;text-align:center}.top img{height:60px}
.meta{display:grid;grid-template-columns:repeat(3,minmax(110px,auto));gap:8px 26px;font-size:15px}.meta small{display:block;color:#7b2cbf;font-size:11px;text-transform:uppercase;letter-spacing:.5px}.meta b{font-weight:600}.meta input{padding:4px 6px}
.st{margin:0;border:0;border-radius:0;box-shadow:none}.st td{padding:7px 10px;font-size:15px}.st td.nm{text-align:left;font-weight:500;color:#222}.st td:first-child{width:56px}
.sc{display:inline-flex;align-items:center;gap:6px;justify-content:center;min-width:80px}.sc .v{font-size:16px;min-width:26px}
.sc input{display:none;width:70px;text-align:center;font-size:15px;padding:5px;border:2px solid #b980e6;border-radius:8px}.sc input:focus{outline:0;border-color:#7b2cbf;box-shadow:0 0 0 3px #7b2cbf26}
.sc.ed .v,.sc.ed .pen{display:none}.sc.ed input{display:inline-block}
.pen{padding:2px 7px;font-size:14px;line-height:1.2;border-radius:6px;border-color:#d9c2f0;color:#7b2cbf;background:#faf5ff}.pen:hover{background:#7b2cbf;color:#fff}
.hint{color:#666;font-size:13px;margin:6px 2px}
.winbox h3{margin:0 0 10px;color:#4b1a8f}.winbox select{min-width:220px}.winbox label{font-weight:600}
.wchip{background:#f3e8ff;border-radius:10px;padding:8px 16px;min-width:200px}.wchip small{display:block;color:#7b2cbf;font-size:11px;text-transform:uppercase}.wchip b{font-size:16px}
.warn{background:#fff7e0;border:1px solid #f0d27a}
@media(max-width:700px){.meta{grid-template-columns:repeat(2,1fr)}.top h1{font-size:20px;flex-basis:100%;order:3}th,td{padding:6px}}
@media print{.sheet{box-shadow:none}.st td{padding:5px 8px}.sc input{border:0}}

/* ---- course colours ---- */
.cpill{display:inline-block;padding:2px 11px;border-radius:12px;font-weight:600;font-size:13px;white-space:nowrap;background:hsl(var(--h),85%,92%);color:hsl(var(--h),70%,27%);border:1px solid hsl(var(--h),60%,68%);-webkit-print-color-adjust:exact;print-color-adjust:exact}
.ccard{border-left:8px solid hsl(var(--h),70%,52%);background:linear-gradient(90deg,hsl(var(--h),85%,95%),#fff 45%);-webkit-print-color-adjust:exact;print-color-adjust:exact}
.ccard .row .cpill{min-width:30px;text-align:center}
/* ---- pencil / edit dialog ---- */
td.nw{white-space:nowrap}.pen2{border-color:#7b2cbf;font-weight:600}
.ov{position:fixed;inset:0;background:#2a0a4a88;display:flex;align-items:center;justify-content:center;z-index:50;padding:14px}
.dlg{background:#fff;border-radius:14px;padding:20px 22px;width:100%;max-width:620px;max-height:92vh;overflow:auto;box-shadow:0 10px 40px #0006}
.dlg h3{margin:0 0 4px;color:#4b1a8f}.dlg .sub{color:#666;font-size:13px;margin:0 0 12px}
.fg{display:grid;grid-template-columns:1fr 1fr;gap:10px 14px;margin-top:10px}.fg label{display:flex;flex-direction:column;gap:4px;font-weight:600;font-size:13px;color:#4b1a8f}.fg label.full{grid-column:1/-1}
.fg input,.fg select,.fg textarea{font-weight:400;color:#222;width:100%}.fg small{font-weight:400;color:#777}
.row.end{justify-content:flex-end;margin:14px 0 0}.dlg .err{min-height:18px;margin:8px 0 0}
@media(max-width:600px){.fg{grid-template-columns:1fr}}
@media print{#modal{display:none}}
/* ---- judges ---- */
.jc{display:inline-block;background:#f3e8ff;color:#4b1a8f;border-radius:12px;padding:2px 10px;margin:2px 4px 2px 0;border:1px solid #e0cdf3}
.jc.warn{background:#fff3cd;color:#8a5a00;border-color:#f0d27a}.jc.bad{background:#fde2e2;color:#b00020;border-color:#f1a5a5}
.tag.jt{background:#e0f2ff;color:#0b4f7c}.jd td.lt{text-align:left;min-width:120px}

/* ---- result popup ---- */
.submitbtn{font-size:18px;padding:12px 38px;font-weight:700}
.resdlg{max-width:680px;text-align:center}.resdlg h2{margin:4px 0;color:#4b1a8f;font-size:30px}.confetti{font-size:34px}
.pod{border-radius:16px;padding:16px 20px;margin:12px 0;border:3px solid;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.pod .pic{font-size:40px;line-height:1}.pod .pl{font-weight:700;text-transform:uppercase;letter-spacing:1px;font-size:14px;margin-top:4px}
.pod .pn{font-size:28px;font-weight:800;margin:4px 0}.pod .ps{display:inline-block;font-size:26px;font-weight:800;background:#fff;border-radius:12px;padding:4px 22px}.pod .ps small{font-size:15px;font-weight:600;color:#666}
.pod.gold{background:linear-gradient(135deg,#fff3b0,#ffd54a);border-color:#e0a800;color:#6b4a00;transform:scale(1.04)}
.pod.silver{background:linear-gradient(135deg,#f1f4f8,#c9d1db);border-color:#8e9aaa;color:#37424f}
.pod.bronze{background:linear-gradient(135deg,#ffe3cc,#e8a77a);border-color:#b86b34;color:#6a3510}

/* ---- day type, status, charts ---- */
.dtp{display:inline-block;padding:1px 9px;border-radius:10px;font-size:12px;font-weight:700;vertical-align:middle;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.dtp.weekday{background:#e0f2ff;color:#0b4f7c}.dtp.weekend{background:#ffe8cc;color:#8a4b00}.dtp.mixed{background:#e8f8e0;color:#2c6b13}
.bcrow{display:flex;justify-content:space-between;align-items:center;gap:12px}.bstat{display:flex;align-items:center;gap:10px}
.stp{display:inline-block;padding:4px 14px;border-radius:14px;font-weight:700;font-size:14px}.stp.ok{background:#dff6e3;color:#157a2f;border:1px solid #9fd8ac}.stp.no{background:#fde8e8;color:#b00020;border:1px solid #f1a5a5}
.bchart{display:flex;flex-direction:column;gap:8px}.brow{display:grid;grid-template-columns:minmax(120px,260px) 1fr minmax(150px,260px);gap:10px;align-items:center}
.bl{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bt{background:#f1e6fb;border-radius:8px;height:24px;overflow:hidden}.bf{height:100%;border-radius:8px}
.bv{font-weight:700;color:#4b1a8f}.bv small{font-weight:400;color:#666;display:block}
.bf.c0{background:linear-gradient(90deg,#e6007e,#7b2cbf)}.bf.c1{background:#7b2cbf}.bf.c2{background:#2a9d8f}.bf.c3{background:#e9a100}.bf.c4{background:#3a7bd5}.bf.c5{background:#d1495b}
@media(max-width:700px){.brow{grid-template-columns:1fr}}

/* ---- active / inactive ---- */
.actsel{font-weight:700;border-radius:8px}.actsel.on{border-color:#9fd8ac;background:#dff6e3;color:#157a2f}.actsel.off{border-color:#f1a5a5;background:#fde8e8;color:#b00020}
/* ---- results popup (dark purple / gold) ---- */
.resdlg{position:relative;overflow:hidden;max-width:520px;padding:22px 26px 20px;color:#fff;border:2px solid #c99a3a;background:radial-gradient(ellipse at 50% 0%,#7a2fc9 0%,#3a0f6e 38%,#1a0538 100%)}
.resdlg .spot{position:absolute;inset:0;pointer-events:none;background:conic-gradient(from 200deg at 50% -10%,transparent 0 8%,#ffffff22 12%,transparent 18% 32%,#ffffff1a 38%,transparent 44%)}
.rtrophy{position:relative;font-size:78px;line-height:1;filter:drop-shadow(0 0 18px #ffc94d)}
.resdlg h2{position:relative;margin:2px 0 0;font-family:Georgia,'Times New Roman',serif;font-size:50px;font-weight:700;background:linear-gradient(#fff3c0,#f5c542 55%,#b98414);-webkit-background-clip:text;background-clip:text;color:transparent}
.rstar{position:relative;color:#e8b64a;letter-spacing:2px;font-size:13px}.rsub{position:relative;color:#e9d9ff;margin:2px 0 8px;font-size:13px}
.rp{position:relative;margin:14px 0}.rcrown{font-size:30px;line-height:1;height:34px;display:flex;justify-content:center;align-items:flex-end;gap:6px}
.rcrown .lf{font-size:22px;opacity:.9}.rcrown .rt{transform:scaleX(-1)}
.rp.silver .cr{filter:grayscale(1) brightness(1.6)}.rp.bronze .cr{filter:sepia(1) saturate(3) hue-rotate(-15deg) brightness(.9)}
.rlab{margin:-6px auto 6px;width:62%;border:2px solid;border-radius:30px;padding:3px 0;font-family:Georgia,serif;font-weight:700;font-size:24px;background:linear-gradient(#4a1b86,#2a0b52)}
.rp.gold .rlab{border-color:#e8b64a;color:#f8d46a}.rp.silver .rlab{border-color:#c9d1db;color:#e8edf3}.rp.bronze .rlab{border-color:#d9955c;color:#f0b88a}
.rbar{display:flex;align-items:stretch;border:2px solid;border-radius:14px;overflow:hidden;background:linear-gradient(#4a1b86,#220645);text-align:left}
.rp.gold .rbar{border-color:#e8b64a}.rp.silver .rbar{border-color:#c9d1db}.rp.bronze .rbar{border-color:#d9955c}
.rn{flex:1;padding:12px 16px;font-size:20px;font-weight:600;font-family:Georgia,serif}.rs{min-width:96px;display:flex;align-items:center;justify-content:center;font-size:30px;font-weight:700;font-family:Georgia,serif;color:#f8d46a;border-left:2px solid #e8b64a55;background:#0000002e}
.rp.silver .rs{color:#e8edf3}.rp.bronze .rs{color:#f0b88a}
.resdlg .row.end{position:relative;justify-content:center;gap:12px;margin-top:18px}.rcan{background:transparent;color:#fff;border-color:#c99a3a}.rback{background:linear-gradient(#f8d46a,#c99a3a);color:#3a0f6e;font-weight:700;border-color:transparent}

/* ---- login page (poster style) ---- */
.lside{flex:1;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;min-height:100vh;background:radial-gradient(circle at 80% 10%,#f6ecff,#fff 55%)}
.lside .wave{position:absolute;right:0;bottom:0;width:46%;height:42%;pointer-events:none}
.lside .dancer{position:absolute;right:6%;top:2%;font-size:190px;opacity:.12;filter:grayscale(1) sepia(1) hue-rotate(230deg) saturate(6);pointer-events:none;line-height:1}
.lside .login{position:relative;max-width:520px;width:calc(100% - 48px);margin:0;padding:54px 36px 34px;gap:18px;background:linear-gradient(#ffffffee,#faf4ffee);border:2px solid #b27df0;border-radius:34px;box-shadow:0 0 0 6px #f3e8ff80,0 22px 50px #7b2cbf33;backdrop-filter:blur(6px)}
.ltab{position:absolute;left:50%;top:-30px;transform:translateX(-50%);background:#fff;border:2px solid #b27df0;border-radius:30px;padding:8px 52px}
.ltab::before,.ltab::after{content:"";position:absolute;top:50%;width:70px;height:4px;border-radius:3px;background:linear-gradient(90deg,#e6007e,#7b2cbf)}
.ltab::before{right:100%;margin-right:0}.ltab::after{left:100%}
.lside .login h1{font-size:34px;letter-spacing:1px;color:#3b0f8f;font-weight:800}
.fld{display:flex;align-items:center;gap:10px;background:#fff;border:2px solid #d9c2f0;border-radius:40px;padding:6px 18px;box-shadow:inset 0 1px 6px #7b2cbf14}
.fld:focus-within{border-color:#7b2cbf;box-shadow:0 0 0 4px #7b2cbf22}
.fld .ic{display:flex;width:46px;height:46px;border-radius:50%;background:#f3e8ff;align-items:center;justify-content:center;flex:none}
.fld input{flex:1;border:0;outline:0;background:transparent;font-size:18px;padding:14px 4px;min-width:0;box-shadow:none}
.eye{border:0;background:transparent;padding:4px;cursor:pointer;line-height:0}.eye #eyes{display:none}.eye.on #eyes{display:inline}
.lbtn{display:flex;align-items:center;justify-content:center;gap:16px;border-radius:40px;padding:16px;font-size:26px;font-weight:700;color:#fff;box-shadow:0 10px 24px #e6007e44}
.lbtn i{display:inline-flex;width:40px;height:40px;border:2px solid #fff;border-radius:50%;align-items:center;justify-content:center;font-style:normal;font-size:20px}
@media(max-width:800px){.lside{padding:40px 0}.lside .dancer{font-size:110px}}

/* ---- dashboard ---- */
.tiles{gap:14px;margin:8px 0}.tiles .wchip{min-width:170px;text-align:center}.tiles .wchip b{font-size:30px}.wchip.okc{background:#dff6e3}.wchip.okc small,.wchip.okc b{color:#157a2f}.wchip.noc{background:#fde8e8}.wchip.noc small,.wchip.noc b{color:#b00020}
.tn{margin:1px 0;line-height:1.3}.tn small{color:#666;display:block}.sc2{display:block;color:#7b2cbf;font-weight:700}
td .tn{white-space:normal}
/* ---- results popup v2 (light, like the poster) ---- */
.resdlg2{display:flex;max-width:1000px;width:96vw;padding:0;overflow:hidden;background:#fff;border:2px solid #d9c2f0;text-align:center}
.rpost{flex:0 0 38%;background:#f6f0ff}.rpost img{width:100%;height:100%;object-fit:cover;object-position:top;display:block}
.rmain{flex:1;padding:14px 22px 18px;background:radial-gradient(circle at 90% 0%,#f3e5ff,#fff 55%);min-width:0}
.rhead{display:flex;justify-content:center;align-items:flex-end;gap:10px}.rhead .lf{font-size:46px;filter:sepia(1) saturate(4) hue-rotate(5deg)}.rhead .rt{transform:scaleX(-1)}.rtr{font-size:76px;line-height:1;filter:drop-shadow(0 4px 8px #c99a3a88)}
.rban{display:inline-block;margin-top:-6px;padding:8px 46px;border-radius:18px;font-family:Georgia,serif;font-weight:700;font-size:40px;letter-spacing:2px;background:linear-gradient(#7b2cbf,#3a0f6e);border:3px solid #e8b64a;box-shadow:0 8px 20px #7b2cbf55;-webkit-background-clip:padding-box;color:#f8d46a;text-shadow:0 2px 0 #7a5200}
.rsub2{margin:6px 0 10px;color:#6b4a99;font-size:13px}
.rtab{background:#fff;border:2px solid #e3d0f7;border-radius:22px;padding:12px;box-shadow:0 10px 26px #7b2cbf22}
.rth,.rrow{display:grid;grid-template-columns:34% 1fr 22%;align-items:center}.rth{background:linear-gradient(90deg,#e6007e,#5b1fc9);color:#fff;font-weight:700;border-radius:12px;padding:10px 14px;margin-bottom:10px;text-align:left}.rth span:last-child{text-align:center}
.rrow{border:1px solid #e3d0f7;border-radius:14px;margin:8px 0;padding:8px 10px;background:linear-gradient(#fff,#f7f0ff);color:#3b0f8f;font-weight:700;text-align:left}
.rrow.gold{background:linear-gradient(90deg,#fff6d6,#ffe9a6);border-color:#e8b64a;box-shadow:0 0 16px #ffd54a88}
.rpos{display:flex;align-items:center;gap:10px}.rlb{font-size:17px}
.rmed{position:relative;display:inline-flex;width:44px;height:44px;border-radius:50%;align-items:center;justify-content:center;font-size:24px;font-weight:800;color:#fff;border:3px solid;flex:none}
.rcr{position:absolute;margin:-38px 0 0 -2px;font-size:18px;display:none}
.rrow.gold .rmed{background:radial-gradient(#ffd54a,#c98a00);border-color:#f3c14a}.rrow.silver .rmed{background:radial-gradient(#e5e9ee,#8a96a5);border-color:#c9d1db}.rrow.bronze .rmed{background:radial-gradient(#e8a77a,#9b5524);border-color:#d9955c}
.rnm{font-size:18px;line-height:1.25;border-left:2px solid #e3d0f7;padding-left:14px;font-family:Georgia,serif}.rnm div{padding:1px 0}
.rsc{text-align:center}.rsc span{display:inline-block;min-width:70px;padding:8px 14px;border-radius:12px;background:#efe6fb;font-size:24px;font-weight:800}.rrow.gold .rsc span{background:#ffd978}
.rfoot{color:#e8b64a;margin-top:6px}.rcan2{background:#fff}
.resdlg2 .row.end{justify-content:center;gap:12px;margin-top:14px}
@media(max-width:800px){.rpost{display:none}}

.chgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}.chgrid .card{margin:0}
.chgrid .brow{grid-template-columns:minmax(70px,130px) 1fr minmax(90px,130px)}.chgrid .bv small{font-size:11px}
@media(max-width:1000px){.chgrid{grid-template-columns:1fr}}

/* ---- master: coloured branches, day types, password, excel ---- */
.bgrid,.sgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px}
.bbox{border-left:10px solid hsl(var(--h),70%,52%);background:linear-gradient(90deg,hsl(var(--h),85%,94%),#fff 70%);font-size:20px;padding:22px 18px;-webkit-print-color-adjust:exact}
.bbox b{color:hsl(var(--h),70%,28%)}.bhead{border-left:10px solid hsl(var(--h),70%,52%);padding-left:12px;color:hsl(var(--h),70%,28%)}
.sbox{padding:18px;font-size:19px}.sbox.weekday{border-top:6px solid #3a9bdc;background:#f1f8fe}.sbox.weekend{border-top:6px solid #f0a030;background:#fff7ea}.sbox.mixed{border-top:6px solid #4caf50;background:#f1faf0}
.sbox.off{opacity:.45;cursor:not-allowed}.sbox small{font-size:13px;color:#555}
code.pw{background:#f3e8ff;color:#4b1a8f;padding:2px 8px;border-radius:6px;font-size:14px}
.xlbar{display:flex;justify-content:flex-end;margin:6px 0}.xlbar button{padding:5px 12px;font-size:13px}

.pcell{display:flex;align-items:center;justify-content:space-between;gap:10px}.pcell>div{flex:1}
.chips{display:flex;flex-wrap:wrap;gap:6px;min-height:34px}.chx{cursor:pointer;color:#c00;font-weight:700;margin-left:4px}

.cbox{margin-top:10px;padding:10px 12px;background:#faf5ff;border:1px solid #e3d0f7;border-radius:10px}.call{font-size:15px}.clist{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.clist .cpill{cursor:pointer;font-size:14px}

/* ---- Login page v2 (editable from Admin > Login Page) ---- */
body:has(.lp:not(.pv)){background:#fff}
.lp{position:relative;display:flex;min-height:100vh;overflow:hidden;--acc:#e4002b;
 background:radial-gradient(900px 420px at 88% -8%,#e6d8ff,transparent 62%),radial-gradient(700px 500px at -5% 0,#efe6ff,transparent 60%),radial-gradient(600px 400px at 60% 110%,#f3e9ff,transparent 60%),#fbf9ff}
.lp::after{content:"";position:absolute;right:-2%;bottom:-2%;width:48%;height:30%;background:linear-gradient(100deg,#c026d3,#5b1fc9);clip-path:polygon(32% 100%,100% 18%,100% 100%);opacity:.9;pointer-events:none}
.lp>*{position:relative;z-index:1}
.lp-left{flex:1.1;display:flex;flex-direction:column;padding:26px 24px 20px 32px;max-width:760px}
.lp-head{display:flex;align-items:center;gap:18px}
.lp-logo{height:96px;width:auto;object-fit:contain;mix-blend-mode:multiply}
.lp-bar{width:2px;align-self:stretch;background:#222;opacity:.85}
.lp-title{font-weight:800;font-size:clamp(20px,2.1vw,32px);line-height:1.1;text-transform:uppercase;color:#111}
.lp-title em{display:block;font-style:normal;color:var(--acc);margin-top:4px;letter-spacing:.5px}
.lp-hero{margin:4px 0 6px}
.lp-hero img{display:block;width:100%;max-height:52vh;object-fit:contain;mix-blend-mode:multiply;-webkit-mask-image:linear-gradient(to right,transparent,#000 7%,#000 93%,transparent),linear-gradient(to bottom,transparent,#000 6%,#000 92%,transparent);-webkit-mask-composite:source-in;mask-image:linear-gradient(to right,transparent,#000 7%,#000 93%,transparent),linear-gradient(to bottom,transparent,#000 6%,#000 92%,transparent);mask-composite:intersect}
.lp-feats{display:flex;align-items:stretch;justify-content:center;margin:6px 0 10px}
.lp-f{display:flex;align-items:center;gap:10px;padding:2px 18px;font-weight:700;font-size:clamp(10px,.9vw,13px);line-height:1.25;color:#3b1f9e;text-transform:uppercase}
.lp-f+.lp-f{border-left:2px solid #6d4fd6}
.lp-f svg{flex:none}
.lp-cats{text-align:center}
.lp-catt{position:relative;margin-bottom:6px}.lp-catt::before{content:"";position:absolute;left:4%;right:4%;top:50%;height:1px;background:#a98be0}
.lp-catt span{position:relative;display:inline-block;padding:3px 34px;border-radius:20px;background:linear-gradient(90deg,#7b2cbf,#c026d3);color:#fff;font-weight:700;font-size:12px;letter-spacing:1px}
.lp-catl{display:flex;flex-wrap:wrap;justify-content:center;font-weight:700;font-size:clamp(10px,.85vw,12.5px);color:#2f1c9a;text-transform:uppercase;line-height:1.8}
.lp-catl b{padding:0 12px;font-weight:700}.lp-catl b+b{border-left:2px solid #d0236a}
.lp-right{flex:.9;display:flex;align-items:center;justify-content:center;padding:30px}
.lp-card{width:min(400px,100%);background:#fff;border-radius:22px;padding:22px 22px 26px;display:flex;flex-direction:column;gap:14px;box-shadow:0 14px 40px #5b1fc933,0 2px 8px #0000000f}
.lp-card h1{margin:0;text-align:center;color:var(--acc);font-size:28px;font-weight:800}
.lp-fld{display:flex;align-items:center;gap:8px;background:#fff;border:2px solid #e5dbf5;border-radius:40px;padding:4px 14px 4px 6px}
.lp-fld:focus-within{border-color:#7b2cbf;box-shadow:0 0 0 4px #7b2cbf22}
.lp-ic{display:flex;width:40px;height:40px;border-radius:50%;background:#f6f1ff;align-items:center;justify-content:center;flex:none}
.lp-fld input{flex:1;min-width:0;border:0;outline:0;background:transparent;font-size:16px;padding:11px 6px;color:#3b1f9e}
.lp-fld input::placeholder{color:#6d5aa8}
.lp-eye{border:0;background:transparent;padding:4px;cursor:pointer;line-height:0}.lp-eye .sl{display:none}.lp-eye.on .sl{display:inline}
.lp-btn{border:0;border-radius:40px;padding:14px;font-size:20px;font-weight:700;color:#fff;background:var(--acc);cursor:pointer;box-shadow:0 8px 18px #0003}
.lp-btn:hover{filter:brightness(1.08)}
@media(max-width:900px){.lp{flex-direction:column}.lp-left{max-width:none;padding:18px}.lp-right{order:-1;padding:24px 16px 0}.lp-head{gap:12px}.lp-logo{height:64px}.lp-feats{flex-wrap:wrap;gap:8px}.lp-f{border:0!important}.lp::after{display:none}}
/* admin editor */
.lpgrid{display:grid;grid-template-columns:minmax(300px,520px) 1fr;gap:18px;align-items:start}
.lpside{position:sticky;top:10px}
.lpf{display:flex;flex-direction:column;gap:4px;margin:8px 0;font-size:14px;font-weight:600}.lpf input[type=color]{width:70px;height:36px;padding:2px}
.lpimg{display:flex;align-items:center;gap:12px;margin:8px 0}.lpimg img{height:70px;max-width:120px;object-fit:contain;background:#f6f0ff;border-radius:8px}.lpimg label{display:flex;flex-direction:column;gap:4px;font-weight:600;font-size:14px}
.lpfeat{display:flex;gap:8px;margin:8px 0;align-items:flex-start}.lpfeat textarea{flex:1}.lpfeat>div{display:flex;flex-direction:column;gap:6px}
.lpbox{position:relative;width:100%;overflow:hidden;border:1px solid #ddd;border-radius:10px}
.lpprev{position:absolute;left:0;top:0;width:1400px;transform-origin:0 0;pointer-events:none}.lpprev .lp{min-height:720px}
@media(max-width:1100px){.lpgrid{grid-template-columns:1fr}.lpside{position:static}}

/* poster-background mode: the poster image is the whole page, only a small Login box sits on top */
.lp.bgm{background-color:#fbf9ff;background-repeat:no-repeat;background-size:cover;background-position:left center;height:100vh;height:100dvh;min-height:0;overflow:hidden}
body:has(.lp.bgm:not(.pv)){overflow:hidden}
/* windows wider than the poster (16:9): poster keeps its shape, the strip to its right continues the swirls (mirrored tile) so the page is full */
@media(min-aspect-ratio:16/9){.lp.bgm{background-size:auto 100%}.lp.bgm::before{content:"";position:absolute;top:0;bottom:0;right:0;left:calc(100vh * 1.7767 - 2px);left:calc(100dvh * 1.7767 - 2px);background:url('/login-bg-ext.jpg') left top/auto 100% repeat-x;pointer-events:none}}
.lp.bgm::after{display:none}
.lp.bgm .lp-right{flex:1;justify-content:center;padding:30px 2vw 30px 55vw}
.lp.bgm .lp-card{width:min(330px,100%);padding:16px 18px 20px;gap:11px;border-radius:18px}
.lp.bgm .lp-card h1{font-size:23px}
.lp.bgm .lp-fld{padding:3px 12px 3px 5px}
.lp.bgm .lp-ic{width:34px;height:34px}.lp.bgm .lp-ic svg{width:18px;height:18px}
.lp.bgm .lp-fld input{font-size:14px;padding:9px 5px}
.lp.bgm .lp-eye svg{width:20px;height:20px}
.lp.bgm .lp-btn{padding:11px;font-size:17px}
.lpprev .lp.bgm{height:790px;min-height:790px;background-size:100% 100%!important}.lpprev .lp.bgm::before{display:none}
/* phones / tablets / narrow windows: poster on top, Login box under it */
@media(max-width:900px),(max-aspect-ratio:3/2){body:has(.lp.bgm:not(.pv)){overflow:auto}.lp.bgm{background-size:100% auto;flex-direction:column;height:auto;min-height:100vh;overflow:visible}.lp.bgm .lp-right{order:0;align-items:flex-start;padding:calc(56.25vw + 14px) 16px 28px}.lpprev .lp.bgm .lp-right{padding:30px 2vw 30px 55vw}}

/* row-by-row score sheet */
.nmi{width:100%;min-width:200px;padding:8px 10px;font-size:15px;border:2px solid #b980e6;border-radius:8px;background:#fff}.nmi:focus{outline:0;border-color:#7b2cbf;box-shadow:0 0 0 3px #7b2cbf26}.nmi.bad{border-color:#d33}
.nerr{display:block;color:#c00;font-size:12px;margin-top:2px}
.st td.dim{color:#bbb}
.pmk{display:inline-block;min-width:20px;font-size:11px;font-weight:700;line-height:20px;text-align:center;border-radius:50%}.pmk.on{background:#dff6e3;color:#157a2f;border:1px solid #9bd8aa}
.addrow{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 14px;border-top:1px solid #eee}
.phint{margin:6px 0;font-weight:500}.phint b{color:#157a2f}
@media print{.nmi{border:0;padding:0;background:transparent}.st td .x{display:none}}

/* results popup: small X, Edit score button; winners table scores */
.resdlg2{position:relative}
.rx{position:absolute;top:8px;right:10px;z-index:3;width:26px;height:26px;padding:0;line-height:24px;font-size:13px;border-radius:50%;border:1px solid #d9c2f0;background:#fff;color:#6b4a99;cursor:pointer}
.rx:hover{background:#f3e5ff}
.redit{background:#fff}
.wsc{display:inline;margin-top:2px;font-size:11px;font-weight:600;color:#6b4a99}.wsc b{color:#3b0f8f}

/* year bar (admin) and year tag (master) */
.yrbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:0 0 12px;padding:8px 12px;background:#fff;border:1px solid #e3d0f7;border-radius:12px}
.yrbar label{font-weight:700;color:#3b0f8f}.yrbar select{margin-left:6px;font-weight:700}.yrbar small{color:#6b4a99;margin-left:auto}
.yrtag{padding:3px 12px;border-radius:12px;background:#efe6fb;color:#3b0f8f;font-weight:700}

/* ---- fit every screen: tabs stay on ONE line (scroll sideways on small screens), tables scroll inside their box ---- */
html{-webkit-text-size-adjust:100%}img{max-width:100%}
@media(max-width:900px){
 header{flex-wrap:wrap;gap:8px;padding:6px 12px}header img{height:42px}header b{font-size:15px;min-width:0}
 main{margin:12px auto;padding:0 10px}
 nav{margin-bottom:12px;padding-bottom:4px}nav button{padding:7px 10px;font-size:13px}
 .yrbar{gap:8px;padding:8px 10px}.yrbar small{margin-left:0;flex-basis:100%}
 .row>select,.row>button,.row>label{flex:1 1 150px;max-width:100%}.row input:not([type=number]){flex:1 1 100%}
 th,td{padding:7px 6px;font-size:13px}th{font-size:12px}
 .tiles .wchip{min-width:120px;flex:1 1 120px}.tiles .wchip b{font-size:24px}
 .bgrid,.sgrid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}.bbox{font-size:16px;padding:16px 12px}
 .winbox select{min-width:0;width:100%}
 .card{padding:12px}
}
@media(max-width:600px){
 input,select,textarea{font-size:16px}
 header b{font-size:14px;flex-basis:55%}header>span,header>button{font-size:13px}header button{padding:6px 10px}
 .bar button,.pager button{padding:7px 10px}.pager{gap:8px;flex-wrap:wrap}
 .top{padding:10px 12px}.meta{grid-template-columns:repeat(2,1fr);gap:8px 14px;font-size:14px}
 .dlg{padding:16px 14px}
 .savebar button{width:100%}
 .resdlg2{flex-direction:column;overflow-y:auto;max-height:94vh}
 .rmain{padding:12px 12px 16px}.rtr{font-size:52px}.rhead .lf{font-size:30px}.rban{font-size:26px;padding:6px 26px}
 .rth,.rrow{grid-template-columns:38% 1fr 24%}.rlb{font-size:14px}.rmed{width:34px;height:34px;font-size:18px}.rnm{font-size:15px;padding-left:8px}.rsc span{min-width:48px;padding:6px 8px;font-size:18px}
 .resdlg2 .row.end{flex-wrap:wrap}
 .chgrid .brow{grid-template-columns:1fr}
}

/* ================= MASTER PAGES: soft purple waves, glass header, tab headings, rounded cards ================= */
body.mv{background:linear-gradient(135deg,#f3eaff 0%,#fff 42%,#f1e6ff 100%);min-height:100vh}
body.mv::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;
 background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 260' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%236a3de8' stop-opacity='.05'/%3E%3Cstop offset='.55' stop-color='%237b3fe4'/%3E%3Cstop offset='1' stop-color='%23ff1ab4'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 260C250 70 520 0 800 70V260Z' fill='url(%23g)'/%3E%3Cpath d='M220 260C460 150 620 120 800 150V260Z' fill='%23ff2bb8' opacity='.6'/%3E%3C/svg%3E") right bottom/min(75vw,900px) 28vh no-repeat,
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 200' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='h' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23ff1ab4'/%3E%3Cstop offset='1' stop-color='%236a3de8' stop-opacity='.2'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 0H420C260 40 110 80 0 200Z' fill='url(%23h)'/%3E%3C/svg%3E") left top/min(36vw,420px) 150px no-repeat,
  radial-gradient(ellipse at 70% 30%,#fff 0,#fff0 55%),
  radial-gradient(ellipse at 20% 85%,#e4d2fb 0,#e4d2fb00 60%)}
body.mv header.mh{display:flex;align-items:center;gap:16px;margin:10px 12px 0;padding:8px 26px;background:#ffffffc7;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:0;border-radius:36px;box-shadow:0 8px 28px #7b2cbf26}
.mh img{height:56px}
.mh .vsep{width:1px;align-self:stretch;margin:6px 0;background:#c9b4ea;flex:none}
.mh .mtitle{flex:1;font-size:24px;font-weight:700;color:#2d1b69;letter-spacing:.2px;min-width:0}.mh .mtitle span{color:#e6007e}
.mh .hr{display:flex;align-items:center;gap:20px}
.mh .hitem{display:flex;align-items:center;gap:10px;color:#4b1a8f;font-weight:700;font-size:15px;white-space:nowrap}
.mh .hitem .ic{width:22px;height:22px;color:#c0148f}
.mh .lgo{display:flex;align-items:center;gap:8px;padding:10px 20px;border:0;border-radius:24px;color:#fff;font-weight:700;background:linear-gradient(90deg,#e6007e,#b0129f);box-shadow:0 6px 16px #e6007e55}
.mh .lgo .ic{width:20px;height:20px;color:#fff}
.ic{width:20px;height:20px;flex:none}
body.mv main{max-width:1200px;margin:26px auto;padding:0 20px}

/* tab-shaped page heading with a thin line under it */
.mtabwrap{border-bottom:2px solid transparent;border-image:linear-gradient(90deg,#c0148f,#c0148f55 55%,#c0148f00) 1;margin:6px 0 20px;display:block}
.mtab{display:inline-flex;align-items:center;gap:12px;padding:9px 52px 9px 12px;color:#fff;font-weight:700;font-size:18px;
 background:linear-gradient(90deg,#33288f 0%,#9b1a9f 55%,#e6007e 100%);border-radius:26px 70px 0 0/26px 100% 0 0;box-shadow:0 -2px 14px #7b2cbf33}
.mtab .mti{display:flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:12px;background:#ffffff26}.mtab .mti .ic{width:24px;height:24px;color:#fff}

/* branch cards */
.mgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,380px));gap:16px}
.bcard{display:flex;align-items:center;gap:14px;padding:10px 14px;background:#fff;border-radius:18px;box-shadow:0 8px 22px #7b2cbf26;cursor:pointer;transition:transform .12s,box-shadow .12s}
.bcard:hover{transform:translateY(-2px);box-shadow:0 12px 28px #7b2cbf3a}
.bcard b{flex:1;color:#2d1b69;font-size:17px;min-width:0;overflow-wrap:anywhere}
.bpin,.bgo{display:flex;align-items:center;justify-content:center;border-radius:50%;flex:none;font-style:normal}
.bpin{width:48px;height:48px;background:#fde0f3;color:#d6128f}.bpin .ic{width:26px;height:26px}
.bgo{width:36px;height:36px;background:#fbd3ee;color:#c0148f}.bgo .ic{width:18px;height:18px}
.mhint{color:#6b4a99;margin:0 0 12px}

/* everything inside the master pages: same soft look */
body.mv .card,body.mv .sheet{border:0;border-radius:18px;box-shadow:0 8px 22px #7b2cbf26;background:#ffffffee}
body.mv .sbox{border-left:0}body.mv .bcrow{border-left:0}
body.mv .sheet .top{background:#faf3ff}
body.mv th{background:#ede2fb;color:#3b0f8f;border-bottom:1px solid #d9c2f0}
body.mv button{border-radius:20px;border-color:#c64ad0;color:#9b1a9f;background:#fff}
body.mv button.pri,body.mv .mh .lgo{background:linear-gradient(90deg,#e6007e,#b0129f);color:#fff;border-color:transparent}
body.mv .bar>button:first-child{box-shadow:0 4px 12px #7b2cbf22}

@media(max-width:900px){
 body.mv header.mh{margin:8px 8px 0;padding:8px 14px;gap:10px;border-radius:28px;flex-wrap:wrap}
 .mh img{height:42px}.mh .mtitle{font-size:17px}.mh .hr{gap:12px}.mh .hitem{font-size:14px}
 body.mv main{margin:16px auto;padding:0 12px}
}
@media(max-width:600px){
 body.mv header.mh{padding:8px 12px;border-radius:24px}
 .mh .vsep{display:none}.mh .mtitle{flex:1 1 60%;font-size:15px}
 .mh .hr{flex:1 1 100%;justify-content:space-between;gap:8px}.mh .hitem{font-size:13px;gap:6px}.mh .hitem .ic{width:18px;height:18px}
 .mh .lgo{padding:8px 14px;font-size:13px}
 .mtab{font-size:16px;padding:8px 36px 8px 10px}.mtab .mti{width:32px;height:32px}
 .mgrid{grid-template-columns:1fr}
 body.mv::before{background-size:100% 18vh,70vw 110px,auto,auto}
}
@media print{body.mv::before{display:none}}

/* winner highlight on the master's batch list */
.wchips{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.wch{display:inline-flex;align-items:center;gap:8px;padding:5px 12px 5px 8px;border-radius:999px;font-size:14px;border:1px solid;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.wch i{font-style:normal;font-size:18px;line-height:1}.wch span{font-weight:600;opacity:.85}.wch b{font-weight:800}
.wch em{font-style:normal;font-weight:800;padding:1px 9px;border-radius:999px;background:#ffffffb0}
.wch.gold{background:linear-gradient(90deg,#fff3c4,#ffe08a);border-color:#e8b64a;color:#6b4700;box-shadow:0 0 12px #ffd54a99}
.wch.silver{background:linear-gradient(90deg,#f1f3f6,#dde2e9);border-color:#b8c1cd;color:#3d4756}
.wch.bronze{background:linear-gradient(90deg,#fbe6d6,#f0c4a3);border-color:#d9955c;color:#6b3a14}
@media(max-width:600px){.wch{font-size:13px;padding:4px 10px 4px 6px}}

/* ---- results popup: always fits the screen; table shrinks/scrolls, buttons always visible ---- */
.resdlg2{max-height:94vh;max-height:94dvh;height:auto}
.resdlg2 .rpost{overflow:hidden}
.resdlg2 .rmain{display:flex;flex-direction:column;max-height:94vh;max-height:94dvh;overflow:hidden}
.resdlg2 .rhead,.resdlg2 .rban,.resdlg2 .rsub2{flex:none}
.resdlg2 .rhead .lf{font-size:clamp(26px,5vh,46px)}.resdlg2 .rtr{font-size:clamp(40px,8vh,76px)}
.resdlg2 .rban{font-size:clamp(24px,4.6vh,40px);padding:clamp(4px,.9vh,8px) 40px;align-self:center}
.resdlg2 .rsub2{margin:4px 0 8px}
.resdlg2 .rtab{flex:1 1 auto;min-height:0;overflow-y:auto;padding:10px}
.resdlg2 .rth{padding:8px 12px;margin-bottom:6px}
.resdlg2 .rrow{margin:6px 0;padding:6px 10px}
.resdlg2 .rfoot{display:none}
.resdlg2 .row.end{flex:none;margin-top:10px;padding-top:2px;flex-wrap:wrap}
/* many winners (ties) -> smaller rows */
.resdlg2.dense .rmed{width:32px;height:32px;font-size:17px}
.resdlg2.dense .rnm{font-size:14px;line-height:1.2}
.resdlg2.dense .rsc span{min-width:48px;padding:4px 10px;font-size:18px}
.resdlg2.dense .rrow{margin:4px 0;padding:4px 8px}
.resdlg2.dense .rlb{font-size:14px}
.resdlg2.dense .rtr{font-size:clamp(30px,6vh,52px)}.resdlg2.dense .rban{font-size:clamp(20px,3.6vh,30px)}
@media(max-height:700px){.resdlg2 .rhead{display:none}.resdlg2 .rsub2{display:none}.resdlg2 .rban{margin-top:6px}}
@media(max-width:600px){
 .resdlg2{flex-direction:column;overflow:hidden}
 .resdlg2 .rmain{max-height:94vh;max-height:94dvh}
}

/* scrollable student-name suggestions */
.nmlist{position:fixed;z-index:200;overflow-y:auto;overscroll-behavior:contain;background:#fff;border:2px solid #b980e6;border-radius:10px;box-shadow:0 10px 28px #5b1fc944;padding:4px 0;-webkit-overflow-scrolling:touch}
.nmlist div{padding:8px 14px;font-size:15px;color:#2a1a55;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nmlist div:hover,.nmlist div.on{background:#f1e6ff}
.nmlist .nmno{color:#888;cursor:default}.nmlist .nmno:hover{background:transparent}
.nmlist::-webkit-scrollbar{width:10px}.nmlist::-webkit-scrollbar-thumb{background:#c9a8ee;border-radius:8px}
/* every other dropdown: long lists scroll */
select{max-height:100%}

/* "Fill the scores" notice */
.missdlg{max-width:440px;text-align:center}
.missic{font-size:42px;line-height:1;color:#e6007e}
.missdlg h3{font-size:24px;margin:4px 0}
.misslist{max-height:40vh;overflow-y:auto;text-align:left;margin:10px 0;border:1px solid #e3d0f7;border-radius:12px;background:#faf5ff}
.misslist div{display:flex;flex-direction:column;padding:8px 14px;border-bottom:1px solid #eadcf8}.misslist div:last-child{border:0}
.misslist b{color:#3b0f8f}.misslist span{color:#c0105f;font-size:13px}
.missdlg .row.end{justify-content:center;margin-top:8px}

.nmi{text-transform:none}
.nmlist .nmadd{color:#fff;background:linear-gradient(90deg,#e6007e,#7b2cbf);font-weight:700;margin:4px;border-radius:8px}
.nmlist .nmadd:hover,.nmlist .nmadd.on{background:linear-gradient(90deg,#c70069,#5b1fc9)}
.bcn{font-size:19px;color:#3b0f8f}
.bday{display:inline-block;padding:2px 12px;border-radius:14px;background:#f1e6ff;color:#4b1a8f;font-weight:700;font-size:14px;margin:0 4px}
.rcd{margin:0 0 8px;color:#4b1a8f;font-weight:700;font-size:14px}

/* master login: light single-colour column headings */
body.mv th small{color:#6b4a99}

/* WD / WE / MX tags (Weekday / Weekend / Mixed) */
.dsx{display:inline-block;padding:1px 9px;border-radius:10px;font-size:12px;font-weight:800;letter-spacing:.3px;vertical-align:middle;margin-right:2px;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.dsx.wd{background:#e0f2ff;color:#0b4f7c}.dsx.we{background:#ffe8cc;color:#8a4b00}.dsx.mx{background:#e8f8e0;color:#2c6b13}

/* ================= RULED NOTEBOOK SCORE SHEET ================= */
.sheet{position:relative;background:#fffdf6;border:1px solid #e6dcc4;border-radius:6px 6px 14px 14px;box-shadow:0 10px 26px #5b3a8a2e,0 2px 0 #efe6cf,0 5px 0 #fffdf6,0 6px 0 #e6dcc4}
.sheet::before{content:"";display:block;height:26px;background:
  radial-gradient(circle at 50% 50%,#f3eaff 0 5px,#6a3fb0 5.5px 7px,transparent 7.5px) 0 0/26px 26px repeat-x,
  linear-gradient(#7b2cbf,#a21caf);border-radius:5px 5px 0 0}
body.mv .sheet{background:#fffdf6;border-radius:6px 6px 16px 16px;box-shadow:0 10px 26px #5b3a8a33,0 5px 0 #fffdf6,0 6px 0 #e6dcc4}
body.mv .sheet .top,.sheet .top{background:transparent;border-bottom:2px solid #f0a3ad}
.sheet .top h1{font-family:Georgia,"Times New Roman",serif;color:#4b1a8f;letter-spacing:3px}
.sheet .meta b{font-family:Georgia,serif;border-bottom:1px dashed #b9a6d8;display:inline-block;min-width:60px;padding-bottom:1px}
.sheet .meta small{color:#b0129f}
.sheet table.st{background:transparent;border:0;border-radius:0;box-shadow:none;margin:0;background-image:linear-gradient(90deg,transparent 0,transparent calc(56px - 3px),#f4a6b0 calc(56px - 3px),#f4a6b0 calc(56px - 2px),transparent calc(56px - 2px),transparent calc(56px + 1px),#f4a6b0 calc(56px + 1px),#f4a6b0 calc(56px + 2px),transparent calc(56px + 2px))}
.sheet .st th,body.mv .sheet .st th{background:transparent;color:#4b1a8f;border-bottom:2px solid #f0a3ad;font-weight:700}
.sheet .st th small,body.mv .sheet th small{color:#8a6bbd}
.sheet .st td{background:transparent!important;border-bottom:1px solid #b8d4f0;height:46px;padding:4px 8px;color:#2b2150}
.sheet .st tbody tr:hover td{background:#fff7d6!important}
.sheet .st tbody tr:last-child td{border-bottom:1px solid #b8d4f0}
.sheet .st td:first-child{color:#c0148f;font-family:Georgia,serif;border-right:0}
.sheet .st td.nm{font-family:Georgia,"Times New Roman",serif;font-size:16px}
.sheet .nmi{border:0;border-bottom:1px dotted #9b7fd0;border-radius:0;background:transparent;padding:6px 2px;font-family:Georgia,serif;font-size:16px;color:#1f1650;font-weight:600}
.sheet .nmi:focus{box-shadow:none;border-bottom:2px solid #7b2cbf;background:#fff8d8}
.sheet .sc input{border:0;border-bottom:2px solid #b980e6;border-radius:0;background:#fff8d8;font-family:Georgia,serif}
.sheet .sc .v{font-family:Georgia,serif;font-weight:700;color:#1f1650;cursor:pointer}
.sheet .st td b{font-family:Georgia,serif;color:#b0129f}
.sheet .addrow{border-top:0;background:transparent}
.sheet .pmk.on{background:#dff6e3}

/* ---- phones: the WHOLE table fits the screen (no sideways scroll) ---- */
@media(max-width:700px){
 body.mv main{padding:0 2px}
 body.mv .sheet .top{padding:8px 10px}.sheet .top img{height:44px}.sheet .top h1{font-size:18px;letter-spacing:2px}
 .sheet .tw{overflow-x:visible!important}
 body.mv .sheet table.st{table-layout:fixed;width:100%;background-image:linear-gradient(90deg,transparent 0,transparent 26px,#f4a6b0 26px,#f4a6b0 27px,transparent 27px)}
 .sheet .st th,.sheet .st td{padding:3px 1px;font-size:11px}
 .sheet .st th{font-size:7.5px;line-height:1.15;word-break:normal;overflow-wrap:anywhere;hyphens:none;letter-spacing:-.2px;padding:3px 0;font-family:"Segoe UI",Arial,sans-serif}.sheet .st th small{font-size:8.5px}
 .sheet .st td{height:44px}
 .sheet .st th:first-child,.sheet .st td:first-child{width:27px;font-size:10px}
 .sheet .st th:nth-child(3),.sheet .st td:nth-child(3){width:30px}
 .sheet .st th:nth-child(n+4):nth-last-child(n+4){width:48px}
 .sheet .st th:nth-last-child(3){width:30px}
 .sheet .st th:nth-last-child(2){width:22px}
 .sheet .st th:last-child{width:24px}
 .sheet .st td.nm{padding-left:4px;text-align:left}
 .sheet .nmi{min-width:0;width:100%;font-size:11px!important;padding:5px 0;text-overflow:ellipsis}
 .sheet .sc{min-width:0;gap:0;width:100%}.sheet .sc .v{font-size:14px;min-width:0;padding:6px 4px;display:inline-block}
 .sheet .sc .pen{display:none}
 .sheet .sc input{width:100%;max-width:40px;font-size:14px!important;padding:4px 0;border-radius:0}
 .sheet .st td .x{padding:2px 5px;font-size:12px}
 .dsx{padding:1px 5px;font-size:10px;margin:0}
 .sheet .meta{gap:6px 10px}
 .sheet .addrow{padding:10px}
}

/* ---- login page on phones: poster at the top, login box right under it ---- */
@media(max-width:900px),(max-aspect-ratio:3/2){
 .lp.bgm{background-position:center top;background-color:#faf6ff}
 .lp.bgm .lp-right{padding:calc(56.25vw + 12px) 16px 28px;justify-content:center}
 .lp.bgm .lp-card{width:min(380px,100%);padding:20px 20px 24px;gap:14px;border-radius:22px;box-shadow:0 14px 34px #5b1fc936}
 .lp.bgm .lp-card h1{font-size:26px}
 .lp.bgm .lp-fld input{font-size:16px;padding:11px 5px}
 .lp.bgm .lp-btn{font-size:18px;padding:13px}
 .lpprev .lp.bgm{background-position:left center}
}
@media(max-width:700px){body.mv .bar{padding:0 6px}body.mv .winbox,body.mv .mhint,body.mv .hint{margin-left:6px;margin-right:6px}}

/* ============ PHONE SCORE SHEET (reference design): icon info cards + grid table, fits every phone ============ */
@media(max-width:700px){
 /* header: logo + title, then Year | name | logout icon */
 body.mv header.mh{margin:6px 6px 0;padding:8px 12px;gap:6px 10px;border-radius:22px}
 .mh img{height:38px}.mh .mtitle{flex:1 1 0;font-size:clamp(13px,4.4vw,17px);white-space:nowrap}
 .mh .hr{flex:1 1 100%;justify-content:space-between;gap:6px}.mh .hitem{font-size:clamp(12px,3.6vw,14px);gap:5px}
 .mh .hr .vsep{display:block;height:20px;margin:0}
 .mh .lgo{padding:0;width:44px;height:36px;justify-content:center;border-radius:18px;flex:none}.mh .lgo .lgt{display:none}.mh .lgo .ic{margin:0}
 #msg{font-size:12px}
 body.mv .bar{margin:6px 0}.sv{font-size:12px}.bar button{padding:5px 12px;font-size:13px}
 /* notebook sheet */
 body.mv .sheet{border-radius:4px 4px 14px 14px}
 .sheet::before{height:20px;background:radial-gradient(circle at 50% 50%,#fff 0 4px,#5a2aa0 4.500px 6px,transparent 6.500px) 0 0/20px 20px repeat-x,linear-gradient(#6a2fb8,#8a1fa8)}
 body.mv .sheet .top{display:flex;flex-wrap:wrap;gap:8px;padding:10px 8px 6px;border-bottom:0}
 .sheet .top .meta{order:0;flex:1 1 100%;display:grid;grid-template-columns:repeat(4,1fr);gap:6px;font-size:12px}
 .sheet .top img{order:1;height:40px}
 .sheet .top h1{order:2;flex:1 1 0;display:flex;align-items:center;gap:8px;font-size:15px;letter-spacing:3px;margin:0;text-align:center;white-space:nowrap}
 .sheet .top h1::before,.sheet .top h1::after{content:"";flex:1;height:2px;background:linear-gradient(90deg,transparent,#7b2cbf)}.sheet .top h1::after{transform:scaleX(-1)}
 /* info cards */
 .sheet .meta>div{position:relative;background:#fff;border:1px solid #d9c2f0;border-radius:12px;padding:6px 6px 6px 8px;min-width:0;box-shadow:0 1px 0 #f0e6ff;overflow:hidden}
 .sheet .meta>div::before{content:"";position:absolute;left:7px;top:7px;width:15px;height:15px;background-size:contain;background-repeat:no-repeat}
 .sheet .meta small{font-size:10px;letter-spacing:.2px;text-transform:none;color:#7b2cbf;font-weight:600;padding-left:20px;line-height:15px}
 .sheet .meta b{font-family:Georgia,serif;font-size:12px;border:0;display:block;min-width:0;line-height:1.2;margin-top:2px;word-break:break-word}
 .sheet .meta>div:nth-child(1),.sheet .meta>div:nth-child(2){grid-column:span 2}
 .sheet .meta>div:nth-child(1)::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237b2cbf'%3E%3Cpath d='M7 2v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-2V2h-2v2H9V2H7zm-2 8h14v10H5V10zm2 2v2h2v-2H7zm4 0v2h2v-2h-2zm4 0v2h2v-2h-2z'/%3E%3C/svg%3E")}
 .sheet .meta>div:nth-child(2)::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237b2cbf'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.2 7 13 7 13s7-7.8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E")}
 .sheet .meta>div:nth-child(3)::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237b2cbf'%3E%3Cpath d='M12 3 1 9l11 6 9-4.9V17h2V9L12 3zM5 13.2V17c0 1.7 3.1 3 7 3s7-1.3 7-3v-3.8l-7 3.8-7-3.8z'/%3E%3C/svg%3E")}
 .sheet .meta>div:nth-child(4)::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237b2cbf'%3E%3Cpath d='M12 2l3 6.5 7 .8-5.2 4.8 1.4 7L12 17.600 5.800 21.100l1.400-7L2 9.300l7-.8z'/%3E%3C/svg%3E")}
 .sheet .meta>div:nth-child(5)::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237b2cbf'%3E%3Cpath d='M12 2l3 6.5 7 .8-5.2 4.8 1.4 7L12 17.600 5.800 21.100l1.400-7L2 9.300l7-.8z'/%3E%3C/svg%3E")}
 .sheet .meta>div:nth-child(6)::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237b2cbf'%3E%3Cpath d='M3 20h12v2H3v-2zM13.500 3.500l5 5-2.500 2.500-5-5 2.500-2.500zM9.500 7.500l5 5L8 19l-5-5 6.500-6.500zM17 11l1.500-1.500 3 3L20 14l-3-3z'/%3E%3C/svg%3E")}
 .sheet .meta>div:nth-child(7)::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237b2cbf'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.500 14.500L6 12l1.500-1.500 3 3 6-6L18 9l-7.500 7.500z'/%3E%3C/svg%3E")}
 .sheet .meta>div:nth-child(8)::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237b2cbf'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm4.600 12.100-1.500 1.500-3.100-3.100-3.100 3.100-1.500-1.500 3.100-3.100-3.100-3.100 1.500-1.500 3.100 3.100 3.100-3.100 1.500 1.500-3.100 3.100 3.100 3.100z'/%3E%3C/svg%3E")}
 .sheet .meta>div.pr.ab{cursor:pointer}.sheet .meta>div.pr.ab .pill{background:#ffe3ee;color:#b0124f}.sheet .meta>div.pr.ab .pill b{color:#b0124f}
 .sheet .meta>div:nth-child(3){grid-column:span 1}
 .sheet .meta>div:nth-child(3) .cpill{display:block;background:none;border:0;padding:0;margin-top:2px;white-space:normal;font-family:Georgia,serif;font-weight:700;font-size:11px;line-height:1.2;color:#2b2150;text-align:left}
 .sheet .meta>div:nth-child(4){display:flex;flex-direction:column}.sheet .meta>div:nth-child(4) .dsx{align-self:flex-start;margin-top:2px}
 .sheet .meta .dsx{margin-right:2px}
 .sheet .meta input[type=date]{border:0;background:transparent;padding:0;margin:0;font:700 12px Georgia,serif;color:#2b2150;width:100%;min-width:0;display:block;height:16px}
 .sheet .meta>div.pr{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;padding:6px 10px 6px 8px}
 .sheet .meta>div.pr small{padding-left:22px}.sheet .meta>div.pr .pill{background:#f1e6ff;color:#4b1a8f;border-radius:12px;padding:2px 14px;font-weight:700;font-size:13px}.sheet .meta>div.pr .pill b{display:inline;font-size:13px;margin:0;color:#4b1a8f}
 /* grid table */
 body.mv .sheet table.st{border-collapse:collapse;background-image:none;margin:4px 0 0}
 .sheet .st th,.sheet .st td{border:1px solid #dccdf3}
 .sheet .st th{background:#f3eaff;color:#4b1a8f;border-bottom:2px solid #c9aef0}
 .sheet .st td{height:40px;border-bottom:1px solid #c7dcf3}
 .sheet .st td:first-child{border-right:1px solid #f3b5be}
 .sheet .st tbody tr:nth-child(even) td{background:#fbf8ff!important}
 .sheet .st td.nm{font-weight:700}
 .sheet .sc input{background:#fff3c4;border:0;border-bottom:2px solid #d4a23a;border-radius:6px 6px 0 0;max-width:42px;height:26px}
 .sheet .addrow{padding:8px}.sheet .addrow .hint{display:none}
}
@media(max-width:350px){.sheet .meta small{font-size:9px}.sheet .meta b,.sheet .meta>div:nth-child(3) .cpill{font-size:10.5px}.sheet .st th:nth-child(n+4):nth-last-child(n+4){width:42px}.sheet .nmi{font-size:10px!important}}

/* ============ PHONE LOGIN (reference design): logo + title, dancers, login card, waves - all in ONE screen ============ */
.lm-top,.lm-hero{display:none}
@media(max-width:900px),(max-aspect-ratio:3/2){
 body:has(.lp.bgm:not(.pv)),body:has(.lp:not(.pv)){overflow-x:hidden}
 .lp:not(.pv){position:relative;display:flex;flex-direction:column;align-items:center;min-height:100vh;min-height:100dvh;height:auto;overflow:hidden;background:linear-gradient(#f6eeff,#fff 40%,#f3e8ff)!important;background-image:linear-gradient(#f6eeff,#fff 40%,#f3e8ff)!important}
 .lp:not(.pv)::before{content:"";display:block!important;position:absolute;left:0;right:0;top:0;bottom:auto;height:24dvh;z-index:0;pointer-events:none;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 150' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23ff1ab4' stop-opacity='.55'/%3E%3Cstop offset='.5' stop-color='%237b3fe4' stop-opacity='.25'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 0H400V30C300 10 200 60 120 100 70 125 30 135 0 130Z' fill='url(%23a)'/%3E%3C/svg%3E") top/100% 100% no-repeat;left:0}
 .lp:not(.pv)::after{content:"";display:block!important;position:absolute;left:0;right:0;bottom:0;width:auto;clip-path:none;opacity:1;height:17dvh;z-index:0;pointer-events:none;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='b' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23ff1ab4'/%3E%3Cstop offset='.5' stop-color='%23b227d8'/%3E%3Cstop offset='1' stop-color='%236a3de8'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 50C90 15 190 10 400 55V120H0Z' fill='url(%23b)'/%3E%3Cpath d='M0 85C120 45 260 50 400 90V120H0Z' fill='%23ffffff' opacity='.22'/%3E%3C/svg%3E") bottom/100% 100% no-repeat}
 .lp:not(.pv) .lp-left{display:none}
 .lp:not(.pv) .lm-top{display:flex;align-items:center;gap:10px;padding:clamp(8px,2.4dvh,18px) 16px 0;width:100%;max-width:440px;position:relative;z-index:1}
 .lm-logo{height:clamp(38px,6.6dvh,56px);width:auto;border-radius:8px;background:#fff}
 .lm-sep{width:1px;align-self:stretch;background:#b9a3e4}
 .lm-t{display:flex;flex-direction:column;line-height:1.05;font-weight:800;color:#2d1b69}
 .lm-t small{font-size:clamp(10px,2.4dvh,14px);letter-spacing:1px;color:#2d1b69}.lm-t b{font-size:clamp(17px,3.6dvh,26px);color:#e6007e;letter-spacing:.3px}.lm-t span{font-size:clamp(8.5px,1.9dvh,12px);letter-spacing:2.2px;color:#3b2a8c}
 .lp:not(.pv) .lm-hero{display:block;position:relative;z-index:1;width:min(100%,430px);height:clamp(96px,27dvh,250px);margin:clamp(2px,1dvh,8px) 0 0;flex:none}
 .lm-hero img{width:100%;height:100%;object-fit:cover;object-position:50% 28%;-webkit-mask-image:linear-gradient(90deg,transparent,#000 14%,#000 86%,transparent),linear-gradient(180deg,transparent,#000 22%,#000 90%,transparent);-webkit-mask-composite:source-in;mask-image:linear-gradient(90deg,transparent,#000 14%,#000 86%,transparent),linear-gradient(180deg,transparent,#000 22%,#000 90%,transparent);mask-composite:intersect}
 .lp:not(.pv) .lp-right,.lp.bgm:not(.pv) .lp-right{order:0;flex:1 1 auto;width:100%;display:flex;align-items:center;justify-content:center;padding:6px 16px clamp(34px,9dvh,90px);position:relative;z-index:1}
 .lp:not(.pv) .lp-card{width:min(100%,380px);padding:clamp(10px,2.4dvh,20px) 18px clamp(12px,2.8dvh,22px);gap:clamp(8px,1.9dvh,14px);border-radius:24px;background:#fff;box-shadow:0 14px 34px #5b1fc93a,0 2px 8px #0000000f}
 .lp:not(.pv) .lp-card h1{font-size:clamp(22px,4.4dvh,30px);color:#e6007e;letter-spacing:.5px;padding-bottom:clamp(6px,1.4dvh,12px);position:relative;margin:0}
 .lp:not(.pv) .lp-card h1::after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:#d9c8f3}
 .lp:not(.pv) .lp-card h1::before{content:"";position:absolute;left:50%;bottom:-1px;width:46px;height:4px;margin-left:-23px;border-radius:3px;background:#6a22b5;z-index:1}
 .lp:not(.pv) .lp-fld{background:#efe9ff;border:1.5px solid #ddd0f5;padding:3px 14px 3px 5px}
 .lp:not(.pv) .lp-ic{width:clamp(34px,5.6dvh,42px);height:clamp(34px,5.6dvh,42px);background:#f8f4ff}
 .lp:not(.pv) .lp-fld input{font-size:16px;padding:clamp(7px,1.6dvh,11px) 6px;color:#2d1b69}
 .lp:not(.pv) .lp-btn{background:linear-gradient(90deg,#e6007e,#b0129f);font-size:18px;padding:clamp(10px,1.9dvh,14px);box-shadow:0 8px 18px #e6007e44}
 .lp:not(.pv) .lp-card .err:empty{display:none}
}
@media(max-width:700px){
 .sheet .meta>div:nth-child(4){flex-direction:row;flex-wrap:wrap;align-content:flex-start;gap:2px}
 .sheet .meta>div:nth-child(4) small{flex:1 1 100%}
 .sheet .meta>div:nth-child(4) .dsx{margin-top:2px;padding:1px 4px;font-size:9px}
 .sheet .meta>div.pr{padding-top:4px;padding-bottom:4px}
 .sheet .meta>div.pr::before{top:50%;margin-top:-7px}
 .sheet .st td .x{padding:0;width:20px;height:20px;line-height:18px;font-size:11px;border-radius:50%}
 .sheet .pmk{min-width:20px;line-height:20px}
 .mh .hr .vsep{display:none}.mh .hr{justify-content:flex-start;gap:16px}.mh .lgo{margin-left:auto}
}

/* ============ v13 PHONE FIT (master): nothing may be wider than the screen ============ */
@media(max-width:700px){
 html,body{max-width:100%;overflow-x:hidden}
 body.mv main,body.mv .sheet,body.mv .sheet .top,body.mv header.mh,body.mv .bar,body.mv .card{max-width:100%;box-sizing:border-box;min-width:0}
 body.mv .sheet .top .meta{grid-template-columns:repeat(4,minmax(0,1fr))}
 body.mv .sheet .meta>div{min-width:0;box-sizing:border-box}
 body.mv .sheet .meta b,body.mv .sheet .meta small{overflow-wrap:anywhere}
 body.mv .sheet .meta>div.pr{box-sizing:border-box}
 body.mv .sheet .meta>div.pr .pill{white-space:nowrap}
 body.mv .bar{display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:space-between}
 body.mv .bar .sv{flex:1 1 auto;min-width:0}
 .mh .mtitle{overflow:hidden;text-overflow:ellipsis}
 /* score table: percentage columns, so it always shrinks to the screen */
 body.mv .sheet .tw{overflow-x:hidden!important;max-width:100%}
 body.mv .sheet table.st{table-layout:fixed!important;width:100%!important;max-width:100%}
 body.mv .sheet .st th:first-child,body.mv .sheet .st td:first-child{width:8%!important}
 body.mv .sheet .st th:nth-child(2),body.mv .sheet .st td:nth-child(2){width:23%!important}
 body.mv .sheet .st th:nth-child(3),body.mv .sheet .st td:nth-child(3){width:10%!important}
 body.mv .sheet .st th:nth-child(n+4):nth-last-child(n+4),body.mv .sheet .st td:nth-child(n+4):nth-last-child(n+4){width:auto!important}
 body.mv .sheet .st th:nth-last-child(3){width:9%!important}
 body.mv .sheet .st th:nth-last-child(2){width:8%!important}
 body.mv .sheet .st th:last-child{width:8%!important}
 body.mv .sheet .st th,body.mv .sheet .st td{overflow:hidden;box-sizing:border-box}
 body.mv .sheet .st td.nm{overflow:hidden}
 body.mv .sheet .sc input{max-width:100%;min-width:0}
 body.mv .sheet .sc .v{padding:6px 0}
 body.mv .sheet .st td .x{width:18px;height:18px;line-height:16px;padding:0;font-size:10px}
 body.mv .sheet .st th{font-size:clamp(6px,2.1vw,7.5px)}
 body.mv .sheet .dsx{padding:1px 3px;font-size:clamp(8px,2.6vw,10px)}
 body.mv .winbox,body.mv .card.winbox{box-sizing:border-box}
 body.mv .winbox .row{flex-wrap:wrap}
 body.mv .submitbtn{max-width:100%;box-sizing:border-box}
}
@media(max-width:340px){
 body.mv .sheet .top .meta{grid-template-columns:repeat(2,minmax(0,1fr))}
 body.mv .sheet .meta>div:nth-child(1),body.mv .sheet .meta>div:nth-child(2){grid-column:span 2}
 body.mv .sheet .meta>div:nth-child(3),body.mv .sheet .meta>div:nth-child(4),body.mv .sheet .meta>div:nth-child(5),body.mv .sheet .meta>div:nth-child(6){grid-column:span 1}
}

/* ============ v13 PHONE FIT (admin): tabs wrap, tables become stacked cards, nothing scrolls sideways ============ */
@media(max-width:700px){
 body:not(.mv){overflow-x:hidden}
 body:not(.mv) main{padding:8px;max-width:100%;box-sizing:border-box}
 body:not(.mv) header{flex-wrap:wrap;gap:6px 10px}body:not(.mv) header b{flex:1 1 140px;min-width:0}
 body:not(.mv) nav{display:flex;flex-wrap:wrap;overflow:visible;gap:6px}
 body:not(.mv) nav button{flex:1 1 auto;padding:7px 10px;font-size:13px;white-space:normal}
 body:not(.mv) .row{max-width:100%}body:not(.mv) .row>*{max-width:100%;min-width:0}
 body:not(.mv) .row input,body:not(.mv) .row select{flex:1 1 140px;min-width:0;width:auto}
 body:not(.mv) .card{max-width:100%;box-sizing:border-box;overflow-wrap:anywhere}
 body:not(.mv) textarea{max-width:100%;box-sizing:border-box}
 body:not(.mv) .tw{overflow-x:visible!important}
 body:not(.mv) .tw table:not(.st){display:block;width:100%!important;border:0;background:transparent;box-shadow:none}
 body:not(.mv) .tw table:not(.st) thead{display:none}
 body:not(.mv) .tw table:not(.st) tbody{display:block}
 body:not(.mv) .tw table:not(.st) tr{display:block;background:#fff;border:1px solid #e3d0f7;border-radius:12px;margin:8px 0;padding:4px 12px;box-shadow:0 1px 3px #7b2cbf1a}
 body:not(.mv) .tw table:not(.st) td,body:not(.mv) .tw table:not(.st) th{display:flex;align-items:center;justify-content:space-between;gap:12px;width:auto!important;min-width:0!important;max-width:100%;border:0;border-bottom:1px dashed #eadcf8;padding:6px 0;text-align:right!important;background:transparent!important;white-space:normal}
 body:not(.mv) .tw table:not(.st) tr>:last-child{border-bottom:0}
 body:not(.mv) .tw table:not(.st) td::before{content:attr(data-label);flex:0 0 36%;max-width:36%;text-align:left;font-size:11px;font-weight:700;color:#7b2cbf;text-transform:uppercase;letter-spacing:.3px}
 body:not(.mv) .tw table:not(.st) td[data-label=""]::before{display:none}
 body:not(.mv) .tw table:not(.st) td .cv{flex:1 1 auto;min-width:0;overflow-wrap:anywhere;text-align:right}
 body:not(.mv) .tw table:not(.st) td.nw .cv{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
 body:not(.mv) .tw table:not(.st) tr:has(th[colspan]){background:#f3e8ff}
 body:not(.mv) .tw table:not(.st) th[colspan]{display:block;text-align:left!important}
 body:not(.mv) .tw table:not(.st) td[colspan]{display:block;text-align:center!important}
 body:not(.mv) .pager{flex-wrap:wrap;gap:8px;justify-content:center}
 body:not(.mv) .tiles .wchip{min-width:0;flex:1 1 140px}
 body:not(.mv) .chgrid{grid-template-columns:minmax(0,1fr)}
 body:not(.mv) .bchart .brow{grid-template-columns:minmax(0,1fr)}
 body:not(.mv) .yrbar{flex-wrap:wrap}
 /* admin score sheet (view / edit) keeps its table, but fitted to the width */
 body:not(.mv) .sheet table.st{table-layout:fixed!important;width:100%!important}
 body:not(.mv) .sheet .st th,body:not(.mv) .sheet .st td{padding:3px 1px;font-size:11px;overflow:hidden;box-sizing:border-box}
 body:not(.mv) .sheet .st th{font-size:8px}
 body:not(.mv) .sheet .st th:first-child,body:not(.mv) .sheet .st td:first-child{width:8%!important}
 body:not(.mv) .sheet .st th:nth-child(2),body:not(.mv) .sheet .st td:nth-child(2){width:24%!important}
 body:not(.mv) .sheet .st th:nth-child(3),body:not(.mv) .sheet .st td:nth-child(3){width:10%!important}
 body:not(.mv) .sheet .sc{min-width:0;width:100%;gap:0}body:not(.mv) .sheet .sc input{max-width:100%;min-width:0}body:not(.mv) .sheet .nmi{min-width:0;width:100%}
 body:not(.mv) .sheet .meta{grid-template-columns:repeat(2,minmax(0,1fr))}
 body:not(.mv) .sheet .top{flex-wrap:wrap}
 body:not(.mv) .dlg{max-width:94vw;box-sizing:border-box}
}
@media(max-width:700px){
 body:not(.mv) .row label{display:flex;flex-direction:column;flex:1 1 110px;min-width:0;max-width:100%}
 body:not(.mv) .row label input,body:not(.mv) .row label select{width:100%;max-width:100%;box-sizing:border-box}
 body:not(.mv) .row input,body:not(.mv) .row select,body:not(.mv) .row textarea{box-sizing:border-box}
 body:not(.mv) .ccard .row>button{flex:1 1 100%}
 body:not(.mv) .lpgrid,body:not(.mv) .lpgrid>*{grid-template-columns:minmax(0,1fr);min-width:0;max-width:100%}
 body:not(.mv) .lpgrid input,body:not(.mv) .lpgrid select,body:not(.mv) .lpgrid textarea{max-width:100%;box-sizing:border-box;min-width:0}
 body:not(.mv) .lpgrid .row{flex-wrap:wrap}
 body:not(.mv) .lpimg{max-width:100%;overflow:hidden}
 body:not(.mv) .lpimg *{max-width:100%;min-width:0}
}
@media(max-width:700px){
 body:not(.mv) .row label>input,body:not(.mv) .row label>select,body:not(.mv) .row label>textarea{flex:none}
 body:not(.mv) .sheet .meta .cpill{white-space:normal;max-width:100%;overflow-wrap:anywhere;display:block}
 body:not(.mv) .sheet .meta b{overflow-wrap:anywhere}
 body:not(.mv) .winbox select{height:auto}
}

/* Days dropdown for students typed on the score sheet */
.daysel{font:800 12px inherit;font-family:inherit;border:1px solid #d9c3e8;border-radius:10px;padding:2px 4px;background:#fff;cursor:pointer;max-width:100%}
.daysel.wd{background:#e0f2ff;color:#0b4f7c}.daysel.we{background:#ffe8cc;color:#8a4b00}.daysel.mx{background:#e8f8e0;color:#2c6b13}
@media print{.daysel{appearance:none;-webkit-appearance:none;border:0;padding:0}}
@media (max-width:600px){.daysel{font-size:10px;padding:1px 0}}

/* names wrap (several lines) instead of being cut with ... */
textarea.nmi{resize:none;overflow:hidden;white-space:normal;word-break:break-word;line-height:1.2;display:block;font-family:inherit;box-sizing:border-box}
.sheet textarea.nmi{font-family:Georgia,serif}
.daysel{appearance:none;-webkit-appearance:none;text-align:center;text-align-last:center;padding:2px 14px 2px 6px;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 8px) 55%,calc(100% - 4px) 55%;background-size:4px 4px,4px 4px;background-repeat:no-repeat}
@media (max-width:700px){
 body.mv .sheet .st td.nm,body:not(.mv) .sheet .st td.nm{padding:2px 3px!important;vertical-align:middle}
 body.mv .sheet .st th:nth-child(2),body.mv .sheet .st td:nth-child(2),body:not(.mv) .sheet .st th:nth-child(2),body:not(.mv) .sheet .st td:nth-child(2){width:27%!important}
 body.mv .sheet .st th:nth-child(3),body.mv .sheet .st td:nth-child(3),body:not(.mv) .sheet .st th:nth-child(3),body:not(.mv) .sheet .st td:nth-child(3){width:11%!important}
 .sheet textarea.nmi{font-size:10px!important;line-height:1.2;padding:2px 0!important;min-width:0;width:100%;text-overflow:clip}
 .sheet .st td .daysel{width:100%;font-size:9px;padding:1px 8px 1px 1px;background-position:calc(100% - 5px) 55%,calc(100% - 2px) 55%;background-size:3px 3px,3px 3px}
 .sheet .st td.nm{overflow:visible!important}
 body.mv .sheet .st td{height:auto!important;min-height:44px}
}

/* clean sans-serif look for the score sheet table: name on the first line, register number below */
.sheet .st,.sheet .st *,.sheet .meta b,.sheet .meta input,.sheet .meta .cpill{font-family:"Segoe UI",system-ui,-apple-system,Roboto,"Helvetica Neue",Arial,sans-serif!important;font-variant-numeric:lining-nums}
.sheet textarea.nmi{font-weight:600;color:#241a4d;letter-spacing:0;word-break:normal;overflow-wrap:anywhere}
.sheet .st td:first-child{font-weight:600}
@media (max-width:700px){
 .sheet textarea.nmi{font-size:9.5px!important;line-height:1.3!important;font-weight:600}
 body.mv .sheet .st th:nth-child(2),body.mv .sheet .st td:nth-child(2),body:not(.mv) .sheet .st th:nth-child(2),body:not(.mv) .sheet .st td:nth-child(2){width:31%!important}
 body.mv .sheet .st th:first-child,body.mv .sheet .st td:first-child,body:not(.mv) .sheet .st th:first-child,body:not(.mv) .sheet .st td:first-child{width:7%!important}
 body.mv .sheet .st th:nth-child(3),body.mv .sheet .st td:nth-child(3),body:not(.mv) .sheet .st th:nth-child(3),body:not(.mv) .sheet .st td:nth-child(3){width:10%!important}
 body.mv .sheet .st th:nth-last-child(3),body:not(.mv) .sheet .st th:nth-last-child(3){width:8%!important}
 body.mv .sheet .st th:nth-last-child(2),body:not(.mv) .sheet .st th:nth-last-child(2){width:7%!important}
 body.mv .sheet .st th:last-child,body:not(.mv) .sheet .st th:last-child{width:7%!important}
}

.stl{padding:2px 0;border-bottom:1px dashed #e5d9f2;font-size:13.5px}.stl:last-child{border-bottom:0}.scode{display:inline-block;min-width:92px;color:#5b1f9e;font-size:12.5px;letter-spacing:.2px}
.sd td.wide{max-height:none}

button.rst{background:#d60023;color:#fff;border-color:#d60023;font-weight:700;margin-left:auto}button.rst:hover{background:#a8001b}

button.rst:disabled{opacity:.45;cursor:not-allowed}
