:root {
  color-scheme: light dark;
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-soft: #eef4ff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, .12);
  --primary: #1769ff;
  --primary-dark: #0f4ec0;
  --success: #12805c;
  --danger: #c2410c;
  --shadow: 0 18px 45px rgba(15, 23, 42, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(circle at top left, rgba(23, 105, 255, .16), transparent 34rem),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
}

body.lite-modal-open {
  overflow: hidden;
}

button, input, select, textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.lite-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  min-height: 100svh;
  padding: max(14px, env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
}

.lite-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 14px;
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.brand-logo {
  width: min(220px, 52vw);
  max-height: 50px;
  display: block;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 8px 18px rgba(2, 6, 23, .22));
}

.brand-picture {
  display: block;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 16px;
  background: rgba(2, 6, 23, .56);
  box-shadow: 0 14px 26px rgba(2, 6, 23, .16);
  backdrop-filter: blur(10px);
}

.brand-subtitle {
  color: var(--muted);
  max-width: min(220px, 52vw);
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-button {
  width: 44px;
  height: 44px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.inbox-button {
  flex: 0 0 auto;
}

.push-button {
  flex: 0 0 auto;
}

.push-button.is-enabled {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 32%, var(--line));
}

.push-button.needs-attention {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
}

.push-button.is-blocked {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
}

.topbar-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 21px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .7rem;
  font-weight: 900;
  line-height: 1;
}

.topbar-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--panel);
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 18%, transparent);
}

.login-card,
.hero-panel,
.scanner-card,
.section-heading,
.list-panel,
.stack-form,
.student-match {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.login-card {
  width: min(460px, 100%);
  margin: 8vh auto 0;
  padding: 28px;
  text-align: center;
}

.login-logo {
  width: min(360px, 100%);
  max-height: 150px;
  display: block;
  object-fit: contain;
  margin: 0 auto 18px;
  filter: drop-shadow(0 16px 26px rgba(2, 6, 23, .24));
}

h1, h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 { font-size: clamp(1.55rem, 4vw, 2.25rem); }
h2 { font-size: 1.2rem; }

p {
  color: var(--muted);
  line-height: 1.45;
}

.stack-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  text-align: left;
}

.login-card .stack-form {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

label span {
  display: block;
  font-size: .82rem;
  font-weight: 750;
  color: var(--muted);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px 13px;
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 92%, var(--panel-soft));
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  border-color: color-mix(in srgb, var(--primary) 70%, white);
  box-shadow: 0 0 0 4px rgba(23, 105, 255, .14);
}

.primary-action,
.secondary-action,
.pill-action,
.quick-card,
.tab-button {
  border: 0;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 16px;
  font-weight: 800;
  text-decoration: none;
}

.primary-action {
  background: var(--primary);
  color: #fff;
}

.primary-action:hover { background: var(--primary-dark); }

.secondary-action,
.pill-action {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.link-action {
  color: var(--text);
}

.primary-action:disabled,
.secondary-action:disabled {
  opacity: .55;
}

.app-view {
  display: grid;
  gap: 14px;
}

.lite-tabs {
  position: sticky;
  top: 68px;
  z-index: 18;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(16px);
}

.tab-button {
  min-width: 0;
  color: var(--muted);
  background: transparent;
  padding: 10px 8px;
}

.tab-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-button.active {
  background: var(--primary);
  color: #fff;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: grid;
  gap: 14px;
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
}

.hero-panel h1 {
  font-size: clamp(1.2rem, 3vw, 1.7rem);
}

.hero-panel p {
  margin: 8px 0 0;
}

.hero-panel .pill-action {
  flex: 0 0 auto;
}

.hero-panel .pill-action:not(.has-pending) {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  box-shadow: none;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quick-card {
  min-height: 116px;
  flex-direction: column;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.quick-card i {
  color: var(--primary);
  font-size: 1.7rem;
}

.lite-birthday-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.student-birthday-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  background:
    linear-gradient(135deg, rgba(239, 68, 68, .13), rgba(245, 158, 11, .16)),
    var(--panel);
}

.student-birthday-card > i,
.lite-birthday-heading > i {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: color-mix(in srgb, #f59e0b 22%, var(--panel));
  color: #d97706;
  font-size: 1.35rem;
}

.lite-birthday-card h2 {
  margin: 0;
  font-size: 1.08rem;
}

.lite-birthday-card p {
  margin: 4px 0 0;
}

.lite-birthday-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lite-birthday-list {
  display: grid;
  gap: 8px;
}

.lite-birthday-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 88%, var(--panel-soft));
}

.birthday-day {
  min-width: 72px;
  display: inline-flex;
  justify-content: center;
  padding: 6px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-size: .78rem;
  font-weight: 900;
}

.birthday-day.today {
  background: color-mix(in srgb, #22c55e 18%, transparent);
  color: #12805c;
}

.birthday-day.past {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #b45309;
}

.lite-birthday-row strong,
.lite-birthday-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lite-birthday-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
}

.student-digital-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: stretch;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(17, 24, 39, .92), rgba(23, 105, 255, .88)),
    var(--panel);
  color: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.student-card-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.student-card-photo-wrap {
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, .18);
  border: 2px solid rgba(255, 255, 255, .42);
}

.student-card-photo-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.student-card-info {
  min-width: 0;
}

.student-card-kicker {
  display: inline-flex;
  margin-bottom: 6px;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .74);
}

.student-card-info h2 {
  font-size: clamp(1.25rem, 4vw, 2rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.student-card-info p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, .82);
}

.student-card-code {
  display: inline-grid;
  gap: 2px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .18);
}

.student-card-code span {
  font-size: .72rem;
  color: rgba(255, 255, 255, .75);
  font-weight: 800;
}

.student-card-code strong {
  font-size: 1rem;
  letter-spacing: .02em;
}

.student-card-qr-panel {
  width: 224px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  color: #0f172a;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}

.student-card-qr {
  width: 176px;
  height: 176px;
  display: grid;
  place-items: center;
}

.student-card-qr img,
.student-card-qr canvas {
  width: 176px !important;
  height: 176px !important;
}

.student-card-qr-panel p {
  margin: 0;
  font-size: .76rem;
  color: #475569;
  font-weight: 800;
  text-align: center;
}

.student-card-qr-panel span {
  font-size: .78rem;
  color: var(--primary);
  font-weight: 850;
  text-decoration: none;
}

.lite-inbox-panel,
.student-home-message,
.class-notice-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.staff-message-section {
  display: grid;
  gap: 12px;
}

.lite-inbox-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.lite-inbox-tab {
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 850;
}

.lite-inbox-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.lite-inbox-tab.active .badge {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.lite-inbox-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 88%, var(--panel-soft));
}

.lite-inbox-item {
  align-items: flex-start;
  text-align: left;
}

.lite-inbox-item.unread {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.lite-inbox-item .list-title {
  white-space: normal;
}

.lite-notice-actions,
.lite-conversation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.lite-notice-actions:empty,
.lite-conversation-actions:empty,
.notice-response-badges:empty {
  display: none;
}

.lite-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .86rem;
  font-weight: 850;
}

.lite-pager .secondary-action {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: .84rem;
}

.lite-notice-actions button,
.lite-conversation-actions button {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: .78rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lite-conversation-dialog {
  max-height: min(90svh, 760px);
}

.lite-thread-messages {
  flex: 1 1 auto;
  min-height: 220px;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--panel-soft) 58%, var(--panel));
}

.lite-thread-bubble {
  max-width: min(82%, 460px);
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
}

.lite-thread-bubble.mine {
  justify-self: end;
  background: color-mix(in srgb, var(--primary) 14%, var(--panel));
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
}

.lite-thread-bubble strong {
  font-size: .8rem;
  color: var(--muted);
}

.lite-thread-bubble p {
  margin: 0;
  overflow-wrap: anywhere;
}

.lite-thread-bubble time {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 750;
}

.lite-thread-reply {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.lite-thread-status {
  padding: 0 16px 12px;
}

.class-notice-history {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 88%, var(--panel-soft));
}

.notice-response-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.notice-origin {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--text);
  font-size: .9rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.notice-origin i {
  color: var(--primary);
  flex: 0 0 auto;
}

.compact-push-action[hidden] {
  display: none !important;
}

.student-home-summary {
  display: grid;
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.student-home-summary .section-heading {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding-bottom: 6px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.summary-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--panel) 88%, var(--panel-soft));
}

.summary-card span {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
}

.summary-card strong {
  min-width: 0;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.student-exam-list {
  border-top: 1px solid var(--line);
}

.student-exam-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.student-exam-row .list-main {
  display: grid;
  gap: 6px;
}

.student-exam-rank {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.16;
  font-size: clamp(1rem, 3.8vw, 1.12rem);
}

.student-exam-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.25;
}

.student-exam-detail span + span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 8px 2px 0;
  border-radius: 999px;
  background: currentColor;
  opacity: .55;
}

.student-exam-meta,
.student-exam-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.student-exam-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.student-certificate-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 84%, var(--panel-soft));
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
}

.student-certificate-icon i {
  font-size: 1.15rem;
  line-height: 1;
}

.student-certificate-icon.has-certificate {
  border-color: color-mix(in srgb, var(--text) 22%, var(--line));
}

.student-certificate-icon.no-certificate {
  color: color-mix(in srgb, var(--text) 34%, transparent);
  background: color-mix(in srgb, var(--panel-soft) 48%, transparent);
  box-shadow: none;
  opacity: .42;
}

.student-exam-status {
  padding: 0 16px 14px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.section-heading p {
  margin: 4px 0 0;
}

.scanner-card {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #020617;
}

.scanner-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scanner-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 8px;
  align-content: center;
  color: rgba(255, 255, 255, .82);
  font-weight: 800;
}

.scanner-empty i {
  font-size: 2.4rem;
}

.scan-actions,
.filters-row,
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.filters-row {
  grid-template-columns: 1.2fr .8fr .8fr;
}

.student-lite-filters {
  grid-template-columns: minmax(0, 1fr) 150px;
}

.student-form-actions,
.student-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.student-form-actions {
  justify-content: flex-start;
}

.student-row-actions .icon-button {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  box-shadow: none;
}

.student-row-actions .danger-action {
  color: var(--danger);
}

.student-row-actions .attendance-action {
  color: var(--success);
}

.lite-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
}

.lite-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 6, 23, .58);
  backdrop-filter: blur(8px);
}

.lite-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(88svh, 780px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.lite-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.lite-modal-header p {
  margin: 4px 0 0;
}

.lite-inbox-dialog {
  width: min(760px, 100%);
}

.lite-inbox-modal-body {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 16px;
}

.lite-inbox-dialog .lite-inbox-panel,
.lite-inbox-dialog .student-home-message {
  box-shadow: none;
}

.student-editor-form {
  overflow: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 16px;
}

.student-editor-form .student-form-actions {
  position: sticky;
  bottom: -16px;
  margin: 4px -16px -16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.username-status {
  min-height: 20px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 800;
}

.username-status.success {
  color: var(--success);
}

.username-status.warning {
  color: #a16207;
}

.username-status.danger {
  color: var(--danger);
}

.compact-form {
  box-shadow: none;
}

.status-message {
  min-height: 24px;
  color: var(--muted);
  font-weight: 700;
}

.status-message.success { color: var(--success); }
.status-message.danger { color: var(--danger); }
.status-message.warning { color: #a16207; }

.list-panel {
  overflow: hidden;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.list-row:first-child {
  border-top: 0;
}

.list-main {
  min-width: 0;
}

.list-title {
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-subtitle {
  color: var(--muted);
  font-size: .9rem;
  margin-top: 3px;
}

.badge {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: .78rem;
  font-weight: 850;
  background: var(--panel-soft);
  color: var(--primary);
  white-space: nowrap;
}

.badge.success {
  background: color-mix(in srgb, var(--success) 12%, var(--panel));
  color: var(--success);
}

.badge.warning {
  background: color-mix(in srgb, #d97706 14%, var(--panel));
  color: #a16207;
}

.badge.danger {
  background: color-mix(in srgb, var(--danger) 12%, var(--panel));
  color: var(--danger);
}

.student-match {
  padding: 14px 16px;
}

.empty-panel {
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 68%, transparent);
  text-align: center;
  padding: 22px;
}

.empty-panel i {
  font-size: 2.2rem;
  color: var(--primary);
}

.exam-toolbar,
.exam-stopwatch {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.exam-stopwatch {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 80;
  width: min(360px, calc(100vw - 24px));
  display: none;
  align-items: center;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: contain;
}

body.lite-exams-active .exam-stopwatch {
  display: flex;
}

body.lite-stopwatch-dragging {
  overflow: hidden;
  touch-action: none;
}

.exam-stopwatch.is-dragging {
  cursor: grabbing;
  opacity: .96;
  box-shadow: 0 24px 48px rgba(15, 23, 42, .28);
}

.stopwatch-main {
  min-width: 0;
}

.stopwatch-drag-handle {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: var(--panel-soft);
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.stopwatch-drag-handle:active {
  cursor: grabbing;
}

.exam-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.exam-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.exam-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.exam-mode-tab {
  min-width: 0;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.exam-mode-tab.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--panel));
  color: var(--primary);
}

.exam-manage-panel {
  display: grid;
  gap: 14px;
}

.exam-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.exam-students {
  display: grid;
  gap: 10px;
  position: sticky;
  top: 140px;
}

.exam-student-list {
  max-height: min(62vh, 720px);
  overflow: auto;
}

.exam-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 800;
}

.exam-list-meta button,
.exam-mini-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 850;
  padding: 0;
}

.exam-student-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  cursor: pointer;
}

.exam-student-option input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.exam-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.exam-card {
  min-width: min(440px, 92vw);
  max-width: min(520px, 92vw);
  max-height: calc(100svh - 190px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  scroll-snap-align: start;
}

.exam-card-header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 14px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.exam-card-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.exam-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.exam-section {
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  background: color-mix(in srgb, var(--panel) 88%, var(--panel-soft));
}

.exam-section-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  font-weight: 900;
  text-align: left;
}

.exam-section-body {
  display: none;
  gap: 10px;
  padding: 0 14px 14px;
}

.exam-section.open .exam-section-body {
  display: grid;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 10px;
  align-items: center;
}

.score-row input {
  text-align: center;
  font-weight: 850;
}

.exam-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.exam-approved-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 850;
  color: var(--muted);
}

.exam-approved-toggle input {
  width: 20px;
  height: 20px;
}

.exam-time {
  font-size: 1.65rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) .72fr .85fr .72fr .55fr;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(420px, calc(100% - 28px));
  z-index: 100;
  display: grid;
  gap: 8px;
}

.toast-item {
  border-radius: 15px;
  padding: 12px 14px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 750;
}

.lite-birthday-confetti {
  position: fixed;
  inset: 0;
  z-index: 140;
  pointer-events: none;
}

.qr-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
}

.qr-fullscreen[hidden] {
  display: none;
}

.qr-fullscreen-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 6, 23, .86);
}

.qr-fullscreen-card {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100svh - 28px);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: clamp(18px, 4vw, 30px);
  border-radius: 28px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .42);
  overflow: auto;
}

.qr-fullscreen-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.qr-fullscreen-card h2 {
  margin: 8px 48px 0;
  font-size: clamp(1.25rem, 4vw, 2rem);
  text-align: center;
}

.qr-fullscreen-code {
  width: min(78vw, 420px);
  height: min(78vw, 420px);
  display: grid;
  place-items: center;
}

.qr-fullscreen-code img,
.qr-fullscreen-code canvas {
  width: min(78vw, 420px) !important;
  height: min(78vw, 420px) !important;
}

.qr-fullscreen-card p {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 900;
  color: #0f172a;
}

@media (max-width: 760px) {
  .lite-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .brand-lockup {
    flex-direction: row;
    align-items: center;
    gap: 9px;
  }

  .brand-logo {
    width: 54px;
    height: 54px;
    max-height: none;
    border-radius: 16px;
    object-fit: contain;
    object-position: center;
  }

  .brand-subtitle {
    max-width: min(170px, 38vw);
    font-size: .76rem;
  }

  .lite-tabs {
    top: 64px;
    grid-template-columns: repeat(5, minmax(58px, 1fr));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-button {
    min-height: 54px;
    flex-direction: column;
    font-size: .78rem;
    gap: 4px;
  }

  .hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 18px;
  }

  .hero-panel h1 {
    font-size: 1.08rem;
    line-height: 1.15;
  }

  .hero-panel p {
    margin-top: 4px;
    font-size: .82rem;
    line-height: 1.28;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-panel .pill-action {
    min-width: 0;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: .78rem;
    white-space: nowrap;
  }

  .hero-panel .pill-action i {
    font-size: .92rem;
  }

  .quick-grid,
  .student-digital-card,
  .summary-grid,
  .scan-actions,
  .filters-row,
  .student-lite-filters,
  .two-col,
  .exam-layout,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .student-form-actions,
  .student-form-actions .primary-action,
  .student-form-actions .secondary-action,
  .student-row-actions,
  .lite-thread-reply,
  .lite-thread-reply .primary-action {
    width: 100%;
  }

  .lite-thread-reply {
    grid-template-columns: 1fr;
  }

  .lite-inbox-tab {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .lite-pager {
    flex-wrap: wrap;
  }

  .lite-pager .secondary-action {
    flex: 1 1 120px;
  }

  .lite-pager span {
    order: -1;
    width: 100%;
    text-align: center;
  }

  .lite-thread-bubble {
    max-width: 92%;
  }

  .student-row-actions {
    justify-content: stretch;
  }

  .student-row-actions .icon-button {
    flex: 1;
    min-width: 0;
  }

  .student-digital-card {
    padding: 14px;
  }

  .student-card-main {
    align-items: flex-start;
  }

  .student-card-photo-wrap {
    width: 68px;
    height: 68px;
    flex-basis: 68px;
    border-radius: 20px;
  }

  .student-card-qr-panel {
    width: 100%;
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: start;
    text-align: left;
  }

  .student-card-qr {
    grid-row: span 2;
    width: 150px;
    height: 150px;
  }

  .student-card-qr img,
  .student-card-qr canvas {
    width: 150px !important;
    height: 150px !important;
  }

  .student-exam-row {
    width: 100%;
  }

  .student-exam-actions {
    width: auto;
    justify-content: flex-end;
  }

  .student-certificate-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 13px;
  }

  .quick-card {
    min-height: 86px;
    flex-direction: row;
    justify-content: flex-start;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading .secondary-action {
    width: 100%;
  }

  .scanner-card {
    aspect-ratio: 3 / 4;
  }

  .exam-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .exam-stopwatch {
    align-items: center;
    flex-direction: row;
    right: 10px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
  }

  .exam-toolbar > .exam-toolbar-actions,
  .exam-toolbar > .exam-toolbar-actions .primary-action,
  .exam-toolbar > .exam-toolbar-actions .secondary-action {
    width: 100%;
  }

  .exam-stopwatch .exam-toolbar-actions {
    flex: 0 0 auto;
    width: auto;
  }

  .exam-stopwatch .exam-toolbar-actions .primary-action,
  .exam-stopwatch .exam-toolbar-actions .secondary-action {
    width: auto;
  }

  .exam-students {
    position: static;
  }

  .exam-student-list {
    max-height: 280px;
  }

  .exam-card {
    min-width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: none;
  }

  .lite-modal {
    align-items: end;
    padding: 8px;
  }

  .lite-modal-dialog {
    width: 100%;
    max-height: calc(96svh - env(safe-area-inset-top));
    border-radius: 20px;
  }

  .lite-modal-header {
    padding: 14px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #050816;
    --panel: #0f172a;
    --panel-soft: #111d35;
    --text: #e5edf7;
    --muted: #9aa8bc;
    --line: rgba(226, 232, 240, .14);
    --shadow: 0 18px 45px rgba(0, 0, 0, .32);
  }

  body {
    background:
      radial-gradient(circle at top left, rgba(23, 105, 255, .24), transparent 30rem),
      linear-gradient(180deg, #070b18 0%, var(--bg) 100%);
  }

  .brand-picture {
    border-color: rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04);
    box-shadow: 0 14px 26px rgba(0, 0, 0, .22);
  }
}
