@font-face{font-family:"Plus Jakarta Sans";font-style:normal;font-weight:400;font-display:swap;src:url("fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2")}
@font-face{font-family:"Plus Jakarta Sans";font-style:normal;font-weight:500;font-display:swap;src:url("fonts/plus-jakarta-sans-latin-500-normal.woff2") format("woff2")}
@font-face{font-family:"Plus Jakarta Sans";font-style:normal;font-weight:600;font-display:swap;src:url("fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2")}
@font-face{font-family:"Plus Jakarta Sans";font-style:normal;font-weight:700;font-display:swap;src:url("fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2")}
@font-face{font-family:"Plus Jakarta Sans";font-style:normal;font-weight:800;font-display:swap;src:url("fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2")}
:root {
  --bg: #0f1311;
  --surface: #171c19;
  --raised: #1f2622;
  --line: #2b332e;
  --text: #eef2ef;
  --muted: #98a39c;
  --faint: #6b766f;
  --green: #34c27a;
  --green-deep: #1f7a4c;
  --green-soft: rgba(52, 194, 122, 0.12);
  --amber: #e4a845;
  --amber-soft: rgba(228, 168, 69, 0.13);
  --red: #e5664f;
  --red-soft: rgba(229, 102, 79, 0.13);
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Plus Jakarta Sans", "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --sidebar: 252px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; }
h1 { font-size: 26px; letter-spacing: -0.01em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column;
  padding: 22px 16px;
  overflow-y: auto; overscroll-behavior: contain; /* long menus scroll inside the sidebar, so its background reaches the bottom */
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--green); color: #07130c;
  display: grid; place-items: center;
}
.brand-mark svg { width: 20px; height: 20px; }
.school-chip { margin: 18px 0 22px; padding: 12px; border-radius: var(--radius); background: var(--raised); }
.school-chip strong { display: block; font-size: 14px; }
.school-chip span { font-size: 12.5px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap;
  border: 0; background: none; text-align: left; width: 100%;
}
.nav-item svg { width: 19px; height: 19px; flex: none; }
.nav-item:hover { background: var(--raised); color: var(--text); }
.nav-item.active { background: var(--green-soft); color: var(--green); }
.nav-badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px; background: var(--amber); color: #1b1203;
  font-size: 13px; font-weight: 700; display: grid; place-items: center;
}
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 16px; }
.user-row { display: flex; align-items: center; gap: 10px; }
.user-row .who { min-width: 0; }
.user-row .who strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-row .who span { font-size: 13.5px; color: var(--muted); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--raised); border: 1px solid var(--line);
  display: grid; place-items: center; font-weight: 600; font-size: 14px; color: var(--green);
}
.link-btn { background: none; border: 0; color: var(--muted); padding: 8px 0 0; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.link-btn:hover { color: var(--text); }
.link-btn svg { width: 15px; height: 15px; }

.main { min-width: 0; }
.page { max-width: 1120px; margin: 0 auto; padding: 32px 36px 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 6px; }

.topbar, .tabbar { display: none; }

/* ---------- Building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.page > .card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--raised); color: var(--text); font-weight: 600; font-size: 14.5px;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #3b463f; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--green); border-color: var(--green); color: #06140c; }
.btn-primary:hover { background: #3fd087; border-color: #3fd087; }
.btn-danger { background: var(--red-soft); border-color: transparent; color: var(--red); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 12px; font-size: 14px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-gray { background: var(--raised); color: var(--muted); }

.chip {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; font-size: 14px; font-weight: 500; color: var(--muted);
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--green-soft); border-color: transparent; color: var(--green); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line); outline: none;
}
.input:focus { border-color: var(--green); }
.input-money { position: relative; }
.input-money span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-money .input { padding-left: 28px; }
.hint { font-size: 13.5px; color: var(--faint); }
.error-text { font-size: 14px; color: var(--red); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.stat .label { font-size: 14px; color: var(--muted); }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -0.01em; }
.stat .sub { font-size: 13.5px; color: var(--faint); margin-top: 2px; }
.stat.accent { background: linear-gradient(160deg, #18342a 0%, var(--surface) 70%); border-color: #24503a; }
.stat.accent .value { color: var(--green); }

/* The fee bar: paid (green), awaiting confirmation (amber), installment markers */
.feebar { position: relative; height: 12px; border-radius: 6px; background: var(--raised); display: flex; overflow: hidden; }
.feebar.lg { height: 16px; border-radius: 8px; }
.fb-paid { background: var(--green); height: 100%; transition: width .5s ease; }
.fb-pend { height: 100%; background: repeating-linear-gradient(-45deg, var(--amber) 0 5px, #b9842f 5px 10px); }
.fb-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bg); }
.legend { display: flex; gap: 14px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }

/* Child cards (parent) */
.hero-sum { padding: 24px; background: linear-gradient(150deg, #173126 0%, var(--surface) 65%); border-color: #24503a; }
.hero-sum .big { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.child-card .who { display: flex; gap: 12px; align-items: center; }
.child-card .avatar { width: 44px; height: 44px; font-size: 15px; }
.child-money { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 12px; }
.child-money div span { display: block; font-size: 13.5px; color: var(--muted); }
.child-money div strong { font-size: 16px; }
.next-due { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--raised); display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Lists */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover .li-title { color: var(--green); }
.li-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--raised); color: var(--muted); }
.li-icon svg { width: 18px; height: 18px; }
.li-icon.green { background: var(--green-soft); color: var(--green); }
.li-icon.amber { background: var(--amber-soft); color: var(--amber); }
.li-icon.red { background: var(--red-soft); color: var(--red); }
.li-body { flex: 1; min-width: 0; }
.li-title { font-weight: 600; font-size: 14.5px; }
.li-sub { font-size: 14px; color: var(--muted); }
.li-end { text-align: right; flex: none; }
.li-end strong { display: block; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty svg { width: 32px; height: 32px; color: var(--faint); margin-bottom: 8px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 14px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--raised); }
.table .r { text-align: right; }
.table .name { font-weight: 600; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1; min-width: 200px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); }
.search .input { padding-left: 38px; }

/* Pay flow */
.steps { display: flex; gap: 8px; margin-bottom: 20px; }
.step { flex: 1; height: 4px; border-radius: 2px; background: var(--raised); }
.step.done { background: var(--green); }
.select-row { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--bg); }
.select-row + .select-row { margin-top: 10px; }
.select-row.on { border-color: var(--green-deep); background: #122019; }
.select-top { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.check {
  width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--faint);
  display: grid; place-items: center; flex: none;
}
.check svg { width: 14px; height: 14px; opacity: 0; }
.select-row.on .check { background: var(--green); border-color: var(--green); color: #06140c; }
.select-row.on .check svg { opacity: 1; }
.select-body { margin-top: 14px; padding-left: 34px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.total-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.total-bar .amt { font-size: 22px; font-weight: 700; }

.bank-card { border-radius: var(--radius-lg); padding: 22px; background: linear-gradient(145deg, #1c3a2c 0%, #121815 80%); border: 1px solid #24503a; }
.bank-amount { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.bank-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid rgba(255,255,255,0.08); }
.bank-line span { color: var(--muted); font-size: 14px; display: block; }
.bank-line strong { font-size: 17px; }
.bank-line.acct strong { font-size: 24px; letter-spacing: 0.06em; }
.copy-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 9px; padding: 7px 11px; font-size: 14px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn:hover { border-color: var(--green); color: var(--green); }
.note { padding: 12px 14px; border-radius: var(--radius); background: var(--raised); font-size: 14.5px; color: var(--muted); display: flex; gap: 10px; }
.note svg { width: 18px; height: 18px; flex: none; color: var(--green); margin-top: 1px; }
.note.amber svg { color: var(--amber); }
.upload {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted);
  display: block; cursor: pointer;
}
.upload:hover { border-color: var(--green); }
.upload input { display: none; }
.success { text-align: center; padding: 28px 10px; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--amber-soft); color: var(--amber); display: grid; place-items: center; margin: 0 auto 16px; }
.success-icon svg { width: 30px; height: 30px; }

/* Pending cards (school) */
.pend-card { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.pend-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.pend-meta span { display: block; font-size: 13.5px; color: var(--muted); }
.pend-meta strong { font-size: 14px; font-weight: 600; word-break: break-word; }
.pend-actions { display: flex; flex-direction: column; gap: 8px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; }

/* Modal */
.backdrop { position: fixed; inset: 0; background: rgba(4, 7, 5, 0.72); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .15s ease; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; animation: rise .2s ease; }
.modal.wide { max-width: 680px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 17px; height: 17px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

/* Receipt */
.receipt { background: #f7faf8; color: #101512; border-radius: 14px; padding: 24px; }
.receipt .r-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1.5px dashed #c9d3cd; }
.receipt .r-school { font-weight: 700; font-size: 16px; }
.receipt .r-sub { color: #5d6a62; font-size: 12.5px; }
.receipt .r-amount { font-size: 30px; font-weight: 700; margin: 16px 0 4px; color: #146b40; }
.receipt dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; margin: 14px 0 0; }
.receipt dt { color: #5d6a62; }
.receipt dd { margin: 0; text-align: right; font-weight: 600; }
.receipt .r-foot { margin-top: 16px; padding-top: 12px; border-top: 1.5px dashed #c9d3cd; font-size: 12px; color: #5d6a62; display: flex; justify-content: space-between; gap: 8px; }
.stamp.void { border-color: #b23b2a; color: #b23b2a; }
.stamp { display: inline-block; padding: 3px 10px; border: 2px solid #1f8a54; color: #1f8a54; border-radius: 6px; font-weight: 700; font-size: 13px; transform: rotate(-4deg); }

/* Toast */
#toast-root { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #e9f7ef; color: #0c2016; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); animation: rise .2s ease; display: flex; gap: 8px; align-items: center; }
.toast svg { width: 17px; height: 17px; color: var(--green-deep); }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-side { padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(160deg, #163024 0%, #0f1311 70%); border-right: 1px solid var(--line); }
.login-side h1 { font-size: 44px; line-height: 1.08; letter-spacing: -0.025em; max-width: 13ch; margin-top: 56px; }
.login-side p.lead { color: var(--muted); font-size: 17px; max-width: 42ch; }
.preview-bars { margin-top: 36px; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.preview-bars .spread { font-size: 14.5px; color: var(--muted); margin-bottom: 6px; }
.login-main { padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; max-width: 560px; }
.login-main h2 { font-size: 22px; }
.login-group { margin-top: 26px; }
.login-group > p { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.acct-btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: left; }
.acct-btn + .acct-btn { margin-top: 10px; }
.acct-btn:hover { border-color: var(--green-deep); background: #142019; }
.acct-btn .who { flex: 1; }
.acct-btn .who strong { display: block; }
.acct-btn .who span { font-size: 14px; color: var(--muted); }
.acct-btn > svg { width: 18px; height: 18px; color: var(--faint); }

/* ---------- Mobile ---------- */
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 20;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
    background: rgba(15, 19, 17, 0.92); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand { font-size: 16px; }
  .topbar .brand-mark { width: 30px; height: 30px; }
  .topbar .school { font-size: 12px; color: var(--muted); font-weight: 400; display: block; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: rgba(23, 28, 25, 0.96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--faint); text-decoration: none; font-size: 12.5px; font-weight: 500; }
  .tab svg { width: 22px; height: 22px; }
  .tab.active { color: var(--green); }
  .tab .nav-badge { position: absolute; top: 0; left: 55%; margin: 0; min-width: 18px; height: 18px; font-size: 12.5px; padding: 0 5px; }
  .page { padding: 20px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 22px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 19px; }
  .grid-2, .grid-main { grid-template-columns: 1fr; }
  .card { padding: 16px; border-radius: 16px; }
  .hero-sum .big { font-size: 30px; }
  .pend-card { grid-template-columns: 1fr; }
  .hide-mobile { display: none; }
  .pend-meta { grid-template-columns: 1fr 1fr; }
  .pend-actions { flex-direction: row; }
  .pend-actions .btn { flex: 1; }
  .backdrop { place-items: end center; padding: 0; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .bank-line.acct strong { font-size: 21px; }
  #toast-root { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 32px); }

  /* Tables turn into stacked rows */
  table.table.stackable thead { display: none; }
  table.table.stackable, .table.stackable tbody, .table.stackable tr, .table.stackable td { display: block; width: 100%; }
  .table.stackable tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .table.stackable tr:last-child { border-bottom: 0; }
  .table.stackable td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table.stackable td::before { content: attr(data-label); color: var(--muted); font-size: 14px; text-align: left; }
  .table.stackable td.lead { font-size: 15px; }
  .table.stackable td.lead::before { content: none; }
  .table.stackable tbody tr.clickable:hover td { background: none; }

  .login { grid-template-columns: 1fr; }
  .login-side { padding: calc(28px + env(safe-area-inset-top, 0px)) 22px 28px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-side h1 { font-size: 32px; margin-top: 28px; }
  .login-side p.lead { font-size: 15px; }
  .preview-bars { display: none; }
  .login-main { padding: 26px 22px 40px; }
}

/* Pending items and outstanding */
.pending-list { padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.pending-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 14px; border-top: 1px solid var(--line); }
.pending-row:first-of-type { border-top: 0; }
.out-group { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.out-kid { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.item-chip { display: inline-flex; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--red-soft); color: #f2b4a8; font-size: 13.5px; }
.item-chip strong { color: var(--text); }
/* Attendance methods */
.kiosk-display { margin: 16px 0 12px; padding: 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); font-size: 30px; font-weight: 700; text-align: center; letter-spacing: .08em; min-height: 72px; }
.kiosk-display .faint { font-size: 16px; letter-spacing: 0; font-weight: 500; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key { padding: 18px 0; border-radius: 14px; border: 1px solid var(--line); background: var(--raised); font-size: 22px; font-weight: 700; }
.key:active { background: var(--green-soft); }
.key-fn { font-size: 15px; color: var(--muted); }
.chip.on.late { background: var(--amber-soft); color: var(--amber); }
.chip.on.absent { background: var(--red-soft); color: var(--red); }

/* Exams */
.tick { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--red-soft); color: var(--red); }
.tick svg { width: 14px; height: 14px; }
.tick.ok { background: var(--green-soft); color: var(--green); }
.sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.qbox { padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.qbox input[type=radio] { width: 18px; height: 18px; accent-color: var(--green); flex: none; }
.cbt-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.cbt-timer { font-size: 22px; font-weight: 700; padding: 6px 12px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); }
.qnav-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.qnav { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); font-weight: 600; }
.qnav.done { background: var(--green-soft); color: var(--green); border-color: transparent; }
.qnav.cur { outline: 2px solid var(--green); }
.cbt-q { padding: 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.cbt-text { font-size: 18px; font-weight: 600; margin: 8px 0 14px; }
.cbt-opt { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 14px; margin-top: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 15.5px; }
.cbt-opt span { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--raised); font-weight: 700; flex: none; }
.cbt-opt.on { border-color: var(--green); background: #122019; }
.cbt-opt.on span { background: var(--green); color: #06140c; }
.center-score { text-align: center; padding: 10px 0; }

/* Plans */
.plan-list { display: flex; flex-direction: column; gap: 8px; }
.plan-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.plan-row.on { border-color: var(--green-deep); background: #122019; }

/* Modules */
.module-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.module-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--green); font-size: 15px; }
.module-name svg { width: 18px; height: 18px; }
.sub-tabs { margin: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.sub-tabs .chip { white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.item-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--bg); border-radius: 10px; }
.scan-box { position: relative; background: #000; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; max-height: 360px; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 18% 24%; border: 3px solid var(--green); border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); pointer-events: none; }
.scan-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.scan-card.ok { border-color: var(--green-deep); background: #122019; }
.scan-card.warn { border-color: #5a4520; background: #1d1a12; }
.scan-card.bad { border-color: #6b2f25; background: #1f1513; color: var(--red); }
.scan-card > svg { width: 22px; height: 22px; flex: none; }
.scan-av { width: 56px; height: 56px; font-size: 18px; }
.scan-name { font-size: 18px; font-weight: 700; }
.scan-time { font-weight: 600; color: var(--green); margin-top: 2px; }
.scan-card.warn .scan-time { color: var(--amber); }
.id-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.id-card { background: #fff; color: #111; border-radius: 12px; overflow: hidden; border: 1px solid #ccd5cf; }
.id-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #1f7a4c; color: #fff; font-weight: 700; font-size: 14px; }
.id-top img { width: 24px; height: 24px; object-fit: contain; background: #fff; border-radius: 4px; }
.id-top .brand-mark { width: 24px; height: 24px; }
.id-top .brand-mark svg { width: 14px; height: 14px; }
.id-body { display: flex; gap: 12px; padding: 12px; align-items: center; }
.id-qr { width: 92px; height: 92px; flex: none; }
.id-qr svg { width: 100%; height: 100%; }
.id-name { font-weight: 700; font-size: 15px; }
.id-num { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #444; margin-top: 4px; }
.score-in { width: 74px; padding: 8px; text-align: center; }
.grade { display: inline-block; padding: 2px 8px; border-radius: 6px; font-weight: 700; font-size: 13.5px; background: var(--raised); }
.grade.g-A, .grade.g-B { background: var(--green-soft); color: var(--green); }
.grade.g-C { background: var(--amber-soft); color: var(--amber); }
.grade.g-D, .grade.g-E, .grade.g-F { background: var(--red-soft); color: var(--red); }
.broadsheet th, .broadsheet td { padding: 10px 8px; }
.rc-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.rc-table th, .rc-table td { padding: 6px 6px; border-bottom: 1px solid #dde4df; text-align: left; }
.rc-table .r { text-align: right; }
.report-card dl dd { text-align: right; }

/* Finance extras */
.fin-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.fin-tabs .chip { white-space: nowrap; display: inline-flex; align-items: center; }
.fc-row { display: grid; grid-template-columns: 140px 1fr; gap: 6px 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.fc-row:first-of-type { border-top: 0; }
.fc-month { font-weight: 600; }
.fc-bars { display: flex; flex-direction: column; gap: 4px; }
.fc-bar { height: 9px; border-radius: 5px; min-width: 2px; }
.fc-bar.in { background: var(--green); }
.fc-bar.out { background: var(--red); opacity: .85; }
.fc-nums { grid-column: 2; display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); }
.bud-row .cat-bar { height: 8px; }
.cash-box { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: flex-end; padding: 18px; border-radius: var(--radius-lg); background: var(--bg); border: 1px solid var(--line); }
.total-row td { font-weight: 700; border-top: 2px solid var(--line); }
@media (max-width: 880px) { .fc-row { grid-template-columns: 1fr; } .fc-nums { grid-column: 1; } }

/* Settings: classes, logo, permissions */
.level-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.level-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; background: var(--raised); border: 1px solid var(--line); font-size: 14.5px; font-weight: 600; }
.lv-x { border: 0; background: none; color: var(--faint); padding: 0; display: grid; place-items: center; }
.lv-x svg { width: 14px; height: 14px; }
.lv-x:hover { color: var(--red); }
.lv-arrow svg { width: 14px; height: 14px; color: var(--faint); display: block; }
.logo-prev { width: 56px; height: 56px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.logo-prev.empty { display: grid; place-items: center; background: var(--raised); color: var(--faint); }
.logo-prev.empty svg { width: 24px; height: 24px; }
.perm-row { padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.school-logo { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; background: #fff; flex: none; }
.r-logo { width: 44px; height: 44px; object-fit: contain; margin-right: 10px; }

/* Import */
.import-step { display: flex; gap: 14px; align-items: flex-start; }
.import-step .li-icon { font-weight: 700; }
.import-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.import-sum div { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.import-sum strong { display: block; font-size: 22px; }
.import-sum span { font-size: 13.5px; color: var(--muted); }
.row-bad td { background: rgba(229, 102, 79, 0.05); }
textarea.input { resize: vertical; font-family: inherit; }
@media (max-width: 880px) { .import-sum { grid-template-columns: 1fr 1fr; } }

/* People and terms */
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); flex: none; }
.fee-table .fee-in { padding: 8px 10px; min-width: 110px; }
@media (max-width: 880px) { .fee-table .fee-in { max-width: 150px; text-align: right; } }

/* Finance */
.pro-tag { display: inline-grid; place-items: center; padding: 2px 8px; border-radius: 6px; background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 700; vertical-align: middle; margin-left: 6px; }
.pro-tag.sm { margin-left: auto; font-size: 12.5px; padding: 1px 6px; }
.pro-tag.sm svg { width: 12px; height: 12px; }
.fin-stats { grid-template-columns: repeat(3, 1fr); }
.io-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.io-grid span { display: block; }
.io-grid strong { font-size: 20px; }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 28px; }
.cat-bar { height: 8px; border-radius: 4px; background: var(--raised); margin-top: 6px; overflow: hidden; }
.cat-bar i { display: block; height: 100%; background: var(--red); opacity: .8; border-radius: 4px; }
.locked { text-align: left; }
.lock-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin-bottom: 14px; }
.lock-icon svg { width: 24px; height: 24px; }
.statement { max-width: 640px; margin: 0 auto; }
.st-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.st-school { font-weight: 700; font-size: 17px; }
.st-title { font-size: 15px; margin-top: 2px; }
.st-sub { font-size: 14px; color: var(--muted); }
.st-section { margin-top: 18px; font-size: 14px; font-weight: 600; color: var(--green); }
.st-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; font-size: 14.5px; }
.st-row.total { border-top: 1px solid var(--line); font-weight: 600; }
.st-row.grand { border-top: 2px solid var(--text); border-bottom: 2px solid var(--text); font-weight: 700; margin-top: 10px; padding: 10px 0; font-size: 15.5px; }
.st-row.grand.pos .num { color: var(--green); }
.st-row.grand.neg .num { color: var(--red); }
.st-note { margin-top: 16px; font-size: 13.5px; color: var(--faint); }
@media (max-width: 880px) {
  .fin-stats { grid-template-columns: 1fr; }
  .fin-stats .stat { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; }
  .fin-stats .stat .value { margin: 0; }
  .fin-stats .stat .sub { display: none; }
  .cat-grid { grid-template-columns: 1fr; }
  .io-grid strong { font-size: 16px; }
  .tab span { font-size: 12px; }
}

/* Alerts */
.nav-badge.red { background: var(--red); color: #fff; }
.alert-btn { margin-bottom: 8px; border: 1px solid var(--line) !important; }
.icon-btn.bell { position: relative; color: var(--text); }
.icon-btn.bell .nav-badge { position: absolute; top: -6px; right: -6px; margin: 0; min-width: 18px; height: 18px; font-size: 12.5px; padding: 0 5px; }
.alert-card { border-color: #5a2a22; background: #1f1513; }
.alert-item { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.alert-item.unread { border-color: #6b2f25; }
.alert-item .btn-sm { padding: 5px 9px; font-size: 13px; }
.alert-item .btn-sm svg { width: 14px; height: 14px; }
details summary { cursor: pointer; }

/* Credit score */
.score { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 8px; border-radius: 8px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.score.good { background: var(--green-soft); color: var(--green); }
.score.fair { background: var(--amber-soft); color: var(--amber); }
.score.poor { background: var(--red-soft); color: var(--red); }
.score.big { min-width: 56px; height: 48px; font-size: 22px; border-radius: 12px; }
.score-panel { padding: 16px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.score-panel .list-item { gap: 10px; }

/* Switch */
.switch { width: 50px; height: 28px; border-radius: 14px; border: 0; background: var(--raised); position: relative; flex: none; padding: 0; }
.switch span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .2s ease; }
.switch.on { background: var(--green); }
.switch.on span { transform: translateX(22px); background: #06140c; }

.preview { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: 14.5px; white-space: pre-line; color: var(--text); }
a.icon-btn { color: var(--text); }
a.icon-btn:hover { border-color: var(--green); color: var(--green); }

/* Desktop opens at 90% scale */
@media (min-width: 881px) {
  html { zoom: 0.9; }
  .app, .login { min-height: calc(100vh / 0.9); }
  .sidebar { height: calc(100vh / 0.9); }
  .modal { max-height: calc((100vh - 40px) / 0.9); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ---------- Scheme of work and lesson notes ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.sw-bar { height: 8px; border-radius: 99px; background: var(--raised); overflow: hidden; }
.sw-bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.sw-grid { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.sw-list { padding: 8px; }
.sw-week { display: grid; grid-template-columns: 62px 1fr auto; gap: 10px; align-items: center; padding: 10px 10px; border-radius: var(--radius-sm); border: 1px solid transparent; }
.sw-week + .sw-week { margin-top: 2px; }
.sw-week.clickable { cursor: pointer; }
.sw-week.clickable:hover { background: var(--raised); }
.sw-week.on { background: var(--green-soft); border-color: rgba(52, 194, 122, 0.35); }
.sw-wk { font-size: 13px; font-weight: 600; color: var(--muted); }
.sw-week.on .sw-wk { color: var(--green); }
.sw-topic { font-size: 14px; font-weight: 500; line-height: 1.35; }
.sw-kind { display: block; font-size: 13px; font-weight: 400; color: var(--faint); margin-top: 2px; }
.sw-week.break, .sw-week.exam, .sw-week.empty { opacity: .6; }
.sw-week.break .sw-topic, .sw-week.exam .sw-topic { font-style: italic; color: var(--muted); }
.sw-week.revision .sw-topic { color: var(--amber); }
.sw-tags { display: flex; gap: 6px; align-items: center; }
.sw-tick, .sw-mine { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); }
.sw-mine { background: var(--amber-soft); color: var(--amber); }
.sw-tick svg, .sw-mine svg { width: 13px; height: 13px; }
.pill.sm { font-size: 12.5px; padding: 2px 8px; }
.sw-note { position: sticky; top: 16px; }
.sw-note-head { gap: 10px; }
.ln { margin-top: 14px; }
.ln-topic { font-size: 20px; font-weight: 700; line-height: 1.25; }
.ln-info { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.ln-info b { font-weight: 600; color: var(--text); margin-right: 2px; }
.ln-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.ln-sec h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--green); font-weight: 700; }
.ln-sec p { margin: 0 0 6px; font-size: 14.5px; }
.ln-sec ol, .ln-sec ul { margin: 0; padding-left: 20px; font-size: 14.5px; }
.ln-sec li { margin: 3px 0; }
.ln-paper { }
.ln-paper .ln-topic { margin-top: 14px; color: #101512; }
.ln-paper .ln-info, .ln-paper .ln-info b { color: #3c4741; }
.ln-paper .ln-sec { border-color: #d6ddd9; }
.ln-paper .ln-sec h4 { color: #146b40; }
.ln-paper .faint { color: #7a857f; }
.sw-print { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14.5px; }
.sw-print th, .sw-print td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #d6ddd9; }
.sw-print th { font-size: 13px; color: #5d6a62; }
.sw-edit-row { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: center; }
.sw-edit-row label { font-size: 14px; color: var(--muted); }
.sw-parent { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sw-parent-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 9px 12px; font-size: 14px; }
.sw-parent-row + .sw-parent-row { border-top: 1px solid var(--line); }
.side-note-btn { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 9px; border: 0; border-radius: 12px 0 0 12px; background: var(--green); color: #06130c; font-weight: 600; font-size: 14px; box-shadow: -4px 6px 24px rgba(0, 0, 0, .35); }
.side-note-btn span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.side-note-btn svg { width: 18px; height: 18px; }
.side-note-btn:hover { background: #46d68b; }
@media (max-width: 880px) {
  .sw-grid { grid-template-columns: 1fr; }
  .sw-note { position: static; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .sw-parent-row { grid-template-columns: 1fr; gap: 2px; }
  .side-note-btn { top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); right: 14px; transform: none; flex-direction: row; padding: 12px 16px; border-radius: 999px; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); }
  .side-note-btn span { writing-mode: horizontal-tb; transform: none; }
  .sw-week { grid-template-columns: 54px 1fr auto; padding: 9px 8px; }
}

@media print {
  body { background: #fff; }
  body * { visibility: hidden; }
  .receipt, .receipt *, .statement, .statement *, .print-area, .print-area * { visibility: visible; }
  .side-note-btn { display: none !important; }
  .ln-paper { padding: 0; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .receipt, .statement { position: absolute; left: 0; top: 0; width: 100%; max-width: none; color: #000; }
  .statement .st-sub, .statement .st-note { color: #444; }
  .statement .st-section, .statement .num { color: #000 !important; }
  .statement .st-row.grand { border-color: #000; }
}

/* ===== Report cards: designs, watermark, gallery ===== */
.report-card { position: relative; overflow: hidden; isolation: isolate; -webkit-print-color-adjust: exact; print-color-adjust: exact; --rc: #1f7a4c; }
.report-card > *:not(.rc-wm) { position: relative; z-index: 1; }
.rc-wm { position: absolute !important; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 0 !important; pointer-events: none; }
.rc-wm img { width: 56%; max-height: 66%; object-fit: contain; filter: grayscale(1); }
.rc-wm-text { font-weight: 800; font-size: 52px; line-height: 1.05; text-align: center; transform: rotate(-28deg); color: var(--rc); text-transform: uppercase; letter-spacing: .04em; padding: 0 10%; }
.report-card .rc-com { grid-template-columns: auto 1fr; margin-top: 14px; }
.report-card .rc-com dd { text-align: left; font-weight: 500; }
.rc-g { display: inline-block; min-width: 26px; text-align: center; padding: 0 5px; border-radius: 6px; font-weight: 700; font-size: .92em; background: rgba(0,0,0,.06); }
.rc-g.g-A { background: rgba(31,122,76,.16); color: #14653b; } .rc-g.g-B { background: rgba(29,78,216,.13); color: #1e40af; } .rc-g.g-C { background: rgba(217,119,6,.15); color: #92400e; }
.rc-g.g-D, .rc-g.g-E { background: rgba(234,88,12,.15); color: #9a3412; } .rc-g.g-F { background: rgba(220,38,38,.15); color: #b91c1c; }
.report-card .rc-table th { color: #5d6a62; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }

/* modern */
.rc-t-modern { border-radius: 16px; }
.rc-t-modern .rc-head { background: var(--rc); color: #fff; border: 0; border-radius: 12px; padding: 14px 16px; align-items: center; }
.rc-t-modern .rc-head .r-sub { color: rgba(255,255,255,.82); }
.rc-t-modern .rc-info { grid-template-columns: auto 1fr auto 1fr; gap: 8px 14px; background: rgba(0,0,0,.035); border-radius: 10px; padding: 12px 14px; }
.rc-t-modern .rc-info dd { text-align: left; }
.rc-t-modern .rc-table th { background: color-mix(in srgb, var(--rc) 14%, transparent); border-bottom: 0; }
.rc-t-modern .rc-table td { border-bottom: 1px solid rgba(0,0,0,.06); }
/* elegant */
.rc-t-elegant { font-family: Georgia, "Times New Roman", serif; border: 4px double var(--rc); border-radius: 4px; padding: 28px 26px; background: #fffdf8; }
.rc-t-elegant .rc-head-c { text-align: center; padding-bottom: 12px; border-bottom: 1px solid var(--rc); margin-bottom: 4px; }
.rc-t-elegant .rc-crest { width: 62px; height: 62px; object-fit: contain; margin-bottom: 6px; }
.rc-t-elegant .r-school { font-size: 20px; letter-spacing: .06em; text-transform: uppercase; color: var(--rc); }
.rc-t-elegant .rc-title { font-size: 13px; letter-spacing: .3em; text-transform: uppercase; margin-top: 2px; }
.rc-t-elegant .rc-table th { border-bottom: 2px solid var(--rc); } .rc-t-elegant .rc-table td { border-bottom: 1px dotted #b9b19a; }
.rc-t-elegant dt { font-style: italic; }
/* scoreboard */
.rc-t-bold .rc-head { border-bottom: 3px solid var(--rc); }
.rc-board { display: flex; gap: 12px; margin-top: 14px; }
.rc-board > div { flex: 1; background: color-mix(in srgb, var(--rc) 11%, #fff); border-radius: 12px; padding: 10px 14px; }
.rc-board span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: #5d6a62; }
.rc-board b { font-size: 26px; color: var(--rc); line-height: 1.2; }
.rc-bars { margin-top: 14px; display: grid; gap: 10px; }
.rc-bar-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) 2fr 34px 34px; gap: 10px; align-items: center; font-size: 13px; }
.rc-bar-name span { display: block; font-size: 11px; color: #6b766f; }
.rc-bar { height: 10px; border-radius: 6px; background: rgba(0,0,0,.08); overflow: hidden; } .rc-bar i { display: block; height: 100%; background: var(--rc); border-radius: 6px; }
/* compact */
.rc-t-compact { padding: 16px 18px; font-size: 12px; }
.rc-t-compact .rc-table { font-size: 11.5px; margin-top: 8px; } .rc-t-compact .rc-table th, .rc-t-compact .rc-table td { padding: 3px 5px; }
.rc-t-compact .rc-table tbody tr:nth-child(even) { background: rgba(0,0,0,.035); }
.rc-t-compact dl { font-size: 12px; gap: 4px 12px; margin-top: 8px; } .rc-t-compact .r-head { padding-bottom: 8px; }
/* minimal */
.rc-t-minimal { background: #fff; border: 1px solid #e4e8e5; border-radius: 6px; }
.rc-t-minimal .r-head { border-bottom: 1px solid #e4e8e5; } .rc-t-minimal .r-school { font-weight: 600; letter-spacing: .02em; }
.rc-t-minimal .rc-table th { font-weight: 500; border-bottom: 1px solid #1c211e; } .rc-t-minimal .rc-table td { border-bottom: 1px solid #eef1ef; }
.rc-t-minimal .rc-g { background: none; padding: 0; min-width: 0; }
.rc-t-minimal .r-foot { border-top: 1px solid #e4e8e5; }

/* gallery */
.rc-gallery { display: grid; grid-template-columns: repeat(auto-fill, 232px); gap: 14px; justify-content: start; }
.rc-pick { display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; color: var(--text); cursor: pointer; font: inherit; width: 232px; }
.rc-pick:hover { border-color: var(--green-deep); } .rc-pick.on { border-color: var(--green); background: var(--green-soft); }
.rc-thumb { width: 210px; height: 280px; overflow: hidden; border-radius: 8px; position: relative; background: #fff; margin-bottom: 6px; pointer-events: none; }
.rc-thumb .receipt { width: 560px; transform: scale(.375); transform-origin: top left; position: absolute; top: 0; left: 0; margin: 0; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; } .swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg) inset; }
input[type=range] { width: 100%; accent-color: var(--green); }

/* print: one report card per page, from the Print all button */
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 10mm; }
  body.print-batch > *:not(#print-root) { display: none !important; }
  body.print-batch #print-root { display: block; }
  body.print-batch #print-root .receipt { position: relative !important; width: auto; max-width: 190mm; margin: 0 auto; page-break-after: always; break-after: page; break-inside: avoid; }
  body.print-batch #print-root .receipt:last-child { page-break-after: auto; break-after: auto; }
}

/* ===== Scheme of work, lesson notes, Sir Genius ===== */
.ai-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--green-deep); background: var(--green-soft); border-radius: var(--radius); }
.pill[data-action] { border: 0; cursor: pointer; font: inherit; }
.btn-ai { border-color: var(--green, #1f7a4d); }
.btn-ai.busy { opacity: .6; }
.ln-form .link-btn { padding: 0 0 0 8px; text-decoration: underline; }

/* Student photos and ID check */
.avatar.has-photo { padding: 0; overflow: hidden; background: var(--raised); }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.big { width: 72px; height: 72px; font-size: 22px; }
.avatar.photo-lg { width: 84px; height: 84px; font-size: 24px; margin: 0 auto; }
.scan-av.has-photo, .scan-card .scan-av { width: 72px; height: 72px; }
.photo-field { display: flex; gap: 14px; align-items: center; }
.photo-field .link-btn { padding: 0 0 0 8px; text-decoration: underline; }
.upload-btn { cursor: pointer; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.photo-card .photo-name { font-weight: 600; font-size: 14px; margin-top: 6px; }
.photo-card .btn { margin-top: 8px; cursor: pointer; }
.confirm-card { text-align: center; padding: 20px 16px; border: 1px solid var(--green-deep); border-radius: 16px; background: #122019; }
.confirm-photo { width: 168px; height: 168px; border-radius: 18px; object-fit: cover; display: block; margin: 0 auto 12px; background: var(--raised); }
.confirm-photo.none { display: grid; place-items: center; font-size: 48px; font-weight: 700; color: var(--muted); }
.confirm-name { font-size: 22px; font-weight: 700; }
.confirm-q { margin-top: 14px; font-size: 16px; color: var(--muted); }
.confirm-warn { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: 14px; }
.confirm-btns { justify-content: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.confirm-btns .btn { padding: 14px 20px; font-size: 16px; }
@media (max-width: 480px) { .confirm-btns .btn { flex: 1 1 100%; } .photo-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== Phone-first polish (desktop view above 880px is unchanged) ===== */
.grid-2 > *, .grid-main > *, .grid-4 > * { min-width: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
button, .btn, .chip, .tab { touch-action: manipulation; }
@media (max-width: 880px) {
  .grid-2, .grid-main { grid-template-columns: minmax(0, 1fr); }
  /* inputs at 16px stop iPhones zooming in when a field is tapped */
  .input, input, select, textarea { font-size: 16px; }
  /* comfortable thumb targets */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; padding: 8px 14px; }
  .chip { min-height: 40px; display: inline-flex; align-items: center; }
  .icon-btn { min-width: 44px; min-height: 44px; }
  .input, select.input { min-height: 46px; }
  .check-row { min-height: 44px; }
  .modal-actions { position: sticky; bottom: 0; background: var(--surface, var(--card, #171c19)); padding-top: 12px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 140px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-head .btn { width: 100%; }
  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 24px; }
  /* score entry: CA1, CA2 and Exam sit side by side so a teacher sees a whole student without scrolling */
  .table.score-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; align-items: end; }
  .table.score-table td { display: block; text-align: left; padding: 0; }
  .table.score-table td.lead { grid-column: 1 / -1; display: flex; justify-content: space-between; }
  .table.score-table td::before { display: block; margin-bottom: 4px; }
  .table.score-table td .score-in { width: 100%; max-width: none; text-align: center; font-size: 18px; }
  .table.score-table td.r, .table.score-table td:last-child { grid-column: auto; }
  .table.score-table td:nth-child(5), .table.score-table td:nth-child(6) { display: flex; justify-content: space-between; align-items: center; grid-column: span 3 / span 3; }
  /* students and the ID check */
  .confirm-card { padding: 16px 12px; }
  .confirm-photo { width: min(62vw, 220px); height: min(62vw, 220px); }
  .keypad .key { min-height: 62px; font-size: 24px; }
  .toast, #toast-root > * { max-width: calc(100vw - 24px); }
  .stats { grid-template-columns: 1fr 1fr; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .side-note-btn { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat .value { font-size: 22px; }
  .tab span { font-size: 12px; }
}
@media (hover: none) { .btn:hover, .chip:hover { filter: none; } }

/* PDF import review */
.pdf-q { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.pdf-q.warn { border-color: #5a4520; }
.pdf-opt { display: flex; gap: 8px; align-items: center; }
.pdf-opt .input { flex: 1; min-width: 0; }
.pdf-ans { display: inline-flex; align-items: center; gap: 6px; min-width: 52px; min-height: 44px; font-weight: 600; cursor: pointer; }
.pdf-ans input { width: 20px; height: 20px; accent-color: var(--green); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.btn.disabled { opacity: .5; pointer-events: none; }

/* ---------- Online mode: sign-in, save status, banners ---------- */
.login-wait { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth .login-main .field { margin: 0; }
.auth .login-main .chips { flex-wrap: wrap; }
.notice { margin: 0 0 14px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04); font-size: 14px; line-height: 1.45; }
.notice.warn { border-color: var(--amber); }
.notice a { color: inherit; text-decoration: underline; }
.sync-pill { position: fixed; right: 14px; bottom: 14px; z-index: 40; border: 1px solid var(--line); background: var(--card, #161b18); color: var(--muted); font: inherit; font-size: 13.5px; padding: 6px 12px; border-radius: 999px; cursor: default; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.sync-pill.saved { opacity: .75; }
.sync-pill.saving, .sync-pill.pending { color: var(--amber); }
.sync-pill.error { color: #fff; background: var(--red); border-color: var(--red); cursor: pointer; }
.sync-pill[hidden] { display: none; }
@media (max-width: 880px) { .sync-pill { bottom: calc(76px + env(safe-area-inset-bottom)); right: 10px; } .login.auth { grid-template-columns: 1fr; } .login.auth .login-side h1, .login.auth .login-side p { display: none; } .login.auth .login-side { padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 14px; } .login.auth .login-main { max-width: none; padding: 28px 16px; justify-content: flex-start; } }

/* TrackCS logo tile and exam badges */
.brand-mark { background: #fff; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; padding: 4px; display: block; }
.xlogo { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; font-size: 12px; font-weight: 800; letter-spacing: .02em; color: #fff; overflow: hidden; flex: none; background: #445; text-align: center; line-height: 1; }
.xlogo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 3px; }
.x-jamb { background: #0d7a4a; } .x-waec { background: #1f5fae; } .x-neco { background: #b4452c; } .x-bece { background: #6a4bb5; } .x-post-utme { background: #0e7f8c; }
.xtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.xtab { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--raised); color: var(--muted); font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.xtab.on { border-color: var(--green); color: var(--text); background: var(--green-soft); }
.subj { border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; background: var(--surface); }
.subj.open { border-color: var(--green); }
.subj-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; background: transparent; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.subj-head .n { color: var(--muted); font-size: 14px; }
.subj-body { padding: 0 14px 14px; }

/* All schools (platform admin) */
.sch-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:14px}
.sch-card{background:var(--card,#141a17);border:1px solid var(--line,rgba(255,255,255,.09));border-radius:16px;padding:16px;display:flex;flex-direction:column;gap:14px}
.sch-card.off{opacity:.78}
.sch-top{display:flex;align-items:center;gap:10px}
.sch-top .avatar{flex:none;width:42px;height:42px;font-size:14px}
.sch-name{flex:1;min-width:0;display:flex;flex-direction:column}
.sch-name strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sch-name span{font-size:12px;opacity:.65;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sch-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.sch-stat{display:flex;flex-direction:column;align-items:center;gap:2px;padding:10px 4px;border-radius:12px;background:rgba(255,255,255,.04)}
.sch-stat svg{width:18px;height:18px;opacity:.7}
.sch-stat strong{font-size:18px;line-height:1.1}
.sch-stat span{font-size:11px;opacity:.6}
.sch-dates{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:12px;opacity:.7}
.sch-dates span{display:inline-flex;align-items:center;gap:5px}
.sch-dates svg{width:14px;height:14px}
.sch-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:auto}

/* staff form */
.perm-group{margin-bottom:12px}.perm-group h4{margin:0 0 6px;font-size: 14px;opacity:.75;text-transform:uppercase;letter-spacing:.04em}
.card.inset{background:rgba(255,255,255,.03);padding:14px}
.check-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:6px 12px;max-height:180px;overflow:auto}

/* Rich lesson notes: key words, worked examples, diagrams */
.ln-sec h5 { margin: 12px 0 4px; font-size: 14px; font-weight: 700; color: var(--text); }
.ln-kw { display: grid; grid-template-columns: minmax(90px, max-content) 1fr; gap: 4px 14px; margin: 0; font-size: 14.5px; }
.ln-kw dt { font-weight: 700; }
.ln-kw dd { margin: 0; }
.ln-ex { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 8px; background: var(--surface-2, rgba(14,124,102,.05)); }
.ln-exq { font-size: 14.5px; }
.ln-ex ol { margin: 6px 0 0; padding-left: 20px; font-size: 14.5px; }
.ln-ans { margin-top: 6px; font-size: 14px; color: var(--green); }
.ln-ans b { font-weight: 700; }
.ln-board { padding: 12px 14px; border-radius: 8px; background: #17352c; color: #f3fbf7; font-size: 14.5px; line-height: 1.6; }
.ln-board div { margin: 2px 0; }
.ln-tip { margin-top: 16px; padding: 10px 12px; border-radius: 8px; background: rgba(217,160,30,.12); font-size: 14px; }
figure.dg { margin: 12px 0; text-align: center; break-inside: avoid; }
figure.dg svg { width: 100%; max-width: 560px; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
figure.dg figcaption { margin-top: 4px; font-size: 14px; color: var(--muted); }
.ln-paper .ln-ex { border-color: #d6ddd9; background: #fff; break-inside: avoid; }
.ln-paper .ln-board { background: #fff; color: #101512; border: 1px solid #d6ddd9; }
.ln-paper .ln-ans { color: #146b40; }

/* ===== Exam Maker ===== */
.pro-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--green-soft, #dcf3ec); color: var(--green, #0e7c66); font-size: 13px; font-weight: 600; align-self: flex-start; }
.qg-paper { background: #fff; color: #000; }
.qg-doc { font-family: "Times New Roman", Times, serif; color: #000; font-size: 14px; line-height: 1.45; }
.qg-head { text-align: center; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 8px; }
.qg-school { font-size: 20px; font-weight: 700; }
.qg-title { font-size: 15px; font-weight: 700; margin-top: 2px; }
.qg-sub { font-size: 14px; margin-top: 4px; }
.qg-name { margin: 10px 0; }
.qg-ins ul { margin: 4px 0 0 18px; padding: 0; font-size: 14px; }
.qg-sec { font-size: 15px; border-bottom: 1.5px solid #000; margin: 18px 0 8px; padding-bottom: 2px; color: #000; }
.qg-q { margin: 10px 0; break-inside: avoid; }
.qg-qt { font-weight: 400; }
.qg-no { font-weight: 700; }
.qg-opt { margin-left: 26px; }
.qg-opt.ok { font-weight: 700; color: #1b6b3a; }
.qg-ans { margin: 4px 0 0 26px; font-size: 14px; color: #1b6b3a; }
.qg-sub-q { margin: 6px 0 0 26px; }
.qg-mk { font-weight: 700; font-size: 13px; }
.qg-img { text-align: center; margin: 6px 0; }
.qg-img svg { max-width: 100%; height: auto; max-height: 260px; }
.qg-key { margin-top: 12px; font-size: 14px; }
.qg-end { text-align: center; font-weight: 700; }
.qg-actions { flex-wrap: wrap; }
@media print { .qg-actions { display: none !important; } .qg-paper { padding: 0; } .qg-img svg { max-height: 220px; } }

/* All schools: one circle per school */
.circ-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:20px 12px}
.circ{display:flex;flex-direction:column;align-items:center;gap:6px;background:none;border:0;cursor:pointer;color:inherit;padding:6px;border-radius:16px;font:inherit}
.circ:hover{background:var(--raised)}
.circ.on{background:var(--raised)}
.circ-dot{width:84px;height:84px;border-radius:50%;display:grid;place-items:center;font-weight:700;font-size:24px;background:var(--surface);border:4px solid var(--amber);color:var(--text)}
.circ.active .circ-dot{border-color:var(--green)}
.circ.suspended .circ-dot{border-color:var(--red);opacity:.7}
.circ.on .circ-dot{box-shadow:0 0 0 4px var(--raised),0 0 0 6px currentColor}
.circ-name{font-weight:600;font-size:13.5px;text-align:center;line-height:1.25;max-width:108px;overflow-wrap:anywhere}
.circ-plan{font-size:12px;color:var(--muted)}
.notice.support{border-color:var(--amber);display:flex;gap:12px;align-items:center;flex-wrap:wrap}

/* public application form */
.apply-wrap { max-width: 520px; margin: 0 auto; padding: 20px 16px 60px; }
.apply-wrap .card { padding: 20px; }
.apply-brand { text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.enr-row { align-items: flex-start; gap: 12px; flex-wrap: wrap; }

/* ===== Term bills and fee breakdowns ===== */
.bill .bill-info { grid-template-columns: auto 1fr auto 1fr; gap: 6px 14px; font-size: 14px; }
.bill .bill-info dd { text-align: left; }
.bill-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14.5px; }
.bill-table th { text-align: left; color: #5d6a62; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 6px 4px; border-bottom: 1.5px solid #c9d3cd; }
.bill-table td { padding: 7px 4px; border-bottom: 1px solid #e3e9e5; vertical-align: top; }
.bill-table .r { text-align: right; }
.bill-table .bill-sec td { padding-top: 12px; font-weight: 700; font-size: 13px; color: #146b40; border-bottom: 0; }
.bill-table tfoot td { border-bottom: 0; padding: 5px 4px; }
.bill-table .bill-total td { border-top: 1.5px solid #c9d3cd; font-weight: 700; padding-top: 10px; }
.bill-table .bill-due td { font-weight: 800; font-size: 16px; color: #146b40; }
.bill-sub { color: #7a857e; font-size: 13px; }
.bill-st { font-size: 13px; font-weight: 600; color: #5d6a62; white-space: nowrap; }
.bill-st.ok { color: #146b40; }
.bill-st.part { color: #9a5b00; }
.bill-plan { margin-top: 12px; font-size: 14px; display: grid; gap: 4px; min-width: 220px; }
.bill-pay { margin-top: 14px; padding: 10px 12px; background: #eaf3ee; border-radius: 10px; font-size: 13.5px; line-height: 1.5; }
.bill .stamp { margin-top: 14px; }
.bd-grid { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 760px) { .bd-grid { grid-template-columns: 1fr; } .bill .bill-info { grid-template-columns: auto 1fr; } }
@media print { .bill { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ===== Insights (platform admins) ===== */
.ins-tile h2 { margin: 6px 0 2px; }
.ins-meter .ins-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 6px 0 4px; }
.ins-meter .ins-bar span { display: block; height: 100%; border-radius: 4px; background: var(--green); }
.ins-meter .ins-bar.amber span { background: var(--amber); }
.ins-meter .ins-bar.red span { background: var(--red); }
.ins-cols { display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--line); }
.ins-col { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.ins-col span { display: block; width: 100%; background: var(--green); border-radius: 4px 4px 0 0; min-height: 2px; }
.ins-col:hover span { opacity: .75; }
.score-in.imported { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }

/* Tutorial, partners and billing (build 59) */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-3 > * { min-width: 0; }
@media (max-width: 720px) { .grid-3 { grid-template-columns: 1fr; } }
.opt-btn { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line, #2a332e); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.opt-btn:hover:not([disabled]) { border-color: var(--green); }
.opt-btn.on { border-color: var(--green); background: var(--green-soft); }
.opt-btn.tu-right { border-color: var(--green); background: var(--green-soft); }
.opt-btn.tu-wrong { border-color: var(--red); background: rgba(220, 80, 60, .12); }
.tu-fb { border-top: 1px dashed var(--line, #2a332e); padding-top: 10px; }
.tu-got, .tu-miss { margin: 8px 0 0; padding-left: 0; list-style: none; font-size: 14px; }
.tu-got li::before { content: "\2713  "; color: var(--green); font-weight: 700; }
.tu-miss li::before { content: "\2717  "; color: var(--red); font-weight: 700; }
.tu-got li, .tu-miss li { margin: 3px 0; }
.tu-score { border-color: var(--green); }
.bar { height: 6px; border-radius: 4px; background: var(--line, #2a332e); overflow: hidden; }
.bar i { display: block; height: 100%; }
.pv-read { position: relative; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; line-height: 1.65; }
.pv-read::after { content: attr(data-wm); position: absolute; right: 14px; top: 10px; font-size: 12.5px; opacity: .35; pointer-events: none; }
.pv-read ul { padding-left: 20px; }
.card.off { opacity: .7; }
@media print { .pv-read, .pv-read * { display: none !important; } }
.tu-ai { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; background: rgba(120, 140, 255, .06); }
/* list rows used as buttons (Tutorial home, theory list): sized chevron, stacked text */
.list-item > svg { width: 18px; height: 18px; flex: none; color: var(--faint); }
button.list-item { width: 100%; text-align: left; color: inherit; font: inherit; }
button.list-item .li-body > * { display: block; }
button.list-item .li-body > strong { margin-bottom: 2px; }
.nav-item.nav-sub { padding-left: 34px; font-size: 14.5px; }
.nav-item.nav-sub svg { width: 16px; height: 16px; }
/* Crash Packs */
.cp-tag { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--green); background: rgba(16, 150, 90, .1); border-radius: 999px; padding: 3px 10px; }
.cp-card h2 { font-size: 18px; }
.cp-read { overflow: hidden; }
.cp-read::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .06; background-image: repeating-linear-gradient(-30deg, transparent 0 60px, currentColor 60px 61px); }
.cp-points { padding-left: 0; list-style: none; }
.cp-points li { position: relative; padding: 8px 0 8px 22px; border-bottom: 1px solid var(--line); }
.cp-points li:last-child { border-bottom: 0; }
.cp-points li::before { content: ""; position: absolute; left: 4px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.cp-box { border-radius: 10px; padding: 10px 12px; }
.cp-box strong { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.cp-box strong svg { width: 16px; height: 16px; }
.cp-box ul { padding-left: 18px; margin-top: 6px; }
.cp-box p { margin-top: 6px; }
.cp-trap { background: rgba(220, 60, 60, .07); border: 1px solid rgba(220, 60, 60, .25); }
.cp-hook { background: rgba(230, 160, 20, .09); border: 1px solid rgba(230, 160, 20, .3); }
.cp-q { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.cp-ans { color: var(--green); font-weight: 600; }
.cp-read::after { top: auto; bottom: 8px; }
/* Practice tools: icon buttons, question palette, calculator, flashcards */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--faint); cursor: pointer; }
.icon-btn:hover { border-color: var(--line); color: inherit; }
.icon-btn.on { color: var(--green); }
.icon-btn svg { width: 18px; height: 18px; }
.q-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.q-dot { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; font-size: 14px; cursor: pointer; }
.q-dot.done { background: var(--green-soft); border-color: var(--green); }
.q-dot.cur { outline: 2px solid var(--green); outline-offset: 1px; font-weight: 700; }
.calc-panel { position: fixed; right: 16px; bottom: 16px; width: 248px; z-index: 60; padding: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.calc-screen { margin-top: 8px; padding: 10px; border-radius: 8px; background: rgba(0, 0, 0, .25); text-align: right; font-size: 20px; min-height: 44px; overflow-x: auto; white-space: nowrap; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.calc-key { height: 40px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; font-size: 16px; cursor: pointer; }
.calc-key.op { color: var(--green); }
.calc-key.eq { background: var(--green); color: #04130b; border-color: var(--green); font-weight: 700; }
.flash-card { min-height: 220px; }
.flash-q { font-size: 18px; line-height: 1.5; margin-top: 6px; }
.flash-back { border-top: 1px dashed var(--line); padding-top: 12px; }
.flash-a { font-size: 18px; font-weight: 700; color: var(--green); margin-top: 4px; }
@media (max-width: 520px) { .calc-panel { left: 16px; right: 16px; width: auto; } }
.ic16 { display: inline-flex; } .ic16 svg { width: 16px; height: 16px; }
/* Exam Pass */
.pass-need { border-color: var(--amber); }
.pass-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.pass-opt { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pass-opt.hl { border-color: var(--green); background: var(--green-soft); }
.pass-opt .pill svg { width: 12px; height: 12px; }
.cp-bundle { border-color: var(--green); }
/* Challenges */
.duel-hero h2 { display: flex; align-items: center; gap: 8px; }
.duel-hero h2 svg { width: 22px; height: 22px; color: var(--green); }
.duel-code { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.duel-code strong { font-size: 30px; letter-spacing: .18em; color: var(--green); }
.duel-count { justify-content: center; font-size: 34px; }
.duel-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
@media (max-width: 860px) { .duel-grid { grid-template-columns: 1fr; } }
.duel-win > svg { width: 44px; height: 44px; color: var(--amber); }
.team-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.team-A { border-color: rgba(60, 140, 255, .5); } .team-B { border-color: rgba(240, 120, 60, .5); }
.rank { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, .06); flex: none; }
.me-row { background: var(--green-soft); border-radius: 10px; }
.duel-win h2 { justify-content: center; }
.rank.top1 { background: #e3b341; color: #1a1300; } .rank.top2 { background: #b8c1cc; color: #11161c; } .rank.top3 { background: #c98a4b; color: #1a0f04; }
.mates { border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mates .hint { width: 100%; }
.chat-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.chat-msg { font-size: 14.5px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .05); align-self: flex-start; max-width: 92%; }
.chat-msg.me { align-self: flex-end; background: var(--green-soft); }
.chat-msg strong { font-size: 13px; margin-right: 4px; }
.mock-row { border: 1px solid var(--green); border-radius: 10px; }
/* Registration */
.reg-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 6px; cursor: pointer; }
.reg-opt.on { border-color: var(--green); background: var(--green-soft); }
.reg-opt.sm { padding: 8px 12px; }
.reg-opt > span { display: flex; flex-direction: column; gap: 2px; }
.reg-opt input { margin-top: 3px; }
.reg-feats { display: flex; flex-direction: column; gap: 8px; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.cp-lead { font-style: italic; color: var(--muted, #b9c4bd); line-height: 1.55; }
.cp-mem { background: rgba(242, 182, 50, .1); border: 1px solid rgba(242, 182, 50, .35); }
.cp-mn { margin-top: 8px; } .cp-ac { font-size: 16px; } .cp-ac b { color: #f2b632; font-size: 18px; }
.cp-rev { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px dashed var(--line); padding-top: 10px; }
.cp-tick { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: transparent; color: inherit; font: inherit; font-size: 13.5px; cursor: pointer; }
.cp-tick svg { width: 13px; height: 13px; }
.cp-tick.on { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.cp-tick.due { border-color: #f2b632; color: #f2b632; }
.cp-tick[disabled] { cursor: default; opacity: .8; }
.cp-lead { font-style: italic; color: var(--muted, #b9c4bd); line-height: 1.55; }
.cp-mem { background: rgba(242, 182, 50, .1); border: 1px solid rgba(242, 182, 50, .35); }
.cp-mn { margin-top: 8px; } .cp-ac { font-size: 16px; } .cp-ac b { color: #f2b632; font-size: 18px; }
.cp-rev { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px dashed var(--line); padding-top: 10px; }
.cp-tick { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: transparent; color: inherit; font: inherit; font-size: 13.5px; cursor: pointer; }
.cp-tick svg { width: 13px; height: 13px; }
.cp-tick.on { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.cp-tick.due { border-color: #f2b632; color: #f2b632; }
.cp-tick[disabled] { cursor: default; opacity: .8; }
.cart-bar { position: sticky; bottom: 12px; z-index: 30; margin-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--card, #161d19); border: 1px solid var(--green); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.btn.on { border-color: var(--green); color: var(--green); }

/* WAEC theory: drawing photos and the on-screen writing pad */
.tu-modes .chip svg { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.tu-photo { border: 1px dashed var(--line, #d5dde6); border-radius: 12px; padding: 12px; text-align: center; }
.tu-photo img { max-width: 100%; max-height: 360px; border-radius: 8px; display: block; margin: 0 auto; }
.tu-canvas { display: block; width: 100%; background: #fff; border: 1px solid var(--line, #d5dde6); border-radius: 10px; touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; }
.tu-pad-tools .btn.on { background: var(--brand, #1f6e4b); color: #fff; border-color: transparent; }


/* ---------- Light theme (chosen with the sun/moon button; follows the phone or computer setting until then) ---------- */
html[data-theme="light"] {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --raised: #eef2ef;
  --line: #dde4df;
  --text: #14201a;
  --muted: #56645c;
  --faint: #7f8b84;
  --green: #1e9457;
  --green-deep: #1f7a4c;
  --green-soft: rgba(30, 148, 87, 0.10);
  --amber: #b06f12;
  --amber-soft: rgba(176, 111, 18, 0.11);
  --red: #c23d28;
  --red-soft: rgba(194, 61, 40, 0.10);
  color-scheme: light;
}
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] .btn-primary, html[data-theme="light"] .select-row.on .check, html[data-theme="light"] .cbt-opt.on span { color: #fff; }
html[data-theme="light"] .switch.on span { background: #fff; }
html[data-theme="light"] .acct-btn:hover { background: #e9f6ee; border-color: var(--green); color: var(--text); }
html[data-theme="light"] .btn-primary:hover { background: #157a45; border-color: #157a45; color: #fff; }
html[data-theme="light"] .stat.accent { background: linear-gradient(160deg, #e3f4ea 0%, var(--surface) 70%); border-color: #b9dcc7; }
html[data-theme="light"] .hero-sum { background: linear-gradient(150deg, #e3f4ea 0%, var(--surface) 65%); border-color: #b9dcc7; }
html[data-theme="light"] .bank-card { background: linear-gradient(145deg, #e3f4ea 0%, #ffffff 80%); border-color: #b9dcc7; }
html[data-theme="light"] .bank-line { border-top-color: rgba(0,0,0,0.08); }
html[data-theme="light"] .copy-btn { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); }
html[data-theme="light"] .select-row.on, html[data-theme="light"] .cbt-opt.on, html[data-theme="light"] .plan-row.on,
html[data-theme="light"] .scan-card.ok, html[data-theme="light"] .confirm-card { background: var(--green-soft); }
html[data-theme="light"] .scan-card.warn, html[data-theme="light"] .pdf-q.warn { border-color: #e2c48e; background: var(--amber-soft); }
html[data-theme="light"] .scan-card.bad, html[data-theme="light"] .alert-card { border-color: #eab3a8; background: var(--red-soft); }
html[data-theme="light"] .alert-item.unread { border-color: #eab3a8; }
html[data-theme="light"] .notice, html[data-theme="light"] .sch-stat, html[data-theme="light"] .card.inset,
html[data-theme="light"] .rank, html[data-theme="light"] .chat-msg { background: rgba(0,0,0,.035); }
html[data-theme="light"] .sch-card { background: var(--surface); border-color: var(--line); }
html[data-theme="light"] .backdrop { background: rgba(20, 32, 26, 0.45); }
html[data-theme="light"] .brand-mark { color: #fff; }
html[data-theme="light"] .tu-photo { border-color: var(--line); }
.theme-btn { display: inline-flex; align-items: center; gap: 8px; }
.theme-btn svg { width: 16px; height: 16px; }
.theme-float { position: fixed; top: 12px; right: 12px; z-index: 50; }
.sidebar-foot .theme-btn, .sidebar-foot [data-action="logout"] { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
html[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.94); }
html[data-theme="light"] .tabbar { background: rgba(255, 255, 255, 0.97); }
html[data-theme="light"] .login-side { background: linear-gradient(160deg, #e2f3e9 0%, #f3f6f4 75%); }
.cpa-group td { background: var(--raised); }
.cpa-tools { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }

/* ---------- Menu option A: second column for a module's sub-pages (computers only) ---------- */
.app.has-subnav { grid-template-columns: var(--sidebar) 210px 1fr; }
.subnav { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); background: var(--bg); padding: 22px 10px; }
.subnav-title { font-weight: 700; font-size: 15px; padding: 6px 12px 14px; display: flex; align-items: center; gap: 8px; }
.subnav-title svg { width: 16px; height: 16px; }
.subnav .nav-item { width: 100%; text-align: left; background: none; border: 0; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; justify-content: flex-start; }
.subnav .nav-item.active { color: var(--green); background: var(--green-soft); }
.subnav .nav-item .nav-badge { margin-left: auto !important; }
.module-head.subnav-on { display: none; }
@media (min-width: 881px) { .subnav { height: calc(100vh / 0.9); } }
.pva-ok { color: var(--green); font-weight: 600; }
.pva-bad { color: var(--red); }
.pva-q { padding-top: 10px; border-top: 1px dashed var(--line); }
.pva-q:first-of-type { border-top: 0; padding-top: 0; }
.pva-part { padding-top: 10px; border-top: 1px dashed var(--line); }
.subnav .nav-item { white-space: normal; line-height: 1.3; }

/* ---------- Book reader (pre-varsity and Crash Packs): reads like the printed book ---------- */
.cp-read::before { display: none; }
.bk-page { --paper: #fbf8f1; --ink: #1d1a16; --soft: #5c564c; --rule: #e4dccb;
  position: relative; background: var(--paper); color: var(--ink); border-radius: 6px; padding: 34px 44px 26px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 30px rgba(0,0,0,.18); font-family: "Source Serif 4", Charter, Georgia, serif; font-size: 16.5px; line-height: 1.62; max-width: 980px; }
html[data-theme="dark"] .bk-page { --paper: #f4efe4; }
.bk-page::after { color: var(--soft); top: auto; bottom: 10px; right: 18px; opacity: .45; font-family: var(--font); }
.bk-cover { margin: -34px -44px 28px; padding: 46px 44px 40px; border-radius: 6px 6px 0 0; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(circle at 92% 18%, var(--bk3) 0 22%, transparent 23%), radial-gradient(circle at 92% 18%, var(--bk2) 0 9%, transparent 10%), var(--bk1); }
.bk-cover::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--bk2); }
.bk-kicker { font-family: var(--font); font-weight: 800; letter-spacing: .3em; font-size: 12px; color: var(--bk2); }
.bk-title { font-family: Lora, Georgia, serif; font-size: 44px; line-height: 1.02; margin: 10px 0 0; color: #fff; max-width: 70%; }
.bk-ed { font-family: var(--font); font-weight: 600; margin-top: 10px; color: rgba(255,255,255,.82); }
.bk-promise { margin-top: 16px; max-width: 60ch; color: rgba(255,255,255,.9); }
.bk-head { display: flex; align-items: baseline; gap: 14px; border-bottom: 2px solid var(--bk1); padding-bottom: 8px; margin-bottom: 14px; }
.bk-num { font-family: Lora, Georgia, serif; font-weight: 700; font-size: 34px; color: var(--bk2); line-height: 1; filter: saturate(1.2) brightness(.85); }
.bk-topic { font-family: Lora, Georgia, serif; font-size: 26px; color: var(--bk1); line-height: 1.15; }
.bk-lead { font-style: italic; color: var(--soft); font-size: 17.5px; margin: 4px 0 16px; }
.bk-cols { column-count: 2; column-gap: 38px; column-rule: 1px solid var(--rule); }
.bk-cols > * { break-inside: avoid; }
.bk-p { margin: 0 0 12px; text-align: justify; hyphens: auto; }
.bk-h { font-family: Lora, Georgia, serif; font-size: 17px; color: var(--bk1); margin: 6px 0 6px; break-after: avoid; }
.bk-def { margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid var(--bk2); background: rgba(0,0,0,.03); }
.bk-term { font-weight: 700; color: var(--bk1); }
.bk-ex { margin: 4px 0 14px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; }
.bk-ex-t { display: block; font-family: var(--font); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--bk3); padding: 5px 10px; border-radius: 6px 6px 0 0; }
.bk-ex-b { padding: 8px 12px; font-size: 15.5px; }
.bk-ex-b p { margin: 0 0 4px; }
.bk-list { margin: 0 0 12px; padding-left: 20px; }
.bk-list li { margin-bottom: 4px; }
.bk-quote { margin: 6px 0 14px; padding: 4px 0 4px 14px; border-left: 3px solid var(--rule); font-style: italic; color: var(--soft); }
.bk-quote cite { display: block; font-style: normal; font-size: 13px; margin-top: 4px; }
.bk-box { margin: 4px 0 14px; padding: 10px 14px; border-radius: 6px; font-size: 15px; }
.bk-box ul { margin: 6px 0 0; padding-left: 18px; }
.bk-box-t { display: flex; align-items: center; gap: 6px; font-family: var(--font); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.bk-box-t svg { width: 15px; height: 15px; }
.bk-key { background: rgba(0,0,0,.035); border-top: 3px solid var(--bk1); }
.bk-mem { background: #fdf3d8; border: 1px solid #efd58f; }
.bk-mem .cp-ac b { color: #b07d0b; }
.bk-trap { background: #fbe9e5; border: 1px solid #efc2b8; }
.bk-trap .bk-box-t { color: #a33a26; }
.bk-check { background: #eef5f0; border: 1px solid #cfe2d6; }
.bk-check .btn { background: #fff; color: #1d1a16; border-color: #cfd8d2; }
.bk-check .cp-ans { color: #1d5d3a; }
.bk-page .cp-rev { font-family: var(--font); }
.bk-page .cp-rev .faint, .bk-page .cp-rev .muted { color: var(--soft); }
.bk-foot { display: flex; justify-content: space-between; margin-top: 18px; padding-top: 8px; border-top: 1px solid var(--rule); font-family: var(--font); font-size: 12px; color: var(--soft); }
.bk-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; max-width: 980px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .bk-page { padding: 22px 18px 18px; font-size: 16px; }
  .bk-cover { margin: -22px -18px 22px; padding: 34px 20px 28px; }
  .bk-title { font-size: 32px; max-width: 100%; }
  .bk-cols { column-count: 1; }
  .bk-p { text-align: left; }
}
.list-item .li-body > strong, .list-item .li-body > span { display: block; } .list-item .li-body > strong { margin-bottom: 2px; } .list-item.card { padding: 14px 16px; }
.pva-timer { position: sticky; top: 8px; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--green); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.pva-timer strong { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--green); }
.pva-timer.low { border-color: var(--red); } .pva-timer.low strong { color: var(--red); }

/* Exam choice tiles with logos (objective practice) */
.xtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.xtile { position: relative; display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--bg); color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.xtile:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.10); }
.xtile.on { border-color: var(--green); background: var(--green-soft); }
.xtile.x-jamb.on { box-shadow: 0 0 0 3px rgba(30,148,87,.15); }
.xtile.x-waec.on { border-color: #d8a514; background: rgba(216,165,20,.10); box-shadow: 0 0 0 3px rgba(216,165,20,.15); }
.xtile-logo { position: relative; flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); overflow: hidden; }
.xtile-logo b { font-size: 13px; font-weight: 800; color: #1f6e4b; }
.x-waec .xtile-logo b { color: #3b2a7a; }
.xtile-logo img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; }
.xtile-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.xtile-text strong { font-size: 17px; }
.xtile-text span { font-size: 14px; color: var(--muted); line-height: 1.4; }
.xtile-check { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; }
.x-waec .xtile-check { background: #d8a514; }
.xtile-check svg { width: 13px; height: 13px; }

/* Draw by instructions */
.tu-cmd-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.55; }
.tu-cmd canvas.tu-canvas { touch-action: auto; cursor: default; }
.tu-cmd-errs { border-left: 3px solid var(--amber, #d97706); padding: 6px 10px; background: var(--amber-soft); border-radius: 6px; }
.tu-cmd-errs p + p { margin-top: 6px; }
.tu-cmd-errs code { font-size: 13.5px; }
.tu-cmd-ex { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 4px; white-space: pre-wrap; overflow-x: auto; }

/* Partner portal numbers per school */
.ptn-nums { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--muted); }
.ptn-nums strong { color: var(--text); font-size: 15px; }

/* Partner view: school circles */
.ptn-c .circ-dot { position: relative; }
.circ.trial .circ-dot { border-color: var(--amber); }
.circ.ending .circ-dot, .circ.ended .circ-dot { border-color: var(--red); }
.circ.ended .circ-dot { opacity: .75; }
.circ-tag { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; font-size: 12px; font-style: normal; display: grid; place-items: center; border: 2px solid var(--surface); }
.ptn-detail { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 12px; background: var(--raised); }
.ptn-detail .list-item { border: 0; }
.ptn-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 3px solid var(--amber); margin: 0 4px 0 10px; vertical-align: -1px; }
.ptn-key:first-child { margin-left: 0; }
.ptn-key.active { border-color: var(--green); }
.ptn-key.ending { border-color: var(--red); }

/* Admin: partner on a school card, and partner messages */
.ptn-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--raised); }
.ptn-line .li-body { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.ptn-msg.unread { border-left: 3px solid var(--amber); padding-left: 10px; }
.ptn-msg summary::-webkit-details-marker { display: none; }
.circ .circ-plan.faint { color: var(--faint); font-size: 11.5px; }
.tu-cmd-notes { border-left: 3px solid var(--green); padding: 6px 10px; background: var(--green-soft); border-radius: 6px; }
.tu-cmd-notes p + p { margin-top: 4px; }
.tu-cmd-notes code { font-size: 13.5px; }

/* One-tap AI tool buttons (lesson notes) */
.ai-logo-btn { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line, #d9dee5); border-radius: 10px; padding: 6px 12px; min-height: 44px; cursor: pointer; color: #111; font: 600 13px/1 inherit; }
.ai-logo-btn img { height: 28px; width: auto; display: block; }
.ai-logo-btn:hover { border-color: var(--green, #1f7a4d); box-shadow: 0 0 0 2px rgba(31, 122, 77, .15); }
.ai-logo-btn:active { transform: translateY(1px); }

/* build 124: keep payment cards inside the screen on phones */
.pend-card > div { min-width: 0; max-width: 100%; }
.pend-actions { flex-wrap: wrap; }
.pend-actions .btn { min-width: 0; white-space: normal; }

/* build 136: bottom tab bar scrolls sideways on phones when there are many tabs */
@media (max-width: 880px) {
  .tabbar { overflow-x: auto; overflow-y: hidden; grid-auto-columns: minmax(66px, 1fr); scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; touch-action: pan-x; }
  .tabbar::-webkit-scrollbar { display: none; }
  .tab { min-width: 66px; white-space: nowrap; }
}
/* build 136: the "Saved" pill fades away after a few seconds; Saving and Not saved stay visible */
/* build 136b: no "Saved" pill at all. "Saving" only appears if it takes more than 2 seconds. "Not saved" always shows. */
@keyframes pillin { from { opacity: 0; } to { opacity: 1; } }
.sync-pill, .sync-pill.saved { display: none !important; }
.sync-pill.saving, .sync-pill.pending { opacity: 0; animation: pillin .3s ease 2s forwards; pointer-events: none; }

/* build 138: student photo on the ID card (photo, name and number, QR code) */
.id-grid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.id-card .id-body { gap: 10px; }
.id-photo { width: 66px; height: 82px; flex: none; object-fit: cover; border-radius: 8px; border: 1px solid #ccd5cf; background: #eef2ef; }
.id-nophoto { display: grid; place-items: center; font-weight: 700; font-size: 20px; color: #5a6b62; }
.id-info { flex: 1; min-width: 0; font-size: 14px; }
.id-card .id-name { font-size: 14px; overflow-wrap: anywhere; }
.id-card .id-qr { width: 78px; height: 78px; }
@media (max-width: 880px) { .id-grid { grid-template-columns: 1fr; } }

/* build 143: partner agreement screens on phones, and the owners' signature cards */
.ag-item { flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.ag-item .li-body { flex: 1 1 220px; min-width: 0; }
.ag-item .li-body strong { display: block; word-break: normal; overflow-wrap: anywhere; }
.ag-item .li-end { flex: 1 1 100%; justify-content: flex-start; margin-left: 0; }
.ag-item .li-end .btn { flex: 0 0 auto; }
.ag-editor textarea { min-height: 320px; width: 100%; box-sizing: border-box; }
.ag-editor .row.wrap .btn { flex: 1 1 auto; }
.osg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.osg-slot { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; border: 1px solid var(--line, #e2e8f0); border-radius: 12px; padding: 12px; background: var(--surface, #fff); }
.osg-slot img { max-width: 100%; height: auto; max-height: 90px; background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 4px; }
@media (max-width: 700px) {
  .ag-item .li-end .btn { flex: 1 1 auto; text-align: center; }
  .ag-editor .row.wrap { flex-direction: column; align-items: stretch; }
}

/* Try Demo College (build 146) */
.demo-entry { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 20px; padding: 16px 84px 16px 20px; background: #1e9457; color: #fff; position: relative; z-index: 5; }
.demo-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 280px; }
.demo-text strong { font-size: 18px; font-weight: 800; }
.demo-text span { font-size: 14px; line-height: 1.4; opacity: .92; }
.demo-btn { flex: 0 0 auto; background: #fff; color: #17633f; border: 0; border-radius: 12px; padding: 14px 24px; font: inherit; font-size: 17px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.demo-btn:hover { transform: translateY(-1px); }
.demo-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (max-width: 480px) { .demo-entry { padding: 16px 20px 16px 20px; margin-top: 56px; } .demo-btn { width: 100%; } }
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; background: var(--green-soft); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.demo-bar .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-bar a { margin-left: auto; }

/* Term register (Attendance > Term register): students down the side, school days across, P / A */
.treg-wrap { overflow-x: auto; }
.table.treg { border-collapse: separate; border-spacing: 0; font-size: 13.5px; width: max-content; min-width: 100%; }
.table.treg th, .table.treg td { padding: 6px 6px; white-space: nowrap; }
.table.treg .treg-n { width: 30px; color: var(--muted); }
.table.treg .treg-name { min-width: 170px; }
.table.treg .treg-id { min-width: 96px; color: var(--muted); }
.table.treg .treg-n, .table.treg .treg-name { position: sticky; background: var(--surface); z-index: 1; }
.table.treg .treg-n { left: 0; }
.table.treg .treg-name { left: 30px; box-shadow: 1px 0 0 var(--line); }
.table.treg thead .treg-n, .table.treg thead .treg-name { z-index: 2; }
.table.treg .treg-day { text-align: center; min-width: 34px; line-height: 1.15; font-weight: 500; }
.table.treg .treg-day span { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.table.treg .treg-day b { display: block; font-size: 14px; }
.table.treg .treg-day.off { opacity: .55; }
.table.treg td.treg-m { text-align: center; font-weight: 600; }
.table.treg td.treg-m.p { color: var(--green); }
.table.treg td.treg-m.a { color: var(--red); background: var(--red-soft); }
.table.treg td.treg-m.off { color: var(--muted); background: rgba(127,127,127,.08); font-weight: 400; }
.table.treg .treg-foot td { font-weight: 600; border-top: 2px solid var(--green-deep); }
/* Build 154: a school's own report card design (made by TrackCS) */
.rt-ask { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.rt-ask h3 { margin: 0; font-size: 15px; }
.receipt.rc-custom { padding: 0; background: #fff; border-radius: 0; }
.report-card.rc-custom :where(dl) { display: block; margin: 0; gap: 0; font-size: inherit; }
.report-card.rc-custom :where(dt, dd) { color: inherit; margin: 0; text-align: inherit; font-weight: inherit; }
.rc-custom img { max-width: 100%; }
.rtp-prev { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #eef1ef; padding: 10px; }
.rtp-prev:empty { display: none; }
.rtp-prev .receipt { max-width: 720px; margin: 0 auto; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.45; white-space: pre; }
.chips .chip svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.apply-brand { display: flex; align-items: center; gap: 10px; }
.apply-logo { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: #fff; padding: 4px; }
/* Build 154: Attendance groups (students / teachers and staff) and staff ID cards */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; margin: 8px 0 4px; }
.seg-btn { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.seg-btn.on { background: var(--green); color: #fff; }
.module-head .seg { flex-basis: 100%; width: max-content; max-width: 100%; }
.id-top .id-tag { margin-left: auto; font-size: 12px; letter-spacing: .12em; background: #fff; color: #1f7a4c; border-radius: 4px; padding: 2px 6px; }
.staff-card .id-top { background: #1b3a5c; }
.staff-card .id-top .id-tag { color: #1b3a5c; }
.subnav .pres-groups { display: flex; flex-direction: column; width: 100%; margin: 0 0 12px; border-radius: 12px; }
.subnav .pres-groups .seg-btn { text-align: left; padding: 8px 12px; font-size: 14px; border-radius: 9px; }
/* Build 154: gate passes */
.gp-code { font-size: 40px; font-weight: 800; letter-spacing: .12em; text-align: center; padding: 18px 8px; margin: 8px 0; border: 2px dashed var(--green); border-radius: var(--radius); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.gp-input { max-width: 240px; font-size: 24px; letter-spacing: .14em; text-transform: uppercase; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-align: center; }
.gp-verdict { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); font-size: 18px; }
.gp-verdict svg { width: 34px; height: 34px; flex: none; }
.gp-verdict.ok { background: var(--green-soft, #e3f5ea); color: var(--green-deep, #14532d); border: 2px solid var(--green); }
.gp-verdict.bad { background: var(--red-soft, #fde8e8); color: var(--red, #b42318); border: 2px solid var(--red); }
.gp-who { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.module-head .pres-groups { flex-wrap: wrap; border-radius: 16px; }
.tl-list { max-height: 60vh; overflow: auto; }
.tl-row { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tl-sub { min-width: 170px; font-weight: 600; }
.tl-cls { display: flex; gap: 6px; flex-wrap: wrap; }
.tl-chip { display: inline-flex; gap: 4px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 14px; cursor: pointer; }
.tl-chip:has(input:checked) { border-color: var(--green); background: var(--green-soft, #e3f5ea); }
/* Build 154: reminders hub */
.rem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.rem-card h3 { margin: 0; font-size: 16px; }
.rem-n { display: flex; flex-direction: column; align-items: flex-end; }
.rem-n .num { font-size: 28px; font-weight: 700; line-height: 1; }
.staff-notes { display: grid; gap: 8px; margin-bottom: 14px; }
.staff-notes .note { display: flex; align-items: center; gap: 10px; }
.staff-notes .note span { flex: 1; }
.mb12 { margin-bottom: 12px; }
/* Build 154: Messages (chat) */
.chat-wrap { display: grid; grid-template-columns: 320px 1fr; gap: 14px; height: calc(100vh - 210px); min-height: 420px; }
.chat-list { overflow: auto; padding: 6px; }
.chat-pane { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-item { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.chat-item:hover, .chat-item.on { background: var(--surface); }
.chat-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft, #e3f5ea); color: var(--green); flex: none; }
.chat-av svg { width: 18px; height: 18px; }
.chat-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-last { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.chat-back { display: none; transform: rotate(180deg); }
.chat-msgs { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.chat-day { align-self: center; font-size: 13px; color: var(--muted); background: var(--bg, #fff); border-radius: 999px; padding: 2px 10px; margin: 6px 0; }
.bubble { max-width: 78%; align-self: flex-start; background: var(--bg, #fff); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 7px 10px; }
.bubble.me { align-self: flex-end; background: var(--green-soft, #dcf3e5); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.bubble.notice { border-left: 3px solid var(--amber, #c98a12); }
.b-who { font-size: 13px; font-weight: 700; color: var(--green); }
.b-body { white-space: normal; word-wrap: break-word; }
.b-time { font-size: 12.5px; color: var(--muted); text-align: right; margin-top: 2px; }
.chat-compose { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-compose textarea { resize: none; max-height: 140px; }
.chat-empty { margin: auto; text-align: center; }
.chat-empty svg { width: 40px; height: 40px; }
@media (max-width: 760px) {
  .chat-wrap { grid-template-columns: 1fr; height: calc(100vh - 230px); }
  .chat-wrap.has-thread .chat-list { display: none; }
  .chat-wrap:not(.has-thread) .chat-pane { display: none; }
  .chat-back { display: inline-flex; }
}
.push-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.push-card span { flex: 1; min-width: 200px; }
.chat-mic svg { width: 18px; height: 18px; }
.b-voice { width: 240px; max-width: 100%; height: 36px; display: block; }
.vrec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red, #c0392b); animation: vrec 1s infinite; flex: none; }
.vrec-label { flex: 1; align-self: center; }
@keyframes vrec { 50% { opacity: .25; } }

/* Build 156: live school bus map */
.bus-map { width: 100%; border-radius: 12px; overflow: hidden; background: var(--surface-2, #e9eeeb); position: relative; z-index: 0; }
.bus-map-wait { padding: 14px; }
.bus-map .leaflet-container, .bus-map.leaflet-container { font: inherit; }
.bus-pin { background: none; border: 0; }
.bus-pin .bus-pin-dot { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: #1f7a4c; color: #fff; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); animation: busPulse 2s ease-out infinite; }
.bus-pin .bus-pin-dot svg { width: 22px; height: 22px; }
.bus-pin b { position: absolute; left: 50%; top: 44px; transform: translateX(-50%); white-space: nowrap; font-size: 12.5px; font-weight: 700; color: #123; background: #fff; padding: 1px 6px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.bus-pin.old .bus-pin-dot { background: #8a8f8c; animation: none; }
@keyframes busPulse { 0% { box-shadow: 0 0 0 0 rgba(31,122,76,.55), 0 2px 8px rgba(0,0,0,.35); } 70% { box-shadow: 0 0 0 16px rgba(31,122,76,0), 0 2px 8px rgba(0,0,0,.35); } 100% { box-shadow: 0 0 0 0 rgba(31,122,76,0), 0 2px 8px rgba(0,0,0,.35); } }

/* Build 156: lesson note book reader */
body.book-open { overflow: hidden; }
#book-root:empty { display: none; }
.bk-wrap { position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; background: #2b2f2c; animation: fade .15s ease; }
.bk-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #1d211e; color: #eef2ef; }
.bk-bar .btn { flex: 0 0 auto; }
.bk-bar-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.bk-bar-t strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-bar-t span { font-size: 12px; opacity: .7; }
.bk-bar-a { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.bk-stage { flex: 1; min-height: 0; display: flex; justify-content: center; padding: 18px 16px; perspective: 1600px; }
.bk-page { position: relative; width: 100%; max-width: 780px; display: flex; flex-direction: column; background: #fffdf6; color: #222; border-radius: 4px 12px 12px 4px; box-shadow: 0 18px 40px rgba(0,0,0,.45), inset 14px 0 18px -14px rgba(0,0,0,.35); border-left: 6px solid #e6dfcc; }
.bk-page.turn-next { animation: bkNext .32s ease; transform-origin: left center; }
.bk-page.turn-prev { animation: bkPrev .32s ease; transform-origin: right center; }
@keyframes bkNext { from { opacity: .2; transform: rotateY(-14deg) translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes bkPrev { from { opacity: .2; transform: rotateY(14deg) translateX(-30px); } to { opacity: 1; transform: none; } }
.bk-page-in { flex: 1; min-height: 0; overflow-y: auto; padding: 34px 44px 20px; font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.65; -webkit-overflow-scrolling: touch; }
.bk-page-in.ln { color: #222; }
.bk-page-in .ln-sec h4 { font-family: inherit; font-size: 21px; color: #1f5a3c; border-bottom: 2px solid #e6dfcc; padding-bottom: 6px; margin: 4px 0 12px; }
.bk-page-in .ln-sec + .ln-sec { margin-top: 26px; }
.bk-page-in .faint, .bk-page-in .muted { color: #777; }
.bk-page-in svg { max-width: 100%; height: auto; }
.bk-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 44px 14px; font-size: 12px; color: #8a8270; border-top: 1px solid #eee6d2; font-family: Georgia, serif; }
.bk-cover { text-align: center; padding-top: 10px; }
.bk-school { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #8a8270; }
.bk-kind { margin-top: 18px; font-size: 14px; color: #1f5a3c; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.bk-title { font-size: 30px; line-height: 1.25; margin: 10px 0 16px; color: #1a2a22; }
.bk-cover .ln-info { justify-content: center; }
.bk-by { color: #6b6455; font-style: italic; margin-top: 10px; }
.bk-toc { text-align: left; max-width: 460px; margin: 26px auto 0; border-top: 1px solid #e6dfcc; padding-top: 12px; }
.bk-toc-h { font-weight: 700; color: #1f5a3c; margin-bottom: 6px; }
.bk-toc-i { display: flex; width: 100%; justify-content: space-between; gap: 10px; background: none; border: 0; border-bottom: 1px dotted #d8cfb8; padding: 9px 2px; font: inherit; font-size: 16px; color: #222; cursor: pointer; text-align: left; }
.bk-toc-i:hover { color: #1f7a4c; }
.bk-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px 16px; }
.bk-nav .btn { min-width: 110px; min-height: 46px; }
.bk-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.bk-dot { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: #59605b; cursor: pointer; }
.bk-dot.on { background: #34c27a; transform: scale(1.3); }
@media (max-width: 640px) {
  .bk-bar { padding: 8px 10px; gap: 8px; }
  .bk-bar-a .btn { padding: 6px 9px; font-size: 12px; }
  .bk-bar-a .btn svg { display: none; }
  .bk-stage { padding: 8px 6px; }
  .bk-page-in { padding: 22px 20px 14px; font-size: 16px; }
  .bk-foot { padding: 8px 20px 10px; }
  .bk-title { font-size: 24px; }
  .bk-nav .btn { min-width: 92px; }
  .bk-bar-t span { display: none; }
}
.bk-page { --text: #222; --muted: #6b6455; --faint: #8a8270; --line: #e6dfcc; --surface: #fffaf0; --raised: #f6f0e1; --bg: #fffdf6; --green: #1f7a4c; --green-soft: rgba(31,122,76,.1); --amber-soft: rgba(228,168,69,.18); }
.bk-page-in .ln-sec { border-top: 0; padding-top: 0; }
.bk-page-in .ln-sec h4 { text-transform: none; letter-spacing: 0; font-weight: 700; }
.bk-page-in .ln-sec p, .bk-page-in .ln-sec ol, .bk-page-in .ln-sec ul { font-size: inherit; }
.bk-page-in .ln-sec li { margin: 6px 0; }
.bk-page-in .ln-sec h5 { font-size: 18px; }
.bk-cover .bk-title { text-align: center; }

/* Home screen launcher (build 157) */
.app-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 8px; padding: 8px 0; }
@media (min-width: 880px) { .app-grid { grid-template-columns: repeat(8, 1fr); gap: 26px 14px; } }
.app-tile { display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; color: inherit; }
.app-ic { width: 72px; height: 72px; border-radius: 18px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(20, 40, 60, .18); }
@media (min-width: 880px) { .app-ic { width: 84px; height: 84px; } }
.app-ic svg { width: 36px; height: 36px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.app-lbl { margin-top: 8px; font-size: 14px; line-height: 1.25; }
.app-tile.soon { opacity: .6; }
.app-soon { font-size: 12.5px; color: #b45309; margin-top: 2px; }

/* Home is the only menu (build 161): no list on the left; each feature has a Back to Home link. */
body.no-side .sidebar { display: none; }
body.no-side .app { grid-template-columns: 1fr; }
.home-back { display: inline-block; margin: 4px 0 10px; font-weight: 600; color: var(--green); text-decoration: none; }
.home-back:hover { text-decoration: underline; }

/* Sub-pages as icon tiles, like Home (build 162) */
.sub-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin: 10px 0 18px; }
.sub-tiles > * { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; text-align: center; padding: 12px 8px; height: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; line-height: 1.25; }
.sub-tiles > .on { border-color: var(--green); background: var(--green-soft); }
.sub-tiles > *, .sub-tabs.sub-tiles .chip { white-space: normal; overflow-wrap: anywhere; word-break: normal; min-width: 0; }
.sub-ic { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: #2b6cb0; flex: 0 0 auto; }
.sub-ic svg { width: 26px; height: 26px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* The tiles take the full width under the feature name (build 162) */
.module-head:has(> .sub-tiles) { flex-wrap: wrap; }
.module-head > .module-name { width: 100%; }
.sub-tiles { width: 100%; flex-basis: 100%; }
.sub-ic svg { width: 26px !important; height: 26px !important; }

/* Action notices on the finance overview: one plain line with a Review button (build 165) */
.action-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 10px; background: var(--surface); }
.action-strip .as-label { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.action-strip .as-text { font-size: 14px; margin-top: 2px; }

/* Feature titles match page titles (build 166): the feature name at the top of a page is the same size as a page heading */
.module-head > .module-name { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.module-head > .module-name svg { width: 22px; height: 22px; color: var(--green); }

/* Page titles carry their menu icon (build 167) */
.ttl-ic { display: inline-flex; align-items: center; margin-right: 10px; vertical-align: middle; color: var(--green); }
.ttl-ic svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Payroll flow diagram */
.pay-flow .flow { display: flex; flex-direction: column; align-items: stretch; gap: 4px; max-width: 620px; margin-top: 10px; }
.pay-flow .flow-step { border: 1px solid var(--line, #d8dde6); border-radius: 10px; padding: 10px 12px; background: var(--surface, #fff); display: flex; flex-direction: column; gap: 2px; }
.pay-flow .flow-step strong { font-size: 14px; }
.pay-flow .flow-step span { font-size: 14px; color: var(--muted, #5b6472); }
.pay-flow .flow-ded { border-left: 4px solid #c0392b; }
.pay-flow .flow-net { border-left: 4px solid #1e8449; background: #eef8f1; }
.pay-flow .flow-arrow { text-align: center; color: var(--muted, #5b6472); line-height: 1; font-size: 16px; }
@media (max-width: 600px) { .pay-flow .flow-step span { font-size: 13px; } }

/* Payroll stages */
.steps { display: flex; flex-direction: column; gap: 10px; }
.step-row { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line, #d8dde6); border-radius: 10px; padding: 12px; }
.step-row.current { border-color: #d68910; background: #fef9e7; }
.step-row.done { border-color: #1e8449; background: #eef8f1; }
.step-row.todo { opacity: 0.6; }
.step-mark { width: 26px; height: 26px; min-width: 26px; border-radius: 50%; border: 2px solid var(--line, #c3c9d3); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.step-row.done .step-mark { background: #1e8449; color: #fff; border-color: #1e8449; }
.step-row.current .step-mark { border-color: #d68910; color: #d68910; }

/* Payroll flow, v2 */
.pf { padding: 18px; background: linear-gradient(180deg, var(--surface, #fff), var(--surface-2, #f7f8fa)); }
.pf-head h3 { margin: 0; }
.pf-row { display: flex; align-items: stretch; gap: 6px; margin-top: 14px; }
.pf-stage { flex: 1; min-width: 0; border-radius: 14px; padding: 14px; border: 1px solid var(--line, #d8dde6); background: var(--surface, #fff); display: flex; flex-direction: column; gap: 4px; }
.pf-no { width: 24px; height: 24px; border-radius: 50%; background: #1f3a5f; color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.pf-title { font-weight: 700; font-size: 14px; margin-top: 4px; }
.pf-big { font-size: 20px; font-weight: 700; }
.pf-sub { font-size: 13px; color: var(--muted, #5b6472); line-height: 1.35; }
.pf-s1 .pf-no { background: #1f3a5f; }
.pf-s2 .pf-no { background: #6c5ce7; }
.pf-s3 { border-color: #e6a4a0; } .pf-s3 .pf-no { background: #c0392b; } .pf-s3 .pf-big { color: #c0392b; }
.pf-s4 { border-color: #9fd3b1; background: #eef8f1; } .pf-s4 .pf-no { background: #1e8449; } .pf-s4 .pf-big { color: #1e8449; }
.pf-arrow { display: flex; align-items: center; color: var(--muted, #5b6472); }
.pf-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; margin-top: 18px; background: #e5e8ee; }
.pf-bar span { display: block; height: 100%; }
.pf-net { background: #1e8449; } .pf-stat { background: #d68910; } .pf-tax { background: #c0392b; } .pf-oth { background: #7f8c8d; }
.pf-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 14px; }
.pf-key { display: inline-flex; align-items: center; gap: 6px; }
.pf-key i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.pf-key .pf-net { background: #1e8449; } .pf-key i.pf-net { background: #1e8449; }
.pf-key i.pf-stat { background: #d68910; } .pf-key i.pf-tax { background: #c0392b; } .pf-key i.pf-oth { background: #7f8c8d; }
@media (max-width: 760px) {
  .pf-row { flex-direction: column; }
  .pf-arrow { justify-content: center; transform: rotate(90deg); height: 22px; }
  .pf-stage { padding: 12px; }
}

/* Payroll flow diagram (Graphviz) */
.pf-diagram { margin-top: 12px; overflow-x: auto; }
.pf-diagram svg { width: 1200px; max-width: none; height: auto; display: block; }

/* Payroll key points under the flow */
.pf-key-points { margin-top: 14px; font-size: 14px; color: var(--muted, #44505e); }
.pf-key-points ul { margin: 6px 0 0 18px; padding: 0; }
.pf-key-points li { margin: 3px 0; line-height: 1.45; }

/* Messager: WhatsApp-style layout (list, avatars, chat background, bubbles) */
.chat-wrap { gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.chat-list { background: var(--surface); border-right: 1px solid var(--line); padding: 0; }
.chat-item { border-radius: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-item:hover, .chat-item.on { background: var(--green-soft); }
.chat-av { width: 46px; height: 46px; background: var(--green-soft); color: var(--green); }
.chat-name { font-size: 15px; }
.chat-pane { background: var(--bg); }
.chat-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 14px; }
.chat-msgs { background: var(--bg); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; padding: 16px 14px; gap: 8px; }
.bubble { border: none; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); background: var(--surface); }
.bubble.me { background: var(--green-soft); box-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.chat-compose { background: var(--surface); border-top: 1px solid var(--line); padding: 8px 10px; }
.chat-compose textarea { border-radius: 22px; }

/* Staff Recruitment: how-it-works tree */
.rec-flow h3 { margin: 0 0 10px; }
.rec-tree { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.rec-root { background: var(--green, #2e7d5b); color: #fff; font-weight: 700; border-radius: 12px; padding: 16px 14px; display: flex; align-items: center; justify-content: center; min-width: 120px; }
.rec-branches { display: grid; gap: 8px; flex: 1; min-width: 240px; border-left: 2px solid var(--line, #d7e0dc); padding-left: 14px; }
.rec-branch { position: relative; }
.rec-branch::before { content: ""; position: absolute; left: -14px; top: 50%; width: 14px; border-top: 2px solid var(--line, #d7e0dc); }
.rec-node { border: 1px solid var(--line, #d7e0dc); background: var(--surface, #fff); border-radius: 10px; padding: 8px 10px; }
.rec-node b { display: block; font-size: 14px; }
.rec-node span { font-size: 13px; color: var(--muted, #5b6b64); }

/* Staff Recruitment: decomposition tree */
.dt-card h3 { margin: 0 0 12px; }
.dt-tree { overflow-x: auto; }
.dt-root, .dt-kids { list-style: none; margin: 0; padding: 0; }
.dt-root > li { display: flex; flex-direction: column; align-items: flex-start; }
.dt-kids { margin-left: 22px; padding-left: 16px; border-left: 2px solid var(--line, #d7e0dc); }
.dt-kids > li { position: relative; padding: 8px 0 0; }
.dt-kids > li::before { content: ""; position: absolute; left: -16px; top: 22px; width: 14px; border-top: 2px solid var(--line, #d7e0dc); }
.dt-node { display: inline-block; border: 1px solid var(--line, #d7e0dc); background: var(--surface, #fff); border-radius: 10px; padding: 7px 12px; font-size: 14px; font-weight: 600; }
.dt-top { background: var(--green, #2e7d5b); color: #fff; border-color: transparent; font-size: 15px; }
.dt-branch > .dt-node { font-weight: 700; }
.dt-kids .dt-kids > li { padding-top: 6px; }
.dt-kids .dt-kids > li::before { top: 14px; }
.dt-kids .dt-kids { font-size: 14px; color: var(--muted, #5b6b64); }
.dt-kids .dt-kids > li { list-style: none; }
.dt-kids .dt-kids > li { padding-left: 2px; }
.dt-go { cursor: pointer; font: inherit; font-size: 14px; font-weight: 700; color: inherit; }
.dt-go:hover { border-color: var(--green, #2e7d5b); }
.dt-open { font-weight: 600; color: var(--green, #2e7d5b); margin-left: 6px; font-size: 13px; }

/* Staff Recruitment: horizontal decomposition tree */
.dt-h { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 4px; }
.dt-h > .dt-top { flex: none; align-self: center; }
.dt-cols { display: flex; gap: 12px; border-left: 2px solid var(--line, #d7e0dc); padding-left: 14px; }
.dt-col { min-width: 170px; display: flex; flex-direction: column; gap: 6px; }
.dt-leaves { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--line, #d7e0dc); }
.dt-leaves li { font-size: 13px; color: var(--muted, #5b6b64); padding: 3px 0; }

/* Staff Recruitment home tiles (build 198) */
.rec-tile { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; }
.rec-tile .app-ic { position: relative; }
.rec-plus { position: absolute; right: -5px; top: -5px; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #0f1311; font-style: normal; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.rec-plus-key { position: static; display: inline-flex; width: 16px; height: 16px; font-size: 13px; vertical-align: -3px; border: 1px solid var(--line, #26302c); }
.rec-cnt { font-size: 12.5px; color: var(--muted, #8d9a94); margin-top: 2px; }
.rec-back { background: none; border: 0; cursor: pointer; font-size: inherit; padding: 0; }
.rg-card { padding: 10px 12px; margin: 10px 0 6px; }
.rg-top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.rg-hide { background: none; border: 0; color: var(--muted, #8d9a94); font-size: 13px; cursor: pointer; }
.rg-row { display: flex; align-items: stretch; gap: 4px; margin-top: 8px; overflow-x: auto; }
.rg-step { flex: 1 0 84px; display: flex; flex-direction: column; align-items: center; text-align: center; background: rgba(127,127,127,.12); border-radius: 8px; padding: 6px 4px; }
.rg-step b { color: var(--green, #2fbf86); font-size: 12.5px; }
.rg-t { font-size: 13px; font-weight: 600; line-height: 1.2; }
.rg-d { font-size: 12px; color: var(--muted, #8d9a94); line-height: 1.25; margin-top: 2px; }
.rg-arr { align-self: center; color: var(--muted, #8d9a94); font-size: 13px; }

.jobs-wrap { max-width: 640px; margin: 16px auto; padding: 0 16px; }
.jobs-bar { background: var(--green-soft, #e6f4ec); padding: 8px 16px; font-size: 14px; display: flex; gap: 12px; flex-wrap: wrap; }
.jobs-ul { margin: 6px 0 0 18px; padding: 0; }
.jobs-ul li { margin: 3px 0; }

.rec-back { margin-left: 12px; }

.jt-clock { position: sticky; top: 0; z-index: 5; background: var(--green, #1f7a4c); color: #fff; font-weight: 700; text-align: center; padding: 8px; border-radius: 10px; margin-bottom: 8px; }

/* Build 209: payroll guide and steps readable in dark and light themes */
.pf { background: var(--surface); }
.pf-key-points { color: var(--text); }
.pf-key-points strong { color: var(--text); }
.pf-key-points li { color: var(--text); opacity: .88; }
.step-row.current { border-color: var(--amber); background: var(--amber-soft); }
.step-row.done { border-color: var(--green); background: var(--green-soft); }
.step-row strong { color: var(--text); }
.step-row .muted { color: var(--muted); }
.step-row.todo { opacity: .75; }

/* Build 209: the lesson note editor looks like the book it will become */
.bke-bd { background: #2b2f2c; align-items: stretch; justify-content: center; padding: 0; }
.modal.bke { width: 100%; max-width: 860px; height: 100%; max-height: none; margin: 0 auto; padding: 0; display: flex; flex-direction: column; border-radius: 0; background: #fffdf6; color: #222; border-left: 6px solid #e6dfcc; overflow: hidden; }
.bke-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #1d211e; color: #eef2ef; flex: 0 0 auto; }
.bke-bar .btn { flex: 0 0 auto; }
.bke-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.bke-t strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bke-t span { font-size: 13px; opacity: .7; }
.bke-body { flex: 1; min-height: 0; overflow-y: auto; padding: 30px 44px 20px; font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.6; }
.bke-body .ln-form { gap: 14px; }
.bke-body label { font-family: Georgia, serif; color: #3d382f; }
.bke-body .input, .bke-body select.input, .bke-body textarea.input { background: #fffaf0; border: 1px solid #e0d8c4; color: #222; font-family: Georgia, serif; font-size: 16px; }
.bke-pg { display: none; }
.bke-pg.on { display: block; }
.bke-h { font-family: Georgia, serif; font-size: 22px; color: #1f5a3c; border-bottom: 2px solid #e6dfcc; padding-bottom: 6px; margin: 0 0 16px; }
.bke-pg .field + .field, .bke-pg .grid-2, .bke-pg .grid-4, .bke-pg .row, .bke-pg .card { margin-top: 12px; }
.bke-nav { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px 14px; background: #fffdf6; border-top: 1px solid #eee6d2; }
.bke-nav .btn { min-width: 100px; min-height: 44px; }
.bke-dots { display: flex; gap: 8px; }
@media (max-width: 640px) { .bke-body { padding: 20px 16px 14px; font-size: 16px; } .bke-t span { display: none; } .modal.bke { border-left-width: 3px; } }
.backdrop.bke-bd { background: #2b2f2c !important; align-items: stretch !important; padding: 0 !important; backdrop-filter: none; }
.backdrop.bke-bd .modal.bke { height: 100vh; height: 100dvh; max-height: none; box-shadow: 0 0 40px rgba(0,0,0,.5); }
.bke-pg .grid-4 .field, .bke-pg .grid-2 .field { }
.bke-pg .field label { display: block; margin-bottom: 4px; }
.backdrop.bke-bd .modal.bke { width: min(860px, 100%) !important; max-width: 860px !important; flex: 0 1 860px; }
.bke-pg textarea.input { min-height: 38vh; }
.bke-pg .field textarea.input[rows="2"], .bke-pg .field textarea.input[rows="3"] { min-height: 90px; }

/* Build 210: breadcrumb and one-level-per-screen navigation */
.nav-hide { display: none !important; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; font-size: 14px; }
.crumb { background: none; border: 0; padding: 4px 2px; font: inherit; color: var(--green); cursor: pointer; text-decoration: none; font-weight: 600; }
.crumb:hover { text-decoration: underline; }
.crumb-sep { color: var(--faint); }
.crumb-now { color: var(--text); font-weight: 700; }

/* Build 212: search box on Home */
.home-search { margin: 0 0 14px; }
.home-search input { width: 100%; box-sizing: border-box; min-height: 46px; padding: 10px 14px 10px 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>") no-repeat 13px center; color: var(--text); font: inherit; font-size: 16px; }
.home-search input:focus { outline: 2px solid var(--green); outline-offset: 1px; }

/* Build 216: View as bar */
.viewas-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.viewas-bar.on { background: #fff4d6; border-color: #e6b800; color: #5c4400; }
:root[data-theme="dark"] .viewas-bar.on { background: #3a2f0a; color: #ffe08a; }

/* Build 225: Home is the only menu, so the desktop sidebar is hidden. Keep a slim top bar so the light/dark button and the account menu stay reachable. */
@media (min-width: 881px) {
  body.no-side .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 20; padding: 10px 24px;
    background: var(--surface); color: var(--text); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  body.no-side .topbar .brand { color: var(--text); font-size: 16px; display: flex; align-items: center; gap: 10px; }
  body.no-side .topbar .brand-mark { width: 30px; height: 30px; }
  body.no-side .topbar .school { font-size: 12px; color: var(--muted); font-weight: 400; display: block; }
}

/* Build 226: on short pages (Home) the grid stretched the top bar to fill the screen. Rows now take only the height they need. */
body.no-side .app { align-content: start; }

/* Build 226: Sir Genius */
.gn-head { display: flex; align-items: center; gap: 14px; }
.gn-av { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: var(--green-bg, #e8f5ee); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.gn-av svg { width: 30px; height: 30px; }
.gn-av-lg { width: 56px; height: 56px; flex-basis: 56px; }
.gn-av-lg svg { width: 50px; height: 50px; }
.gn-card { padding: 0; overflow: hidden; }
.gn-chat { max-height: 58vh; min-height: 280px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg, #f4f6f5); }
.gn-msg { display: flex; gap: 8px; align-items: flex-end; }
.gn-msg.me { justify-content: flex-end; }
.gn-bub { max-width: min(82%, 640px); background: var(--surface, #fff); border: 1px solid var(--line, #e3e7e5); border-radius: 16px 16px 16px 4px; padding: 10px 14px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.gn-msg.me .gn-bub { background: var(--green, #1f7a4c); color: #fff; border-color: transparent; border-radius: 16px 16px 4px 16px; }
.gn-bub p { margin: 0 0 6px; } .gn-bub p:last-child { margin-bottom: 0; }
.gn-bub ul, .gn-bub ol { margin: 4px 0 6px 20px; padding: 0; } .gn-bub li { margin: 2px 0; }
.gn-src { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line, #e3e7e5); font-size: 13px; color: var(--green, #1f7a4c); }
.gn-src.amber { color: #a16207; } .gn-src svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 1px; }
.gn-acts { margin-top: 6px; }
.gn-sugs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; } .gn-sugs .chip { white-space: normal; text-align: left; height: auto; padding: 6px 10px; }
.gn-ctx { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px 0; } .gn-ctx .input { width: auto; min-width: 130px; min-height: 36px; padding: 4px 10px; }
.gn-compose { display: flex; gap: 8px; padding: 10px 12px; align-items: flex-end; } .gn-compose textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; }
.gn-note { padding: 0 12px 12px; margin: 0; }
.gn-typing { display: inline-flex; gap: 4px; vertical-align: middle; } .gn-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted, #6b7280); animation: gnb 1s infinite ease-in-out; }
.gn-typing i:nth-child(2) { animation-delay: .15s; } .gn-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes gnb { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }
:root[data-theme="dark"] .gn-src.amber { color: #fbbf24; }
@media (max-width: 600px) { .gn-chat { max-height: 62vh; padding: 12px; } .gn-bub { max-width: 88%; font-size: 15px; } }

/* Build 226: the demo and "View as" bars scroll away with the page. Before, they stayed fixed at the top together with the top bar and drew over it on phones. */
.demo-bar, .demo-bar.viewas-bar { position: relative; top: auto; }

.gn-ai{padding:10px 14px;border-radius:12px;background:color-mix(in srgb,var(--brand,#22c55e) 10%,transparent);border:1px solid color-mix(in srgb,var(--brand,#22c55e) 30%,transparent);font-size:.92rem;line-height:1.5}
.gn-ai.out{background:color-mix(in srgb,#f59e0b 12%,transparent);border-color:color-mix(in srgb,#f59e0b 40%,transparent)}
.gn-caret{display:inline-block;width:7px;height:1em;margin-left:2px;vertical-align:-2px;background:currentColor;opacity:.55;animation:gnBlink .8s steps(1) infinite}@keyframes gnBlink{50%{opacity:0}}
/* Build 226: Sir Genius chat list (like ChatGPT) */
.gn-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; margin-top: 12px; align-items: start; }
.gn-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg, 16px); padding: 12px; display: flex; flex-direction: column; gap: 8px; position: sticky; top: 12px; max-height: calc(100vh - 140px); }
.gn-newbtn { width: 100%; justify-content: center; }
.gn-search { font-size: 14px; }
.gn-list { overflow-y: auto; flex: 1; min-height: 80px; margin: 0 -4px; padding: 0 4px; }
.gn-grp { font-size: 12.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; margin: 12px 6px 4px; }
.gn-item { position: relative; display: flex; align-items: center; border-radius: 10px; }
.gn-item:hover { background: var(--raised); }
.gn-item.on { background: var(--green-soft); }
.gn-item-t { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 9px 8px; font: inherit; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.gn-item.on .gn-item-t { font-weight: 600; }
.gn-dots { background: none; border: 0; color: var(--faint); font-size: 18px; padding: 4px 8px; cursor: pointer; border-radius: 8px; }
.gn-dots:hover { background: var(--line); color: var(--text); }
.gn-menu { position: absolute; right: 4px; top: 36px; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.14); padding: 6px; min-width: 170px; display: flex; flex-direction: column; }
.gn-menu button { background: none; border: 0; text-align: left; font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 8px; color: var(--text); cursor: pointer; }
.gn-menu button:hover { background: var(--raised); }
.gn-menu .del { color: var(--red, #c2410c); }
.gn-side-note { margin: 4px 4px 0; }
.gn-main { min-width: 0; }
.gn-bar { display: flex; align-items: center; gap: 10px; }
.gn-bar-t { flex: 1; min-width: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn-burger { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; font-size: 18px; padding: 4px 10px; color: var(--text); cursor: pointer; }
.gn-main .gn-ai { margin-top: 10px; }
@media (max-width: 880px) {
  .gn-layout { display: block; }
  .gn-side { display: none; position: static; max-height: none; }
  .gn-layout.list .gn-side { display: flex; }
  .gn-layout.list .gn-main { display: none; }
  .gn-layout.list .gn-list { max-height: 62vh; }
  .gn-burger { display: inline-block; }
}
/* Build 226: Home screen polish (Option 3) */
body.has-school-colour .topbar { border-bottom: 3px solid var(--school); }
body.has-school-colour .home-hello h1 { color: var(--school); }
html[data-theme="dark"] body.has-school-colour .home-hello h1 { color: inherit; }
.home-season { display: flex; align-items: center; gap: 12px; border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; color: #fff; background: linear-gradient(120deg, var(--green-deep, #1f7a4c), #2a9d8f); }
body.has-school-colour .home-season { background: linear-gradient(120deg, var(--school), color-mix(in srgb, var(--school) 70%, #fff)); }
.home-season .hs-ic { font-size: 28px; line-height: 1; }
.home-season strong { font-size: 15px; } .home-season span { font-size: 14px; opacity: .92; }
.home-hello { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.home-hello h1 { margin: 0; font-size: 24px; line-height: 1.2; }
.home-hello p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.home-crest { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #fff; border: 1px solid var(--line); flex: none; }
.home-strip { display: flex; gap: 10px; margin: 12px 0 4px; overflow-x: auto; scrollbar-width: none; }
.home-pill { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 13.5px; white-space: nowrap; color: var(--muted); }
.home-pill b { font-size: 15px; margin-right: 5px; color: var(--text); }
.home-new { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid #f3dfb6; border-radius: 14px; padding: 10px 12px; margin: 14px 0 4px; position: relative; }
.home-new .hn-av { width: 44px; height: 44px; flex: none; border-radius: 50%; background: #fff6ea; display: grid; place-items: center; }
.home-new .hn-av svg { width: 40px; height: 40px; }
.home-new .hn-t { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); } .home-new .hn-t strong { color: var(--text); font-size: 15px; }
.home-new .hn-tag { background: #e5484d; color: #fff; font-size: 12px; font-weight: 800; border-radius: 6px; padding: 2px 6px; margin-right: 6px; vertical-align: 2px; }
.home-new .hn-x { background: none; border: 0; font-size: 20px; color: var(--faint); cursor: pointer; padding: 0 4px; }
.home-sec-h { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 4px; font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.home-sec-h .link-btn { text-transform: none; letter-spacing: 0; font-weight: 600; }
.home-mine-empty { margin: 4px 2px 0; }
.app-tile.pinned .app-ic { outline: 2px solid color-mix(in srgb, var(--green) 50%, transparent); outline-offset: 2px; }
.app-ic { position: relative; }
.app-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #e5484d; color: #fff; font-size: 12.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); line-height: 1; }
.pin-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; max-height: 55vh; overflow-y: auto; }
.pin-list .check-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 14px; }
.pin-list svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; flex: none; color: var(--muted); }
@media (max-width: 600px) { .pin-list { grid-template-columns: 1fr; } .home-hello h1 { font-size: 21px; } }
/* arrow button to move down and back up the Home list */
.home-nav { position: fixed; right: 18px; bottom: 24px; z-index: 40; width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--green-deep, #1f7a4c); color: #fff; font-size: 22px; box-shadow: 0 8px 20px rgba(0,0,0,.22); cursor: pointer; display: grid; place-items: center; transition: transform .2s ease, opacity .2s ease; }
body.has-school-colour .home-nav { background: var(--school); }
.home-nav .hn-arrow { display: inline-block; transition: transform .25s ease; }
.home-nav.up .hn-arrow { transform: rotate(180deg); }
.home-nav:hover { transform: translateY(-2px); }
.home-nav[hidden] { display: none; }
@media (max-width: 880px) { .home-nav { bottom: 84px; right: 14px; width: 46px; height: 46px; } }
/* Home: compact header so the apps show straight away */
.home-season { padding: 7px 12px; margin-bottom: 10px; border-radius: 12px; gap: 8px; font-size: 14px; }
.home-season .hs-ic { font-size: 18px; }
.home-season .hs-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.home-season strong { font-size: 14.5px; }
.home-hello { margin: 2px 0 10px; flex-wrap: wrap; gap: 8px 12px; }
.home-hello .hh-t { flex: 1 1 auto; min-width: 0; }
.home-hello h1 { font-size: 19px; }
.home-hello p { font-size: 13.5px; margin-top: 2px; }
.home-crest { width: 38px; height: 38px; }
.home-hello .home-strip { margin: 0; flex: 0 1 auto; }
.home-pill { padding: 5px 10px; font-size: 13px; } .home-pill b { font-size: 14.5px; }
.home-sec-h { margin: 12px 2px 2px; }
.home-sec-slim { margin: 4px 2px 0; }
.app-new { position: absolute; top: -7px; right: -10px; background: #e5484d; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .03em; padding: 2px 6px; border-radius: 7px; border: 2px solid var(--bg); line-height: 1.2; }
body.home-view .main .page > .notice, body.home-view .main .page > div > .notice { padding: 7px 12px; font-size: 13.5px; margin-bottom: 8px; }
@media (max-width: 600px) { .home-hello h1 { font-size: 18px; } .home-hello .home-strip { flex-basis: 100%; } }
@media (max-width: 600px) {
  body.home-view .main .page > .notice:not(.support) { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 6px 10px; margin-bottom: 6px; cursor: pointer; }
  body.home-view .main .page > .notice.open { white-space: normal; }
  body.home-view .main .page > .notice:not(.open)::after { content: ""; }
}
/* Build 226: TrackCS Market Services */
.mp-sec { margin: 18px 2px 8px; font-size: 15px; }
.mp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 700px) { .mp-grid { grid-template-columns: 1fr; } }
.mp-shop2 { display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer; padding: 12px 14px; background: linear-gradient(90deg, var(--tint) 0 130px, var(--surface) 130px); border: 1px solid var(--line); }
html[data-theme="dark"] .mp-shop2 { background: var(--surface); }
.mp-shop2:hover { border-color: var(--green); }
.mp-art { width: 108px; flex: none; display: block; }
.mp-art svg { width: 100%; height: auto; display: block; }
.mp-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 10px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.mp-sh-t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mp-sh-t strong { font-size: 16px; color: var(--text); }
.mp-shop-h { display: flex; align-items: center; gap: 14px; background: var(--tint); border-radius: 12px; padding: 10px 12px; }
html[data-theme="dark"] .mp-shop-h { background: var(--raised); }
.mp-pop { background: #fff4d6; color: #8a6100; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }
@media (max-width: 600px) { .mp-art { width: 84px; } .mp-shop2 { background: linear-gradient(90deg, var(--tint) 0 104px, var(--surface) 104px); } }
/* Long menu names (e.g. "TrackCS Market Services") wrap to two lines instead of running into the next item */
.tabbar .tab span { white-space: normal; text-align: center; line-height: 1.1; max-width: 74px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Show or hide password (build 227) */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { padding-right: 48px !important; width: 100%; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; border-radius: 10px; cursor: pointer; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--green); background: var(--green-soft, #e9f6ee); outline: none; }
.pw-eye.on { color: var(--green); }

/* ---- A Grade Series books (build 228) ---- */
.ag-shelf{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.ag-card{background:var(--surface,#fff);border:1px solid var(--line,#e2e8e4);border-radius:14px;padding:8px;display:flex;flex-direction:column;gap:8px}
.ag-card.off{opacity:.6}
.ag-cover{display:block;padding:0;border:0;background:#e9edeb;border-radius:9px;overflow:hidden;cursor:pointer;aspect-ratio:900/1267;width:100%}
.ag-cover img{display:block;width:100%;height:100%;object-fit:cover;pointer-events:none;-webkit-user-select:none;user-select:none}
.ag-meta{display:flex;flex-direction:column;gap:2px;padding:0 2px}
.ag-meta strong{font-size:14px;line-height:1.25}
.ag-btns{display:flex;flex-direction:column;gap:6px;margin-top:auto}
.ag-btns .btn{width:100%;justify-content:center}
.ag-read{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;margin:0 -4px}
.ag-bar{position:sticky;top:0;z-index:25;display:flex;gap:6px;align-items:center;background:var(--bg,#f4f6f5);padding:8px 2px}
.ag-bar select{flex:1;min-width:0;margin:0}
.ag-prog{height:3px;background:var(--line,#dfe6e2);border-radius:3px;margin:0 2px 6px}
.ag-prog i{display:block;height:3px;background:var(--green,#1a8a4f);border-radius:3px}
.ag-page{position:relative;background:#fff;border-radius:6px;box-shadow:0 1px 4px rgba(0,0,0,.12);margin:10px 0;padding:10px 0 4px;overflow:hidden;color:#16221c}
.ag-page img{display:block;width:100%;height:auto;background:#f3f5f4;pointer-events:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.ag-page img.ag-col{width:calc(100% - 8px);margin:0 4px}
.ag-page img:not([src]){min-height:120px}
.ag-page.flip{transform:rotate(180deg)}
.ag-wm{position:absolute;inset:0;pointer-events:none;background-repeat:repeat}
.ag-pn{text-align:center;font-size: 12.5px;color:#8a978f;margin:4px 0 2px}
.ag-nav{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}
@media (min-width:760px){.ag-read{margin:0 auto}}
@media print{.ag-read{display:none!important}}
.ag-btns .pill{justify-content:center;text-align:center}
/* A Grade reader: same text size across pages */
.ag-row img.ag-col{width:calc(100% - 8px);margin:0 4px}
.ag-wide{overflow:hidden}
.ag-wide.zoom{overflow-x:auto;-webkit-overflow-scrolling:touch}
.ag-wide.zoom img{width:190%;max-width:none}
@media (max-width:759px){.ag-wide{cursor:zoom-in}.ag-wide.zoom{cursor:zoom-out}}
@media (min-width:760px){
  .ag-read{max-width:900px}
  .ag-row{display:flex;align-items:flex-start;gap:0;padding:0 2%}
  .ag-row img.ag-col{width:50%;margin:0}
  .ag-wide img{width:96%;margin:0 2%}
}
/* A Grade reader toolbar */
.ag-foot{position:sticky;bottom:10px;z-index:24;display:flex;justify-content:space-between;gap:2px;margin:12px 0 4px;padding:6px;background:var(--surface,#fff);border:1px solid var(--line,#dfe6e2);border-radius:14px;box-shadow:0 6px 20px rgba(0,0,0,.14)}
.ag-fb{flex:1;display:flex;flex-direction:column;align-items:center;gap:1px;min-width:0;padding:6px 2px;border:0;background:none;border-radius:10px;color:var(--text);font:inherit;font-size: 12.5px;cursor:pointer;white-space:nowrap}
.ag-fb b{font-size:18px;line-height:1;color:var(--green,#1a8a4f)}
.ag-fb:hover:not([disabled]){background:var(--green-soft,#e7f5ec)}
.ag-fb[disabled]{opacity:.35;cursor:default}
.ag-fb-note{justify-content:center;color:var(--green,#1a8a4f);font-weight:600}
@media (max-width:880px){.ag-foot{bottom:calc(70px + env(safe-area-inset-bottom,0px))}}
.ag-toc{display:flex;flex-direction:column;gap:4px;max-height:65vh;overflow-y:auto}
.ag-toc-i{display:flex;justify-content:space-between;gap:10px;text-align:left;padding:10px 12px;border:1px solid var(--line,#dfe6e2);border-radius:10px;background:var(--surface,#fff);color:var(--text);font:inherit;cursor:pointer}
.ag-toc-i.on{border-color:var(--green,#1a8a4f);background:var(--green-soft,#e7f5ec)}
.ag-toc-i[disabled]{opacity:.5;cursor:default}
.ag-toc-i span:last-child{white-space:nowrap;flex-shrink:0}

/* ---- Drawing Board (drawboard.js) ---- */
.db { margin-top: 8px; }
.db-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.db-set { font-size: 13px; font-weight: 600; color: var(--green); background: var(--green-soft); border-radius: 20px; padding: 4px 10px; }
.db-paper { width: auto; padding: 6px 8px; font-size: 14px; }
.db-zoom { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.db-top .btn.on { background: var(--green-soft); color: var(--green); border-color: transparent; }
.db-axes { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); }
.db-axg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.db-axg label span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.db-axg .input { padding: 6px 8px; font-size: 14px; }
@media (max-width: 560px) { .db-axg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.db-msg { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; margin: 8px 0 6px; font-size: 13px; }
.db-read { font-weight: 700; color: var(--green); }
.db-hint { color: var(--muted); }
.db-wrap { position: relative; overflow: auto; max-height: 78vh; border: 1px solid #cfd8d2; border-radius: 10px; background: #fff; -webkit-overflow-scrolling: touch; }
.db-c { display: block; touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; }
.db-ro .db-c { cursor: default; touch-action: auto; }
.db-lab { position: absolute; z-index: 4; display: flex; gap: 4px; align-items: center; background: #fff; border: 1px solid #b9c6bf; border-radius: 10px; padding: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.18); width: 256px; }
.db-lab .input { flex: 1; padding: 6px 8px; font-size: 15px; background: #fff; color: #16233a; border-color: #cfd8d2; }
.db-sel { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.db-kit { margin-top: 8px; }
.db-kt { display: flex; gap: 6px; flex-wrap: wrap; }
.db-tiles { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; }
.db-tile { flex: none; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 3px; background: #fff; border: 1.5px solid #d6ded9; border-radius: 10px; padding: 4px; cursor: pointer; }
.db-tile canvas { width: 80px; height: 50px; }
.db-tile span { font-size: 12px; color: #33433b; text-align: center; line-height: 1.2; }
.db-tile.on { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.db-tools { display: flex; gap: 4px; overflow-x: auto; margin-top: 8px; padding: 6px; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; }
.db-t { flex: 1 0 auto; min-width: 54px; display: flex; flex-direction: column; align-items: center; gap: 1px; background: none; border: 0; border-radius: 9px; padding: 6px 4px; color: var(--muted); font-size: 12.5px; cursor: pointer; font-family: inherit; }
.db-t b { font-size: 18px; line-height: 1.2; color: var(--text); font-weight: 600; }
.db-t.on { background: var(--green-soft); color: var(--green); font-weight: 700; }
.db-t.on b { color: var(--green); }
@media print { .db-top, .db-tools, .db-msg, .db-kit, .db-sel { display: none; } }
.db-lab[hidden], .db-sel[hidden], .db-kit[hidden], .db-axes[hidden] { display: none !important; }
.db-top .input.db-paper { width: auto; min-width: 0; flex: 0 0 auto; padding: 5px 8px; font-size: 13.5px; height: auto; }
.db-top .btn-sm { padding: 5px 9px; font-size: 13px; }
.db-tools { flex-wrap: wrap; overflow: visible; }
.db-t { flex: 1 0 17%; }
.db-msg { min-height: 36px; align-content: flex-start; }
.db-wrap { text-align: center; } .db-c { margin: 0 auto; }

/* ---- Exam Marker ---- */
.pill-blue { background: rgba(59,130,246,.14); color: #6ea8fe; }
.em-row { gap: 10px; align-items: center; }
.em-score { white-space: nowrap; font-size: 14px; }
.em-how li { margin: 4px 0 4px 18px; }
.em-who { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--green-soft); margin-bottom: 10px; }
.em-who svg { width: 26px; height: 26px; color: var(--green); flex: none; }
.em-who strong { display: block; font-size: 16px; }
.em-who span { display: block; }
.em-tips { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--raised); }
.em-tips ul { margin: 6px 0 0 18px; font-size: 14px; line-height: 1.5; }
.em-pages, .em-bulk { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.em-bulk { grid-template-columns: 1fr; }
.em-pg, .em-bk { position: relative; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.em-pg.bad, .em-bk.bad { border-color: var(--red); }
.em-pg img { display: block; width: 100%; height: 150px; object-fit: cover; }
.em-pg-cap { padding: 6px 8px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.em-bk { display: flex; gap: 10px; align-items: center; padding: 6px; }
.em-bk img { width: 64px; height: 84px; object-fit: cover; border-radius: 6px; flex: none; }
.em-bk > div { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.em-good { color: var(--green); font-size: 13px; } .em-bad { color: var(--red); font-size: 13px; }
.em-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.em-bk .em-x { position: static; flex: none; }
.em-big { display: block; width: 100%; max-width: 720px; margin: 8px auto 0; border-radius: 8px; border: 1px solid var(--line); }
.em-q { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.em-mk { width: 76px; padding: 6px 8px; text-align: center; }
.em-tr { white-space: pre-wrap; font-family: inherit; font-size: 14.5px; background: var(--raised); border-radius: 8px; padding: 8px 10px; margin: 8px 0 4px; max-height: 260px; overflow: auto; }

/* ---- Maths and chemistry keys ---- */
.mk-wrap .chip { margin: 0; }
.mk-bar { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; padding: 6px; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; }
.mk-k { min-width: 42px; padding: 7px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-family: 'Cambria Math', 'STIX Two Math', 'Times New Roman', serif; font-size: 16px; cursor: pointer; }
.mk-k:active { background: var(--green-soft); }
.mk-prev { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: #fff; color: #16233a; font-family: 'Cambria Math', 'STIX Two Math', 'Times New Roman', serif; font-size: 18px; line-height: 2; border: 1px dashed #cfd8d2; }
.mk-fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; line-height: 1.15; margin: 0 2px; }
.mk-fr > span:first-child { border-bottom: 1.3px solid currentColor; padding: 0 3px; }
.mk-fr > span:last-child { padding: 0 3px; }
.mk-sq { border-top: 1.3px solid currentColor; padding: 0 2px; }
.em-own-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 8px; }
.em-heads { background: #fff; color: #111; padding: 8px; }
.em-head { border: 1.5px solid #222; border-radius: 6px; padding: 14px 16px; margin-bottom: 16px; page-break-after: always; break-after: page; }
.em-head-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.em-h-school { font-weight: 700; font-size: 15px; } .em-h-title { font-weight: 700; font-size: 17px; margin-top: 2px; } .em-h-sub { font-size: 14px; color: #444; }
.em-qr { width: 96px; height: 96px; flex: none; } .em-qr svg { width: 96px; height: 96px; }
.em-h-name { display: grid; grid-template-columns: auto 1fr auto auto; gap: 6px 10px; align-items: baseline; margin-top: 10px; font-size: 15px; border-top: 1px solid #ccc; padding-top: 8px; }
.em-h-name span { font-size: 13px; color: #555; } .em-h-name strong { font-size: 18px; }
.em-h-note { font-size: 13px; color: #444; margin: 8px 0; }
.em-line { border-bottom: 1px solid #b9c4cf; height: 30px; }
@media print { .em-head { border-color: #000; } .em-lines { display: block; } .em-line { height: 34px; } }
.mk-k.mk-wide{min-width:auto;padding:0 10px;font-size: 14px}
.mk-calc{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-top:6px}
.mk-calc .input{flex:1;min-width:160px}
.mk-calc-out{font-weight:700;font-size:16px}
.mk-tbl{border-collapse:collapse;margin:6px 0}
.mk-tbl td,.mk-tbl th{border:1px solid var(--line,#cfd6dd);padding:4px 10px;min-width:40px}
.mk-tbl th{background:var(--soft,#f1f4f7)}
.sb-card:fullscreen{overflow:auto;background:var(--bg,#fff);padding:16px;border-radius:0}
.sb-card:fullscreen .db-wrap{max-height:calc(100vh - 230px)}
.em-idw{border:1px solid #f0c36d;background:#fff8e6;border-radius:10px;padding:10px 12px;margin:8px 0;font-size:14px}
.em-idw ul{margin:6px 0 0 18px;padding:0}
[data-theme=dark] .em-idw{background:#3a2f12;border-color:#7a5d1a}

/* Build 235: Home and pages fit every desktop screen. Tiles, text and spacing grow with the screen width; phones are not touched. */
@media (min-width: 1280px) {
}
@media (min-width: 1280px) {
  body.no-side .sb-card .db { display: grid; grid-template-columns: minmax(0, 1fr) clamp(240px, 19vw, 380px); column-gap: 18px; align-items: start;
    grid-template-areas: "top top" "axes axes" "msg msg" "wrap tools" "wrap kit" "wrap sel"; grid-template-rows: auto auto auto auto auto 1fr; }
  body.no-side .sb-card .db .db-top { grid-area: top; } body.no-side .sb-card .db .db-axes { grid-area: axes; } body.no-side .sb-card .db .db-msg { grid-area: msg; }
  body.no-side .sb-card .db .db-wrap { grid-area: wrap; max-height: max(420px, calc(100vh - 360px)); }
  body.no-side .sb-card .db .db-tools { grid-area: tools; }
  body.no-side .sb-card .db .db-kit { grid-area: kit; } body.no-side .sb-card .db .db-sel { grid-area: sel; }
  body.no-side .sb-card .db .db-t { flex: 1 0 40%; }
}

/* Build 239: the "Where to?" / "Choose a school" screen: big, friendly cards */
.auth .login-main:has(.login-group) { max-width: 680px; padding-left: clamp(24px, 5vw, 72px); padding-right: clamp(24px, 5vw, 72px); }
.auth .login-main:has(.login-group) h2 { font-size: clamp(30px, 4.2vw, 42px); letter-spacing: -.02em; line-height: 1.1; }
.auth .login-main:has(.login-group) > p.muted { font-size: 17px; }
.auth .login-group { margin-top: 30px; display: grid; gap: 16px; }
.auth .login-group .acct-btn { position: relative; gap: 20px; min-height: 104px; padding: 22px 26px; border-radius: 22px; border: 1.5px solid var(--line); background: linear-gradient(135deg, var(--surface) 0%, var(--green-soft) 160%); box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 10px 28px rgba(20,80,50,.08); cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.auth .login-group .acct-btn + .acct-btn { }
.auth .login-group .acct-btn:hover { transform: translateY(-3px); border-color: var(--green); box-shadow: 0 4px 8px rgba(0,0,0,.06), 0 18px 40px rgba(20,110,70,.18); }
.auth .login-group .acct-btn:active { transform: translateY(0); }
.auth .login-group .acct-btn .avatar { flex: none; width: 68px; height: 68px; border-radius: 20px; font-size: 22px; font-weight: 800; letter-spacing: .02em; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #34c27a 0%, #157a45 100%); box-shadow: 0 8px 18px rgba(21,122,69,.35); }
.auth .login-group .acct-btn:nth-child(2n) .avatar { background: linear-gradient(145deg, #3d8bfd 0%, #2457c5 100%); box-shadow: 0 8px 18px rgba(36,87,197,.35); }
.auth .login-group .acct-btn:nth-child(3n) .avatar { background: linear-gradient(145deg, #f0b429 0%, #c47f0a 100%); box-shadow: 0 8px 18px rgba(196,127,10,.35); }
.auth .login-group .acct-btn .who strong { font-size: 22px; line-height: 1.2; letter-spacing: -.01em; }
.auth .login-group .acct-btn .who span { display: block; margin-top: 5px; font-size: 15px; }
.auth .login-group .acct-btn > svg { width: 28px; height: 28px; color: var(--green); flex: none; transition: transform .15s; }
.auth .login-group .acct-btn:hover > svg { transform: translateX(4px); }
@media (max-width: 640px) { .auth .login-group .acct-btn { min-height: 92px; padding: 18px 18px; gap: 16px; } .auth .login-group .acct-btn .avatar { width: 58px; height: 58px; font-size: 19px; border-radius: 17px; } .auth .login-group .acct-btn .who strong { font-size: 19px; } }
html[data-theme="light"] .auth .login-group .acct-btn:hover { background: linear-gradient(135deg, #fff 0%, #dff3e7 160%); }
.auth .login-main:has(.login-group) .link-btn { font-size: 15px; font-weight: 600; }

/* Build 242: decorative sides on the sign-in screen (school theme, no figures) */
.login.auth { position: relative; overflow: hidden; background-color: var(--bg); background-image: radial-gradient(circle at 1px 1px, rgba(31,110,75,.15) 1.4px, transparent 1.6px), radial-gradient(60% 50% at 92% 6%, rgba(52,194,122,.20), transparent 70%), radial-gradient(55% 45% at 85% 100%, rgba(240,180,41,.16), transparent 70%); background-size: 26px 26px, auto, auto; }
.login.auth::after { content: ""; position: absolute; right: -160px; bottom: -160px; width: 640px; height: 640px; pointer-events: none; opacity: .55; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400' fill='none' stroke='%231f6e4b' stroke-opacity='.35' stroke-width='1.4'><circle cx='200' cy='200' r='190'/><circle cx='200' cy='200' r='150'/><circle cx='200' cy='200' r='110'/><circle cx='200' cy='200' r='70'/><path d='M200 10V390M10 200H390M65 65 335 335M335 65 65 335' stroke-dasharray='3 7'/><path d='M200 200 330 110' stroke-width='2.4' stroke-opacity='.6'/><circle cx='330' cy='110' r='6' fill='%23f0b429' stroke='none'/></svg>") center/contain no-repeat; animation: scSpin 90s linear infinite; }
@keyframes scSpin { to { transform: rotate(360deg); } }
.login-side { position: relative; overflow: hidden; isolation: isolate; }
.login-side > * { position: relative; z-index: 2; }
.login-side::before, .login-side::after { content: ""; position: absolute; border-radius: 50%; z-index: 0; filter: blur(60px); pointer-events: none; }
.login-side::before { width: 420px; height: 420px; right: -120px; top: -100px; background: rgba(52,194,122,.38); animation: scDrift 14s ease-in-out infinite alternate; }
.login-side::after { width: 360px; height: 360px; left: -120px; bottom: -120px; background: rgba(240,180,41,.26); animation: scDrift 18s ease-in-out infinite alternate-reverse; }
@keyframes scDrift { to { transform: translate(40px, 30px) scale(1.12); } }
.lg-subj { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 22px 0 14px; max-width: 540px; }
.lg-t { border-radius: 22px; padding: 16px 14px 14px; color: #fff; box-shadow: 0 14px 30px rgba(0,0,0,.16); animation: scFloat 6s ease-in-out infinite; position: relative; overflow: hidden; min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; }
.lg-t::after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; right: -28px; top: -28px; background: rgba(255,255,255,.16); }
.lg-t b { font-size: 25px; line-height: 1.1; letter-spacing: -.01em; font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,.18); }
.lg-t span { font-size: 13px; font-weight: 700; opacity: .95; }
.lg-t:nth-child(1) { background: linear-gradient(145deg, #34c27a, #157a45); animation-delay: -.5s; }
.lg-t:nth-child(2) { translate: 0 16px; background: linear-gradient(145deg, #3d8bfd, #2457c5); animation-delay: -2s; }
.lg-t:nth-child(3) { background: linear-gradient(145deg, #f0b429, #c47f0a); animation-delay: -3.5s; }
.lg-t:nth-child(4) { background: linear-gradient(145deg, #9a6bff, #5a32c4); animation-delay: -1.2s; }
.lg-t:nth-child(5) { translate: 0 16px; background: linear-gradient(145deg, #ff7a59, #d4401f); animation-delay: -2.7s; }
.lg-t:nth-child(6) { background: linear-gradient(145deg, #25b8c8, #137a8a); animation-delay: -4.2s; }
@keyframes scFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.lg-perks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; max-width: 640px; margin-bottom: 8px; }
.lg-perk { display: flex; align-items: center; gap: 12px; font-size: 14.5px; line-height: 1.3; font-weight: 600; color: var(--text); }
.lg-perk i { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-size: 18px; color: #fff; background: linear-gradient(145deg, #34c27a, #157a45); box-shadow: 0 6px 14px rgba(21,122,69,.3); }
.lg-perk:nth-child(4n+2) i { background: linear-gradient(145deg, #3d8bfd, #2457c5); box-shadow: 0 6px 14px rgba(36,87,197,.3); }
.lg-perk:nth-child(4n+3) i { background: linear-gradient(145deg, #f0b429, #c47f0a); box-shadow: 0 6px 14px rgba(196,127,10,.3); }
@media (max-width: 900px) { .lg-subj, .lg-perks { display: none; } .login.auth::after { width: 360px; height: 360px; right: -120px; bottom: -120px; } }
@media (prefers-reduced-motion: reduce) { .lg-t, .login.auth::after, .login-side::before, .login-side::after { animation: none; } }
.lg-perk:nth-child(4n) i { background: linear-gradient(145deg, #9a6bff, #5a32c4); box-shadow: 0 6px 14px rgba(90,50,196,.3); }
.lg-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 640px; margin: 4px 0 16px; }
.lg-h { display: flex; gap: 12px; align-items: flex-start; padding: 15px 16px; border-radius: 20px; color: #fff; background: linear-gradient(145deg, #1f9d5c, #0f6a3b); box-shadow: 0 14px 30px rgba(15,106,59,.30); position: relative; overflow: hidden; }
.lg-h2 { background: linear-gradient(145deg, #3d8bfd, #2457c5); box-shadow: 0 14px 30px rgba(36,87,197,.30); }
.lg-h::after { content: ""; position: absolute; width: 110px; height: 110px; border-radius: 50%; right: -34px; top: -34px; background: rgba(255,255,255,.15); }
.lg-h i { flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-style: normal; font-size: 21px; background: rgba(255,255,255,.22); }
.lg-h strong { display: block; font-size: 18px; letter-spacing: -.01em; margin-bottom: 4px; }
.lg-h span { display: block; font-size: 12.5px; line-height: 1.4; opacity: .95; font-weight: 500; }
@media (max-width: 900px) { .lg-hero { display: none; } }
.lg-t { min-height: 92px; } .lg-t b { font-size: 22px; }
@media (max-height: 820px) { .lg-subj { display: none; } }
@media (max-height: 640px) { .lg-perks { display: none; } }

/* Build 245: word cloud */
.lg-cloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 16px; max-width: 640px; margin: 26px 0 10px; padding: 8px 0; }
.lg-cloud .w { display: inline-block; font-weight: 800; letter-spacing: -.02em; line-height: 1.12; white-space: nowrap; animation: scFloat 7s ease-in-out infinite; }
.lg-cloud .w1 { font-size: 17px; opacity: .8; } .lg-cloud .w2 { font-size: 25px; } .lg-cloud .w3 { font-size: 38px; }
.lg-cloud .w4 { font-size: 56px; padding: 6px 22px 10px; border-radius: 22px; color: #fff; box-shadow: 0 16px 34px rgba(0,0,0,.18); }
.lg-cloud .w4.c-g { background: linear-gradient(145deg, #1f9d5c, #0f6a3b); } .lg-cloud .w4.c-b { background: linear-gradient(145deg, #3d8bfd, #2457c5); }
.lg-cloud .w:not(.w4) { background-clip: text; -webkit-background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.lg-cloud .c-g:not(.w4) { background-image: linear-gradient(135deg, #34c27a, #0f6a3b); } .lg-cloud .c-b:not(.w4) { background-image: linear-gradient(135deg, #3d8bfd, #2457c5); }
.lg-cloud .c-y { background-image: linear-gradient(135deg, #f0b429, #b86f00); } .lg-cloud .c-p { background-image: linear-gradient(135deg, #9a6bff, #5a32c4); } .lg-cloud .c-o { background-image: linear-gradient(135deg, #ff7a59, #d4401f); }
.lg-cloud .w:nth-child(3n) { transform-origin: center; rotate: -4deg; } .lg-cloud .w:nth-child(5n+1) { rotate: 3deg; } .lg-cloud .w:nth-child(4n+2) { animation-delay: -2s; } .lg-cloud .w:nth-child(3n+1) { animation-delay: -4s; } .lg-cloud .w:nth-child(7n) { animation-delay: -5.5s; }
.lg-say { font-size: 20px; font-weight: 800; color: #157a45; max-width: 640px; text-align: center; letter-spacing: -.01em; }
@media (max-width: 900px) { .lg-cloud, .lg-say { display: none; } }
@media (max-height: 700px) { .lg-cloud .w4 { font-size: 44px; } .lg-cloud .w3 { font-size: 30px; } }
@media (prefers-reduced-motion: reduce) { .lg-cloud .w { animation: none; } }
.login.auth::before { content: "TC"; position: absolute; right: 56px; top: 18px; font-size: clamp(140px, 17vw, 260px); font-weight: 900; letter-spacing: -.05em; line-height: 1; pointer-events: none; background: linear-gradient(145deg, #34c27a, #3d8bfd); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; opacity: .13; }
@media (max-width: 900px) { .login.auth::before { font-size: 120px; right: 16px; top: 4px; opacity: .1; } }
.lg-cloud { max-width: 700px; gap: 4px 14px; }
.lg-cloud .w3 { font-size: 34px; } .lg-cloud .w4 { font-size: 52px; }
@media (max-height: 820px) { .login-side { padding-top: 32px; padding-bottom: 28px; } .login-side h1 { margin-top: 12px; font-size: 38px; } .login-side p.lead { margin-top: 10px; font-size: 15px; } .lg-cloud { margin: 10px 0 4px; } .lg-cloud .w4 { font-size: 40px; padding: 4px 16px 7px; } .lg-cloud .w3 { font-size: 27px; } .lg-cloud .w2 { font-size: 19px; } .lg-cloud .w1 { font-size: 14px; } .lg-say { display: none; } }

/* Build 247: drawing board help text and tool labels, easier to read */
.db-msg { font-size: 15px; line-height: 1.45; }
.db-hint { font-size: 15px; }
.db-set { font-size: 14px; } .db-zoom { font-size: 14px; }
.db-tile span { font-size: 13.5px; } .db-t { font-size: 14px; } .db-t b { font-size: 20px; }
.db-axg label span { font-size: 13.5px; }
.db-top .btn-sm { font-size: 14px; padding: 7px 11px; }
.db-top .input.db-paper { font-size: 14px; }

/* ---- Build 249: Drawing Board tabs and lesson-note figures ---- */
.sb-tabs{display:flex;flex-wrap:wrap;gap:6px;align-items:center;border-bottom:1px solid var(--line);padding-bottom:8px}
.sb-tab{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:10px;background:var(--bg-soft,#f4f6f4);overflow:hidden}
.sb-tab.on{background:#fff;border-color:var(--green,#1f7a4d);box-shadow:0 0 0 2px rgba(31,122,77,.15)}
.sb-tab-b{border:0;background:none;padding:9px 12px;font:600 14px/1.1 inherit;font-family:inherit;color:inherit;cursor:pointer;display:inline-flex;align-items:center;gap:7px;min-height:40px}
.sb-tab-x{border:0;background:none;padding:0 9px;font-size:16px;line-height:1;color:var(--muted,#6b7a72);cursor:pointer;min-height:40px}
.sb-tab-x:hover{color:var(--red,#c0392b)}
.sb-dot{width:8px;height:8px;border-radius:50%;background:var(--green,#1f7a4d);display:inline-block}
.sb-add{border:1px dashed var(--green,#1f7a4d);background:none;color:var(--green,#1f7a4d);border-radius:10px;padding:0 12px;min-height:40px;font:600 14px/1 inherit;font-family:inherit;cursor:pointer;display:inline-flex;align-items:center;gap:6px}
.sb-add svg{width:15px;height:15px}
.ln-figs{display:flex;flex-wrap:wrap;gap:10px;margin-top:6px}
.ln-figt{position:relative;width:140px;border:1px solid var(--line);border-radius:8px;padding:6px;background:#fff;text-align:center}
.ln-figt img{width:100%;height:92px;object-fit:contain;display:block}
.ln-figt span{font-size:13px;color:var(--muted,#6b7a72)}
.ln-figx{position:absolute;top:2px;right:2px;width:26px;height:26px;border-radius:50%;border:0;background:rgba(0,0,0,.6);color:#fff;font-size:17px;line-height:1;cursor:pointer}
.ln-figov{position:fixed;inset:0;z-index:100000;background:var(--bg,#fff);display:flex;flex-direction:column}
.ln-figov-bar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;padding:10px 14px;border-bottom:1px solid var(--line);background:#fff}
.ln-figov-body{flex:1;overflow:auto;padding:12px 14px}
.ln-fig{margin:12px 0;text-align:center;break-inside:avoid}
.ln-fig img{max-width:100%;height:auto;border:1px solid #d8ded9;border-radius:4px;background:#fff}
.ln-fig figcaption{font-size:13px;color:#555;margin-top:4px}
@media print{.ln-fig img{max-height:230mm;width:auto}}
/* Build 250: draw a figure for an exam question */
.qg-figbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 10px;padding:10px;border:1px dashed var(--green,#1f7a4d);border-radius:10px;background:rgba(31,122,77,.05)}
.qg-paper .qg-img img{max-width:100%;height:auto;border:1px solid #d8ded9;background:#fff}
.ln-figpick{cursor:pointer;font:inherit}
.ln-figpick:hover{border-color:var(--green,#1f7a4d)}

/* Build 258: icons stay at their normal size on every screen; the words under them are larger, bold and dark so they are easy to read. */
.app-lbl { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.25; }
.sub-tiles > * { font-size: 15px; font-weight: 700; color: var(--text); }
@media (min-width: 1280px) { .app-lbl { font-size: 16px; } .sub-tiles > * { font-size: 16px; } }
/* Build 258: use the whole width of the screen. Icons keep their size and spread across the row instead of leaving empty margins. */
body.no-side .page { width: 100%; max-width: 100%; box-sizing: border-box; padding-left: clamp(16px, 5vw, 96px); padding-right: clamp(16px, 5vw, 96px); }
body.no-side .app-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 18px 6px; }
/* Build 258: forms and long pages keep a comfortable maximum width; only Home uses the whole screen. */

/* Build 259: Exam Marker folders */
.em-fold { background: none; border: 0; cursor: pointer; position: relative; font: inherit; }
.em-badge { position: absolute; top: -4px; right: calc(50% - 46px); background: #e0892b; color: #fff; border-radius: 99px; font-size: 12px; padding: 2px 8px; font-weight: 700; }

.em-crumb .link-btn { color: var(--green); font-weight: 700; text-decoration: underline; }

/* Build 262: sign-in and "Where to?" screens. On wide screens the content is centred in each half and grows with the screen instead of hugging the left edge. */
@media (min-width: 1100px) {
  .login.auth .login-side > div:not(.brand), .login.auth .login-side > .lg-cloud, .login.auth .login-side > .lg-say, .login.auth .login-side > p { align-self: center; width: 100%; max-width: 640px; }
  .login.auth .login-side > .lg-cloud { justify-content: center; }
  .login.auth .login-main { margin-left: auto; margin-right: auto; width: 100%; }
}
@media (min-width: 1500px) { .login.auth .login-side > :not(.brand), .login.auth .login-main { zoom: 1.1; } }
@media (min-width: 1900px) { .login.auth .login-side > :not(.brand), .login.auth .login-main { zoom: 1.25; } }
@media (min-width: 2300px) { .login.auth .login-side > :not(.brand), .login.auth .login-main { zoom: 1.5; } }
@media (min-width: 3000px) { .login.auth .login-side > :not(.brand), .login.auth .login-main { zoom: 1.9; } }
@media (min-width: 1500px) and (max-height: 950px) { .login.auth .login-side > :not(.brand), .login.auth .login-main { zoom: 1.1; } }

/* Build 262: the "Where to?" cards are longer and bigger on wide screens. */
@media (min-width: 1100px) {
  .auth .login-main:has(.login-group) { max-width: 920px; }
  .auth .login-group { gap: 22px; }
  .auth .login-group .acct-btn { min-height: 148px; padding: 30px 36px; gap: 28px; border-radius: 28px; }
  .auth .login-group .acct-btn .avatar { width: 88px; height: 88px; border-radius: 26px; font-size: 28px; }
  .auth .login-group .acct-btn .who strong { font-size: 28px; }
  .auth .login-group .acct-btn .who span { font-size: 18px; margin-top: 8px; }
  .auth .login-group .acct-btn > svg { width: 34px; height: 34px; }
}
