/* PhiExam · student web: home, exams tab, exam room, result and review screens, in the app's look.
   Colours come from the palette tokens in app.css (and the .tone-* classes); the medal tokens are the only new ones. */

:root {
  --medal-gold: var(--hero-accent);
  --medal-gold-soft: var(--warn-soft);
  --medal-gold-ink: var(--warn-ink);
  --medal-silver: #B4BCCB;
  --medal-silver-soft: #EEF1F6;
  --medal-silver-ink: #4B5468;
  --medal-bronze: #D99A6C;
  --medal-bronze-soft: #FBEDE2;
  --medal-bronze-ink: #8A4B1F;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --medal-silver: #C9CFDC;
    --medal-silver-soft: rgba(201, 207, 220, .12);
    --medal-silver-ink: #DCE1EA;
    --medal-bronze: #E0A37A;
    --medal-bronze-soft: rgba(224, 163, 122, .13);
    --medal-bronze-ink: #EDBB98;
  }
}
:root[data-theme="dark"] {
  --medal-silver: #C9CFDC;
  --medal-silver-soft: rgba(201, 207, 220, .12);
  --medal-silver-ink: #DCE1EA;
  --medal-bronze: #E0A37A;
  --medal-bronze-soft: rgba(224, 163, 122, .13);
  --medal-bronze-ink: #EDBB98;
}

/* ================================================================== হোম (the app's src/features/home) */
.hx-home { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 28px; }
.hx-main, .hx-side { min-width: 0; display: flex; flex-direction: column; }
.hx-sec { margin-top: 24px; }
.hx-sec > .ui-section { margin-top: 0; }
.hx-stack { display: flex; flex-direction: column; gap: 10px; }
.hx-muted { color: var(--muted); padding: 16px; font-size: 14px; }

/* greeting row: avatar, "শুভ সকাল" over the name, theme and bell */
.hx-greet { display: flex; align-items: center; gap: 12px; margin: 2px 0 16px; grid-column: 1 / -1; }
.hx-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 15px;
}
.hx-avatar:hover { text-decoration: none; }
.hx-greet-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hx-greet-text span { color: var(--muted); font-size: 13px; line-height: 18px; }
.hx-greet-text h1 { font-size: 22px; line-height: 32px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-greet .icon-btn { width: 44px; height: 44px; border-radius: 50%; color: var(--text); position: relative; }
.hx-bell:hover { text-decoration: none; }
.hx-dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); border: 2px solid var(--surface); }

/* the hero block: notice, hero, today strip */
.hx-top { display: flex; flex-direction: column; gap: 12px; }

/* the urgent / pinned notice */
.hx-notice { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 12px; border-radius: var(--radius); background: var(--tone-soft); }
.hx-notice-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 6px 0; color: var(--text); }
.hx-notice-main:hover { text-decoration: none; }
.hx-notice-ic { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--tone-solid); color: var(--on-tint); }
.hx-notice-text { min-width: 0; display: flex; flex-direction: column; }
.hx-notice-text strong { font-size: 14px; line-height: 21px; }
.hx-notice-text span {
  font-size: 12px; line-height: 18px; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.hx-notice-x { border-color: transparent; background: transparent; width: 40px; height: 40px; border-radius: 50%; color: var(--text-2); }

/* hero: the exam (countdown chips + button) or the day's goal (ring + streak + rank) */
.hx-hero .ui-hero-title { overflow-wrap: anywhere; }
.hx-hero .ui-hero-actions { width: 100%; align-items: center; }
.hx-hero .ui-hero-btn { flex: none; }
.hx-hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; flex-wrap: wrap; }
.hx-hero-ends { color: var(--hero-muted); font-size: 13px; font-weight: 600; }
.hx-count { display: flex; gap: 8px; }
.hx-count-box {
  min-width: 58px; padding: 6px 10px; border-radius: 14px; background: var(--hero-chip); display: flex; flex-direction: column;
  align-items: center; line-height: 1.1;
}
.hx-count-box strong { font-size: 22px; line-height: 28px; color: var(--hero-text); font-variant-numeric: tabular-nums; }
.hx-count-box span { font-size: 11px; color: var(--hero-muted); }
.hx-goal .ui-hero-title { font-size: 18px; line-height: 28px; }
.hx-goal-row { display: flex; align-items: center; gap: 18px; width: 100%; flex: 1 0 100%; margin: 2px 0 6px; }
.hx-goal-row .ring { flex: none; }
.hx-goal-row .ring-text strong { font-size: 22px; }
.hx-goal-row .ring-text span { font-size: 11px; }
.hx-hstats { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hx-hstat { display: flex; align-items: center; gap: 10px; color: var(--hero-text); }
a.hx-hstat:hover { text-decoration: none; opacity: .9; }
.hx-hstat-ic { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--hero-chip); color: var(--hero-accent); }
.hx-hstat-text { display: flex; flex-direction: column; line-height: 1.25; }
.hx-hstat-text strong { font-size: 16px; color: var(--hero-text); }
.hx-hstat-text span { font-size: 12px; color: var(--hero-muted); }

/* today strip under an exam hero */
.hx-today {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text);
}
.hx-today:hover { text-decoration: none; border-color: var(--border-strong); }
.hx-today .ring-text { color: var(--brand); }
.hx-today-goal { flex: 1; min-width: 0; }
.hx-today-cell { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.hx-today-cell span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.hx-today-cell strong { font-size: 15px; white-space: nowrap; }
.hx-sep { width: 1px; align-self: stretch; background: var(--border); flex: none; }
.hx-today-ic { width: 30px; height: 30px; border-radius: 10px; margin-right: -4px; }

/* three facts */
.hx-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.hx-stat {
  min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); transition: transform .14s, border-color .14s;
}
.hx-stat:hover { text-decoration: none; border-color: color-mix(in srgb, var(--tone) 40%, var(--border)); }
.hx-stat:active { transform: scale(.98); }
.hx-stat-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--tone-soft); color: var(--tone); }
.hx-stat-num { display: flex; align-items: baseline; gap: 2px; margin-top: 2px; }
.hx-stat-num strong { font-size: 28px; line-height: 38px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hx-stat-num span { font-size: 14px; color: var(--muted); font-weight: 600; }
.hx-stat-label { font-size: 12px; line-height: 18px; font-weight: 700; }
.hx-stat-sub { font-size: 11px; line-height: 16px; color: var(--muted); overflow-wrap: anywhere; }

/* continue */
.hx-cont {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text);
}
.hx-cont:hover { text-decoration: none; border-color: var(--border-strong); }
.hx-cont-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hx-cont-text strong { font-size: 14px; line-height: 21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-cont-text span { font-size: 12px; line-height: 18px; color: var(--muted); }
.hx-play { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); }

/* the question bank's categories: a bento of tinted tiles with a faint picture */
.hx-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hx-cat { overflow: hidden; min-height: 132px; }
.hx-cat.wide { min-height: 96px; }
.hx-cat .ui-ico, .hx-cat .ui-tile-text, .hx-cat .ui-chev { position: relative; z-index: 1; }
.hx-cat.wide .ui-chev { width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: var(--surface); }
.hx-cat-art { position: absolute; right: -10px; top: 6px; color: var(--tone); opacity: .16; pointer-events: none; line-height: 0; }
.hx-cat.wide .hx-cat-art { right: 58px; top: 50%; transform: translateY(-50%); }
.hx-cat-art svg { stroke-width: 1.4; }
/* the institution count: the bank hub's badge (bank.css .bk-t-n), at the foot beside the name (clear of the drawing at the
   top right); on the wide tile under the name, left of the drawing and the arrow */
.hx-cat .bk-t-n, .hx-cat-chip .bk-t-n { background: var(--surface); color: var(--tone); }
.hx-cat:not(.wide) .ui-tile-text { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 8px; width: 100%; margin-top: auto; }
.hx-cat.wide .bk-t-n { align-self: flex-start; margin-top: 4px; }
.hx-cat-sk { height: 132px; border-radius: 20px; }
.hx-cat-sk.wide { grid-column: 1 / -1; height: 96px; }
.hx-cat-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.hx-cat-strip::-webkit-scrollbar { display: none; }
.hx-cat-chip {
  flex: none; display: inline-flex; align-items: center; gap: 10px; min-width: 140px; max-width: 220px; min-height: 60px; padding: 10px 16px 10px 10px;
  border-radius: 18px; background: var(--tone-soft); color: var(--text); scroll-snap-align: start;
}
.hx-cat-chip:hover { text-decoration: none; filter: brightness(.98); }
.hx-cat-chip .ui-ico { flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--tone-solid); color: var(--on-tint); }
.hx-cat-chip-text { display: flex; flex-direction: column; min-width: 0; }
.hx-cat-chip-text strong { font-size: 15px; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-cat-sk.chip { flex: none; width: 150px; height: 60px; border-radius: 18px; }
.hx-subject.wide { min-height: 76px; }
.hx-subject .ui-ico { background: var(--brand); color: var(--on-brand); width: 46px; height: 46px; border-radius: 15px; }
.hx-subject .ui-chev { width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }

/* quick start: three small tinted tiles */
.hx-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hx-quick .ui-tile { min-height: 128px; padding: 12px; border-radius: var(--radius); }
.hx-quick .ui-tile .ui-ico { width: 40px; height: 40px; }
.hx-quick .ui-tile-title { font-size: 14px; line-height: 21px; }
.hx-quick .ui-tile-sub { font-size: 11px; line-height: 16px; }

/* the 28-day heatmap */
.hx-heat-card { padding: 14px; }
.hx-heat { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.hx-heat-wd { text-align: center; font-size: 11px; color: var(--muted); line-height: 18px; margin-bottom: 2px; white-space: nowrap; }
.hx-heat-cell {
  aspect-ratio: 1; max-height: 44px; width: 100%; border-radius: 9px; border: 1.5px solid transparent; padding: 0; cursor: pointer;
  background: var(--track); transition: transform .12s;
}
.hx-heat-cell.none { background: transparent; cursor: default; }
.hx-heat-cell.l1, .hx-heat-legend i.l1 { background: color-mix(in srgb, var(--brand) 30%, var(--surface)); }
.hx-heat-cell.l2, .hx-heat-legend i.l2 { background: color-mix(in srgb, var(--brand) 50%, var(--surface)); }
.hx-heat-cell.l3, .hx-heat-legend i.l3 { background: color-mix(in srgb, var(--brand) 75%, var(--surface)); }
.hx-heat-cell.l4, .hx-heat-legend i.l4 { background: var(--brand); }
.hx-heat-cell.today { border-color: var(--text); }
.hx-heat-cell.picked { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand); }
button.hx-heat-cell:hover { transform: scale(1.06); }
.hx-heat-legend { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 12px; font-size: 11px; color: var(--muted); }
.hx-heat-legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--track); }
.hx-heat-total { margin-left: auto; font-weight: 600; color: var(--text-2); }
.hx-heat-line { margin-top: 6px; font-size: 13px; line-height: 20px; color: var(--text); font-weight: 600; }
.hx-heat-line.muted { color: var(--muted); font-weight: 400; font-size: 12px; }

/* subject progress */
.hx-papers { padding: 6px 16px; }
.hx-paper { padding: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.hx-paper + .hx-paper { border-top: 1px solid var(--border); }
.hx-paper-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hx-paper-top strong { font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.hx-paper-top span { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* a recent result row's score */
.rx-score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.rx-score strong { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.rx-score span { font-size: 11px; color: var(--tone); font-weight: 700; }

@media (max-width: 380px) {
  .hx-stat { padding: 10px; }
  .hx-stat-num strong { font-size: 24px; line-height: 32px; }
  .hx-quick { gap: 8px; }
  .hx-quick .ui-tile { padding: 10px; min-height: 120px; }
  .hx-quick .ui-tile-title { font-size: 13px; line-height: 19px; }
  .hx-goal-row { gap: 14px; }
  .hx-today { gap: 9px; padding: 10px 12px; }
}
@media (min-width: 1024px) {
  .hx-home { grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); align-items: start; }
  .hx-side > .hx-sec:first-child { margin-top: 0; }
  .hx-stats { gap: 14px; }
}

/* recentItem() rows inside the older plain .list (history, progress, practice) */
.list > .ui-row { padding-left: 0; padding-right: 0; }
.list > .ui-row + .ui-row { border-top: 1px solid var(--border); }
@media (min-width: 1024px) {
  .hx-goal .ui-hero-actions { flex-wrap: nowrap; justify-content: space-between; align-items: flex-end; }
  .hx-goal-row { flex: 1 1 auto; width: auto; margin-bottom: 0; }
}

/* ================================================================== the exams tab (the app's LiveList / CourseList) */
.xl-headbox { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.xl-headbox .ui-head { margin-bottom: 8px; }
.xl-seg { display: flex; width: 100%; }
.xl-seg button { flex: 1; }
.xl-body { display: flex; flex-direction: column; gap: 20px; margin-top: 12px; }
.xl-top { display: flex; flex-direction: column; gap: 12px; }
.xl-top:empty { display: none; }
.xl-notes { display: flex; flex-direction: column; gap: 10px; }
.xl-note-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.xl-note-text strong { font-size: 15px; line-height: 22px; color: var(--text); }
.xl-note-text span { font-size: 12px; line-height: 18px; color: var(--text-2); }
.xl-locked {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--warn-soft); color: var(--text); font: inherit; cursor: pointer;
}
.xl-locked .xl-note-text strong { color: var(--warn-ink); }
.xl-locked .ui-ico { background: var(--surface); }
.xl-locked .ui-chev { color: var(--warn-ink); flex: none; }
/* the access chip (the app's): "ফ্রি অ্যাক্সেস ›" */
.xl-guest { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; min-height: 44px; margin: 0; padding: 0 14px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-ink); font-size: 15px; font-weight: 700; text-decoration: none; }
.xl-guest:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.xl-lead { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; line-height: 20px; font-weight: 700; color: var(--tone); }
.xs-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--tone-solid); }
.xl-lead.tone-bad .xs-dot, .xs-head.tone-bad .xs-dot { animation: pulse 1.4s infinite; }
.xl-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.xl-chips::-webkit-scrollbar { display: none; }
.xl-chips .chip { flex: none; min-height: 38px; font-size: 13px; }
.xl-chips .chip svg { flex: none; }
.xl-uni { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.xl-uni-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); }
.xl-uni-head:hover { text-decoration: none; background: var(--surface-2); }
.xl-uni-head .ui-chev { color: var(--muted); flex: none; }
.xl-uni .hx-cats-box { padding: 0 0 14px; }
.xl-uni .hx-cat-strip { padding: 0 16px; scroll-padding: 0 16px; scroll-snap-type: x proximity; }
.xl-uni > .ui-tile { border-radius: 20px; }
.xl-course { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.xl-empty { padding: 8px; border-radius: 20px; }
.xl-empty-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.xl-empty-acts .btn { margin-top: 0; }

/* a section: sticky head (dot · title · count), then the cards */
.xs { display: flex; flex-direction: column; }
.xs-head {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; margin: 0 -16px; padding: 10px 16px;
  background: var(--bg); font-size: 16px; line-height: 24px; font-weight: 700; color: var(--text);
}
.xs-head.tone-slate .xs-dot { background: var(--border-strong); }
.xs-title { flex: 1; min-width: 0; }
.xs-list { display: grid; gap: 12px; margin-top: 4px; }
.xs-more {
  margin-top: 12px; min-height: 48px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  color: var(--brand); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
}
.xs-more:hover { border-color: var(--border-strong); }

/* an exam card (the app's ExamCard); the whole card opens the pre-start */
.xc {
  position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transition: border-color .18s ease, transform .18s ease;
}
.xc:hover { border-color: var(--border-strong); }
.xc.live { border-color: color-mix(in srgb, var(--bad) 55%, var(--border)); }
.xc-top { display: flex; align-items: flex-start; gap: 12px; }
.xc-top > .ui-ico { width: 44px; height: 44px; border-radius: 14px; }
.xc-top > .ui-pill { flex: none; margin-top: 2px; }
.xc-head { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.xc-kind { font-size: 12px; line-height: 18px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xc-head h3 { margin: 0; font-size: 15px; line-height: 23px; font-weight: 700; }
.xc-open {
  all: unset; cursor: pointer; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  overflow-wrap: anywhere; color: var(--text);
}
.xc-open::after { content: ""; position: absolute; inset: 0; border-radius: 20px; }
.xc-open:focus-visible::after { outline: 2px solid var(--brand); outline-offset: 2px; }
.xc-sub { margin: -4px 0 0; font-size: 13px; line-height: 20px; color: var(--text-2); }
.xc-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; line-height: 18px; color: var(--text-2); }
.xc-facts > span { display: inline-flex; align-items: center; gap: 5px; }
.xc-facts svg { color: var(--muted); flex: none; }
.xc-facts .bad, .xc-facts .bad svg { color: var(--bad-ink); }
.xc-clock {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--tone-soft); color: var(--tone);
  font-size: 13px; line-height: 20px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.xc-clock svg { flex: none; }
.xc-groups { display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 18px; color: var(--text-2); }
.xc-done { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; line-height: 20px; font-weight: 700; color: var(--good-ink); }
.xc-done svg { flex: none; }
.xc-acts { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.xc-acts .btn { min-height: 44px; }
.xc-acts .grow { flex: 1 1 auto; justify-content: center; }
.xc-wait:disabled { opacity: 1; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }

/* not in the student's course (no purchase): a lock and where to see the access */
.lk { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0; text-align: center; }
.lk-ico { width: 64px; height: 64px; border-radius: 20px; }
.lk p { margin: 0; max-width: 380px; color: var(--text-2); font-size: 14px; line-height: 22px; }

@media (min-width: 1024px) {
  .xl-headbox { flex-direction: row; align-items: center; justify-content: space-between; }
  .xl-headbox .ui-head { margin-bottom: 0; }
  .xl-seg { width: auto; }
  .xl-seg button { min-width: 132px; }
  .xl-chips { margin: 0; padding: 2px 0; flex-wrap: wrap; overflow: visible; }
  .xs-head { margin: 0; padding: 10px 0; }
  .xs-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .xl-top { display: grid; grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .xl-lead .xs-dot, .xs-head .xs-dot { animation: none !important; }
  .xc { transition: none; }
}

/* ================================================================== the pre-start (the app's PreStart) */
.ps-sheet .ui-sheet-body { padding-bottom: 16px; }
.ps { display: flex; flex-direction: column; gap: 16px; }
.ps > section { display: flex; flex-direction: column; }
.ps .ui-section-head, .ps .ui-sec-head { margin-top: 0; }
.ps-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--radius-hero);
  background: var(--hero-1); border: 1px solid var(--hero-border); color: var(--hero-text);
}
.ps-chips { position: relative; display: flex; flex-wrap: wrap; gap: 6px; }
.ps-title { position: relative; margin: 0; font-size: 20px; line-height: 30px; font-weight: 700; color: var(--hero-text); overflow-wrap: anywhere; }
.ps-src { position: relative; display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 12px; line-height: 18px; color: var(--hero-muted); }
.ps-src svg { flex: none; margin-top: 2px; }
.ps-stats { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.ps-stat { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border-radius: 14px; background: var(--hero-chip); color: var(--hero-muted); }
.ps-stat svg { flex: none; }
.ps-stat-text { display: flex; flex-direction: column; min-width: 0; }
.ps-stat-text strong { font-size: 17px; line-height: 24px; color: var(--hero-text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-stat-text span { font-size: 12px; line-height: 16px; }
.ps-stat.accent .ps-stat-text strong, .ps-stat.accent svg { color: var(--hero-accent); }
.ps-mine, .ps-off { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.ps-mine-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ps-mine-text strong { font-size: 14px; line-height: 21px; color: var(--text); }
.ps-mine-text span { font-size: 12px; line-height: 18px; color: var(--text-2); }
.ps-off { background: var(--warn-soft); }
.ps-off .ui-ico { background: var(--surface); }
.ps-window { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); font-size: 13px; line-height: 20px; color: var(--text-2); }
.ps-window > span { display: inline-flex; align-items: center; gap: 6px; }
.ps-window svg { color: var(--muted); flex: none; }
.ps-panel { padding: 16px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.ps-subjects { display: flex; flex-wrap: wrap; gap: 8px; }
.ps-subject { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.ps-subject b { min-width: 26px; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: 12px; text-align: center; }
/* the rules as short chips that wrap (three words each) */
.ps-rules { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ps-rule { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; font-size: 15px; line-height: 20px;
  font-weight: 600; background: var(--tone-soft, var(--surface-2)); color: var(--tone, var(--text)); }
.ps-rule .icon { flex: none; }
.ps-foot { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ps-sum { margin: 0; text-align: center; font-size: 12px; line-height: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ps-btns { display: flex; gap: 10px; }
.ps-btns .btn { flex: 1; }
.ps-btns .btn[hidden] { display: none; }
.ps-btns .ps-go { flex: 2; }
.ui-sheet-foot .ps-go:disabled { opacity: .55; }
@media (min-width: 1024px) {
  .ps-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ps-panel { padding: 18px; }
  .ps-sum { text-align: right; }
  .ps-btns { justify-content: flex-end; }
  .ui-sheet-foot .ps-btns .btn { flex: 0 0 auto; min-width: 160px; }
  .ui-sheet-foot .ps-btns .ps-go { min-width: 220px; }
}

/* the optional-subject picker (the app's SubjectPicker) */
.sp { display: flex; flex-direction: column; gap: 16px; }
.sp-title { margin: 0; font-size: 18px; line-height: 27px; font-weight: 700; }
.sp-group { display: flex; flex-direction: column; gap: 10px; }
.sp-head { display: flex; align-items: flex-start; gap: 10px; }
.sp-head-text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.sp-head-text strong { font-size: 15px; line-height: 22px; }
.sp-head-text span { font-size: 12px; line-height: 18px; color: var(--muted); }
.sp-count {
  flex: none; min-width: 44px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2);
  font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
.sp-count.full { background: var(--good-soft); color: var(--good-ink); }
.sp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sp-grid > .fixed:only-child { grid-column: 1 / -1; }
.sp-card {
  display: flex; align-items: center; gap: 12px; min-height: 64px; min-width: 0; padding: 10px 12px; border-radius: 14px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
button.sp-card:hover { border-color: var(--border-strong); }
.sp-card.on { border-color: var(--brand); background: var(--brand-soft); }
.sp-card.fixed { cursor: default; }
.sp-box {
  flex: none; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; border: 1.5px solid var(--border-strong);
  background: var(--surface); color: transparent;
}
.sp-card.on .sp-box { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.sp-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sp-text strong { font-size: 14px; line-height: 21px; overflow-wrap: anywhere; }
.sp-text span { font-size: 12px; line-height: 18px; color: var(--text-2); }
.sp-status { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: 13px; line-height: 20px; }
.sp-status svg { flex: none; margin-top: 2px; }
.sp-status.ok { background: var(--good-soft); color: var(--good-ink); }
.sp-status.bad { background: var(--bad-soft); color: var(--bad-ink); }
.sp-note { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; line-height: 18px; color: var(--muted); }
.sp-note svg { flex: none; }
@media (max-width: 360px) {
  .sp-grid { grid-template-columns: minmax(0, 1fr); }
  .ps-hero { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-card { transition: none; }
}

/* ------------------------------------------------------------------ the student site on a phone (CLEANUI): body type
   at least 15 px, labels and counts at least 12 px, 8 px between targets (scoped: admin shares this file) */
.student .hx-notice { gap: 8px; }
.student .hx-notice-text strong, .student .hx-cont-text strong, .student .hx-paper-top strong, .student .rx-score strong { font-size: 15px; line-height: 22px; }
.student .hx-notice-text span, .student .hx-cont-text span, .student .hx-paper-top span { font-size: 13px; line-height: 19px; }
.student .hx-greet-text span, .student .hx-hero-ends { font-size: 14px; }
.student .hx-today-cell span, .student .hx-count-box span, .student .rx-score span, .student .hx-heat-wd, .student .hx-heat-legend { font-size: 12px; }
.student .hx-stat-label { font-size: 13px; }
.student .hx-heat-line, .student .hx-heat-line.muted { font-size: 15px; line-height: 22px; }
.student .hx-quick .ui-tile-title { font-size: 15px; line-height: 21px; }
.student .hx-quick .ui-tile-sub { font-size: 12px; }
.student .xl-chips .chip { min-height: 44px; font-size: 15px; }
.student .xl-uni .hx-cats-box { padding-top: 8px; }
.student .xl-note-text span { font-size: 13px; line-height: 19px; }
.student .xc-sub { font-size: 14px; line-height: 21px; }
.student .xc-facts, .student .xc-kind { font-size: 13px; line-height: 19px; }
.student .xc-clock { font-size: 14px; }
.student .ps-src, .student .ps-stat-text span { font-size: 13px; line-height: 19px; }
.student .ps-window { font-size: 14px; line-height: 21px; }
.student .hx-muted { font-size: 15px; }
