@font-face {
  font-family: "DM Sans";
  src: url("./assets/dm-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: Manrope;
  src: url("./assets/manrope.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #24243e;
  --text: #28273c;
  --muted: #636375;
  --faint: #6c6c7d;
  --line: #e5e5e9;
  --canvas: #f8f8f4;
  --white: #fff;
  --purple: #5341a1;
  --lavender: #ede8fb;
  --lime: #e8f49b;
  --heading: Manrope, Arial, sans-serif;
  --sidebar-width: 244px;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
  background: var(--canvas);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--heading); letter-spacing: -.038em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #735acb; outline-offset: 3px; }
.icon { flex: 0 0 auto; vertical-align: middle; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 20; left: 1rem; top: 1rem; border-radius: 8px; background: white; padding: .75rem 1rem; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 5; display: flex; flex-direction: column; padding: 29px 17px 16px; background: var(--white); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; width: fit-content; margin: 0 0 46px 12px; font: 800 2rem/.94 var(--heading); letter-spacing: -.10em; }
.brand-mark { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 13px; background: var(--lime); color: var(--ink); }
.brand-dot { color: #6e57b3; }
.brand small { display: block; margin-top: 6px; font: 700 .59rem/1 "DM Sans", sans-serif; letter-spacing: .10em; color: #77758a; }
.navigation { display: grid; gap: 23px; }
.nav-group { display: grid; gap: 4px; }
.nav-group:last-child { padding-top: 15px; border-top: 1px solid #eeeef1; margin-top: -6px; }
.nav-group:first-child { padding-top: 0; border: 0; margin-top: 0; }
.nav-label { color: #777488; font-size: .69rem; font-weight: 700; letter-spacing: .10em; margin: 0 11px 5px; }
.nav-link { min-height: 44px; padding: 0 11px; display: flex; align-items: center; gap: 11px; border-radius: 9px; color: #5a596e; font-size: .91rem; font-weight: 600; }
.nav-link:hover, .install-button:hover, .profile-button:hover { background: #f6f4fb; color: var(--ink); }
.nav-link.active { background: #eee9fb; color: #4b368d; font-weight: 700; }
.nav-link > span:nth-child(2) { flex: 1; }
.nav-count { min-width: 23px; padding: 3px 5px; text-align: center; font-size: .72rem; line-height: 1.1; border-radius: 6px; background: #f0edf9; color: #554181; }
.nav-link.active .nav-count { background: #e1d8f5; }
.sidebar-footer { display: grid; gap: 12px; margin-top: auto; padding-top: 28px; }
.install-button, .profile-button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; border-radius: 9px; background: transparent; }
.install-button { min-height: 42px; padding: 8px 11px; font-weight: 600; font-size: .9rem; color: #5a596e; }
.profile-button { padding: 10px 8px; border-top: 1px solid #eeeef1; border-radius: 0 0 9px 9px; }
.profile-button > span:nth-child(2) { display: grid; gap: 2px; flex: 1; }
.profile-button strong { font-size: .9rem; font-weight: 700; }
.profile-button small { font-size: .77rem; color: var(--muted); }
.profile-button > .icon { color: var(--muted); }

.workspace { margin-left: var(--sidebar-width); min-height: 100dvh; }
.topbar { height: 70px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: var(--white); }
.breadcrumbs, .top-actions { display: flex; gap: 10px; align-items: center; font-size: .89rem; }
.breadcrumbs { color: var(--muted); min-width: 0; }
.breadcrumb-root { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumbs strong { color: var(--ink); font-weight: 700; }
.role-button, .date-pill, .offline-label { align-items: center; gap: 8px; display: inline-flex; border: 1px solid #e4e2ea; background: var(--white); color: #4a485f; border-radius: 9px; min-height: 36px; padding: 6px 10px; font-size: .84rem; font-weight: 700; white-space: nowrap; }
.role-button:hover { border-color: #b5a8d6; background: #faf8ff; }
.role-button > .icon:first-child { color: #68559e; }
.date-pill { padding: 8px 11px; color: #515064; }
.date-pill .icon { color: #6b5d95; }
.offline-label { background: #fff3cf; }
.menu-button, .sidebar-scrim { display: none !important; }

.main-content { max-width: 1550px; padding: 29px 34px 42px; margin: 0 auto; outline: none; }
.page-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin: 0 0 23px; }
.page-heading h1 { color: var(--ink); font-size: clamp(1.85rem, 2.7vw, 2.45rem); font-weight: 800; line-height: 1.16; }
.page-heading p { color: var(--muted); margin-top: 6px; line-height: 1.45; }
.hero { position: relative; min-height: 255px; overflow: hidden; display: flex; align-items: center; background: #242541; color: #fff; border-radius: 17px; isolation: isolate; }
.hero-content { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; padding: 29px 34px; }
.hero-art { position: absolute; inset: 0 0 0 auto; width: 52%; z-index: -1; background: url("./assets/hero.webp") center 44% / cover no-repeat; mask-image: linear-gradient(90deg, transparent, #000 15%, #000 96%, transparent); }
.class-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid #ffffff38; border-radius: 6px; color: #e0daf9; font-size: .74rem; font-weight: 700; letter-spacing: .035em; }
.hero h2 { font-size: clamp(2.1rem, 3.8vw, 3.6rem); line-height: 1.05; font-weight: 800; margin: 10px 0 8px; letter-spacing: -.065em; }
.hero p { color: #dfdded; line-height: 1.5; max-width: 25rem; margin-bottom: 21px; font-size: .99rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 9px 14px; border: 1px solid transparent; border-radius: 9px; font-size: .91rem; line-height: 1.2; font-weight: 700; white-space: nowrap; transition: background .14s ease, border-color .14s ease; }
.button:disabled { opacity: .54; cursor: not-allowed; }
.button-lime { background: var(--lime); color: #25263c; padding-inline: 16px; }
.button-lime:hover { background: #f1f9bb; }
.button-primary { background: #292645; color: var(--white); }
.button-primary:not(:disabled):hover { background: #463971; }
.button-outline { background: var(--white); border-color: #dddbe6; color: #443957; }
.button-outline:not(:disabled):hover { background: #f5f0fd; border-color: #bbadd9; }
.button-small { min-height: 35px; padding: 7px 10px; font-size: .84rem; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin: 19px 0 22px; }
.stat-card { display: flex; gap: 13px; align-items: flex-start; position: relative; background: var(--white); border: 1px solid var(--line); border-radius: 13px; padding: 15px; min-height: 108px; transition: border-color .14s ease; }
.stat-card:has(.stat-link):hover { border-color: #bdb2d5; }
.stat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; flex: 0 0 auto; }
.lavender { background: #eee8fb; color: #5b4199; }
.yellow { background: #fcf0c4; color: #785615; }
.mint { background: #e1f2e8; color: #28624d; }
.peach { background: #f9e6dc; color: #835241; }
.blue { background: #e2ebfb; color: #3a5c9c; }
.pink { background: #f7e5ee; color: #874e75; }
.stat-info { display: grid; gap: 2px; min-width: 0; }
.stat-label { color: #565469; font-size: .86rem; font-weight: 600; }
.stat-info strong { font: 800 1.85rem/1.13 var(--heading); letter-spacing: -.065em; color: #24243e; }
.stat-detail { color: var(--muted); font-size: .77rem; line-height: 1.35; }
.stat-link { position: absolute; inset: 0; border-radius: inherit; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.68fr) minmax(0, 1fr); align-items: start; gap: 17px; }
.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--white); min-width: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px 14px; }
.panel-header h2 { font-size: 1.21rem; font-weight: 800; color: var(--ink); line-height: 1.2; }
.panel-header p { color: var(--muted); margin-top: 4px; font-size: .86rem; line-height: 1.35; }
.panel-footer { border-top: 1px solid #f0edf3; padding: 13px 18px 16px; }
.text-link { color: #584393; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; }
th { font-weight: 700; font-size: .77rem; color: #5e5b71; background: #f8f7fb; }
th, td { padding: 12px 10px; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
td { border-top: 1px solid #f0edf3; color: #4a495f; }
td strong { color: var(--ink); font-weight: 700; }
tr:last-child td { padding-bottom: 14px; }
.person-cell { display: flex; align-items: center; gap: 8px; }
.person-cell strong { min-width: 0; white-space: nowrap; }
.avatar { display: inline-grid; align-items: center; justify-items: center; border-radius: 50%; width: 34px; height: 34px; flex: 0 0 auto; font-size: .69rem; font-weight: 700; letter-spacing: .01em; }
.profile-button .avatar { width: 36px; height: 36px; font-size: .76rem; }
.earned-pill { background: #e9f3dc; color: #355e38; display: inline-block; padding: 4px 7px; border-radius: 6px; font-weight: 700; font-size: .77rem; white-space: nowrap; }
.note-cell { overflow-wrap: anywhere; }
.when-cell { font-size: .77rem; color: var(--muted); white-space: nowrap; }
.roster-table th, .roster-table td { padding-block: 13px; }
.roster-table td:last-child { text-align: right; }
.roster-search { max-width: 230px; }
.balance-label { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; white-space: nowrap; }

.quick-header { justify-content: flex-start; padding-bottom: 13px; }
.quick-header .stat-icon { width: 37px; height: 37px; border-radius: 9px; }
.award-form { padding: 17px 18px 19px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; gap: 24px; }
.quick-panel .award-form { padding-top: 0; grid-template-columns: minmax(0, 1fr); gap: 11px; }
.field-label { display: block; font-weight: 700; color: #38364d; font-size: .87rem; margin-bottom: 6px; }
.field-label small { color: var(--muted); font-size: .76rem; font-weight: 500; }
.optional-label { display: flex; justify-content: space-between; gap: 6px; }
.input-shell { display: flex; align-items: center; gap: 8px; min-height: 41px; border: 1px solid #e0dce8; border-radius: 8px; color: #6d6584; padding: 0 10px; background: #fff; }
.input-shell:focus-within { border-color: #907bc4; box-shadow: 0 0 0 3px #eee8fb; }
.input-shell input { width: 100%; min-width: 0; padding: 9px 0; border: 0; outline: none; color: var(--ink); background: transparent; font-size: .91rem; }
.input-shell input:focus-visible { outline: 0; }
input::placeholder, textarea::placeholder { color: #737187; opacity: 1; }
.text-input { display: block; width: 100%; min-height: 41px; padding: 8px 10px; border: 1px solid #e0dce8; background: #fff; color: var(--ink); border-radius: 8px; font-size: .91rem; }
select.text-input { appearance: none; padding-right: 32px; background: linear-gradient(45deg, transparent 50%, #655b79 50%) calc(100% - 17px) 52% / 5px 5px no-repeat, linear-gradient(135deg, #655b79 50%, transparent 50%) calc(100% - 12px) 52% / 5px 5px no-repeat, #fff; }
textarea.text-input { resize: vertical; }
.field-label .text-input { margin-top: 5px; font-weight: 400; }
.award-students { position: relative; min-width: 0; }
.student-options { margin-top: 7px; display: grid; gap: 3px; padding: 5px; max-height: 380px; overflow: auto; border: 1px solid #e6e1ee; border-radius: 9px; background: white; }
.dropdown-options { position: absolute; top: 100%; left: 0; right: 0; z-index: 3; max-height: 230px; box-shadow: 0 8px 22px #33225020; }
.student-option { display: flex; align-items: center; gap: 8px; text-align: left; min-height: 40px; padding: 5px 8px; border: 0; border-radius: 7px; background: white; font-size: .88rem; font-weight: 600; }
.student-option .avatar { width: 30px; height: 30px; }
.student-option:hover, .student-option.is-selected { background: #f1ebfb; }
.option-check { margin-left: auto; color: #665097; }
.search-empty { color: var(--muted); padding: 9px; font-size: .88rem; }
.selection { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.selection-chip { display: flex; align-items: center; gap: 5px; background: var(--lavender); color: #503a85; border: 0; border-radius: 6px; padding: 5px 8px; font-size: .8rem; font-weight: 700; }
.selection-chip:hover { background: #e3d7f6; }
fieldset { border: 0; margin: 0 0 11px; padding: 0; min-width: 0; }
legend { padding: 0; }
.point-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.point-choice, .filter-chip { border: 1px solid #e2ddea; background: #fff; border-radius: 7px; min-height: 36px; padding: 6px; color: #4f4a65; font-size: .85rem; font-weight: 700; }
.point-choice:hover, .filter-chip:hover { background: #f7f2fc; border-color: #c2b3db; }
.point-choice.chosen, .filter-chip.selected { color: #553c94; border-color: #d7c8f1; background: #eee8fb; }
#custom-points-wrap { margin-top: 7px; }
.award-submit { margin-top: 12px; width: 100%; }
.field-error { margin-top: 8px; color: #ad303b; font-size: .86rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 16px; }
.filter-chip { min-height: 38px; padding: 7px 12px; background: white; }
.reward-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.reward-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; }
.reward-art { position: relative; isolation: isolate; display: grid; place-items: center; height: 135px; overflow: hidden; background: #eee8fb; color: #513f83; }
.reward-art::before { position: absolute; width: 180px; height: 180px; transform: rotate(-13deg); border-radius: 25px; z-index: -1; opacity: .14; background: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 15px), repeating-linear-gradient(0deg, currentColor 0 1px, transparent 1px 15px); content: ""; }
.reward-art-icon { transform: rotate(-15deg); filter: drop-shadow(4px 4px 0 #ffffffa8); }
.reward-art-icon .icon { stroke-width: 1.4; }
.reward-spark { position: absolute; top: 14%; right: 18%; font-size: 1.35rem; }
.art-voucher { color: #715617; background: #fcf0bf; }
.art-pencils { color: #935647; background: #f9e7de; }
.art-juice { color: #39795a; background: #e0f2e4; }
.reward-content { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; flex: 1; }
.reward-content h2 { font-size: 1.12rem; line-height: 1.25; overflow-wrap: anywhere; }
.reward-content p { font-size: .88rem; color: var(--muted); line-height: 1.42; flex: 1; overflow-wrap: anywhere; }
.reward-category { display: inline-block; border-radius: 5px; padding: 4px 6px; font-size: .74rem; font-weight: 700; }
.reward-meta { display: flex; align-items: center; justify-content: space-between; width: 100%; flex-wrap: wrap; gap: 5px; padding: 3px 0; }
.reward-meta strong, .balance-badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.reward-meta span:not(.point-coin), .balance-badge > span:not(.point-coin) { color: var(--muted); font-size: .79rem; }
.reward-content .button { width: 100%; }
.point-coin { color: #6b4b13; background: #ffefb5; border: 1px solid #edcb73; border-radius: 50%; display: inline-grid; place-items: center; width: 19px; height: 19px; line-height: 1; font-size: .8rem; }
.balance-badge { border: 1px solid #e8d9aa; border-radius: 9px; background: #fffbeb; padding: 8px 10px; gap: 6px; }

.empty { padding: 30px 18px; display: grid; justify-items: center; text-align: center; gap: 7px; }
.empty h3 { margin-top: 3px; font-size: 1rem; }
.empty p { color: var(--muted); font-size: .9rem; }
.pickup-list { padding: 0 18px; }
.pickup-row { display: flex; gap: 9px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.pickup-row > span { display: grid; gap: 3px; flex: 1; }
.pickup-row small { color: var(--muted); }
.pickup-row code { font-size: .79rem; }
.redemption-list { padding: 0 16px; }
.redemption-row { display: flex; align-items: center; gap: 13px; padding: 15px 0; }
.redemption-row + .redemption-row { border-top: 1px solid var(--line); }
.redemption-info { flex: 1; min-width: 0; }
.redemption-info h2 { font-size: 1.02rem; overflow-wrap: anywhere; }
.redemption-info p { margin-top: 3px; font-size: .88rem; color: var(--muted); }
.redemption-time { font-size: .77rem; color: var(--muted); }
.redemption-status, .redemption-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.pickup-code { border: 1px dashed #d4c9e7; border-radius: 6px; padding: 6px 7px; color: #514071; background: #faf7ff; white-space: nowrap; }
.status-badge { padding: 4px 7px; border-radius: 6px; font-size: .77rem; font-weight: 700; white-space: nowrap; }
.status-pending { color: #785615; background: #fcf0c4; }
.status-fulfilled { color: #28624d; background: #e1f2e8; }
.status-cancelled { color: #66576d; background: #efecf2; }

dialog { width: min(450px, calc(100% - 30px)); max-height: calc(100dvh - 30px); padding: 21px; border: 1px solid #e6dfef; border-radius: 16px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px #1b153b36; }
dialog::backdrop { background: #211a3b7d; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.dialog-heading h2 { font-size: 1.46rem; font-weight: 800; }
.dialog-heading p { margin-top: 5px; color: var(--muted); line-height: 1.45; font-size: .94rem; }
.icon-button { display: inline-grid; align-items: center; justify-items: center; width: 35px; height: 35px; border: 1px solid var(--line); background: #fff; border-radius: 8px; color: #5a4d73; flex: 0 0 auto; }
.icon-button:hover { background: #f5f0fd; }
.dialog-form { display: grid; gap: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.role-options { display: grid; gap: 6px; margin-bottom: 6px; }
.role-option { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.role-option:has(input:checked) { background: #f6f0fd; border-color: #d9c9f1; }
.role-option .stat-icon { width: 35px; height: 35px; }
.role-option strong, .role-option small { display: block; }
.role-option small { font-size: .82rem; color: var(--muted); }
.role-option input { accent-color: #69529c; }
.install-help p { margin-bottom: 10px; line-height: 1.45; }
.toast { position: fixed; z-index: 10; bottom: max(18px, env(safe-area-inset-bottom)); right: 18px; display: flex; align-items: center; gap: 9px; max-width: calc(100vw - 36px); border-radius: 10px; padding: 10px 13px; background: #292645; color: #fff; font-weight: 600; font-size: .91rem; box-shadow: 0 7px 24px #17132a30; }
.toast-check { display: grid; place-items: center; color: #25263c; background: var(--lime); width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto; }

@media (min-width: 1500px) {
  .main-content { padding-inline: 44px; }
  .topbar { padding-inline: 44px; }
  .hero { min-height: 285px; }
}
@media (max-width: 1240px) {
  .reward-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1130px) {
  :root { --sidebar-width: 212px; }
  .main-content, .topbar { padding-inline: 24px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.47fr) minmax(0, 1fr); gap: 12px; }
  .stat-card { padding: 12px; gap: 8px; }
  .stats { gap: 10px; }
  .stat-card .stat-icon { width: 36px; height: 36px; }
  .activity-table td, .activity-table th { padding-inline: 7px; }
  .activity-table td:first-child, .activity-table th:first-child { padding-left: 12px; }
  .activity-table td:last-child, .activity-table th:last-child { padding-right: 12px; }
  .activity-table .person-cell strong { white-space: normal; }
  .redemption-status, .redemption-actions { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 930px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-grid .quick-panel { grid-row: 1; }
  .quick-panel .award-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hero p { max-width: 17rem; }
  .reward-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); visibility: hidden; transition: transform .18s ease, visibility .18s; width: min(260px, 84vw); }
  .sidebar.is-open { transform: translateX(0); visibility: visible; }
  .sidebar-scrim:not([hidden]) { display: block !important; position: fixed; border: 0; inset: 0; z-index: 4; background: #27203962; }
  .menu-open { overflow: hidden; }
  .workspace { margin-left: 0; }
  .topbar { height: 57px; padding-inline: 15px; }
  .menu-button { display: inline-grid !important; margin-right: 2px; }
  .main-content { padding: 20px 15px 34px; }
  .page-heading { margin-bottom: 16px; }
  .hero { min-height: 230px; }
  .hero-content { padding: 21px; }
  .hero-art { width: 54%; }
}
@media (max-width: 510px) {
  .breadcrumbs { gap: 5px; }
  .breadcrumb-root, .breadcrumbs > .icon { display: none; }
  .top-actions { gap: 5px; }
  .offline-label { min-height: 30px; padding: 4px 5px; font-size: .74rem; }
  .offline-label .icon { display: none; }
  .page-heading { align-items: flex-start; flex-wrap: wrap; gap: 9px; }
  .hero { border-radius: 13px; min-height: 228px; }
  .hero-content { padding: 17px; }
  .hero-art { width: 56%; opacity: .7; background-position: 45% center; mask-image: linear-gradient(90deg, transparent, #000 59%); }
  .hero h2 { max-width: 218px; font-size: 2.04rem; }
  .hero p { max-width: min(55vw, 226px); font-size: .91rem; margin-bottom: 13px; }
  .class-tag { font-size: .67rem; }
  .stats { grid-template-columns: 1fr; margin: 12px 0; gap: 7px; }
  .stat-card { min-height: 0; padding: 9px 10px; align-items: center; }
  .stat-info { flex: 1; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 5px; align-items: center; }
  .stat-label { grid-column: 1; }
  .stat-info strong { grid-column: 2; grid-row: 1 / span 2; font-size: 1.55rem; }
  .stat-detail { grid-column: 1; }
  .award-form, .quick-panel .award-form { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .panel-header { padding-inline: 12px; }
  .award-form { padding-inline: 12px; }
  .activity-table { font-size: .8rem; }
  .activity-table .person-cell { gap: 5px; }
  .activity-table .avatar { width: 24px; height: 24px; font-size: .6rem; }
  .when-cell { font-size: .72rem; white-space: normal; }
  .roster-search { max-width: 147px; }
  .roster-table .avatar { display: none; }
  .roster-table td, .roster-table th { padding-inline: 6px; }
  .roster-table td:first-child, .roster-table th:first-child { padding-left: 10px; }
  .roster-table td:last-child, .roster-table th:last-child { padding-right: 10px; }
  .redemption-row { display: grid; grid-template-columns: auto 1fr; gap: 7px 9px; }
  .redemption-status, .redemption-actions { flex-direction: row; grid-column: 2; }
  .reward-grid { gap: 8px; }
  .reward-art { height: 100px; }
  .reward-content { padding: 9px; }
  .reward-content .button { min-height: 38px; padding-inline: 5px; font-size: .8rem; }
  .reward-content .button .icon { display: none; }
  .reward-content h2 { font-size: .98rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.sync-label { padding: 5px 8px; border-radius: 6px; background: #fcf0c4; color: #785615; font-size: .77rem; white-space: nowrap; }
.catalog-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.catalog-pickup { color: var(--muted); font-size: .81rem; border-top: 1px solid var(--line); width: 100%; padding-top: 8px; }
.browse-link { margin-left: 14px; }
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 17px; align-items: start; }
.checkout-filters { padding: 0 18px; margin-bottom: 4px; }
.checkout-items, .cart-lines { padding: 0 18px 6px; }
.checkout-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px 0; }
.checkout-item + .checkout-item, .cart-line + .cart-line { border-top: 1px solid var(--line); }
.checkout-item h3 { font-size: 1rem; }
.checkout-item p { color: var(--muted); font-size: .85rem; margin-top: 3px; }
.cart-panel { position: sticky; top: 16px; }
.clear-cart { background: transparent; border: 0; padding: 4px; }
.cart-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 0; }
.cart-line > div:first-child { display: grid; gap: 3px; }
.cart-line strong { font-size: .92rem; overflow-wrap: anywhere; }
.cart-line small { color: var(--muted); }
.stepper { display: flex; align-items: center; border: 1px solid #e2dbea; border-radius: 8px; }
.stepper button { border: 0; background: #f5effb; color: #533c84; width: 34px; min-height: 33px; font-weight: 700; border-radius: 7px; }
.stepper button:disabled { opacity: .45; cursor: not-allowed; }
.stepper span { width: 30px; text-align: center; font-size: .9rem; font-variant-numeric: tabular-nums; }
.cart-footer { display: grid; gap: 11px; padding: 14px 18px 17px; border-top: 1px solid var(--line); }
.cart-total { display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.cart-total strong { font: 800 1.5rem/1.2 var(--heading); letter-spacing: -.045em; color: var(--ink); }
.cart-empty { padding-top: 17px; }
.payment-qr { display: grid; justify-items: center; gap: 11px; padding: 16px; background: #f5f0fc; border: 1px solid #e9dff8; border-radius: 13px; }
.qr-balance, .qr-validity { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.qr-validity { color: var(--purple); }
.qr-countdown { font-variant-numeric: tabular-nums; }
#payment-qr { display: block; width: min(100%, 235px); height: auto; border: 1px solid #e3dceb; border-radius: 9px; }
.manual-code { margin-top: 13px; font-size: .9rem; }
.manual-code summary { cursor: pointer; color: var(--purple); font-weight: 700; }
.manual-code-body { display: grid; justify-items: start; gap: 8px; padding: 10px 0 2px; }
.manual-code code { word-break: break-all; padding: 5px; background: #f5f0fc; border-radius: 5px; font-size: .84rem; }
.scanner-preview { display: grid; place-items: center; min-height: 128px; overflow: hidden; border: 1px dashed #cec1e5; border-radius: 10px; color: #625087; background: #f5f0fc; }
.scanner-preview video { display: block; width: 100%; max-height: 225px; background: #262541; object-fit: contain; }
#scan-idle { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 15px; font-size: .87rem; }
.scanner-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.qr-file { cursor: pointer; }
.qr-file:focus-within { outline: 2px solid #735acb; outline-offset: 3px; }
.scanner-status { color: var(--purple); font-size: .91rem; }
.payment-receipt { border: 1px solid #dadfe5; border-radius: 10px; padding: 13px; background: #f9f9f5; }
.receipt-student { display: flex; gap: 8px; align-items: center; margin-bottom: 9px; font-weight: 700; }
.payment-receipt dl { margin: 0; display: grid; gap: 6px; }
.payment-receipt dl > div { display: flex; justify-content: space-between; gap: 9px; font-size: .9rem; }
.payment-receipt dd { margin: 0; font-weight: 700; white-space: nowrap; }
.payment-receipt .receipt-total { border-top: 1px solid #dedee5; padding-top: 7px; font-weight: 700; }
.receipt-reference { padding-top: 10px; color: var(--muted); font-size: .8rem; }
@media (max-width: 1010px) {
  .checkout-layout { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; }
}
@media (max-width: 570px) {
  .checkout-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; }
  .catalog-actions .button { min-height: 37px; }
  .sync-label { display: none; }
}

.access-screen { min-height: 100dvh; display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1fr); padding: 24px; gap: 24px; background: #fafaf7; }
.access-card { width: min(100%, 440px); align-self: center; justify-self: center; padding: 25px 13px; }
.access-card h1 { font-size: clamp(1.85rem, 3.5vw, 2.65rem); color: var(--ink); line-height: 1.15; }
.access-card > p { color: var(--muted); margin: 10px 0 23px; line-height: 1.5; }
.access-logo { display: flex; gap: 10px; align-items: center; margin-bottom: 39px; }
.access-logo strong { font: 800 2.1rem/.95 var(--heading); letter-spacing: -.10em; }
.access-art { background: #242541 url("./assets/hero.webp") center / cover no-repeat; border-radius: 20px; min-height: 360px; }
.setup-form { gap: 10px; }
.setup-form .button { justify-self: start; }
.classroom-settings { margin-bottom: 16px; }
.account-name { display: grid; gap: 3px; }
.account-name small, .account-profile small, .account-role-label { color: var(--muted); }
.account-actions { display: flex; justify-content: flex-end; gap: 6px; }
.account-profile { display: flex; gap: 10px; align-items: center; margin: 6px 0 15px; }
.account-profile > span:last-child { display: grid; gap: 3px; }
.account-role-label { font-size: .9rem; }

@media (max-width: 720px) {
  .access-screen { grid-template-columns: 1fr; padding: 16px; }
  .access-art { display: none; }
  .accounts-table { min-width: 530px; }
}

.class-switch { min-width: 0; }
.class-switch select { min-height: 36px; max-width: 225px; padding-block: 6px; }
.class-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.class-cards { display: grid; padding: 3px 17px; }
.class-card, .invite-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 0; }
.class-card + .class-card, .invite-row + .invite-row { border-top: 1px solid var(--line); }
.class-card h3 { font-size: 1.03rem; overflow-wrap: anywhere; }
.class-card p, .invite-row small, .record-class { display: block; color: var(--muted); margin-top: 3px; font-size: .85rem; }
.invite-row strong, .invite-row small { overflow-wrap: anywhere; }
.enrollment-panel { margin-bottom: 17px; }
.invite-rows { padding: 0 17px 6px; }
.approval-header { border-top: 1px solid var(--line); }
.approval-header h2 { font-size: 1.04rem; }
.invite-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 12px; }
@media (max-width: 555px) {
  .class-switch select { max-width: min(36vw, 145px); font-size: .8rem; min-height: 33px; }
  .class-switch ~ .role-button { display: none; }
  .invite-row { gap: 7px; }
  .approval-rows .invite-row > .account-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .approval-rows .invite-row { grid-template-columns: auto minmax(0, 1fr); }
}

.access-card .auth-help { margin-top: 19px; font-size: .88rem; }
.access-card .field-label small { display: block; margin-top: 5px; }

.school-signup-code { display: block; margin-top: 4px; }
