/* The schools portal. The website's colours and font, light and dark, laid out for a laptop and still fine on a phone. */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 200 800; font-display: swap; src: url(../assets/fonts/bricolage-latin.woff2) format("woff2"); }
:root { --bg: #FFF6E9; --fg: #1B0F0B; --muted: #5B4A42; --card: #FFFFFF; --line: rgba(27, 15, 11, .14); --soft: rgba(27, 15, 11, .06);
  --teal: #0E8C80; --teal-bg: #13B5A6; --amber: #B7791F; --red: #B83A1A; --sun: #FFD23F; --violet: #6C4FD1; --c: #13B5A6;
  --font: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif; color-scheme: light; }
@media (prefers-color-scheme: dark) { :root { --bg: #120C26; --fg: #FFF6E9; --muted: #CFC4F5; --card: #1D1540; --line: rgba(255, 246, 233, .16); --soft: rgba(255, 246, 233, .07);
  --teal: #4FD6C8; --amber: #F2B84B; --red: #FF9A80; --violet: #B3A2FF; color-scheme: dark; } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 500 16px/1.5 var(--font); }
body.printing > *:not(.print-only) { }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--teal-bg); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.015em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.03em; }
h2 { font-size: 21px; margin-bottom: 10px; }
h2.gap { margin-top: 22px; }
h3 { font-size: 16px; margin: 16px 0 6px; }
p { margin: 0 0 10px; }
ul, ol { margin: 0; padding: 0; }
.dim { color: var(--muted); }
.fine { color: var(--muted); font-size: 14px; margin-top: 10px; }
.boot { padding: 40px 20px; text-align: center; color: var(--muted); }
.err { color: var(--red); font-weight: 700; margin: 10px 0; }
.ic { display: inline-flex; vertical-align: -3px; }
.ic svg { display: block; }

/* the frame */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px max(20px, env(safe-area-inset-left)) 14px; max-width: 1160px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.brand .on-dark { display: none; }
@media (prefers-color-scheme: dark) { .brand .on-dark { display: block; } .brand .on-light { display: none; } }
.tag { font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--sun); color: #1B0F0B; }
.acct { display: flex; align-items: center; gap: 14px; font-size: 15px; min-width: 0; }
.acct .me { color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
main { max-width: 1160px; margin: 0 auto; padding: 8px max(20px, env(safe-area-inset-left)) 56px; outline: 0; }
.foot { max-width: 1160px; margin: 0 auto; padding: 18px max(20px, env(safe-area-inset-left)) 40px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; color: var(--muted); }
.foot a { font-weight: 700; }
.page > .head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 18px 0 22px; }
.lead { color: var(--muted); font-weight: 600; margin-top: 8px; max-width: 60ch; }

/* buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 2px solid var(--fg); border-radius: 999px; background: var(--fg); color: var(--bg); font: 800 15px var(--font); text-decoration: none; cursor: pointer; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--fg); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.danger { color: #1B0F0B; } }
.btn.big { min-height: 52px; font-size: 17px; width: 100%; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.link { background: none; border: 0; padding: 4px 0; font: 700 15px var(--font); color: var(--fg); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.link.bad { color: var(--red); }
.link:disabled { color: var(--muted); text-decoration: none; cursor: default; }
label { display: block; font-weight: 700; font-size: 14px; margin: 14px 0 5px; }
input, select, textarea { width: 100%; font: 600 16px var(--font); color: var(--fg); background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 44px; }
input:focus, select:focus, textarea:focus { border-color: var(--teal-bg); outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal-bg) 30%, transparent); }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--teal); flex: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 15px; margin-top: 18px; }
.check input { margin-top: 2px; }
.codein { font-size: 28px; letter-spacing: .3em; text-align: center; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
form .btn.big { margin-top: 18px; }

/* cards and layout */
.card { background: var(--card); border: 2px solid var(--fg); border-radius: 18px; box-shadow: 0 4px 0 var(--fg); padding: 20px; margin-bottom: 20px; }
.card.narrow { max-width: 460px; margin: 40px auto; }
.card.danger { border-color: var(--red); box-shadow: 0 4px 0 var(--red); }
.plain { margin: 26px 0; max-width: 70ch; }
.plain li { margin: 4px 0 4px 20px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid2.even { grid-template-columns: 1fr 1fr; }
.stack { display: grid; gap: 16px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.cols .side { position: sticky; top: 12px; }
.head.small { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 4px 0 16px; }
.head.small h2 { margin: 4px 0 4px; font-size: 26px; }
.crumb { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; color: var(--muted); text-decoration: none; }
.crumb:hover { text-decoration: underline; }
.empty { text-align: center; padding: 44px 20px; border: 2px dashed var(--line); border-radius: 18px; color: var(--muted); }
.empty h2 { color: var(--fg); margin-top: 8px; }
.empty p { max-width: 46ch; margin: 0 auto 14px; }
.empty.small { padding: 24px 16px; }
.empty .btn { margin-top: 4px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; margin: 0 0 16px; border: 2px solid var(--line); background: var(--card); }
.notice.warn { border-color: var(--amber); }
.notice p { margin: 4px 0 0; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--soft); margin: 18px 0 4px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); font: 800 14px var(--font); padding: 9px 12px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--fg); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.seg.small { margin: 8px 0; }

/* school cards on the home page */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.school-card { display: block; text-decoration: none; background: var(--card); border: 2px solid var(--fg); border-radius: 20px; box-shadow: 0 5px 0 var(--c); padding: 18px; }
.school-card:hover { transform: translateY(-2px); }
.sc-top { display: flex; gap: 14px; align-items: center; }
.sc-top h2 { margin: 0; font-size: 20px; }
.sc-top p { margin: 2px 0 0; font-size: 14px; }
.sc-code { margin: 16px 0 8px; display: flex; align-items: baseline; gap: 10px; }
.sc-code small { color: var(--muted); font-weight: 700; }
.sc-code b { font-size: 24px; letter-spacing: .12em; }
.sc-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); font-weight: 700; }
.hot { color: var(--red); }
.go { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 8px; font-weight: 800; font-size: 14px; color: var(--muted); }
.paused { display: flex; gap: 6px; align-items: center; color: var(--amber); font-weight: 800; font-size: 14px; margin: 10px 0 0; }

/* a school's head and tabs */
.school-head { margin: 14px 0 10px; }
.sh-row { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 0; align-items: center; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 14px 0 20px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 11px 14px; font-weight: 800; font-size: 15px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a:hover { color: var(--fg); }
.tabs a.on { color: var(--fg); border-bottom-color: var(--c); }
.dot { font-style: normal; display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 800; }
@media (prefers-color-scheme: dark) { .dot { color: #1B0F0B; } }
.logo { display: inline-grid; place-items: center; flex: none; border-radius: 22%; background: color-mix(in srgb, var(--c) 20%, #fff); color: #1B0F0B; font-weight: 800; overflow: hidden; }
.logo.img { background: #fff; }
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.who { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--c); color: #1B0F0B; font-weight: 800; }

/* overview */
.code-card small { display: block; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.codebox { display: flex; gap: 8px; align-items: center; margin: 10px 0 4px; }
.codebox span { width: 52px; height: 64px; display: grid; place-items: center; background: var(--soft); border: 2px solid var(--fg); border-radius: 14px; font-size: 32px; font-weight: 800; }
.codebox i { width: 12px; height: 4px; border-radius: 2px; background: var(--fg); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile { display: grid; gap: 2px; justify-items: start; padding: 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); text-decoration: none; }
.tile:hover { border-color: var(--fg); }
.tile b { font-size: 30px; line-height: 1; margin-top: 8px; }
.tile span { font-weight: 700; color: var(--muted); font-size: 14px; }
.tile em { font-style: normal; font-weight: 800; font-size: 13px; color: var(--red); }
.tic { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--soft); color: var(--violet); flex: none; }
.tic.teal { color: var(--teal); background: color-mix(in srgb, var(--teal-bg) 18%, transparent); }
.tic.amber { color: var(--amber); background: color-mix(in srgb, var(--amber) 18%, transparent); }
.tic.grey { color: var(--muted); }
.rows { list-style: none; }
.rows li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.rows .link { margin-left: auto; }
.kind { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--teal-bg) 20%, transparent); color: var(--teal); }
.kind.exam { background: color-mix(in srgb, var(--amber) 22%, transparent); color: var(--amber); }

/* people and tables */
.people { list-style: none; }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.people li:first-child { border-top: 0; }
.pn { display: grid; flex: 1; min-width: 140px; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.acts { text-align: right; white-space: nowrap; }
td.acts .link + .link { margin-left: 14px; }
.cell-who { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.cell-bar { display: inline-flex; align-items: center; gap: 10px; }
.cell-bar b { min-width: 3.2ch; }
.pass { font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--teal-bg) 20%, transparent); color: var(--teal); }
.bar { position: relative; display: inline-block; width: 120px; height: 10px; border-radius: 6px; background: var(--soft); vertical-align: middle; }
.bar i { display: block; height: 100%; border-radius: 6px; background: var(--amber); }
.bar i.ok { background: var(--teal-bg); }
.bar s { position: absolute; top: -3px; width: 3px; height: 16px; background: var(--fg); border-radius: 2px; transform: translateX(-1px); }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; }
.ring-track { stroke: var(--soft); }
.ring-arc { stroke: var(--amber); }
.ring-arc.ok { stroke: var(--teal-bg); }
.ring b { position: relative; }

/* sets */
.setlist { list-style: none; display: grid; gap: 10px; }
.set { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border: 2px solid var(--line); border-radius: 16px; text-decoration: none; }
.set:hover { border-color: var(--fg); }
.sn { display: grid; flex: 1; min-width: 0; }
.sn b { font-size: 17px; }
.rs { display: grid; gap: 2px; justify-items: end; font-size: 14px; font-weight: 700; }
.live, .off { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.live { background: color-mix(in srgb, var(--teal-bg) 20%, transparent); color: var(--teal); }
.live.exam { background: color-mix(in srgb, var(--amber) 22%, transparent); color: var(--amber); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.off { background: var(--soft); color: var(--muted); }
.status p { margin: 8px 0 0; }
.editor { min-width: 0; }
.bignum { font-size: 28px; font-weight: 800; margin: 0; line-height: 44px; }
.ownq { display: flex; gap: 14px; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.oq { min-width: 0; }
.oq ol { margin: 6px 0 4px 22px; }
.oq li.right { font-weight: 800; color: var(--teal); }
.tick { display: inline-flex; gap: 3px; align-items: center; margin-left: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.oacts { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex: none; }
.qform { padding: 14px; border: 2px solid var(--teal-bg); border-radius: 14px; margin: 10px 0; display: grid; gap: 8px; background: var(--soft); }
.optrow { display: flex; gap: 10px; align-items: center; }
.search { margin: 10px 0 6px; }
.chapter { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 6px; }
.lesson { border-top: 1px solid var(--line); }
.lesson summary { display: flex; gap: 12px; align-items: center; padding: 10px 2px; cursor: pointer; list-style: none; }
.lesson summary::-webkit-details-marker { display: none; }
.lesson .lt { flex: 1; font-weight: 700; }
.bq { list-style: none; padding: 0 0 10px 34px; }
.bq label { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin: 6px 0; font-size: 15px; }
.pic { color: var(--muted); font-style: normal; font-size: 13px; }
.savebar { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; position: sticky; bottom: 0; padding: 14px 0; background: var(--bg); border-top: 1px solid var(--line); }
.savebar .btn { width: auto; margin: 0; }

/* the import box, dialogs, toasts */
dialog.box { border: 2px solid var(--fg); border-radius: 20px; background: var(--card); color: var(--fg); padding: 22px; width: min(480px, calc(100vw - 32px)); box-shadow: 0 6px 0 var(--fg); }
dialog.box.wide { width: min(720px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(18, 12, 38, .55); }
.box-body { margin: 6px 0 16px; }
.box-btns { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.import textarea { margin-top: 12px; font-size: 14px; min-height: 150px; }
.import input[type=file] { padding: 8px; font-size: 14px; }
.imp { list-style: none; max-height: 220px; overflow: auto; margin-top: 8px; }
.imp li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.imp li .ic { color: var(--teal); margin-top: 2px; }
.imp li.bad .ic, .imp li em { color: var(--red); font-style: normal; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--fg); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 800; max-width: min(92vw, 560px); transition: opacity .2s, transform .2s; z-index: 50; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--red); color: #fff; }

/* results */
.summary { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; }
.summary .card { margin-bottom: 20px; }
.sum { display: flex; gap: 18px; align-items: center; }
.sum small { font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); }
.sum p { margin: 4px 0 0; }
.sum2 { display: grid; align-content: center; justify-items: start; }
.sum2 b { font-size: 34px; line-height: 1.1; }
.sum2 span { color: var(--muted); font-weight: 700; }
.hard { list-style: none; }
.hard li { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.hard li:first-child { border-top: 0; }
.hn { display: grid; justify-items: center; min-width: 64px; font-weight: 800; font-size: 18px; color: var(--red); }
.hn small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* school look */
.drop { display: flex; gap: 16px; align-items: center; padding: 16px; border: 2px dashed var(--line); border-radius: 16px; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--teal-bg); background: var(--soft); }
.drop p { margin: 2px 0 0; font-size: 14px; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.sw { width: 100%; aspect-ratio: 1; border-radius: 14px; border: 3px solid transparent; background: var(--sw); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.sw.on { border-color: var(--fg); box-shadow: 0 0 0 2px var(--card) inset; }
.sw.mini { display: inline-block; width: 18px; height: 18px; border-radius: 6px; cursor: default; aspect-ratio: auto; }
.match { margin-top: 12px; }
.match .btn { gap: 10px; }
.preview { border-radius: 20px; overflow: hidden; border: 2px solid var(--line); background: #FFF6E9; color: #1B0F0B; max-width: 360px; }
.p-hero { display: flex; gap: 12px; align-items: center; padding: 18px 16px; background: color-mix(in srgb, var(--c) 24%, #1B0F0B); color: #fff; }
.p-hero b { display: block; font-size: 18px; }
.p-hero span { font-size: 13px; opacity: .9; }
.p-task { margin: 14px; display: flex; gap: 12px; align-items: center; padding: 12px; background: #fff; color: #1B0F0B; border-radius: 16px; border: 2px solid rgba(27, 15, 11, .12); }
.p-task .tic { background: color-mix(in srgb, var(--c) 18%, #fff); color: color-mix(in srgb, var(--c) 34%, #1B0F0B); }
.p-task div { flex: 1; display: grid; }
.p-task small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #5B4A42; font-weight: 800; }
.p-play { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--c) 34%, #1B0F0B); color: #fff; }

/* a table row becomes a card on a phone, so nothing scrolls sideways */
@media (max-width: 860px) {
  .grid2, .grid2.even, .cols, .summary { grid-template-columns: 1fr; }
  .cols .side { position: static; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .two { grid-template-columns: 1fr; }
  .tablewrap { overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; left: -9999px; }
  tr { border: 1.5px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 6px 4px; }
  td { border: 0; padding: 5px 10px; }
  td::before { content: attr(data-label); display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
  td.acts { text-align: left; }
  td.acts::before { content: none; }
  .codebox span { width: 40px; height: 52px; font-size: 26px; }
  .swatches { grid-template-columns: repeat(4, 1fr); }
  .acct .me { display: none; }
  .tiles { grid-template-columns: 1fr; }
  .set { flex-wrap: wrap; }
  .rs { justify-items: start; }
}

/* printing the class code: only its card, large */
@media print {
  body > * { visibility: hidden; }
  body.printing .code-card, body.printing .code-card * { visibility: visible; }
  body.printing .code-card { position: fixed; inset: 20mm; border: 0; box-shadow: none; text-align: center; background: #fff; color: #000; }
  body.printing .code-card .btns, body.printing .code-card .fine { display: none; }
  body.printing .codebox { justify-content: center; }
  body.printing .codebox span { width: 28mm; height: 36mm; font-size: 24mm; border-color: #000; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .btn:hover, .school-card:hover { transform: none; } }

/* asking to be set up */
.card.narrow.wide { max-width: 560px; }
.apply-note { margin-top: 22px; padding: 16px; border-radius: 14px; background: var(--soft); }
.apply-note p { margin: 4px 0 12px; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.big-tick { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: color-mix(in srgb, var(--teal-bg) 22%, transparent); color: var(--teal); margin-bottom: 8px; }

/* ---- the redesign: numbers and chips first ---- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 800; padding: 3px 11px; border-radius: 999px; background: var(--soft); color: var(--fg); white-space: nowrap; }
.chip .ic { margin: 0; }
.chip.teal { background: color-mix(in srgb, var(--teal-bg) 20%, transparent); color: var(--teal); }
.chip.amber { background: color-mix(in srgb, var(--amber) 22%, transparent); color: var(--amber); }
.chip.red { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.chip.violet { background: color-mix(in srgb, var(--violet) 18%, transparent); color: var(--violet); }
.chip.grey { color: var(--muted); }

.school-head { margin: 14px 0 6px; padding: 18px 20px; border-radius: 22px; color: #fff; background: var(--c); }
.school-head .crumb { color: rgba(255, 255, 255, .85); }
.school-head h1 { color: #fff; }
.school-head .chip { background: rgba(255, 255, 255, .2); color: #fff; }
.school-head .logo { box-shadow: 0 0 0 3px rgba(255, 255, 255, .85); }
.sh-row { display: flex; align-items: center; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.sh-t { flex: 1; min-width: 200px; }
.codepill { display: inline-flex; align-items: center; gap: 10px; border: 2px solid rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .14); color: #fff; border-radius: 16px; padding: 8px 14px; cursor: pointer; font: inherit; }
.codepill small { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.codepill b { font-size: 22px; letter-spacing: .14em; }
.codepill.big { background: var(--card); color: var(--fg); border-color: var(--fg); margin-top: 6px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.stat { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "ic n" "ic l" "note note"; column-gap: 12px; align-items: center; padding: 16px; border-radius: 18px; background: var(--card); border: 2px solid var(--line); text-decoration: none; }
a.stat:hover { border-color: var(--fg); }
.stat .tic { grid-area: ic; width: 48px; height: 48px; border-radius: 14px; }
.stat b { grid-area: n; font-size: 34px; line-height: 1; align-self: end; }
.stat .sl { grid-area: l; font-weight: 800; color: var(--muted); font-size: 14px; }
.stat em { grid-area: note; font-style: normal; font-weight: 800; font-size: 13px; margin-top: 8px; }
.stat.red { border-color: var(--red); }
.stat.red b, .stat em.red { color: var(--red); }
.tic.red { color: var(--red); background: color-mix(in srgb, var(--red) 16%, transparent); }
.stat.teal b { color: var(--teal); }

.sec { margin: 22px 0 10px; font-size: 20px; }
.sechead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.sechead h2 { margin: 0; }
.sechead .search { max-width: 240px; margin: 0; }

.attn { border-color: var(--amber); box-shadow: 0 4px 0 var(--amber); }
.alist { list-style: none; display: grid; gap: 8px; }
.alist li { display: flex; align-items: center; gap: 12px; }
.alist .at { flex: 1; font-weight: 700; min-width: 0; }

.ucards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.ucard { display: grid; gap: 12px; padding: 16px; border-radius: 20px; background: var(--card); border: 2px solid var(--line); border-top: 6px solid var(--teal-bg); text-decoration: none; }
.ucard.exam { border-top-color: var(--amber); }
.ucard:hover { border-color: var(--fg); }
.uc-top { display: flex; gap: 6px; flex-wrap: wrap; }
.uc-t { font-size: 18px; line-height: 1.2; }
.uc-mid { display: flex; gap: 14px; align-items: center; }
.uc-n { display: grid; gap: 6px; min-width: 0; }
.meter { display: inline-flex; align-items: center; gap: 10px; }
.mbar { width: 90px; height: 8px; border-radius: 5px; background: var(--soft); overflow: hidden; }
.mbar i { display: block; height: 100%; background: var(--teal-bg); border-radius: 5px; }
.meter b { font-size: 14px; white-space: nowrap; }

.invite { display: grid; gap: 4px; }
.invite h2 { margin-bottom: 4px; }
.settings { margin: 6px 0 0; }
.settings summary { cursor: pointer; display: inline-flex; gap: 8px; align-items: center; font-weight: 800; color: var(--muted); padding: 8px 0; }
.settings .danger { margin-top: 8px; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--red); }
.settings .danger p { margin: 0 0 10px; }

.wcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.wcard { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 16px; border-radius: 18px; background: var(--soft); }
.wcard .btns { margin-top: 4px; justify-content: center; }
.iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 2px solid var(--line); background: transparent; color: var(--fg); cursor: pointer; }
.iconbtn:hover { border-color: var(--fg); }
.iconbtn.bad { color: var(--red); }
td.acts { display: flex; gap: 8px; justify-content: flex-end; }

.scards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.scard { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 20px; background: var(--card); border: 2px solid var(--line); text-decoration: none; }
.scard.is-live { border-top: 6px solid var(--teal-bg); }
.scard.is-exam { border-top: 6px solid var(--amber); }
.scard:hover { border-color: var(--fg); }
.scard .tic { width: 48px; height: 48px; border-radius: 14px; }
.sc-t { font-size: 18px; line-height: 1.2; }
.scard .go { justify-content: flex-start; margin: 4px 0 0; }

.srows { list-style: none; }
.srows li { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(190px, 1.4fr) auto auto 1fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.srows li:first-child { border-top: 0; }
.srows .dim { text-align: right; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--soft); font-weight: 700; font-size: 14px; }
.hard li { gap: 14px; }
.hq { flex: 1; display: grid; gap: 6px; font-weight: 700; min-width: 0; }
.mini { display: block; height: 6px; border-radius: 4px; background: var(--soft); overflow: hidden; max-width: 260px; }
.mini i { display: block; height: 100%; background: var(--red); }
.hn b { font-size: 20px; }
.bigline { margin: 6px 0 0; font-size: 18px; }
.bigline b { font-size: 26px; }
.sum2 { align-content: center; gap: 6px; }
.sum2 .tic { margin-bottom: 4px; }

.empty { border: 0; padding: 26px 16px; }
.empty .bubble { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--soft); color: var(--muted); }
.empty .eline { margin: 12px auto 14px; font-weight: 700; max-width: 36ch; }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .srows li { grid-template-columns: 1fr auto; }
  .srows li .cell-bar { grid-column: 1 / -1; }
  .srows .dim { text-align: left; grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .stat { padding: 12px; }
  .stat b { font-size: 28px; }
  .stat .tic { width: 40px; height: 40px; }
  .stats.three { grid-template-columns: 1fr 1fr 1fr; }
  .stats.three .stat { grid-template-columns: 1fr; grid-template-areas: "ic" "n" "l"; justify-items: start; row-gap: 4px; }
  .school-head { padding: 14px; border-radius: 18px; }
  .codepill { width: 100%; justify-content: space-between; }
  .ucards, .scards { grid-template-columns: 1fr; }
  td.acts { justify-content: flex-start; }
}

/* the class on a phone: one compact card per student (name, last result, goes), no labels */
@media (max-width: 640px) {
  .tablewrap tr { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 12px; }
  .tablewrap tr td::before { content: none; }
  .tablewrap td { padding: 0; }
  .tablewrap td:nth-child(1) { grid-column: 1; }
  .tablewrap td:nth-child(2) { grid-column: 1; }
  .tablewrap td:nth-child(3) { grid-column: 2; grid-row: 2; justify-self: end; }
  .tablewrap td:nth-child(4) { display: none; }
  .tablewrap td.acts { grid-column: 2; grid-row: 1; justify-self: end; }
  .wcard { grid-template-columns: auto 1fr; justify-items: start; text-align: left; column-gap: 12px; }
  .wcard .person, .wcard .who { grid-row: 1 / 3; }
  .wcard .btns { grid-column: 1 / -1; justify-content: stretch; }
  .wcard .btns .btn { flex: 1; }
}
