/* PhiExam · student web: login, SSO and the প্রোফাইল tab (profile hub, history, progress, leaderboard, notices, reports, settings), in the app's look (PROFILE agent). */
/* Prefixes: au = welcome / sign in / SSO, pf = the profile hub, edit and password (and shared bits of these screens),
   ac = access, nt = notices, rp = reports, st = settings, hs = my exams, lb = leaderboard, pg = progress.
   Palette tokens only, so both themes follow app.css; glass only on the sticky save bar. */

/* ------------------------------------------------------------------ shared bits */
.pf-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.pf-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px 28px; align-items: start; margin-top: 24px; }
.pf-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.pf-col > :empty, .pf-help:empty { display: none; }
.pf-caption { color: var(--muted); font-size: 13px; line-height: 20px; margin: 2px 4px 12px; }
.pf-tools { margin-bottom: 14px; }
.pf-tools .segmented { width: 100%; }
.pf-tools .segmented button { flex: 1; justify-content: center; }
.pf-more { display: flex; justify-content: center; margin-top: 14px; }
.pf-more .btn { max-width: 320px; }
.pf-msg { margin: 2px 0 14px; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 20px; font-weight: 600; }
.pf-msg.bad { background: var(--bad-soft); color: var(--bad-ink); }
.pf-msg.info { background: var(--info-soft); color: var(--brand-ink); }
.pf-note { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; padding: 12px 14px; border-radius: 14px; background: var(--info-soft);
  color: var(--text-2); font-size: 13px; line-height: 21px; }
.pf-note .icon { color: var(--brand); margin-top: 1px; }
.pf-narrow { width: 100%; max-width: 560px; margin: 0 auto; }
/* the password page before anything else (came in from Physics Hunters, ph_password switch): no menu, a plain head */
.pf-gate-head { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 560px; margin: 24px auto 18px; text-align: center; }
.pf-gate-head h1 { margin: 0; font-size: 1.5rem; }
.pf-gate-logo { width: 48px; height: 48px; }
.pf-gate-phone { margin: 0 0 14px; font-weight: 600; }
.pf-pass .btn.ghost { margin-top: 10px; }

/* a thin bar (the app's ProgressBar): the track, and the fill coloured by its class or the tone around it */
.pf-bar { display: block; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.pf-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .3s ease; }
.pf-bar.gold { background: var(--hero-chip); }
.pf-bar.gold > i { background: var(--hero-accent); }
.pf-bar.t-good > i { background: var(--good); }
.pf-bar.t-bad > i { background: var(--bad); }
.pf-bar.t-warn > i { background: var(--warn); }
.pf-bar.t-brand > i { background: var(--brand); }
.pf-bar.t-slate > i { background: var(--muted); }
.pf-bar.t-tone > i { background: var(--tone, var(--brand)); }

/* ------------------------------------------------------------------ welcome / sign in / new account */
.au { min-height: 100dvh; background: var(--bg); }
.au-story { display: flex; flex-direction: column; gap: 16px; }
.au-hero { flex-direction: column; align-items: stretch; gap: 18px; padding: 22px 20px 24px; }
.au-hero > :not(.ui-hero-ring):not(.ui-hero-blob) { position: relative; }
.au-brand { display: flex; align-items: center; gap: 12px; color: var(--hero-text); font-size: 22px; line-height: 30px; font-weight: 800; }
.au-logo { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.au-hero-row { display: flex; align-items: center; gap: 12px; }
.au-hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.au-tag { font-size: 26px; line-height: 40px; font-weight: 800; color: var(--hero-text); letter-spacing: 0; }
.au-lead { color: var(--hero-muted); font-size: 14px; line-height: 22px; }
.au-piku { width: 92px; height: auto; flex: none; align-self: flex-start; filter: drop-shadow(0 10px 16px var(--shadow-color)); }
.au-feats { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.au-feat { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.au-feat + .au-feat { border-top: 1px solid var(--border); }
.au-feat .ui-ico { width: 46px; height: 46px; border-radius: 14px; }
.au-feat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.au-feat-text strong { font-size: 15px; line-height: 22px; font-weight: 700; }
.au-feat-text span { font-size: 13px; line-height: 20px; color: var(--muted); }
.au-copy { text-align: center; color: var(--muted); font-size: 12px; line-height: 18px; }
.au-story > .au-copy { display: none; }
.au-actions { display: flex; flex-direction: column; gap: 12px; }
.au-actions .au-link { align-self: center; }
.au .btn.lg { min-height: 54px; }
.au-link { padding: 8px; border: 0; background: none; color: var(--brand); font: inherit; font-size: 14px; line-height: 22px; font-weight: 700; cursor: pointer; text-align: center; }
.au-link:hover { text-decoration: underline; }

/* the Physics Hunters button and the "or" line under it */
.au-ph { display: flex; flex-direction: column; gap: 16px; }
.au-form .au-ph { margin-top: 16px; }
.au-ph-btn { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); gap: 10px; }
.au-ph-btn:hover { background: var(--surface-2); text-decoration: none; }
/* the logo is a wide mark (dark letters): kept at its own shape on a light chip so it reads in dark mode too */
.au-ph-btn img { height: 18px; width: auto; max-width: 72px; padding: 3px 6px; box-sizing: content-box; border-radius: 6px; background: var(--hero-text); object-fit: contain; }
.au-ph-btn.pulse { animation: au-pulse .9s ease-out 2; border-color: var(--brand); }
@keyframes au-pulse { from { box-shadow: 0 0 0 0 var(--brand-soft); } 50% { box-shadow: 0 0 0 10px var(--brand-soft); } to { box-shadow: 0 0 0 0 transparent; } }
.au-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; line-height: 18px; font-weight: 600; }
.au-or::before, .au-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* the form (a plain page on a phone, a card on a wide screen) */
.au-main { width: 100%; max-width: 520px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom)); }
.au-card { display: flex; flex-direction: column; }
.au-card-top { display: flex; align-items: center; gap: 12px; min-height: 56px; margin-bottom: 18px; }
.au-card-title { flex: 1; min-width: 0; font-size: 18px; line-height: 28px; font-weight: 700; }
.au-mark { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: var(--brand-soft); margin-bottom: 18px; flex: none; }
.au-mark img { width: 44px; height: 44px; border-radius: 12px; }
.au-heading { font-size: 26px; line-height: 38px; font-weight: 800; letter-spacing: 0; }
.au-sub { color: var(--muted); font-size: 15px; line-height: 24px; margin: 4px 0 22px; }
.au-form { display: flex; flex-direction: column; }
.au-form .field input { min-height: 52px; border-radius: 14px; }
.au-form > .btn.primary { margin-top: 4px; }
.au-terms { color: var(--muted); font-size: 12px; line-height: 18px; text-align: center; margin-top: 12px; }
.au-links { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 16px; }
/* a new account or a new password with an SMS code: the step, the 6-digit box, the resend line, the number proved */
.au-mark .icon { color: var(--brand); }
.au-step { color: var(--brand); font-size: 13px; line-height: 20px; font-weight: 700; margin-bottom: 2px; }
.au-sub .au-inline { display: inline; padding: 0; font-size: inherit; line-height: inherit; }
.au-form .field input.au-code { min-height: 60px; text-align: center; font-size: 28px; line-height: 36px; font-weight: 700;
  letter-spacing: .5em; text-indent: .5em; font-variant-numeric: tabular-nums; }
.au-form .field input.au-code::placeholder { color: var(--border-strong); }
.au-resend { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; min-height: 40px; margin-top: 14px;
  color: var(--muted); font-size: 14px; line-height: 22px; }
.au-resend-wait { font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.au-resend .au-link { display: inline-flex; align-items: center; gap: 6px; }
.pf-note.au-ok { background: var(--good-soft); }
.pf-note.au-ok .icon { color: var(--good); }

/* a phone: the welcome page is the story + the buttons; the form pages are the form alone */
.au.welcome { display: flex; flex-direction: column; gap: 24px; max-width: 560px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)); }
.au.welcome .au-main { display: none; }
.au.welcome .au-actions { margin-top: auto; }
.au.form .au-story, .au.form .au-actions { display: none; }

/* a wide screen: the story on the left, the sign-in card on the right */
@media (min-width: 1024px) {
  .au.welcome, .au.form { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; max-width: none; margin: 0; padding: 0; }
  .au.welcome .au-main, .au.form .au-story { display: flex; }
  .au.welcome .au-actions { display: none; }
  .au-story { justify-content: center; gap: 18px; padding: 40px 32px 40px 48px; }
  .au-hero { padding: 40px 40px 44px; gap: 26px; }
  .au-hero .ui-hero-ring { width: 340px; height: 340px; right: -90px; top: -90px; border-width: 48px; }
  .au-hero .ui-hero-blob { width: 110px; height: 110px; right: 140px; bottom: -44px; }
  .au-tag { font-size: 38px; line-height: 54px; }
  .au-lead { font-size: 16px; line-height: 26px; max-width: 460px; }
  .au-piku { width: 150px; align-self: center; }
  .au-story > .au-copy { display: block; text-align: left; padding-left: 4px; }
  .au-main { max-width: none; margin: 0; padding: 40px 48px 40px 32px; display: flex; align-items: center; justify-content: center; }
  .au-card { width: min(460px, 100%); padding: 28px 32px 26px; border-radius: var(--radius-hero); background: var(--surface);
    border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
  .au-card-top { min-height: 40px; margin-bottom: 14px; }
  .au-back { display: none; }
  .au-mark { width: 56px; height: 56px; border-radius: 16px; }
  .au-mark img { width: 38px; height: 38px; }
}

/* sign in from the website */
.au.au-sso { display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px 24px; }
.au-sso-card { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
  padding: 32px 22px 26px; border-radius: var(--radius-hero); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.au-sso-card .au-mark, .au-sso-card .au-sub { margin: 0; }
.au-sso-card .au-heading { font-size: 20px; line-height: 30px; }
.au-sso-piku { width: 120px; height: auto; }
.au-sso-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 6px; }

/* ------------------------------------------------------------------ the প্রোফাইল hub */
.pf-hero { flex-direction: column; align-items: stretch; gap: 16px; }
.pf-hero > :not(.ui-hero-ring):not(.ui-hero-blob) { position: relative; }
.pf-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.pf-avatar { width: 78px; height: 78px; flex: none; padding: 4px; border-radius: 50%; border: 3px solid var(--hero-accent); }
.pf-avatar > span { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; background: var(--hero-chip);
  color: var(--hero-text); font-size: 24px; font-weight: 800; letter-spacing: .02em; }
.pf-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-name { font-size: 22px; line-height: 32px; font-weight: 800; color: var(--hero-text); overflow-wrap: anywhere; letter-spacing: 0; }
.pf-meta { color: var(--hero-muted); font-size: 14px; line-height: 22px; }
.pf-roll { color: var(--hero-muted); font-size: 12px; line-height: 18px; }
.pf-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-tag { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 10px; border-radius: 999px; background: var(--hero-chip);
  color: var(--hero-text); font-size: 12px; line-height: 18px; font-weight: 600; }
.pf-tag > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-tag .icon { color: var(--hero-accent); }
.pf-side { display: flex; flex-direction: column; gap: 16px; }
.pf-nums { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.pf-num { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 14px; border-radius: 16px; background: var(--hero-chip); color: var(--hero-text); }
.pf-num:hover { text-decoration: none; background: color-mix(in srgb, var(--hero-text) 14%, transparent); }
.pf-num strong { font-size: 22px; line-height: 30px; font-weight: 800; white-space: nowrap; }
.pf-num small { font-size: 13px; font-weight: 700; color: var(--hero-muted); margin-left: 2px; }
.pf-num > span { font-size: 13px; line-height: 20px; color: var(--hero-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* English labels ("Study streak") are longer than the Bangla ones: on a phone the box is a little tighter and the label may wrap */
html[lang="en"] .pf-num { padding: 12px 10px; }
html[lang="en"] .pf-num > span { white-space: normal; overflow-wrap: anywhere; }
.pf-fill { display: flex; flex-direction: column; gap: 8px; color: var(--hero-text); }
.pf-fill:hover { text-decoration: none; }
.pf-fill-row { display: flex; justify-content: space-between; gap: 10px; color: var(--hero-muted); font-size: 13px; line-height: 20px; }
.pf-fill-row strong { color: var(--hero-accent); font-weight: 700; }
.pf-fill:hover .pf-fill-row strong { text-decoration: underline; }
.pf-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pf-out .ui-row .ui-chev { display: none; }
@media (min-width: 1024px) {
  .pf-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 16px 36px; padding: 28px 32px; }
  .pf-hero .pf-id, .pf-hero .pf-tags { grid-column: 1; }
  .pf-hero .pf-side { grid-column: 2; grid-row: 1 / span 2; }
  .pf-avatar { width: 92px; height: 92px; }
  .pf-avatar > span { font-size: 28px; }
  .pf-name { font-size: 26px; line-height: 36px; }
  .pf-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ profile edit + password */
.pf-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 24px; align-items: start; }
.pf-part .pf-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
.pf-part .pf-card > .field:last-child { margin-bottom: 0; }
.pf-part .field input:disabled { background: var(--surface-2); color: var(--text-2); cursor: not-allowed; }
.pf-part .ui-choice .chip { min-height: 44px; }
.pf-form > .pf-msg { margin: 0; }
.pf-savebar {
  position: sticky; bottom: calc(var(--tabbar-h) + 10px); z-index: 6; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px;
  border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
}
body.student:has(.pf-savebar) .pk { bottom: calc(var(--tabbar-h) + 84px); } /* Piku stands on the save bar, as in the app */
.pf-save-fill { flex: 1; min-width: 0; color: var(--text-2); font-size: 13px; line-height: 20px; font-weight: 600; }
.pf-save { flex: none; min-width: 140px; }
.pf-save:disabled { opacity: .5; }
.pf-pass { padding: 20px; }
.pf-pass > .btn { margin-top: 6px; }
@media (min-width: 640px) {
  .pf-part .pf-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-part .pf-card > .field:has(.ui-choice), .pf-part .pf-card > .field:has(textarea) { grid-column: 1 / -1; }
  .pf-part .pf-card > .field:nth-last-child(2):nth-child(odd) { margin-bottom: 0; }
}
@media (min-width: 1024px) {
  .pf-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pf-form > .pf-msg, .pf-form > .pf-savebar { grid-column: 1 / -1; }
  .pf-savebar { bottom: 16px; }
  .pf-pass { padding: 28px; }
}

/* ------------------------------------------------------------------ access */
.ac-page .pf-col { gap: 0; }
.ac-hero .ui-hero-main { width: 100%; }
.ac-hero .ui-hero-actions { width: 100%; margin-top: 8px; }
.ac-flags { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.ac-flag { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px 14px; border-radius: 16px; background: var(--hero-chip); }
.ac-flag-ic { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--hero-chip); color: var(--hero-muted); }
.ac-flag.on .ac-flag-ic { background: var(--hero-accent); color: var(--hero-1); }
.ac-flag-text { display: flex; flex-direction: column; min-width: 0; }
.ac-flag-text strong { color: var(--hero-text); font-size: 14px; line-height: 21px; font-weight: 700; }
.ac-flag-text span { color: var(--hero-muted); font-size: 12px; line-height: 18px; }
.ac-courses { display: flex; flex-direction: column; gap: 10px; }
.ac-course { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); }
.ac-course.soon { border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); }
.ac-course-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ac-course-text strong { font-size: 15px; line-height: 22px; font-weight: 700; overflow-wrap: anywhere; }
.ac-session { color: var(--text-2); font-size: 12px; line-height: 18px; }
.ac-ends { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; line-height: 18px; }
.ac-course.soon .ac-ends { color: var(--warn-ink); font-weight: 700; }
.ac-none { color: var(--text-2); font-size: 14px; line-height: 22px; }
.ui-list > .ac-none { padding: 16px; }
.ac-track { align-items: flex-start; }
.ac-track-sub { display: flex; flex-direction: column; gap: 2px; }
.ac-track-sub > span { color: var(--text-2); font-size: 13px; line-height: 20px; }
.ac-track-sub > small { color: var(--muted); font-size: 12px; line-height: 18px; }
.ac-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 28px; text-align: center; }
.ac-foot .btn.ghost { color: var(--brand); font-weight: 700; }

/* ------------------------------------------------------------------ notices */
.nt-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: start; }
.nt-card { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 14px 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); font: inherit; text-align: left; }
button.nt-card { cursor: pointer; transition: border-color .14s; }
button.nt-card:hover { border-color: var(--border-strong); }
.nt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.nt-title-row { display: flex; align-items: center; gap: 8px; max-width: 100%; }
.nt-title { font-size: 15px; line-height: 22px; font-weight: 700; overflow-wrap: anywhere; }
.nt-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--bad); } /* unread: the app's red dot */
.nt-meta { color: var(--muted); font-size: 12px; line-height: 18px; }
.nt-pin { margin-top: 2px; }
.nt-body { margin-top: 6px; color: var(--text-2); font-size: 14px; line-height: 23px; white-space: pre-line; overflow-wrap: anywhere; }
.nt-chev { color: var(--muted); margin-top: 10px; transition: transform .18s ease; }
.nt-card.open .nt-chev { transform: rotate(180deg); }
@media (min-width: 1024px) { .nt-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }

/* ------------------------------------------------------------------ reports */
.rp-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: start; }
.rp-card { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.rp-top { display: flex; align-items: flex-start; gap: 12px; }
.rp-stem { flex: 1; min-width: 0; font-size: 15px; line-height: 23px; font-weight: 700; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rp-top .ui-pill { margin-top: 2px; flex: none; }
.rp-meta { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 18px; }
.rp-note { margin-top: 8px; color: var(--text-2); font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.rp-reply { display: flex; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink);
  font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.rp-reply .icon { margin-top: 3px; }
@media (min-width: 1024px) { .rp-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }

/* ------------------------------------------------------------------ settings */
.st-page { margin-top: 0; }
.st-theme .segmented { width: 100%; }
.st-theme .segmented button { flex: 1; justify-content: center; }
.st-row .ui-switch { flex: none; }
.st-row.off .ui-ico, .st-row.off .ui-row-text { opacity: .55; }

/* ------------------------------------------------------------------ my exams */
.hs-list { display: flex; flex-direction: column; gap: 20px; }
.hs-day-head { display: flex; align-items: center; gap: 10px; margin: 0 4px 10px; color: var(--text-2); font-size: 13px; line-height: 20px; font-weight: 600; }
.hs-day-head > i { flex: 1; height: 1px; background: var(--border); }
.hs-day-n { color: var(--muted); font-size: 12px; font-weight: 600; }
.hs-day-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.hs-card { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); transition: border-color .14s, transform .14s; }
.hs-card:hover { text-decoration: none; border-color: var(--border-strong); }
.hs-card:active { transform: scale(.99); }
.hs-card > .ui-ico { width: 48px; height: 48px; border-radius: 14px; }
.hs-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.hs-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.hs-title { font-size: 15px; line-height: 22px; font-weight: 700; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hs-sub { color: var(--muted); font-size: 12px; line-height: 18px; }
.hs-score { flex: none; width: 76px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.hs-num { white-space: nowrap; }
.hs-num strong { font-size: 17px; line-height: 24px; font-weight: 800; color: var(--text); }
.hs-num small { font-size: 12px; color: var(--muted); font-weight: 600; }
.hs-score.t-good .hs-num strong { color: var(--good-ink); }
.hs-score.t-bad .hs-num strong { color: var(--bad-ink); }
.hs-score.t-brand .hs-num strong { color: var(--brand); }
.hs-score .pf-bar { width: 100%; height: 4px; }
.hs-acc { color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 600; }
.hs-go { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.hs-later { flex: none; color: var(--muted); font-size: 12px; font-weight: 600; }
@media (min-width: 1024px) {
  .pf-tools .segmented { width: auto; }
  .pf-tools .segmented button { flex: 0 0 auto; min-width: 120px; }
  .hs-day-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* ------------------------------------------------------------------ leaderboard */
.lb-body { min-height: 320px; }
.lb-skel { display: flex; flex-direction: column; gap: 12px; }
.lb-page { display: flex; flex-direction: column; }
.lb-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 20px; }
.lb-hero > :not(.ui-hero-ring):not(.ui-hero-blob) { position: relative; }
.lb-hero:not(:has(.lb-facts)) { grid-template-columns: minmax(0, 1fr); }
.lb-place { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.lb-rank { font-size: 44px; line-height: 52px; font-weight: 800; color: var(--hero-text); letter-spacing: 0; }
.lb-rank.none { color: var(--hero-muted); }
.lb-of { color: var(--hero-muted); font-size: 13px; line-height: 20px; max-width: 260px; }
.lb-facts { display: flex; flex-direction: column; gap: 10px; padding-left: 20px; border-left: 1px solid var(--hero-chip); min-width: 0; }
.lb-fact { display: flex; align-items: center; gap: 8px; color: var(--hero-muted); font-size: 13px; line-height: 20px; min-width: 0; }
.lb-fact strong { color: var(--hero-text); font-size: 16px; font-weight: 800; }
.lb-fact > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* English "Correct answers" may take two lines on a 360 px phone rather than end in "…" */
html[lang="en"] .lb-fact > span:last-child { white-space: normal; line-height: 16px; }
.lb-fact-ic { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--hero-accent); color: var(--hero-1); }
.lb-fact-ic .icon { width: 14px; height: 14px; }
.lb-page > .pf-caption { margin: 18px 4px 12px; }
.lb-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.lb-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; padding: 22px 14px 0; border-radius: var(--radius-hero);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.lb-spot { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; text-align: center; }
.lb-crown { color: var(--medal-gold, var(--hero-accent)); margin-bottom: 4px; }
.lb-avatar { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink);
  font-size: 14px; font-weight: 800; }
.lb-avatar.m1, .lb-avatar.m2, .lb-avatar.m3 { margin-bottom: 8px; box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--medal-gold, var(--hero-accent)); }
.lb-avatar.m1 { width: 72px; height: 72px; font-size: 20px; background: var(--brand); color: var(--on-brand); }
.lb-avatar.m2, .lb-avatar.m3 { width: 56px; height: 56px; font-size: 16px; }
.lb-avatar.m2 { box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--medal-silver, var(--border-strong)); }
.lb-avatar.m3 { box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--medal-bronze, var(--warn)); }
.lb-name { max-width: 100%; font-size: 14px; line-height: 21px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-spot.me .lb-name { color: var(--brand); }
.lb-score { font-size: 18px; line-height: 26px; font-weight: 800; }
.lb-spot.r1 .lb-score { color: var(--brand); }
.lb-acc { color: var(--muted); font-size: 12px; line-height: 18px; }
.lb-step { width: 100%; display: grid; place-items: center; margin-top: 10px; border-radius: 18px 18px 0 0; font-size: 22px; font-weight: 800; }
.lb-spot.r1 .lb-step { height: 120px; background: var(--medal-gold-soft, var(--warn-soft)); color: var(--medal-gold-ink, var(--warn-ink)); }
.lb-spot.r2 .lb-step { height: 88px; background: var(--medal-silver-soft, var(--surface-2)); color: var(--medal-silver-ink, var(--text-2)); }
.lb-spot.r3 .lb-step { height: 70px; background: var(--medal-bronze-soft, var(--warn-soft)); color: var(--medal-bronze-ink, var(--warn-ink)); }
.lb-rows { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.lb-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; }
.lb-rows > .lb-row + .lb-row { border-top: 1px solid var(--border); }
.lb-row.me { background: var(--brand-soft); }
.lb-n { width: 28px; flex: none; text-align: center; color: var(--text-2); font-size: 15px; font-weight: 700; }
.lb-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lb-who strong, .lb-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-who strong { font-size: 15px; line-height: 22px; font-weight: 700; }
.lb-row.me .lb-who strong { color: var(--brand-ink); }
.lb-who span { color: var(--muted); font-size: 12px; line-height: 18px; }
.lb-right { flex: none; display: flex; flex-direction: column; align-items: flex-end; }
.lb-right strong { font-size: 15px; line-height: 22px; font-weight: 800; }
.lb-right span { color: var(--muted); font-size: 12px; line-height: 18px; }
.lb-mine { border-top: 1px dashed var(--border-strong); }
.lb-mine-label { display: block; padding: 10px 16px 0; color: var(--muted); font-size: 12px; line-height: 18px; font-weight: 700; }
@media (min-width: 1024px) {
  .lb-hero { padding: 28px 32px; gap: 32px; }
  .lb-facts { flex-direction: row; flex-wrap: wrap; gap: 14px 28px; padding-left: 32px; }
  .lb-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
  .lb-cols > :only-child { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ progress */
.pg-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pg-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 14px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); }
.pg-stat .ui-ico { width: 36px; height: 36px; border-radius: 11px; margin-bottom: 8px; }
.pg-stat strong { font-size: 22px; line-height: 30px; font-weight: 800; }
.pg-stat-label { font-size: 14px; line-height: 21px; font-weight: 700; }
.pg-stat-sub { color: var(--muted); font-size: 12px; line-height: 18px; }
.pg-papers { display: flex; flex-direction: column; gap: 10px; }
.pg-paper { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.pg-paper-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px 12px; border: 0; background: none; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; }
.pg-paper-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pg-paper-text strong { font-size: 15px; line-height: 22px; font-weight: 700; overflow-wrap: anywhere; }
.pg-paper-text span { color: var(--muted); font-size: 12px; line-height: 18px; }
.pg-chev { color: var(--muted); transition: transform .18s ease; }
.pg-paper.open .pg-chev { transform: rotate(180deg); }
.pg-paper > .pf-bar { height: 8px; border-radius: 4px; margin: 0 16px 16px; }
.pg-chs { border-top: 1px solid var(--border); background: var(--surface-2); }
.pg-ch { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; }
.pg-ch + .pg-ch { border-top: 1px solid var(--border); }
.pg-ch-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pg-ch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pg-ch-text small { color: var(--muted); font-size: 11px; line-height: 16px; }
.pg-ch-text strong { font-size: 14px; line-height: 21px; font-weight: 700; overflow-wrap: anywhere; }
.pg-ch-btns { flex: none; display: flex; gap: 6px; }
.pg-bars { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; }
.pg-bar-label { color: var(--muted); font-size: 12px; line-height: 18px; }
.pg-bars .pf-bar { height: 5px; }
.pg-bar-n { min-width: 36px; text-align: right; color: var(--text-2); font-size: 12px; line-height: 18px; font-weight: 700; }
.pg-wrong { color: var(--bad-ink); font-size: 12px; line-height: 18px; font-weight: 700; }
.pg-weak { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.pg-weak-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.pg-weak-row + .pg-weak-row { border-top: 1px solid var(--border); }
.pg-weak-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pg-weak-text strong { font-size: 14px; line-height: 21px; font-weight: 700; overflow-wrap: anywhere; }
.pg-weak-text > span { color: var(--muted); font-size: 12px; line-height: 18px; }
.pg-weak-text .pf-bar { height: 4px; margin-top: 6px; }
.pg-none { color: var(--muted); font-size: 14px; line-height: 22px; }
.pg-cols .hs-day-list { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 380px) {
  .pg-stats { gap: 8px; }
  .pg-stat { padding: 12px 10px; }
  .pg-stat strong { font-size: 19px; line-height: 26px; }
  .pg-stat-label { font-size: 13px; }
}
@media (min-width: 1024px) {
  .pg-stats { gap: 14px; }
  .pg-stat { padding: 18px; }
  .pg-cols { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ no motion when the student asks for none */
@media (prefers-reduced-motion: reduce) {
  .au-ph-btn.pulse { animation: none; }
  .pf-bar > i, .nt-chev, .pg-chev, .hs-card, button.nt-card { transition: none; }
  .hs-card:active { transform: none; }
}

/* ------------------------------------------------------------------ on a phone (CLEANUI): body type at least 15 px,
   labels and counts at least 12 px, 44 px targets with 8 px between */
.au-link { min-height: 44px; font-size: 15px; }
.au-links { gap: 8px; }
.au-copy { font-size: 13px; line-height: 19px; }
.pf-fill { min-height: 44px; justify-content: center; }
.pf-fill-row { font-size: 14px; line-height: 21px; }
.pf-meta, .ac-flag-text strong, .ac-none, .pg-weak-text strong { font-size: 15px; line-height: 22px; }
.pf-save-fill, .hs-day-head, .lb-of, .ac-track-sub > span { font-size: 14px; line-height: 21px; }
.ac-flag-text span, .ac-ends, .nt-meta, .hs-sub, .hs-acc, .pg-paper-text span, .pg-weak-text > span { font-size: 13px; line-height: 19px; }
.hs-day-n, .hs-num small, .ac-track-sub > small { font-size: 12px; }
@media (max-width: 420px) { .pg-stat-label { font-size: 14px; } }
.pg-none { font-size: 15px; }
.au-heading:not(:has(+ .au-sub)) { margin-bottom: 22px; }
