/* Components. New pages should only use these classes. */

/* Card */
.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--shadow); padding: var(--s4); }
.card.flat { box-shadow: none; }
.card > * + * { margin-top: var(--s3); }

/* Stat */
.stat { display: flex; flex-direction: column; gap: 2px; padding: var(--s3) var(--s4); }
.stat .label { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat .hint { font-size: var(--fs-xs); color: var(--muted); }
.stat.alert .value { color: var(--bad); }
.stat.good .value { color: var(--ok); }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: var(--fs-xs); font-weight: 700; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { background: color-mix(in srgb, var(--ok) 15%, var(--sheet)); color: var(--ok); }
.chip.warn { background: color-mix(in srgb, var(--warn) 16%, var(--sheet)); color: var(--warn); }
.chip.bad { background: color-mix(in srgb, var(--bad) 14%, var(--sheet)); color: var(--bad); }
.chip.due { background: var(--hl); color: #3a2f00; }
.chip.plain::before { display: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s5); border-radius: var(--r-sm); border: 2px solid var(--btn-bg); background: var(--btn-bg); color: var(--btn-fg); font-weight: 700; cursor: pointer; text-align: center; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; }

/* List */
.list { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; }
.li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); min-height: 60px; color: inherit; }
.li + .li { border-top: 1px solid var(--rule); }
.li .lead { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; font-weight: 800; }
.li .lead svg { width: 22px; height: 22px; }
.li .body { flex: 1; min-width: 0; }
.li .body b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .body span { font-size: var(--fs-sm); color: var(--muted); }
.li .end { text-align: right; font-weight: 700; flex: none; }
.li .end small { display: block; font-weight: 400; font-size: var(--fs-xs); color: var(--muted); }
.li .end.neg { color: var(--bad); } .li .end.pos { color: var(--ok); }
.li.unread { background: var(--unread); }

/* Signature: the notebook page. Homework lives on ruled paper with a red margin. */
.page {
  position: relative; border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--shadow);
  background-color: var(--sheet);
  background-image:
    linear-gradient(to right, transparent 0 45px, var(--margin) 45px 47px, transparent 47px),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--ruled) - 1px), var(--rule) calc(var(--ruled) - 1px) var(--ruled));
  background-position: 0 0, 0 calc(var(--s4) + 6px);
  padding: var(--s4) var(--s4) var(--s4) 62px;
  line-height: var(--ruled);
  color: var(--text); display: block;
}
.page .subject { position: absolute; left: 0; top: var(--s4); width: 46px; text-align: center; font-weight: 800; font-size: 10px; color: var(--brand); line-height: 1.1; letter-spacing: 0; text-transform: uppercase; }
.page .subject i { display: block; font-style: normal; font-size: 1.3rem; color: var(--brand); }
.page h3 { line-height: var(--ruled); font-size: var(--fs-md); }
.page .meta { font-size: var(--fs-sm); color: var(--muted); line-height: var(--ruled); }
.page .foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s2); }
.page .foot > * { line-height: 1.2; }
.remark { font-family: var(--font-hand); color: var(--pen); font-size: 1.45rem; line-height: 1.1; transform: rotate(-1.2deg); }
.stars { color: var(--star); letter-spacing: 2px; font-size: 1.1rem; }
.stars .off { color: var(--rule); }
.page.checked::after { content: "Checked"; position: absolute; right: 14px; top: 10px; transform: rotate(6deg); border: 2px solid var(--pen); color: var(--pen); border-radius: 6px; font-weight: 800; font-size: var(--fs-xs); padding: 0 8px; line-height: 20px; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }

/* Tabs (segmented) */
.tabs { display: flex; background: var(--well); border-radius: var(--r-sm); padding: 4px; gap: 4px; }
.tabs button { flex: 1; min-height: 40px; border: 0; background: transparent; border-radius: 8px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--raised); color: var(--brand); box-shadow: var(--shadow); }

/* Forms */
.field { display: grid; gap: 6px; }
.field label { font-size: var(--fs-sm); font-weight: 600; }
.input { width: 100%; min-height: 48px; padding: 0 var(--s4); border: 2px solid var(--rule); border-radius: var(--r-sm); background: var(--field); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--hl); }
.field .help { font-size: var(--fs-xs); color: var(--muted); }
.field.error .input { border-color: var(--bad); }
.field.error .help { color: var(--bad); font-weight: 600; }

/* Attendance month */
.cal { max-width: 420px; margin: 0 auto; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; font-size: var(--fs-sm); }
.cal .dow { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.cal .d { aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; font-weight: 600; background: var(--well); }
.cal .d.p { background: color-mix(in srgb, var(--ok) 18%, var(--sheet)); color: var(--ok); }
.cal .d.a { background: color-mix(in srgb, var(--bad) 16%, var(--sheet)); color: var(--bad); }
.cal .d.h { background: transparent; color: var(--muted); opacity: .6; }
.cal .d.today { box-shadow: 0 0 0 3px var(--hl); }
.legend { display: flex; gap: var(--s4); font-size: var(--fs-xs); color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

/* Uploader */
.uploader { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.thumb { position: relative; aspect-ratio: 3/4; border-radius: var(--r-sm); overflow: hidden; background: var(--brand-soft); border: 1px solid var(--rule); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .no { position: absolute; left: 6px; bottom: 6px; background: var(--brand); color: var(--on-brand); font-size: var(--fs-xs); font-weight: 700; padding: 1px 8px; border-radius: 10px; }
.thumb .x { position: absolute; right: 4px; top: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.add-page { aspect-ratio: 3/4; border: 2px dashed var(--brand-2); border-radius: var(--r-sm); background: transparent; color: var(--brand); font-weight: 700; display: grid; place-items: center; align-content: center; gap: 4px; cursor: pointer; }
.add-page svg { width: 28px; height: 28px; margin: 0 auto; }
.progress { height: 8px; background: var(--brand-soft); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 4px; transition: width .2s; }

/* Banner, empty, skeleton */
.banner { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--banner-bg); color: var(--banner-fg); font-size: var(--fs-sm); font-weight: 600; }
.banner .btn { min-height: 36px; padding: 0 var(--s4); background: var(--banner-btn-bg); border-color: var(--banner-btn-bg); color: var(--banner-btn-fg); font-size: var(--fs-sm); }
.empty { text-align: center; padding: var(--s6) var(--s4); color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: var(--fs-md); margin-bottom: 4px; }
.skeleton { background: linear-gradient(90deg, var(--well) 25%, var(--raised) 50%, var(--well) 75%); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: var(--r-sm); min-height: 16px; }
@keyframes sk { to { background-position: -200% 0; } }

/* Ledger entry (report card) */
.entry { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s3); padding: var(--s3) var(--s4); }
.entry + .entry { border-top: 1px dashed var(--rule); }
.entry .what { font-weight: 600; } .entry .when { font-size: var(--fs-sm); color: var(--muted); }
.entry .amt { font-weight: 800; text-align: right; } .entry .bal { font-size: var(--fs-xs); color: var(--muted); text-align: right; }

/* Bottom sheet and toast */
.scrim { position: fixed; inset: 0; background: rgba(15,20,40,.5); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto; background: var(--sheet); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: var(--s3) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .25s ease; }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--rule); margin: 0 auto var(--s4); }
.sheet.open { transform: none; } .scrim.open { opacity: 1; pointer-events: auto; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(var(--nav-h) + var(--s4) + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--text); color: var(--paper); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: var(--fs-sm); opacity: 0; transition: .2s; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .grid.cols-3 { gap: var(--s4); } .toast { bottom: var(--s5); } }

/* Student + academic-year context bar (shown under the app bar on every page) */
.ctxbar { background: var(--sheet); border-bottom: 1px solid var(--rule); }
.ctxbar .in { max-width: 960px; margin: 0 auto; padding: var(--s2) var(--s4); display: flex; align-items: center; gap: var(--s3); }
.who { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; cursor: pointer; padding: 0; }
.who b { display: block; font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.who .chev { margin-left: auto; width: 18px; height: 18px; color: var(--muted); flex: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: var(--fs-sm); flex: none; }
.avatar.lg { width: 52px; height: 52px; font-size: var(--fs-lg); }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1.5px solid var(--rule); border-radius: 18px; background: var(--sheet); font-weight: 700; font-size: var(--fs-sm); cursor: pointer; white-space: nowrap; }
.pill svg { width: 16px; height: 16px; color: var(--muted); }
.pill.past { border-color: var(--hl); background: color-mix(in srgb, var(--hl) 18%, var(--sheet)); }
.pastbar { background: var(--unread); font-size: var(--fs-sm); font-weight: 600; }
.pastbar .in { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); max-width: 960px; margin: 0 auto; padding: var(--s2) var(--s4); }
.pastbar button { border: 0; background: transparent; font-weight: 800; color: var(--brand); cursor: pointer; min-height: 36px; }

/* Choice rows inside sheets (student / year) */
.opt { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 60px; padding: var(--s2) var(--s3); border: 2px solid var(--rule); border-radius: var(--r-md); background: var(--sheet); text-align: left; cursor: pointer; }
.opt + .opt { margin-top: var(--s2); }
.opt[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); }
.opt .t { flex: 1; min-width: 0; } .opt .t b { display: block; font-weight: 700; } .opt .t span { font-size: var(--fs-sm); color: var(--muted); }
.opt .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--rule); flex: none; display: grid; place-items: center; }
.opt[aria-checked="true"] .tick { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.opt[aria-checked="true"] .tick::after { content: "✓"; font-size: 13px; font-weight: 800; }
.sheet h2 + p { margin: 4px 0 var(--s4); }
.tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ok); margin-left: 6px; }

/* Avatars with photo or initials. .ring = active profile (Instagram-style ring) */
.avatar { overflow: hidden; position: relative; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.ring { box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px var(--brand); overflow: visible; }
.avatar.xl { width: 96px; height: 96px; font-size: 2rem; margin: 0 auto; }
.avatar.xl.ring { box-shadow: 0 0 0 3px var(--sheet), 0 0 0 6px var(--brand); }
.avatar.ring img { border-radius: 50%; }
.opt .news { background: var(--hl); color: #3a2f00; font-weight: 800; font-size: var(--fs-xs); border-radius: 10px; padding: 2px 8px; }
.profile-head { text-align: center; padding: var(--s5) var(--s4) var(--s2); }
.profile-head .photo { position: relative; width: 96px; margin: 0 auto var(--s3); }
.profile-head .cam { position: absolute; right: -6px; bottom: -2px; width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--paper); background: var(--brand); color: var(--on-brand); display: grid; place-items: center; cursor: pointer; padding: 0; }
.profile-head .cam svg { width: 18px; height: 18px; }
.profile-head h1 { margin-top: var(--s2); } .profile-head p { color: var(--muted); }
.li.danger b { color: var(--bad); }
.profile-head button.photo { display: block; border: 0; background: transparent; padding: 0; cursor: pointer; }
.profile-head .cam { pointer-events: none; }

/* ---- Attendance: leave day, low-attendance alert ---- */
.cal .d.l { background: color-mix(in srgb, var(--warn) 18%, var(--sheet)); color: var(--warn); }
.cal .d.n { background: transparent; color: var(--muted); border: 1px dashed var(--rule); font-weight: 500; }
.stat.warn .value { color: var(--warn); }
.alertbar { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r-md); background: color-mix(in srgb, var(--bad) 12%, var(--sheet)); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--sheet)); font-size: var(--fs-sm); }
.alertbar b { display: block; }
.alertbar span { color: var(--text); }
.legend { flex-wrap: wrap; }

/* ---- Exams ---- */
.exam-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); }
.exam-head h3 { margin: 0; font-size: var(--fs-md, 1.05rem); }
.sched { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.sched td { padding: 8px 0; border-top: 1px solid var(--rule); }
.sched td:last-child { text-align: right; color: var(--muted); white-space: nowrap; }
.locked { opacity: .75; }

/* ---- Report card (screen + print / save as PDF) ---- */
.rc { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-md); padding: var(--s4); }
.rc-school { text-align: center; border-bottom: 2px solid var(--brand); padding-bottom: var(--s3); margin-bottom: var(--s3); }
.rc-school h2 { margin: 0; color: var(--brand); }
.rc-school p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.rc-title { text-align: center; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; margin: var(--s3) 0; }
.rc-info { display: grid; grid-template-columns: 1fr 1fr; gap: 6px var(--s4); font-size: var(--fs-sm); margin-bottom: var(--s4); }
.rc-info div span { display: block; font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.rc-marks { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.rc-marks th, .rc-marks td { padding: 8px 6px; border-bottom: 1px solid var(--rule); text-align: right; }
.rc-marks th:first-child, .rc-marks td:first-child { text-align: left; }
.rc-marks th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.rc-marks small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.rc-marks tfoot td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--brand); }
.rc-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-top: var(--s4); text-align: center; }
.rc-sum div { background: var(--well); border-radius: var(--r-sm); padding: var(--s3); }
.rc-sum b { display: block; font-size: var(--fs-lg, 1.25rem); }
.rc-sum span { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.rc-remarks { margin-top: var(--s4); font-size: var(--fs-sm); }
@page { margin: 14mm; }
@media print {
  .rc-marks tr, .rc-sum { break-inside: avoid; }
  .appbar, .nav, .no-print, .toast, .scrim { display: none !important; }
  body { background: #fff; padding: 0 !important; }
  .container { max-width: none; padding: 0; }
  .rc { border: 0; padding: 0; }
  .rc-sum div { border: 1px solid #ccc; background: #fff; }
}
[hidden] { display: none !important; }
.lang-toggle { display: inline-flex; gap: 2px; margin-inline-start: auto; margin-inline-end: 8px; }
.lang-toggle button { min-height: 32px; min-width: 36px; padding: 0 8px; border: 1px solid var(--rule); background: transparent; color: inherit; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; }
.lang-toggle button[aria-pressed="true"] { background: var(--brand, #98012e); color: #fff; border-color: transparent; }
.nav .count[hidden] { display: none; }

.topper-ph{width:40px;height:40px;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:var(--rule)}
.topper-ph img{width:100%;height:100%;object-fit:cover}
.topper-ph i{font-style:normal;font-weight:600}
.rankboard{break-inside:avoid}
@media print{.rankboard{display:none}}

/* #region Login hero polish */
.hero .lang-toggle { margin: 0 auto var(--s4); padding: 3px; gap: 0; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); }
.hero .lang-toggle button { min-height: 34px; min-width: 52px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: rgba(255,255,255,.85); font-weight: 600; font-size: 14px; transition: background .15s, color .15s; }
.hero .lang-toggle button:hover { color: #fff; }
.hero .lang-toggle button[aria-pressed="true"] { background: #fff; color: var(--appbar); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.hero .lang-toggle button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.hero .logo { box-shadow: 0 0 0 6px rgba(255,255,255,.16), 0 12px 32px rgba(0,0,0,.3); }
.hero .mark { text-shadow: 0 2px 12px rgba(0,0,0,.25); }
.hero p { font-size: var(--fs-lg, 1.1rem); max-width: 28ch; margin-inline: auto; line-height: 1.4; }
/* #endregion */

/* #region Appbar language toggle: selected state visible on the brand-coloured bar */
.appbar .lang-toggle button { border-color: rgba(255,255,255,.55); color: var(--on-appbar); }
.appbar .lang-toggle button[aria-pressed="true"] { background: #fff; color: var(--appbar); border-color: #fff; font-weight: 700; }
/* #endregion */

/* #region Desktop sheet: true centre (base.css centring was overridden by the bottom/left/right of the phone sheet) */
@media (min-width: 900px) {
  .sheet { top: 50%; bottom: auto; left: 50%; right: auto; width: 520px; max-width: 92vw; max-height: 90vh; margin: 0; }
}
/* #endregion */

/* #region Notebook page: wider margin so long subject names (MATHEMATICS, GENERAL AWARENESS) fit inside it */
.page {
  background-image:
    linear-gradient(to right, transparent 0 71px, var(--margin) 71px 73px, transparent 73px),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--ruled) - 1px), var(--rule) calc(var(--ruled) - 1px) var(--ruled));
  padding-left: 90px;
}
.page .subject { width: 72px; padding: 0 3px; box-sizing: border-box; font-size: 9px; overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 480px) {
  .page { background-image: linear-gradient(to right, transparent 0 61px, var(--margin) 61px 63px, transparent 63px), repeating-linear-gradient(to bottom, transparent 0 calc(var(--ruled) - 1px), var(--rule) calc(var(--ruled) - 1px) var(--ruled)); padding-left: 76px; }
  .page .subject { width: 62px; font-size: 8px; }
}
/* #endregion */

/* #region Report card - attractive hero, bars and pills */
.rc { box-shadow: 0 6px 24px rgba(0,0,0,.06); overflow: hidden; }
.rc-hero { --tc: var(--ok); display: flex; align-items: center; gap: var(--s4); padding: var(--s4); margin-bottom: var(--s4); border-radius: var(--r-md); background: linear-gradient(135deg, var(--brand-soft, var(--well)), var(--well)); border: 1px solid var(--rule); }
.t-top { --tc: var(--ok); } .t-good { --tc: #2f7fd1; } .t-mid { --tc: var(--warn); } .t-low { --tc: var(--bad); }
.rc-ring { position: relative; width: 104px; height: 104px; flex: none; }
.rc-ring svg { width: 100%; height: 100%; }
.rc-ring circle { fill: none; stroke-width: 10; }
.rc-ring .trk { stroke: var(--rule); }
.rc-ring .val { stroke: var(--tc); stroke-linecap: round; animation: rc-draw .9s ease-out both; }
.rc-ring b { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; font-size: 1.5rem; line-height: 1; }
.rc-ring b small { font-size: .7rem; color: var(--muted); }
@keyframes rc-draw { from { stroke-dasharray: 0 400; } }
.rc-hero-txt { min-width: 0; }
.rc-cheer { font-weight: 800; color: var(--tc); }
.rc-hero-name { font-size: var(--fs-lg, 1.25rem); font-weight: 800; overflow-wrap: anywhere; }
.rc-hero-sub { font-size: var(--fs-sm); color: var(--muted); }
.rc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rc-chip { background: var(--sheet); border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px; font-size: var(--fs-xs); font-weight: 700; }
.rc-bar { display: block; height: 6px; margin-top: 6px; border-radius: 99px; background: var(--well); overflow: hidden; }
.rc-bar u { display: block; height: 100%; border-radius: 99px; background: var(--tc, var(--ok)); text-decoration: none; }
.rc-pill { display: inline-block; min-width: 48px; text-align: center; padding: 2px 8px; border-radius: 99px; font-weight: 700; color: #fff; background: var(--tc, var(--ok)); }
.rc-marks tbody tr:nth-child(even) { background: color-mix(in srgb, var(--well) 45%, transparent); }
.rc-sum div { border-top: 3px solid var(--brand); }
@media (max-width: 420px) { .rc-hero { flex-direction: column; text-align: center; } .rc-chips { justify-content: center; } }
@media print { .rc-hero { background: #fff; break-inside: avoid; } .rc-ring .val { animation: none; } .rc-pill { color: #000; background: none; border: 1px solid #999; } .rc { box-shadow: none; } .rc-bar, .rc-bar u, .rc-ring circle { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* #endregion */

/* #region Report card - premium certificate look (maroon + gold) */
.rc { padding: 0; border-radius: var(--r-lg); border: 1px solid var(--rule); box-shadow: 0 10px 40px rgba(60,10,25,.12); }
.rc > *:not(.rc-school):not(.rc-title) { margin-inline: var(--s5); }
.rc-school { margin: 0; padding: var(--s5) var(--s4) var(--s4); border: 0; color: #fff; background: radial-gradient(120% 140% at 85% -20%, #c4284f 0%, transparent 55%), linear-gradient(135deg, #6b0a27, #98012e); border-bottom: 4px solid #f4b400; }
.rc-school h2 { color: #fff; font-size: var(--fs-xl); letter-spacing: .02em; text-transform: uppercase; }
.rc-school p { color: rgba(255,255,255,.82); }
.rc-title { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0 0 var(--s4); padding: 0 var(--s4); transform: translateY(-14px); }
.rc-title span { background: #f4b400; color: #3a2f00; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: var(--fs-sm); padding: 6px 22px; border-radius: 999px; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.rc-title em { font-style: normal; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; margin-top: 8px; }
.rc-hero { background: radial-gradient(90% 130% at 100% 0%, #b3274f 0%, transparent 60%), linear-gradient(135deg, #7a0a2c, #98012e); border: 0; color: #fff; box-shadow: 0 8px 22px rgba(152,1,46,.28); }
.rc-hero .rc-ring .trk { stroke: rgba(255,255,255,.22); }
.rc-hero .rc-ring b { color: #fff; font-size: 1.7rem; } .rc-hero .rc-ring b small { color: rgba(255,255,255,.75); }
.rc-hero.t-top { --tc: #5fe3a8; } .rc-hero.t-good { --tc: #8cc2ff; } .rc-hero.t-mid { --tc: #ffd45c; } .rc-hero.t-low { --tc: #ff9a9a; }
.rc-hero .rc-cheer { color: #ffd45c; }
.rc-hero .rc-hero-name { font-size: var(--fs-xl); text-transform: uppercase; letter-spacing: .02em; }
.rc-hero .rc-hero-sub { color: rgba(255,255,255,.8); }
.rc-hero .rc-chip { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
.rc-info { gap: 0; border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; }
.rc-info div { padding: 10px 14px; font-weight: 700; border-bottom: 1px solid var(--rule); background: var(--sheet); }
.rc-info div:nth-child(odd) { border-inline-end: 1px solid var(--rule); }
.rc-info div:nth-last-child(-n+2) { border-bottom: 0; }
.rc-info div span { color: var(--brand); font-weight: 600; margin-bottom: 1px; }
.rc-marks { border: 1px solid var(--rule); border-radius: var(--r-md); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.rc-marks thead th { background: var(--brand-soft); color: var(--brand); font-weight: 800; padding: 10px 8px; border-bottom: 2px solid var(--brand); }
.rc-marks tbody td { padding: 12px 8px; }
.rc-marks tbody td:first-child { font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.rc-marks tbody td:first-child small { font-weight: 500; text-transform: none; letter-spacing: 0; }
.rc-bar { height: 7px; }
.rc-pill { background: color-mix(in srgb, var(--tc) 14%, transparent); color: var(--tc); border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); }
.rc-marks tfoot td { background: var(--brand); color: #fff; border: 0; padding: 12px 8px; }
.rc-sum div { border: 1px solid var(--rule); border-top: 4px solid #f4b400; background: var(--sheet); box-shadow: var(--shadow); padding: var(--s4) var(--s3); }
.rc-sum b { font-size: 1.7rem; color: var(--brand); line-height: 1.1; }
.rc-sum span { display: block; margin-top: 4px; font-weight: 600; }
.rc-remarks { padding: 12px 14px; border-inline-start: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.rc-declared { margin: var(--s4) var(--s5) 0; }
.rc-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); margin-top: 44px; margin-bottom: var(--s5); text-align: center; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.rc-sign i { display: block; border-top: 1px solid var(--muted); margin-bottom: 6px; }
@media (max-width: 480px) { .rc > *:not(.rc-school):not(.rc-title) { margin-inline: var(--s3); } .rc-declared { margin-inline: var(--s3); } .rc-sign { gap: var(--s3); } .rc-sum b { font-size: 1.3rem; } .rc-hero .rc-hero-name { font-size: var(--fs-lg); } }

/* Class toppers: gold / silver / bronze medals */
.rankboard h3 { color: var(--brand); border-bottom: 2px solid #f4b400; padding-bottom: 8px; }
.rankboard .list .li { border-radius: var(--r-sm); }
.medal { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--well); color: var(--muted); font-weight: 800; }
.rk-1 .medal { background: linear-gradient(135deg, #ffe08a, #e3a008); color: #3a2f00; }
.rk-2 .medal { background: linear-gradient(135deg, #f1f3f5, #aab2bb); color: #2b3138; }
.rk-3 .medal { background: linear-gradient(135deg, #f3c9a1, #b8743a); color: #3a1d06; }
.rk-1 { background: linear-gradient(90deg, #fff7dc, transparent); }
.rankboard .topper-ph { box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px var(--rule); }
.rk-1 .topper-ph { box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px #f4b400; }
.rankboard .banner, .rankboard > p:first-of-type { border-radius: var(--r-sm); }
:root[data-theme="dark"] .rk-1 { background: linear-gradient(90deg, #3a2f10, transparent); }
@media print {
  .rc-school { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rc-hero, .rc-title span, .rc-marks thead th, .rc-marks tfoot td, .rc-remarks, .rc-sum div { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rc-hero { background: linear-gradient(135deg, #7a0a2c, #98012e); }
  .rc-pill { color: var(--tc); background: none; border: 1px solid var(--tc); }
  .rc { border: 1px solid #ccc; }
  .rc-sum div { box-shadow: none; }
}
/* #endregion */

/* #region Report card refinements: table fit, hero colour + photo, topper crowns */
.rc-marks { width: calc(100% - 2 * var(--s5)); }
@media (max-width: 480px) { .rc-marks { width: calc(100% - 2 * var(--s3)); } }

/* Hero: deep indigo instead of the header maroon, gold accents kept */
.rc-hero { background: radial-gradient(90% 130% at 100% 0%, #3f5bbf 0%, transparent 60%), linear-gradient(135deg, #172554, #243b86); box-shadow: 0 8px 22px rgba(23,37,84,.28); }
.rc-photo { width: 76px; height: 76px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: rgba(255,255,255,.14); border: 3px solid #f4b400; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.rc-photo img { width: 100%; height: 100%; object-fit: cover; }
.rc-photo i { font-style: normal; font-weight: 800; font-size: 1.8rem; color: #fff; }
@media (max-width: 480px) { .rc-hero { gap: var(--s3); } .rc-ring { width: 88px; height: 88px; } .rc-photo { width: 64px; height: 64px; } }
@media (max-width: 420px) { .rc-hero { align-items: center; } }

/* Toppers: metallic crown + ring per rank */
.rankboard .topper-wrap { position: relative; width: 40px; height: 40px; border-radius: 0; background: none; display: block; }
.rankboard .topper-wrap .topper-ph { width: 40px; height: 40px; }
.rankboard .crown { position: absolute; top: -13px; left: 50%; width: 22px; height: 15px; margin-left: -11px; transform: rotate(-8deg); filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.rk-1 .crown { fill: #f4b400; } .rk-2 .crown { fill: #aab2bb; } .rk-3 .crown { fill: #b8743a; }
.rk-2 .topper-ph { box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px #aab2bb; }
.rk-3 .topper-ph { box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px #b8743a; }
.rk-2 { background: linear-gradient(90deg, #f1f3f5, transparent); }
.rk-3 { background: linear-gradient(90deg, #fbeee0, transparent); }
:root[data-theme="dark"] .rk-2 { background: linear-gradient(90deg, #2c3036, transparent); }
:root[data-theme="dark"] .rk-3 { background: linear-gradient(90deg, #3a2a1c, transparent); }
.rankboard .list .li { padding-top: calc(var(--s3) + 6px); }
@media print { .rc-hero { background: linear-gradient(135deg, #172554, #243b86); } .rc-photo { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* #endregion */

/* #region Report card hero order, bigger crowns, trophy rank badges */
.rc-hero .rc-ring { margin-left: auto; }
.rankboard .crown { top: -21px; width: 34px; height: 23px; margin-left: -17px; }
.rankboard .list .li { padding-top: calc(var(--s3) + 12px); }
.trophy { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
.trophy svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.trophy b { position: relative; top: -3px; font-size: .8rem; font-weight: 800; line-height: 1; }
.rk-1 .trophy svg { fill: #f4b400; stroke: #f4b400; } .rk-1 .trophy b { color: #3a2f00; }
.rk-2 .trophy svg { fill: #aab2bb; stroke: #aab2bb; } .rk-2 .trophy b { color: #2b3138; }
.rk-3 .trophy svg { fill: #b8743a; stroke: #b8743a; } .rk-3 .trophy b { color: #fff; }
.trophy svg path[fill="none"] { fill: none; }
@media print { .trophy svg { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* #endregion */
