/* ==========================================================================
   Piano Class — design system v2 ("vui, rõ, chuyên nghiệp")
   Friendly kids-education look: vivid accent, pastel tints, chunky rounded
   cards and buttons, bold Nunito. Class names kept from v1 where possible.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* accent (per-class theme) */
  --accent: #3D7BFF;
  --accent-hover: #2F69E6;
  --accent-deep: #2556C9;        /* 3d shadow under primary buttons */
  --accent-soft: #E6EEFF;
  --accent-soft-2: #CFDDFF;
  --accent-tint: #F1F5FF;
  --on-accent: #FFFFFF;
  --accent-grad: linear-gradient(135deg, #4C8BFF 0%, #2F69E6 100%);

  /* palette for tiles, badges, pastel cards */
  --blue: #3D7BFF;   --blue-soft: #E6EEFF;   --blue-edge: #C9D9FF;
  --purple: #8B5CF6; --purple-soft: #EFE9FF; --purple-edge: #DCD0FF;
  --orange: #FF8A3D; --orange-soft: #FFEDDF; --orange-edge: #FFD6B8;
  --green: #22B573;  --green-soft: #DDF6EA;  --green-edge: #B9EBD2;
  --yellow: #FFC531; --yellow-soft: #FFF4CC; --yellow-edge: #FFE59A;
  --pink: #FF5C8A;   --pink-soft: #FFE3EB;   --pink-edge: #FFC3D3;
  --teal: #14B8A6;   --teal-soft: #DDF5F2;   --teal-edge: #B4E9E2;

  --white: #FFFFFF;
  --bg: #F4F6FC;
  --surface: #FFFFFF;
  --surface-2: #F1F3F9;
  --text: #1C2140;
  --text-2: #5C6486;
  --text-3: #9198B3;
  --border: #E6E9F2;
  --border-2: #D3D8E6;

  --success: #22B573; --success-soft: #DDF6EA; --success-deep: #178F5A;
  --danger: #F04D5E;  --danger-soft: #FFE5E8;
  --warning: #F59E0B; --warning-soft: #FFF1D6;
  --wrong: #1C2140; --wrong-deep: #0E1128;

  --key-bg: #FFFFFF; --key-edge: #D9DEEA; --key-text: #1C2140;
  --key-black-bg: #2A2F4F; --key-black-edge: #1A1E38;

  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 26px; --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(28, 33, 64, .05), 0 2px 8px rgba(28, 33, 64, .05);
  --shadow-2: 0 8px 24px rgba(28, 33, 64, .10);
  --shadow-accent: 0 8px 20px rgba(61, 123, 255, .28);

  --font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;


  /* text-on-tint colors used by chips, tiles, avatars (kept as tokens so Flutter shares them) */
  --success-text: #178F5A; --danger-text: #D63A4B; --warning-text: #B36B00; --warning-text-strong: #C77700;
  --orange-text: #D9631B; --teal-text: #0E8F82; --yellow-text: #9A6A00; --yellow-text-soft: #B07A00; --on-yellow: #5A3E00;
  --danger-deep: #B8303F; --warning-ink: #9A5B00; --yellow-ink: #8A5A0B; --yellow-deep: #E0A317;
  --hero-blob: rgba(255,255,255,.12); --inset-shade: rgba(0,0,0,.14); --hero-switch-bg: rgba(255,255,255,.18); --chip-glass-bg: rgba(255,255,255,.2); --scrim: rgba(28,33,64,.5); --google-blue: #4285F4; --auth-dark: #111111; --auth-dark-deep: #000000;
  --progress-on-tint: rgba(255,255,255,.6); --hero-avatar-bg: rgba(255,255,255,.25); --hero-logo-bg: rgba(255,255,255,.22);
  --shadow-logo: 0 10px 30px rgba(0,0,0,.18); --shadow-medal: 0 8px 20px rgba(0,0,0,.18); --shadow-staff: 0 10px 30px rgba(28,33,64,.08);
  --staff-ink: #171B26; --staff-muted: #A3ABB8; --staff-muted-2: #B3B9CC;

  --topbar-h: 60px; --tabbar-h: 68px; --sidenav-w: 252px; --rail-w: 84px;
  --content-max: 640px; --content-max-wide: 1140px;
}

[data-theme="green"]  { --accent:#1FB37A; --accent-hover:#189C69; --accent-deep:#127A52; --accent-soft:#DDF6EA; --accent-soft-2:#B9EBD2; --accent-tint:#F0FBF6; --accent-grad:linear-gradient(135deg,#2ECC8B 0%,#189C69 100%); --shadow-accent:0 8px 20px rgba(31,179,122,.28); }
[data-theme="purple"] { --accent:#8B5CF6; --accent-hover:#7A48E8; --accent-deep:#5F35C4; --accent-soft:#EFE9FF; --accent-soft-2:#DCD0FF; --accent-tint:#F6F3FF; --accent-grad:linear-gradient(135deg,#9D74FF 0%,#7A48E8 100%); --shadow-accent:0 8px 20px rgba(139,92,246,.30); }
[data-theme="orange"] { --accent:#FF8A3D; --accent-hover:#F07627; --accent-deep:#C95C15; --accent-soft:#FFEDDF; --accent-soft-2:#FFD6B8; --accent-tint:#FFF6EF; --accent-grad:linear-gradient(135deg,#FF9F5A 0%,#F07627 100%); --shadow-accent:0 8px 20px rgba(255,138,61,.30); }
[data-theme="rose"]   { --accent:#FF5C8A; --accent-hover:#EE4576; --accent-deep:#C42D5B; --accent-soft:#FFE3EB; --accent-soft-2:#FFC3D3; --accent-tint:#FFF2F6; --accent-grad:linear-gradient(135deg,#FF7AA2 0%,#EE4576 100%); --shadow-accent:0 8px 20px rgba(255,92,138,.30); }
[data-theme="teal"]   { --accent:#14B8A6; --accent-hover:#0FA392; --accent-deep:#0B7F72; --accent-soft:#DDF5F2; --accent-soft-2:#B4E9E2; --accent-tint:#EFFAF8; --accent-grad:linear-gradient(135deg,#2BCDBB 0%,#0FA392 100%); --shadow-accent:0 8px 20px rgba(20,184,166,.28); }

@font-face { font-family: "Bravura"; src: url("./fonts/Bravura.woff2") format("woff2"); font-display: block; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent); text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
[hidden] { display: none !important; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* ---------- Typography ---------- */
.h1 { font-size: 28px; font-weight: 900; letter-spacing: -.01em; line-height: 1.2; }
.h2 { font-size: 22px; font-weight: 800; line-height: 1.25; }
.h3 { font-size: 17px; font-weight: 800; }
.t-body { font-size: 16px; } .t-sm { font-size: 14px; } .t-xs { font-size: 12.5px; }
.t-muted { color: var(--text-2); } .t-faint { color: var(--text-3); }
.t-accent { color: var(--accent); } .t-success { color: var(--success); } .t-danger { color: var(--danger); } .t-warning { color: var(--warning-text-strong); }
.t-center { text-align: center; } .t-bold { font-weight: 700; } .t-black { font-weight: 800; }
.t-mono { font-family: var(--mono); } .t-nowrap { white-space: nowrap; }

/* ---------- Icons ---------- */
[data-icon] { display: inline-flex; width: 22px; height: 22px; flex: 0 0 auto; }
[data-icon] svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
[data-icon].sm { width: 18px; height: 18px; } [data-icon].lg { width: 28px; height: 28px; } [data-icon].xl { width: 40px; height: 40px; }

/* Colored icon tiles */
.tile { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; }
.tile [data-icon] { width: 24px; height: 24px; }
.tile--sm { width: 40px; height: 40px; border-radius: 13px; } .tile--sm [data-icon] { width: 20px; height: 20px; }
.tile--lg { width: 64px; height: 64px; border-radius: 20px; } .tile--lg [data-icon] { width: 32px; height: 32px; }
.tile--round { border-radius: 50%; }
.tile--accent { background: var(--accent); }
.tile--blue { background: var(--blue); } .tile--purple { background: var(--purple); } .tile--orange { background: var(--orange); }
.tile--green { background: var(--green); } .tile--yellow { background: var(--yellow); color: var(--on-yellow); } .tile--pink { background: var(--pink); } .tile--teal { background: var(--teal); }
.tile--soft-accent { background: var(--accent-soft); color: var(--accent); }
.tile--soft-blue { background: var(--blue-soft); color: var(--blue); } .tile--soft-purple { background: var(--purple-soft); color: var(--purple); }
.tile--soft-orange { background: var(--orange-soft); color: var(--orange-text); } .tile--soft-green { background: var(--green-soft); color: var(--green); }
.tile--soft-yellow { background: var(--yellow-soft); color: var(--yellow-text-soft); } .tile--soft-pink { background: var(--pink-soft); color: var(--pink); } .tile--soft-teal { background: var(--teal-soft); color: var(--teal); }

/* Number badge (colored circle) */
.num-badge { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 17px; flex: 0 0 auto; box-shadow: inset 0 -3px 0 var(--inset-shade); }
.num-badge--sm { width: 30px; height: 30px; font-size: 13px; }
.num-badge--accent { background: var(--accent); } .num-badge--blue { background: var(--blue); } .num-badge--purple { background: var(--purple); }
.num-badge--orange { background: var(--orange); } .num-badge--green { background: var(--green); } .num-badge--pink { background: var(--pink); } .num-badge--teal { background: var(--teal); } .num-badge--yellow { background: var(--yellow); color: var(--on-yellow); }
.num-badge--muted { background: var(--surface-2); color: var(--text-3); box-shadow: none; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

.topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar--accent { background: var(--accent); color: var(--on-accent); border-bottom-color: transparent; }
.topbar--accent .icon-btn { color: var(--on-accent); } .topbar--accent .icon-btn:hover { background: rgba(255,255,255,.16); }
.topbar--plain { background: transparent; border-bottom: 0; position: static; }
.topbar__title { flex: 1; min-width: 0; font-size: 18px; font-weight: 800; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__title--left { text-align: left; padding-left: 6px; }
.topbar__actions { display: flex; gap: 4px; align-items: center; }
.topbar__spacer { width: 40px; height: 40px; flex: 0 0 auto; }

.content { flex: 1; padding: 16px; padding-bottom: calc(var(--tabbar-h) + 24px); }
.content--center { max-width: var(--content-max); margin: 0 auto; width: 100%; }
.content--wide { max-width: var(--content-max-wide); margin: 0 auto; width: 100%; }
.content--flush { padding: 0; }
.content--no-tabbar { padding-bottom: 24px; }

/* Student hero header (colored, curved bottom) */
.hero-block { background: var(--accent-grad); color: #fff; padding: 12px 20px 28px; border-radius: 0 0 30px 30px; position: relative; overflow: hidden; }
.hero-block::before, .hero-block::after { content: ""; position: absolute; border-radius: 50%; background: var(--hero-blob); pointer-events: none; }
.hero-block::before { width: 220px; height: 220px; right: -70px; top: -110px; }
.hero-block::after { width: 140px; height: 140px; left: -50px; bottom: -80px; }
.hero-block > * { position: relative; }
.hero-block .icon-btn { color: #fff; } .hero-block .icon-btn:hover { background: rgba(255,255,255,.16); }
.hero-block__row { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.hero-block__title { font-size: 26px; font-weight: 900; line-height: 1.15; }
.hero-block__sub { font-size: 14px; opacity: .9; margin-top: 4px; }
.hero-block .chip--glass { background: var(--chip-glass-bg); color: #fff; }
.hero-block .avatar { background: var(--hero-avatar-bg); color: #fff; }
.content--overlap { margin-top: -18px; }
@media (min-width: 640px) { .hero-block { border-radius: 30px; margin: 20px auto 0; width: 100%; max-width: var(--content-max); padding: 20px 24px 30px; } }

/* Bottom tab bar (mobile) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: var(--tabbar-h); display: flex; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 4px; }
.tabbar__item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 11.5px; font-weight: 700; border-radius: 14px; }
.tabbar__item [data-icon] { width: 24px; height: 24px; }
.tabbar__item.is-active { color: var(--accent); background: var(--accent-soft); }

/* Side navigation (teacher, tablet and web) */
.sidenav { display: none; width: var(--sidenav-w); flex: 0 0 auto; background: var(--surface); border-right: 1px solid var(--border); padding: 18px 14px; position: sticky; top: 0; height: 100vh; height: 100dvh; flex-direction: column; gap: 4px; }
.sidenav__brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; font-weight: 900; font-size: 18px; }
.sidenav__brand .logo { width: 36px; height: 36px; border-radius: 12px; background: var(--accent-grad); color: #fff; display: grid; place-items: center; font-size: 16px; font-weight: 900; box-shadow: var(--shadow-accent); }
.sidenav__item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; color: var(--text-2); font-weight: 700; font-size: 15px; }
.sidenav__item:hover { background: var(--surface-2); color: var(--text); }
.sidenav__item.is-active { background: var(--accent-soft); color: var(--accent); }
.sidenav__section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 14px 12px 6px; font-weight: 800; }
.sidenav__footer { margin-top: auto; padding: 8px 4px 0; }
.sidenav__label { white-space: nowrap; }

@media (min-width: 640px) {
  .shell--teacher .sidenav { display: flex; }
  .tabbar { display: none; }
  .content { padding: 24px; padding-bottom: 32px; }
  .topbar { padding: 0 20px; height: 64px; }
  .topbar__title { text-align: left; font-size: 21px; }
  .topbar__spacer { display: none; }
  .shell--student .tabbar { display: flex; position: static; height: 56px; border: 1px solid var(--border); border-radius: 999px; padding: 6px; justify-content: center; gap: 6px; width: 100%; max-width: var(--content-max); margin: 12px auto 0; box-shadow: var(--shadow-1); }
  .shell--student .tabbar__item { border-radius: 999px; }
  .shell--student .tabbar__item { flex: 0 0 auto; flex-direction: row; gap: 8px; font-size: 14px; padding: 0 18px; }
  .shell--student .tabbar__item [data-icon] { width: 20px; height: 20px; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .shell--teacher .sidenav { width: var(--rail-w); padding: 14px 8px; }
  .sidenav__brand { justify-content: center; padding: 6px 0 14px; } .sidenav__brand span { display: none; }
  .sidenav__item { flex-direction: column; gap: 4px; padding: 10px 4px; font-size: 11px; }
  .sidenav__section { display: none; }
  .sidenav__label { font-size: 10.5px; white-space: normal; text-align: center; line-height: 1.15; }
}
@media (min-width: 1024px) { .content { padding: 32px; } }

.only-mobile { display: block; } .only-tablet-up { display: none; } .only-web { display: none; }
@media (min-width: 640px) { .only-mobile { display: none; } .only-tablet-up { display: block; } }
@media (min-width: 1024px) { .only-web { display: block; } .hide-web { display: none !important; } }

/* Teacher page head */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head__title { font-size: 24px; font-weight: 900; letter-spacing: -.01em; }
.page-head__sub { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.page-head__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* The teacher's own avatar on a phone, where there is no side navigation to carry it: opens the settings. */
.page-head__me { width: 36px; height: 36px; font-size: 13px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent-soft-2); margin-left: 4px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 14px; font-weight: 800; font-size: 15px; border: 1px solid transparent; transition: background .12s, border-color .12s, transform .06s, box-shadow .06s; white-space: nowrap; }
.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 0 var(--accent-deep); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-deep); }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-2); box-shadow: 0 3px 0 var(--border-2); }
.btn--secondary:hover { background: var(--surface-2); }
.btn--secondary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border-2); }
.btn--soft { background: var(--accent-soft); color: var(--accent); }
.btn--soft:hover { background: var(--accent-soft-2); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); }
.btn--danger { background: var(--danger); color: #fff; box-shadow: 0 4px 0 var(--danger-deep); }
.btn--danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn--success { background: var(--success); color: #fff; box-shadow: 0 4px 0 var(--success-deep); }
.btn--white { background: #fff; color: var(--accent); box-shadow: 0 4px 0 rgba(0,0,0,.12); }
.btn--lg { min-height: 56px; font-size: 17px; border-radius: 18px; padding: 0 26px; }
.btn--sm { min-height: 36px; font-size: 13.5px; padding: 0 12px; border-radius: 10px; }
.btn--sm.btn--primary { box-shadow: 0 3px 0 var(--accent-deep); }
.btn--pill { border-radius: var(--r-pill); }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; box-shadow: none; }
.btn [data-icon] { width: 20px; height: 20px; }

.icon-btn { width: 42px; height: 42px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn--accent { color: var(--accent); } .icon-btn--danger { color: var(--danger); }
.icon-btn--filled { background: var(--surface-2); }
.icon-btn--sm { width: 34px; height: 34px; border-radius: 10px; } .icon-btn--sm [data-icon] { width: 18px; height: 18px; }

.btn-row { display: flex; gap: 10px; } .btn-row > .btn { flex: 1; }
.sticky-actions { position: sticky; bottom: 0; z-index: 10; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); margin: 0 -16px -16px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
@media (min-width: 640px) { .sticky-actions { margin: 0; padding: 16px 0 0; background: none; position: static; } }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-1); }
.card--flush { padding: 0; overflow: hidden; }
.card--flat { box-shadow: none; }
.card--accent { background: var(--accent-grad); color: var(--on-accent); border-color: transparent; box-shadow: var(--shadow-accent); }
.card--soft { background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.card--chunky { border-bottom-width: 4px; }
/* pastel tinted cards with a darker bottom edge, like the reference */
.card--tint-blue { background: var(--blue-soft); border-color: var(--blue-edge); border-bottom: 4px solid var(--blue-edge); box-shadow: none; }
.card--tint-purple { background: var(--purple-soft); border-color: var(--purple-edge); border-bottom: 4px solid var(--purple-edge); box-shadow: none; }
.card--tint-orange { background: var(--orange-soft); border-color: var(--orange-edge); border-bottom: 4px solid var(--orange-edge); box-shadow: none; }
.card--tint-green { background: var(--green-soft); border-color: var(--green-edge); border-bottom: 4px solid var(--green-edge); box-shadow: none; }
.card--tint-yellow { background: var(--yellow-soft); border-color: var(--yellow-edge); border-bottom: 4px solid var(--yellow-edge); box-shadow: none; }
.card--tint-pink { background: var(--pink-soft); border-color: var(--pink-edge); border-bottom: 4px solid var(--pink-edge); box-shadow: none; }
.card--tint-accent { background: var(--accent-soft); border-color: var(--accent-soft-2); border-bottom: 4px solid var(--accent-soft-2); box-shadow: none; }
.card + .card { margin-top: 12px; }
.stack > .card + .card, .grid-2 > .card, .grid-3 > .card, .split > .card { margin-top: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card__title { font-size: 16px; font-weight: 800; }
a.card { color: inherit; display: block; } a.card:hover { border-color: var(--accent-soft-2); box-shadow: var(--shadow-2); }

.section { margin-bottom: 22px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section__title { font-size: 17px; font-weight: 800; color: var(--text); }
.section__title .count { color: var(--text-3); font-weight: 700; margin-left: 6px; font-size: 14px; }
.section__link { font-size: 14px; font-weight: 800; color: var(--accent); }

.stack { display: flex; flex-direction: column; gap: 12px; } .stack--sm { gap: 8px; } .stack--lg { gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; } .row--between { justify-content: space-between; } .row--wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-8{margin-top:8px}.mt-12{margin-top:12px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}.mt-32{margin-top:32px}
.mb-8{margin-bottom:8px}.mb-12{margin-bottom:12px}.mb-16{margin-bottom:16px}.mb-24{margin-bottom:24px}

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-2--web-3 { grid-template-columns: 2fr 1fr; } }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.split > * { min-width: 0; }
@media (min-width: 1024px) { .split { grid-template-columns: minmax(0, 1fr) 360px; } .split--wide-side { grid-template-columns: minmax(0, 1fr) 420px; } .split--reverse { grid-template-columns: 360px minmax(0, 1fr); } }

/* ---------- Lists ---------- */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; border-bottom: 1px solid var(--border); color: inherit; width: 100%; text-align: left; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--accent-tint); }
.list-item--static:hover { background: var(--surface); }
.list-item__body { flex: 1; min-width: 0; }
.list-item__title { font-weight: 800; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item__sub { font-size: 13px; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item__trail { display: flex; align-items: center; gap: 8px; color: var(--text-3); flex: 0 0 auto; }
.list-item__chev { color: var(--text-3); }
.list-item--lg { padding: 16px 14px; min-height: 78px; }
/* Card-style list (separate rounded rows) */
.list--cards { background: transparent; border: 0; box-shadow: none; display: flex; flex-direction: column; gap: 10px; overflow: visible; }
.list--cards .list-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.list--cards .list-item:hover { border-color: var(--accent-soft-2); }

.avatar { width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 900; font-size: 15px; }
.avatar--lg { width: 58px; height: 58px; font-size: 20px; } .avatar--xl { width: 88px; height: 88px; font-size: 32px; }
.avatar--sq { border-radius: 14px; } .avatar--muted { background: var(--surface-2); color: var(--text-2); }
.avatar--ring { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--accent-soft-2); }
.avatar--purple { background: var(--purple-soft); color: var(--purple); } .avatar--orange { background: var(--orange-soft); color: var(--orange-text); }
.avatar--green { background: var(--green-soft); color: var(--green); } .avatar--pink { background: var(--pink-soft); color: var(--pink); } .avatar--teal { background: var(--teal-soft); color: var(--teal); }

.class-logo { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-grad); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 16px; flex: 0 0 auto; box-shadow: var(--shadow-accent); }
.class-logo--sm { width: 36px; height: 36px; border-radius: 11px; font-size: 13px; box-shadow: none; }
.class-logo--lg { width: 72px; height: 72px; border-radius: 22px; font-size: 26px; }
.class-logo--xl { width: 100px; height: 100px; border-radius: 30px; font-size: 36px; }

/* ---------- Chips, badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 800; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.chip [data-icon] { width: 14px; height: 14px; }
.chip--accent { background: var(--accent-soft); color: var(--accent); }
.chip--success { background: var(--success-soft); color: var(--success-text); }
.chip--danger { background: var(--danger-soft); color: var(--danger-text); }
.chip--warning { background: var(--warning-soft); color: var(--warning-text); }
.chip--purple { background: var(--purple-soft); color: var(--purple); } .chip--orange { background: var(--orange-soft); color: var(--orange-text); } .chip--pink { background: var(--pink-soft); color: var(--pink); } .chip--teal { background: var(--teal-soft); color: var(--teal-text); } .chip--yellow { background: var(--yellow-soft); color: var(--yellow-text); }
.chip--dark { background: var(--text); color: #fff; }
.chip--white { background: #fff; color: var(--text); box-shadow: var(--shadow-1); }
.chip--outline { background: transparent; border: 1.5px solid var(--border-2); }
.chip--lg { height: 34px; font-size: 13.5px; padding: 0 14px; }
.chip--dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 900; display: inline-grid; place-items: center; }

/* Language switch (Vietnamese / English). Light variant on cards, hero variant on colored headers. */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); }
.lang-switch button { height: 28px; padding: 0 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 800; color: var(--text-2); }
.lang-switch button.is-on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-1); }
.lang-switch--hero { background: var(--hero-switch-bg); }
.lang-switch--hero button { color: var(--white); }
.lang-switch--hero button.is-on { background: var(--white); color: var(--accent); box-shadow: none; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; } .field + .field { margin-top: 16px; }
.label { font-size: 14px; font-weight: 800; color: var(--text); } .label .opt { color: var(--text-3); font-weight: 600; }
.help { font-size: 13px; color: var(--text-2); } .help--error { color: var(--danger); font-weight: 700; } .help--success { color: var(--success-text); font-weight: 700; }
.input, .select, .textarea { width: 100%; min-height: 50px; padding: 0 14px; background: var(--surface); border: 1.5px solid var(--border-2); border-radius: 14px; font-size: 16px; font-weight: 600; outline: none; transition: border-color .12s, box-shadow .12s; }
.textarea { padding: 12px 14px; min-height: 96px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); font-weight: 600; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.is-error { border-color: var(--danger); } .input.is-success { border-color: var(--success); }
.input--code { font-family: var(--mono); font-size: 30px; letter-spacing: .26em; text-align: center; text-transform: uppercase; min-height: 68px; font-weight: 800; }
.input-wrap { position: relative; } .input-wrap .input { padding-right: 44px; }
.input-wrap__icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); display: flex; }
.input-wrap__icon--left { right: auto; left: 12px; } .input-wrap .input--with-left { padding-left: 42px; padding-right: 14px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }

.pin { display: flex; gap: 8px; justify-content: center; }
.pin__box { width: 46px; height: 56px; border: 1.5px solid var(--border-2); border-radius: 14px; background: var(--surface); display: grid; place-items: center; font-size: 24px; font-weight: 800; font-family: var(--mono); }
.pin__box.is-filled::after { content: ""; width: 13px; height: 13px; border-radius: 50%; background: var(--text); }
.pin__box.is-active { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
@media (min-width: 640px) { .pin__box { width: 54px; height: 64px; } }

/* Big numeric keypad (student PIN) */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 0 auto; }
.keypad__key { height: 62px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--border); box-shadow: 0 3px 0 var(--border-2); font-size: 24px; font-weight: 800; display: grid; place-items: center; color: var(--text); }
.keypad__key:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border-2); }
.keypad__key--ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.keypad__key.is-disabled { opacity: .4; pointer-events: none; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch__track { width: 48px; height: 30px; border-radius: 15px; background: var(--border-2); position: relative; transition: background .15s; flex: 0 0 auto; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: left .15s; }
.switch.is-on .switch__track { background: var(--accent); } .switch.is-on .switch__track::after { left: 21px; }

.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio { display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border: 1.5px solid var(--border-2); border-radius: 14px; background: var(--surface); }
.radio.is-on { border-color: var(--accent); background: var(--accent-soft); }
.radio__dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-2); flex: 0 0 auto; margin-top: 1px; background: #fff; }
.radio.is-on .radio__dot { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 45%, #fff 48%); }
.radio__title { font-weight: 800; font-size: 15px; } .radio__sub { font-size: 13px; color: var(--text-2); }

.checkbox { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--border-2); display: grid; place-items: center; flex: 0 0 auto; background: var(--surface); }
.checkbox.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.checkbox [data-icon] { width: 16px; height: 16px; }

.setting-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row__body { flex: 1; min-width: 0; }
.setting-row__title { font-weight: 800; font-size: 15px; } .setting-row__sub { font-size: 13px; color: var(--text-2); }

.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--border-2); border-radius: 12px; background: var(--surface); overflow: hidden; }
.stepper button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--text-2); }
.stepper button:hover { background: var(--surface-2); }
.stepper__val { min-width: 60px; text-align: center; font-weight: 800; font-size: 15px; }

.segmented { display: inline-flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 2px; max-width: 100%; overflow-x: auto; }
.segmented button { padding: 8px 14px; border-radius: 11px; font-weight: 800; font-size: 14px; color: var(--text-2); white-space: nowrap; }
.segmented button.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.segmented--block { display: flex; } .segmented--block button { flex: 1; }
.segmented--accent button.is-on { background: var(--accent); color: #fff; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { padding: 10px 14px; font-weight: 800; font-size: 14px; color: var(--text-2); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.is-on { color: var(--accent); border-bottom-color: var(--accent); }

.search { position: relative; }
.search .input { padding-left: 44px; min-height: 46px; border-radius: 14px; }
.search [data-icon] { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 20px; height: 20px; }

.theme-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; display: grid; place-items: center; color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.swatch.is-on { border-color: var(--text); }
.swatch [data-icon] { width: 20px; height: 20px; }
.swatch--blue { background: #3D7BFF; } .swatch--green { background: #1FB37A; } .swatch--purple { background: #8B5CF6; }
.swatch--orange { background: #FF8A3D; } .swatch--rose { background: #FF5C8A; } .swatch--teal { background: #14B8A6; }

/* ---------- Banners, empty states, progress ---------- */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; }
.banner [data-icon] { width: 20px; height: 20px; margin-top: 1px; }
.banner--info { background: var(--accent-soft); color: var(--accent); }
.banner--warning { background: var(--warning-soft); color: var(--warning-ink); }
.banner--danger { background: var(--danger-soft); color: var(--danger-text); }
.banner--success { background: var(--success-soft); color: var(--success-text); }
.banner__body { flex: 1; } .banner__title { font-weight: 800; }

.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .tile { margin: 0 auto 14px; }
.empty [data-icon].big { width: 48px; height: 48px; margin: 0 auto 12px; color: var(--text-3); }
.empty__title { font-weight: 800; color: var(--text); font-size: 17px; } .empty__sub { font-size: 14px; margin-top: 4px; }

.progress { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.progress__bar { height: 100%; background: var(--accent); border-radius: 5px; }
.progress--success .progress__bar { background: var(--success); }
.progress--thin { height: 6px; }
.progress--on-tint { background: var(--progress-on-tint); }

/* Progress ring (conic) */
.ring { --p: 0; --ring-color: var(--accent); position: relative; width: 72px; height: 72px; border-radius: 50%; background: conic-gradient(var(--ring-color) calc(var(--p) * 1%), var(--surface-2) 0); display: grid; place-items: center; flex: 0 0 auto; }
.ring::before { content: ""; position: absolute; width: 56px; height: 56px; border-radius: 50%; background: var(--surface); }
.ring > * { position: relative; font-weight: 900; font-size: 15px; }
.ring--lg { width: 120px; height: 120px; } .ring--lg::before { width: 96px; height: 96px; } .ring--lg > * { font-size: 26px; }

.divider { height: 1px; background: var(--border); margin: 16px 0; }

.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 10px; text-align: center; box-shadow: var(--shadow-1); }
.stat-tile__val { font-size: 24px; font-weight: 900; line-height: 1.1; }
.stat-tile__label { font-size: 12.5px; color: var(--text-2); margin-top: 4px; font-weight: 700; }
.stat-tile .tile { margin: 0 auto 8px; }
.stat-tiles--2 { grid-template-columns: repeat(2, 1fr); } .stat-tiles--4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .stat-tiles--4 { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Tables (tablet/web) ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 800; background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--accent-tint); }
.table td.num, .table th.num { text-align: right; }
.table .sticky { position: sticky; left: 0; background: inherit; z-index: 1; }
.matrix th.sticky { background: var(--surface-2); } .matrix td.sticky { background: var(--surface); }
.matrix tbody tr:hover td.sticky { background: var(--accent-tint); }
.matrix td { text-align: center; } .matrix td.sticky { text-align: left; }
.cell-status { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; }
.cell-status__score { font-weight: 900; font-size: 15px; }
.cell-status__sub { font-size: 11.5px; color: var(--text-3); font-weight: 700; }
.cell-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-pill); font-weight: 900; font-size: 13.5px; }

/* ---------- Modal / sheet ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); border-radius: 26px 26px 0 0; padding: 12px 18px calc(20px + env(safe-area-inset-bottom)); width: 100%; max-width: 560px; }
.sheet__grab { width: 44px; height: 5px; border-radius: 3px; background: var(--border-2); margin: 0 auto 14px; }
.sheet__title { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.sheet__sub { font-size: 14px; color: var(--text-2); margin-bottom: 16px; }
@media (min-width: 640px) { .scrim { align-items: center; } .sheet { border-radius: 26px; padding: 26px; } .sheet__grab { display: none; } }

/* ---------- Music: staff, note pad, piano ---------- */
.staff-wrap { background: var(--surface); border-radius: 22px; padding: 10px; overflow: hidden; }
.staff-wrap svg { width: 100%; height: auto; display: block; }
.staff-wrap--bare { background: transparent; padding: 0; }
.staff-wrap--card { border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.staff-wrap--hero { border: 2px solid var(--accent-soft-2); box-shadow: var(--shadow-staff); }

/* Play screen top: progress + stats chips */
.play-top { background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px 12px; }
.play-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.play-stats__item { background: var(--surface-2); border-radius: 14px; padding: 8px 6px; text-align: center; }
.play-stats__label { font-size: 11.5px; color: var(--text-2); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.play-stats__val { font-size: 22px; font-weight: 900; line-height: 1.15; font-variant-numeric: tabular-nums; }
.play-stats__val--ok { color: var(--success); }
.play-stats__item--accent { background: var(--accent-soft); color: var(--accent); } .play-stats__item--accent .play-stats__label { color: var(--accent); }

.play-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 14px; gap: 10px; }
.play-area .staff-wrap { width: 100%; max-width: 760px; }
.play-hint { font-size: 15px; color: var(--text-2); text-align: center; min-height: 22px; font-weight: 700; }
.play-hint--correct { color: var(--success); font-weight: 900; }
.play-hint--wrong { color: var(--text); font-weight: 900; }

/* Note-name pad laid out like piano keys (14-col grid) */
.notepad { padding: 10px 12px 14px; background: var(--surface); border-top: 1px solid var(--border); }
.notepad__grid { display: grid; grid-template-columns: repeat(14, 1fr); gap: 10px 6px; max-width: 760px; margin: 0 auto; }
.notepad__grid .key { grid-column: span 2; }
.notepad__grid .key--black { grid-row: 1; } .notepad__grid .key--white { grid-row: 2; }
.notepad__grid .key[data-pos="1"] { grid-column: 2 / span 2; } .notepad__grid .key[data-pos="2"] { grid-column: 4 / span 2; }
.notepad__grid .key[data-pos="3"] { grid-column: 8 / span 2; } .notepad__grid .key[data-pos="4"] { grid-column: 10 / span 2; } .notepad__grid .key[data-pos="5"] { grid-column: 12 / span 2; }
.notepad--no-accidentals .key--black { display: none; } .notepad--no-accidentals .key--white { grid-row: 1; }
.key { height: 58px; border-radius: 16px; background: var(--key-bg); color: var(--key-text); border: 1.5px solid var(--key-edge); box-shadow: 0 4px 0 var(--key-edge); font-size: 18px; font-weight: 900; display: grid; place-items: center; transition: background .08s, transform .06s, box-shadow .06s; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.key:active, .key.is-pressed { transform: translateY(3px); box-shadow: 0 1px 0 var(--key-edge); }
.key--black { background: var(--key-black-bg); color: #fff; border-color: var(--key-black-edge); box-shadow: 0 4px 0 var(--key-black-edge); font-size: 15px; height: 50px; }
.key.is-correct { background: var(--success); color: #fff; border-color: var(--success-deep); box-shadow: 0 4px 0 var(--success-deep); }
.key.is-wrong { background: var(--wrong); color: #fff; border-color: var(--wrong-deep); box-shadow: 0 4px 0 var(--wrong-deep); }
.key.is-answer { box-shadow: 0 0 0 3px var(--success), 0 4px 0 var(--success-deep); border-color: var(--success); }
@media (min-width: 640px) { .key { height: 66px; font-size: 20px; } .key--black { height: 56px; } .notepad { padding: 14px 24px 18px; } }

/* Virtual piano */
.piano { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 12px 16px; }
.piano__keys { position: relative; height: 150px; display: flex; width: max-content; margin: 0 auto; --wk: 44px; }
.piano__white { width: var(--wk); height: 100%; border: 1.5px solid var(--border-2); border-right-width: 0; background: #fff; border-radius: 0 0 8px 8px; position: relative; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; font-size: 12px; color: var(--text-3); font-weight: 800; box-shadow: inset 0 -4px 0 var(--border); }
.piano__white:first-child { border-radius: 8px 0 8px 8px; } .piano__white:last-child { border-right-width: 1.5px; border-radius: 0 8px 8px 8px; }
.piano__white.is-anchor { color: var(--accent); }
.piano__white.is-correct { background: var(--success); color: #fff; } .piano__white.is-wrong { background: var(--wrong); color: #fff; }
.piano__black { position: absolute; top: 0; width: 28px; height: 92px; background: var(--key-black-bg); border-radius: 0 0 6px 6px; z-index: 2; margin-left: -14px; box-shadow: inset 0 -5px 0 var(--key-black-edge); }
.piano__black.is-correct { background: var(--success); } .piano__black.is-wrong { background: var(--danger); }
@media (min-width: 640px) { .piano__keys { height: 170px; --wk: 52px; } .piano__black { width: 32px; margin-left: -16px; height: 104px; } }

.answer-switch { display: flex; justify-content: center; padding: 8px 0 0; }

/* Note editor toolbar */
.note-toolbar { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-1); }
.note-toolbar__group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.note-toolbar__label { font-size: 12px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; width: 64px; flex: 0 0 auto; }
.tool { min-width: 44px; height: 42px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 800; font-size: 14px; color: var(--text-2); }
.tool:hover { background: var(--border); color: var(--text); }
.tool.is-on { background: var(--accent); color: #fff; }
.tool--danger { color: var(--danger); } .tool--danger:hover { background: var(--danger-soft); color: var(--danger); }
.tool .glyph { font-family: "Bravura"; font-size: 20px; line-height: 1; }
.note-seq { display: flex; gap: 6px; flex-wrap: wrap; }
.note-seq .chip { height: 34px; font-size: 14px; padding: 0 13px; background: var(--surface); border: 1.5px solid var(--border-2); }
.note-seq .chip.is-on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Result ---------- */
.result-hero { text-align: center; padding: 24px 16px 8px; }
.result-hero__score { font-size: 60px; font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.result-hero__score small { font-size: 24px; color: var(--text-3); font-weight: 800; }
.result-hero__label { margin-top: 8px; font-size: 16px; color: var(--text-2); font-weight: 700; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-dot--passed { background: var(--success); } .status-dot--failed { background: var(--danger); } .status-dot--doing { background: var(--accent); } .status-dot--new { background: var(--border-2); } .status-dot--late { background: var(--warning); }

/* ---------- Misc ---------- */
.kbd { font-family: var(--mono); font-size: 12px; padding: 2px 6px; border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
.code-big { font-family: var(--mono); font-size: 32px; font-weight: 800; letter-spacing: .22em; }
.logo-mark { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 24px; background: var(--accent-grad); color: #fff; box-shadow: var(--shadow-accent); }
.logo-mark [data-icon] { width: 36px; height: 36px; }
.hero { text-align: center; padding: 28px 16px 16px; }
.hero__title { font-size: 28px; font-weight: 900; letter-spacing: -.01em; margin-top: 16px; }
.hero__sub { font-size: 15px; color: var(--text-2); margin-top: 6px; font-weight: 600; }

.role-card { display: flex; align-items: center; gap: 16px; padding: 18px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 22px; width: 100%; text-align: left; color: inherit; box-shadow: var(--shadow-1); transition: transform .08s, border-color .12s, box-shadow .12s; }
.role-card:hover { border-color: var(--accent-soft-2); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.role-card__icon { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; }
.role-card__icon [data-icon] { width: 30px; height: 30px; }
.role-card__title { font-size: 18px; font-weight: 900; } .role-card__sub { font-size: 14px; color: var(--text-2); margin-top: 2px; font-weight: 600; }

.auth-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 0 16px; border: 1.5px solid var(--border-2); border-radius: 16px; background: var(--surface); font-weight: 800; font-size: 16px; box-shadow: 0 3px 0 var(--border-2); }
.auth-btn:hover { background: var(--surface-2); }
.auth-btn__mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 15px; flex: 0 0 auto; }
.auth-btn__mark--google { background: #fff; border: 1.5px solid var(--border-2); color: var(--google-blue); }
.auth-btn__mark--apple { background: var(--auth-dark-deep); color: #fff; }
.auth-btn--dark { background: var(--auth-dark); color: #fff; border-color: var(--auth-dark); box-shadow: 0 3px 0 var(--auth-dark-deep); }
.auth-btn--dark:hover { background: #222; }

/* Centered onboarding pages: hero on top, white card below (mobile too) */
.center-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 0 0 32px; }
.center-page__box { width: 100%; max-width: 460px; padding: 20px; }
@media (min-width: 640px) { .center-page { justify-content: center; padding: 32px 20px; } .center-page__box { background: var(--surface); border: 1px solid var(--border); border-radius: 28px; padding: 32px; box-shadow: var(--shadow-2); } }

/* Decorative blobs for onboarding screens */
.blob-bg { position: relative; overflow: hidden; }
.blob-bg::before, .blob-bg::after { content: ""; position: absolute; border-radius: 50%; z-index: 0; pointer-events: none; }
.blob-bg::before { width: 260px; height: 260px; background: var(--accent-soft); top: -120px; right: -90px; }
.blob-bg::after { width: 180px; height: 180px; background: var(--yellow-soft); bottom: -70px; left: -60px; }
.blob-bg > * { position: relative; z-index: 1; }

.deadline { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); font-weight: 700; }
.deadline [data-icon] { width: 15px; height: 15px; }
.deadline--late { color: var(--warning-text-strong); font-weight: 800; }

.question-preview { display: flex; gap: 12px; align-items: center; }
.question-preview .staff-wrap { width: 132px; flex: 0 0 auto; padding: 4px 6px; background: var(--surface-2); border-radius: 12px; }
.question-preview .staff-wrap svg { width: 100%; }
.mc-thumb { width: 96px; height: 56px; border-radius: 12px; background: var(--purple-soft); color: var(--purple); display: grid; place-items: center; flex: 0 0 auto; }

.spinner { width: 48px; height: 48px; border-radius: 50%; border: 5px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Sparkles for celebration screens (pure CSS) */
.sparkles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sparkles i { position: absolute; width: 10px; height: 10px; background: #fff; border-radius: 50%; opacity: .9; animation: twinkle 1.8s ease-in-out infinite; }
.sparkles i:nth-child(2) { width: 6px; height: 6px; animation-delay: .4s; } .sparkles i:nth-child(3) { width: 14px; height: 14px; animation-delay: .8s; }
.sparkles i:nth-child(4) { width: 8px; height: 8px; animation-delay: 1.2s; } .sparkles i:nth-child(5) { width: 5px; height: 5px; animation-delay: .2s; } .sparkles i:nth-child(6) { width: 9px; height: 9px; animation-delay: 1.5s; }
@keyframes twinkle { 0%, 100% { transform: scale(.6); opacity: .4; } 50% { transform: scale(1.2); opacity: 1; } }

/* ---------- Onboarding pattern (join flow, login, PIN): colored hero + white card ---------- */
.onboard { min-height: 100vh; min-height: 100dvh; }
.onboard__hero { background: var(--accent-grad); color: #fff; padding: 10px 16px 52px; border-radius: 0 0 36px 36px; text-align: center; position: relative; overflow: hidden; }
.onboard__hero::before, .onboard__hero::after { content: ""; position: absolute; border-radius: 50%; background: var(--hero-blob); pointer-events: none; }
.onboard__hero::before { width: 240px; height: 240px; right: -80px; top: -120px; }
.onboard__hero::after { width: 160px; height: 160px; left: -60px; bottom: -80px; }
.onboard__hero > * { position: relative; }
.onboard__hero .icon-btn { color: #fff; } .onboard__hero .icon-btn:hover { background: rgba(255,255,255,.16); }
.onboard__nav { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.onboard__icon { width: 76px; height: 76px; border-radius: 26px; background: #fff; color: var(--accent); display: grid; place-items: center; margin: 6px auto 0; box-shadow: var(--shadow-logo); }
.onboard__icon [data-icon] { width: 38px; height: 38px; }
.onboard__icon--class { background: #fff; color: var(--accent); font-weight: 900; font-size: 28px; }
.onboard__title { font-size: 26px; font-weight: 900; margin-top: 14px; line-height: 1.15; }
.onboard__sub { font-size: 14.5px; font-weight: 700; opacity: .92; margin-top: 6px; }
.onboard__body { max-width: 480px; margin: -30px auto 0; padding: 0 16px 32px; position: relative; }
.onboard__body > .card { padding: 20px; border-radius: 24px; }
.onboard__foot { text-align: center; margin-top: 18px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
@media (min-width: 640px) {
  body.onboard-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
  .onboard { width: 100%; max-width: 500px; min-height: auto; background: var(--surface); border-radius: 32px; overflow: hidden; box-shadow: var(--shadow-2); border: 1px solid var(--border); }
  .onboard__hero { border-radius: 0; padding-bottom: 56px; }
  .onboard__body { padding: 0 24px 28px; }
}

/* On phones, list pages that already have a .page-head do not repeat the title in the topbar */
@media (max-width: 639px) { .shell--teacher .main:has(> .content > .page-head) > .topbar { display: none; } .shell--teacher .main:has(> .content > .page-head) > .content { padding-top: 20px; } }

@media (max-width: 639px) { .swatch { width: 40px; height: 40px; } }
