:root {
  --qp-bg: #f5f3ff;
  --qp-bg-2: #eef2ff;
  --qp-panel: #ffffff;
  --qp-panel-2: #fafafa;
  --qp-text: #111827;
  --qp-muted: #6b7280;
  --qp-soft: #e5e7eb;
  --qp-border: #d7dce8;
  --qp-purple: #6d28d9;
  --qp-purple-2: #8b5cf6;
  --qp-purple-3: #ede9fe;
  --qp-blue: #2563eb;
  --qp-green: #059669;
  --qp-yellow: #d97706;
  --qp-red: #dc2626;
  --qp-dark: #111827;
  --qp-radius: 22px;
  --qp-shadow: 0 18px 45px rgba(17, 24, 39, .12);
  --qp-shadow-soft: 0 10px 25px rgba(17, 24, 39, .08);
  --qp-ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
.qp-initially-hidden { display: none; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--qp-text);
  background: radial-gradient(circle at top left, #ddd6fe, transparent 34%), linear-gradient(135deg, var(--qp-bg), var(--qp-bg-2));
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }

.qp-topbar {
  min-height: 72px;
  padding: 14px 24px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(109,40,217,.16);
  position: sticky;
  top: 0;
  z-index: 20;
}
.qp-brand { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 24px; color: var(--qp-purple); }
.qp-logo { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg, var(--qp-purple), var(--qp-blue)); color: white; box-shadow: var(--qp-shadow-soft); }
.qp-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.qp-btn {
  border: 0;
  border-radius: 15px;
  padding: 12px 18px;
  font-weight: 800;
  color: var(--qp-text);
  background: #fff;
  border: 1px solid var(--qp-border);
  box-shadow: 0 7px 16px rgba(17,24,39,.08);
  transition: transform .18s var(--qp-ease), box-shadow .18s var(--qp-ease), background .18s;
}
.qp-btn:hover { transform: translateY(-2px); box-shadow: var(--qp-shadow-soft); }
.qp-btn.primary { color: #fff; background: linear-gradient(135deg, var(--qp-purple), var(--qp-blue)); border-color: transparent; }
.qp-btn.success { color: #fff; background: linear-gradient(135deg, #059669, #10b981); border-color: transparent; }
.qp-btn.danger { color: #fff; background: linear-gradient(135deg, #dc2626, #f97316); border-color: transparent; }
.qp-btn.ghost { background: transparent; box-shadow: none; }
.qp-btn.small { padding: 8px 11px; border-radius: 12px; font-size: 13px; }
.qp-btn.icon { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; }

.qp-container { max-width: 1180px; margin: 0 auto; padding: 28px; }
.qp-card { background: rgba(255,255,255,.92); border: 1px solid rgba(109,40,217,.14); border-radius: var(--qp-radius); box-shadow: var(--qp-shadow); padding: 24px; }
.qp-grid { display: grid; gap: 18px; }
.qp-grid.cards { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.qp-input, .qp-select, .qp-textarea {
  width: 100%;
  border: 2px solid var(--qp-border);
  border-radius: 16px;
  padding: 13px 15px;
  color: var(--qp-text);
  background: #fff;
  outline: none;
}
.qp-input:focus, .qp-select:focus, .qp-textarea:focus { border-color: var(--qp-purple-2); box-shadow: 0 0 0 4px rgba(139,92,246,.18); }
.qp-password-control { position:relative; width:100%; }
.qp-password-control .qp-input { padding-right:56px; }
.qp-password-toggle { position:absolute; top:50%; right:7px; transform:translateY(-50%); width:42px; height:42px; display:grid; place-items:center; padding:0; border:0; border-radius:12px; background:transparent; color:#64748b; box-shadow:none; cursor:pointer; transition:background .16s ease,color .16s ease,box-shadow .16s ease; }
.qp-password-toggle:hover { background:#f1f5f9; color:#4c1d95; }
.qp-password-toggle:focus-visible { outline:none; color:#4c1d95; box-shadow:0 0 0 3px rgba(139,92,246,.24); }
.qp-password-toggle[aria-pressed="true"] { background:#ede9fe; color:#5b21b6; }
.qp-password-toggle span { position:relative; display:grid; place-items:center; width:24px; height:24px; font-size:19px; line-height:1; }
.qp-password-toggle[aria-pressed="true"] span::after { content:""; position:absolute; width:22px; height:2px; border-radius:999px; background:currentColor; transform:rotate(-45deg); box-shadow:0 0 0 1px rgba(255,255,255,.8); }
.qp-label { display: block; font-weight: 900; color: var(--qp-text); margin: 10px 0 8px; }
.qp-muted { color: var(--qp-muted); }
.qp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; background: var(--qp-purple-3); color: var(--qp-purple); font-weight: 900; font-size: 12px; }
.qp-empty { padding: 28px; border-radius: 20px; border: 2px dashed var(--qp-border); background: #fff; text-align: center; color: var(--qp-muted); }

.qp-home-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: center; padding-top: 20px; }
.qp-hero-title { font-size: clamp(38px, 7vw, 78px); line-height: .98; margin: 0; letter-spacing: -2px; }
.qp-hero-title span { color: var(--qp-purple); }
.qp-hero-sub { font-size: 20px; color: var(--qp-muted); line-height: 1.55; }
.qp-quiz-card { display: flex; flex-direction: column; gap: 13px; min-height: 190px; }
.qp-quiz-card h3 { margin: 0; font-size: 22px; }
.qp-quiz-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.qp-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 12px 16px; border-radius: 14px; background: var(--qp-dark); color: white; font-weight: 800; z-index: 100; box-shadow: var(--qp-shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.qp-toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

@media (max-width: 850px) {
  .qp-home-hero { grid-template-columns: 1fr; }
  .qp-topbar { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}


/* QuizPulse Kahoot-inspired dashboard, adjusted for QuizPulse branding */
.qp-home-dashboard-body {
  background: #f7f7fb;
  min-height: 100vh;
  color: #1f1a3d;
}
.qp-home-offer {
  min-height: 46px;
  background: linear-gradient(90deg, #3b0b8f, #5b21b6 50%, #421185);
  color: white;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 7px 18px;
  font-weight: 800;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 50;
}
.qp-home-offer-btn {
  background: white;
  color: #3b0b8f;
  border-radius: 5px;
  padding: 10px 17px;
  font-weight: 950;
  white-space: nowrap;
}
.qp-home-offer-close {
  border: 0;
  background: transparent;
  color: white;
  font-size: 32px;
  line-height: 1;
  padding: 0 3px;
}
.qp-dashboard-shell {
  min-height: calc(100vh - 46px);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}
.qp-dashboard-sidebar {
  background: #fff;
  border-right: 1px solid #ece8f8;
  min-height: calc(100vh - 46px);
  position: sticky;
  top: 46px;
  align-self: start;
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  gap: 18px;
}
.qp-dashboard-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #3b0b8f;
  font-size: 25px;
  font-weight: 950;
  letter-spacing: -.8px;
  margin-bottom: 10px;
}
.qp-dashboard-logo span span { color: #7c3aed; }
.qp-dashboard-logo-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #6d28d9, #2563eb);
  color: #fff;
  box-shadow: 0 12px 22px rgba(109, 40, 217, .24);
}
.qp-dashboard-nav,
.qp-dashboard-side-bottom {
  display: grid;
  gap: 4px;
}
.qp-dashboard-side-bottom {
  margin-top: auto;
  border-top: 1px solid #eee8fb;
  padding-top: 12px;
}
.qp-dashboard-nav a,
.qp-dashboard-side-bottom a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #4b5563;
  font-weight: 750;
  padding: 11px 9px;
  border-radius: 12px;
  transition: background .18s, color .18s, transform .18s;
}
.qp-dashboard-nav a span,
.qp-dashboard-side-bottom a span {
  width: 22px;
  color: #5b21b6;
  display: inline-grid;
  place-items: center;
}
.qp-dashboard-nav a:hover,
.qp-dashboard-side-bottom a:hover,
.qp-dashboard-nav a.active {
  background: #f0e7ff;
  color: #3b0b8f;
  transform: translateX(2px);
}
.qp-dashboard-main {
  min-width: 0;
  background: #f6f4ff;
}
.qp-dashboard-topbar {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid #ece8f8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 24px;
  position: sticky;
  top: 46px;
  z-index: 30;
}
.qp-search-wrap {
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: 540px;
  width: min(540px, 48vw);
  border: 1px solid #cfd4e2;
  border-radius: 5px;
  padding: 0 14px;
  background: #fff;
  height: 44px;
  color: #4b5563;
}
.qp-search-wrap input {
  border: 0;
  outline: 0;
  width: 100%;
  color: #111827;
  font-weight: 650;
  background: transparent;
}
.qp-dashboard-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.qp-icon-circle {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.qp-dashboard-content {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 28px 44px;
}
.qp-kahootlike-hero {
  min-height: 520px;
  margin: 0 -28px;
  padding: 70px 11vw 58px;
  background:
    radial-gradient(circle at 80% 18%, rgba(255,255,255,.18), transparent 32%),
    linear-gradient(135deg, #3b0b8f 0%, #5c2fd3 43%, #9777f4 100%);
  color: white;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 360px;
  align-items: start;
  gap: 90px;
}
.qp-kahootlike-hero-text {
  max-width: 770px;
  margin-top: 30px;
}
.qp-pill.inverse {
  background: rgba(255,255,255,.16);
  color: white;
  border: 1px solid rgba(255,255,255,.24);
}
.qp-kahootlike-hero h1 {
  margin: 15px 0 20px;
  font-size: clamp(38px, 4.2vw, 62px);
  line-height: 1.08;
  letter-spacing: .02em;
}
.qp-kahootlike-hero p {
  font-size: 18px;
  line-height: 1.55;
  max-width: 770px;
}
.qp-home-hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.qp-btn.gold {
  background: #b99a00;
  border-color: #a28300;
  color: white;
}
.qp-btn.white {
  background: rgba(255,255,255,.96);
  border-color: transparent;
  color: #3b0b8f;
}
.qp-dashboard-summary-card {
  background: #150035;
  color: white;
  border-radius: 13px;
  padding: 22px;
  box-shadow: 0 22px 55px rgba(17, 0, 46, .28);
  position: relative;
}
.qp-summary-badge {
  display: inline-block;
  padding: 8px 11px;
  background: #b99a00;
  border-radius: 7px;
  font-weight: 950;
  margin: -22px 0 18px -22px;
}
.qp-dashboard-summary-card h2 {
  margin: 0 0 10px;
  font-size: 26px;
}
.qp-summary-price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 12px 0 18px;
}
.qp-summary-price span {
  font-size: 54px;
  font-weight: 950;
  line-height: 1;
}
.qp-summary-price small {
  font-weight: 800;
}
.qp-dashboard-summary-card ul {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  display: grid;
  gap: 7px;
  color: #f5f3ff;
  font-weight: 650;
}
.qp-btn.block { display: block; text-align: center; width: 100%; }
.qp-feature-showcase {
  margin-top: -8px;
  padding: 34px 0 8px;
}
.qp-feature-showcase h2,
.qp-dashboard-library h2 {
  color: #3b0b8f;
  font-size: 25px;
  margin: 0 0 18px;
}
.qp-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.qp-feature-card {
  min-height: 236px;
  border: 1px solid rgba(255,255,255,.7);
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
  color: white;
  border-radius: 7px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: 0 14px 28px rgba(42, 17, 101, .18);
  position: relative;
  overflow: hidden;
}
.qp-feature-card::after {
  content: '';
  position: absolute;
  inset: auto -40px -55px auto;
  width: 150px;
  height: 150px;
  border-radius: 44px;
  rotate: 14deg;
  background: rgba(255,255,255,.12);
}
.qp-feature-card.ai { background: linear-gradient(145deg, #5321b7, #7c3aed); }
.qp-feature-card.types { background: linear-gradient(145deg, #6041c7, #8b5cf6); }
.qp-feature-card.teams { background: linear-gradient(145deg, #5b21b6, #9333ea); }
.qp-feature-card span { font-weight: 850; opacity: .86; }
.qp-feature-card h3 {
  font-size: 20px;
  line-height: 1.2;
  margin: 12px 0 11px;
}
.qp-feature-card p {
  color: rgba(255,255,255,.85);
  line-height: 1.45;
  margin: 0;
}
.qp-feature-card a {
  margin-top: auto;
  font-weight: 950;
  color: white;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.qp-dashboard-library {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  margin-top: 28px;
  border: 1px solid #ece8f8;
  box-shadow: 0 18px 45px rgba(42, 17, 101, .08);
}
.qp-section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.qp-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}
.qp-dashboard-stats div {
  border-radius: 15px;
  background: #f6f4ff;
  padding: 16px;
  border: 1px solid #e8ddff;
}
.qp-dashboard-stats strong {
  display: block;
  font-size: 28px;
  color: #4c1d95;
}
.qp-dashboard-stats span {
  font-size: 13px;
  font-weight: 800;
  color: #6b7280;
}
.qp-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.qp-library-card {
  background: #fff;
  border: 1px solid #e2d8ff;
  border-radius: 18px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 230px;
  box-shadow: 0 12px 24px rgba(42,17,101,.08);
}
.qp-library-card-top,
.qp-library-mini-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.qp-status,
.qp-question-chip {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}
.qp-status.finished { background: #dcfce7; color: #166534; }
.qp-status.draft { background: #fef3c7; color: #92400e; }
.qp-question-chip { background: #ede9fe; color: #5b21b6; }
.qp-library-card h3 {
  margin: 0;
  font-size: 22px;
  color: #22125d;
}
.qp-library-card p {
  margin: 0;
  color: #6b7280;
  line-height: 1.45;
}
.qp-library-mini-meta {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  margin-top: auto;
}
.qp-library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.small-note { font-size: 13px; font-weight: 800; align-self: center; }
.qp-library-empty { grid-column: 1 / -1; }


@media (max-width: 1150px) {
  .qp-dashboard-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .qp-dashboard-sidebar { padding: 18px 10px; }
  .qp-dashboard-logo span:not(.qp-dashboard-logo-icon) { display: none; }
  .qp-dashboard-nav a,
  .qp-dashboard-side-bottom a { justify-content: center; font-size: 0; }
  .qp-dashboard-nav a span,
  .qp-dashboard-side-bottom a span { font-size: 18px; }
  .qp-kahootlike-hero { grid-template-columns: 1fr; gap: 26px; padding-inline: 6vw; }
  .qp-dashboard-summary-card { max-width: 420px; }
  .qp-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .qp-home-offer { grid-template-columns: 1fr auto; text-align: left; }
  .qp-home-offer-btn { display: none; }
  .qp-dashboard-shell { display: block; }
  .qp-dashboard-sidebar {
    position: static;
    min-height: auto;
    flex-direction: row;
    overflow-x: auto;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid #ece8f8;
  }
  .qp-dashboard-logo { flex: 0 0 auto; margin: 0; }
  .qp-dashboard-logo span:not(.qp-dashboard-logo-icon) { display: inline; }
  .qp-dashboard-nav,
  .qp-dashboard-side-bottom { display: flex; min-width: max-content; margin: 0; padding: 0; border: 0; }
  .qp-dashboard-nav a,
  .qp-dashboard-side-bottom a { font-size: 0; }
  .qp-dashboard-topbar { position: static; height: auto; align-items: stretch; flex-direction: column; padding: 14px; }
  .qp-search-wrap { width: 100%; max-width: none; }
  .qp-dashboard-top-actions { justify-content: flex-start; }
  .qp-dashboard-content { padding: 0 14px 28px; }
  .qp-kahootlike-hero { margin: 0 -14px; padding: 38px 18px; min-height: auto; }
  .qp-dashboard-summary-card { max-width: none; }
  .qp-feature-grid,
  .qp-dashboard-stats { grid-template-columns: 1fr; }
  .qp-section-title-row { flex-direction: column; }
}

/* Clean dashboard revision: remove promo feel, keep only working actions, sticky header */
body.qp-dashboard-clean {
  background: #f6f4ff;
}
.qp-dashboard-clean .qp-dashboard-shell {
  min-height: 100vh;
  grid-template-columns: 220px minmax(0, 1fr);
}
.qp-dashboard-clean .qp-dashboard-sidebar {
  top: 0;
  min-height: 100vh;
  height: 100vh;
  z-index: 42;
}
.qp-dashboard-clean .qp-dashboard-main {
  min-height: 100vh;
}
.qp-dashboard-clean .qp-dashboard-topbar {
  position: sticky;
  top: 0;
  z-index: 45;
  min-height: 78px;
  height: auto;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 20px rgba(42, 17, 101, .06);
}
.qp-dashboard-title-group {
  min-width: 180px;
}
.qp-dashboard-title-group h1 {
  margin: 0;
  font-size: 21px;
  color: #3b0b8f;
  letter-spacing: -.02em;
}
.qp-dashboard-title-group p {
  margin: 3px 0 0;
  font-size: 13px;
  color: #6b7280;
  font-weight: 700;
}
.qp-dashboard-clean .qp-search-wrap {
  flex: 1 1 280px;
  max-width: 520px;
  width: auto;
  border-radius: 14px;
}
.qp-dashboard-clean .qp-dashboard-content {
  padding-top: 24px;
}
.qp-dashboard-hero-simple {
  border-radius: 28px;
  padding: clamp(26px, 4vw, 46px);
  background:
    radial-gradient(circle at 84% 12%, rgba(255,255,255,.24), transparent 30%),
    linear-gradient(135deg, #3b0b8f 0%, #6d28d9 50%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 18px 48px rgba(76, 29, 149, .18);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  align-items: center;
  gap: 28px;
}
.qp-dashboard-hero-simple h2 {
  margin: 14px 0 12px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
  letter-spacing: -.03em;
}
.qp-dashboard-hero-simple p {
  max-width: 780px;
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: rgba(255,255,255,.9);
}
.qp-dashboard-hero-status {
  min-height: 190px;
  border-radius: 22px;
  background: rgba(18, 3, 52, .65);
  border: 1px solid rgba(255,255,255,.16);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
}
.qp-dashboard-hero-status strong {
  display: block;
  font-size: 64px;
  line-height: .9;
  color: #fff;
}
.qp-dashboard-hero-status span:last-child {
  font-size: 14px;
  color: rgba(255,255,255,.82);
  font-weight: 850;
}
.qp-summary-badge.clean {
  margin: 0;
  background: #b99a00;
  color: white;
}
.qp-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0;
}
.qp-quick-card {
  background: #fff;
  border: 1px solid #e2d8ff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 12px 24px rgba(42,17,101,.07);
  transition: transform .18s var(--qp-ease), box-shadow .18s var(--qp-ease), border-color .18s;
}
.qp-quick-card:hover {
  transform: translateY(-3px);
  border-color: #8b5cf6;
  box-shadow: 0 18px 38px rgba(42,17,101,.12);
}
.qp-quick-card span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 20px;
  margin-bottom: 12px;
}
.qp-quick-card h3 {
  margin: 0 0 8px;
  color: #22125d;
  font-size: 19px;
}
.qp-quick-card p {
  margin: 0;
  color: #6b7280;
  line-height: 1.45;
  font-weight: 650;
}


@media (max-width: 1150px) {
  .qp-dashboard-clean .qp-dashboard-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .qp-dashboard-clean .qp-dashboard-sidebar { padding: 18px 10px; }
  .qp-dashboard-hero-simple { grid-template-columns: 1fr; }
  .qp-dashboard-hero-status { max-width: 300px; }
  .qp-quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .qp-dashboard-clean .qp-dashboard-shell { display: block; }
  .qp-dashboard-clean .qp-dashboard-sidebar {
    position: sticky;
    top: 0;
    height: auto;
    min-height: auto;
    z-index: 55;
    flex-direction: row;
    overflow-x: auto;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid #ece8f8;
  }
  .qp-dashboard-clean .qp-dashboard-topbar {
    position: sticky;
    top: 72px;
    z-index: 50;
    min-height: unset;
    align-items: stretch;
    flex-direction: column;
    padding: 12px 14px;
  }
  .qp-dashboard-title-group h1 { font-size: 18px; }
  .qp-dashboard-title-group p { display: none; }
  .qp-dashboard-clean .qp-search-wrap { width: 100%; max-width: none; }
  .qp-dashboard-clean .qp-dashboard-top-actions { justify-content: flex-start; }
  .qp-dashboard-clean .qp-dashboard-content { padding: 16px 14px 28px; }
  .qp-dashboard-hero-simple { padding: 28px 18px; border-radius: 22px; }
  .qp-dashboard-hero-status { min-height: 140px; }
  .qp-dashboard-hero-status strong { font-size: 48px; }
  .qp-quick-actions { grid-template-columns: 1fr; }
}

/* Version 2 simplification: clearer menu, statuses, and sound controls */
.qp-quick-actions-simple { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qp-dashboard-settings {
  margin-top: 24px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid #e2d8ff;
  box-shadow: 0 14px 34px rgba(42,17,101,.07);
  padding: 22px;
}
.qp-settings-card {
  margin-top: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, #faf9ff, #fff);
  border: 1px solid #e9ddff;
  padding: 18px;
}
.qp-settings-card h3 { margin: 0 0 8px; color: #2e1065; }
.qp-settings-card p { margin: 0 0 14px; color: #6b7280; font-weight: 650; }
.qp-audio-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.qp-audio-toggle {
  border: 1px solid #c4b5fd;
  background: #ede9fe;
  color: #4c1d95;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 950;
  cursor: pointer;
}
.qp-audio-toggle.is-off { background: #f3f4f6; color: #6b7280; border-color: #d1d5db; }
.qp-library-card.is-draft { border-left: 6px solid #f59e0b; }
.qp-library-card.is-finished { border-left: 6px solid #22c55e; }
.qp-status.finished,
.qp-status.draft { font-weight: 950; }


@media (max-width: 760px) { .qp-quick-actions-simple { grid-template-columns: 1fr; } }

.qp-card-health { margin: 10px 0; padding: 9px 11px; border-radius: 14px; font-weight: 950; font-size: 12px; }
.qp-card-health.ok { background:#dcfce7; color:#166534; border:1px solid #86efac; }
.qp-card-health.warn { background:#fef3c7; color:#92400e; border:1px solid #fcd34d; }


/* QuizPulse version 6: separate library page with Kahoot-style cards adjusted for QuizPulse */
.qp-library-page-body { background: #f3f4f6; }
.qp-library-main { min-height: 100vh; background: #f3f4f6; }
.qp-library-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid #d8dce7;
  backdrop-filter: blur(14px);
}
.qp-library-title-group h1 { margin: 0; font-size: 24px; color: #111827; }
.qp-library-title-group p { margin: 4px 0 0; color: #6b7280; }
.qp-library-content-shell { max-width: 1460px; margin: 0 auto; padding: 20px 28px 42px; }
.qp-library-tabs {
  display: inline-flex;
  border: 1px solid #cfd4df;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.06);
  margin-bottom: 18px;
}
.qp-library-tabs button {
  min-width: 108px;
  padding: 13px 18px;
  border: 0;
  border-right: 1px solid #e1e5ee;
  background: #fff;
  color: #111827;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}
.qp-library-tabs button:last-child { border-right: 0; }
.qp-library-tabs button.active { color: #2563eb; background: #f8fbff; }
.qp-library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.qp-library-search {
  width: min(360px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #cfd4df;
  border-radius: 3px;
  padding: 0 14px;
  min-height: 44px;
  color: #6b7280;
}
.qp-library-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: #111827;
}
.qp-library-view-actions { display: flex; gap: 8px; }
.qp-library-view-actions button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #737b88;
  font-size: 26px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.qp-library-view-actions button.active { color: #1473d2; background: #eaf3ff; }
.qp-library-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #6b7280;
  margin-bottom: 10px;
}
.qp-library-status-row p { margin: 0; }
.qp-kahoot-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  align-items: start;
}
.qp-kahoot-quiz-card {
  position: relative;
  background: #fff;
  border-radius: 7px;
  box-shadow: 0 2px 7px rgba(15,23,42,.16);
  overflow: visible;
  min-height: 232px;
  transition: transform .16s ease, box-shadow .16s ease;
}
.qp-kahoot-quiz-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(15,23,42,.18); }
.qp-kahoot-card-brand {
  height: 23px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  color: #5f6673;
  font-size: 12px;
  letter-spacing: .01em;
}
.qp-kahoot-card-thumb {
  position: relative;
  height: 106px;
  overflow: hidden;
  background: #777;
}
.qp-kahoot-card-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.qp-library-generated-thumb {
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.92);
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.18), transparent 22%), linear-gradient(135deg, #5046e5, #8b5cf6);
}
.qp-library-generated-thumb[data-theme="1"] { background: linear-gradient(135deg, #0ea5e9, #7c3aed); }
.qp-library-generated-thumb[data-theme="2"] { background: linear-gradient(135deg, #111827, #334155); }
.qp-library-generated-thumb[data-theme="3"] { background: linear-gradient(135deg, #059669, #14b8a6); }
.qp-library-generated-thumb[data-theme="4"] { background: linear-gradient(135deg, #f97316, #e11d48); }
.qp-library-generated-thumb[data-theme="5"] { background: linear-gradient(135deg, #4f46e5, #0f172a); }
.qp-library-generated-thumb span { font-size: 36px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.24)); }
.qp-library-generated-thumb b { font-size: 18px; opacity: .86; }
.qp-kahoot-question-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: #111827;
  color: #fff;
  border-radius: 4px;
  padding: 3px 7px;
  font-weight: 800;
  font-size: 12px;
}
.qp-kahoot-card-body { padding: 10px 10px 12px; }
.qp-kahoot-card-mainline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: start;
}
.qp-kahoot-card-mainline h3 {
  margin: 0;
  min-height: 44px;
  color: #1f2937;
  font-size: 16px;
  line-height: 1.35;
  word-break: break-word;
}
.qp-card-menu-btn {
  width: 28px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 22px;
  cursor: pointer;
  border-radius: 6px;
}
.qp-card-menu-btn:hover { background: #f1f5f9; }
.qp-kahoot-owner { margin: 6px 0 0; color: #6b7280; font-size: 13px; }
.qp-kahoot-card-status { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.qp-kahoot-card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.qp-kahoot-dropdown {
  position: absolute;
  right: 8px;
  top: 160px;
  z-index: 100;
  min-width: 168px;
  background: #fff;
  border: 1px solid #d7dce7;
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(15,23,42,.24);
  padding: 6px;
}
.qp-kahoot-dropdown a,
.qp-kahoot-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #111827;
  text-decoration: none;
  padding: 10px 11px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font: inherit;
}
.qp-kahoot-dropdown a:hover,
.qp-kahoot-dropdown button:hover { background: #f3f4f6; }
.qp-kahoot-dropdown .danger { color: #dc2626; }
.qp-kahoot-library-grid.is-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qp-kahoot-library-grid.is-list .qp-kahoot-quiz-card {
  min-height: auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  overflow: visible;
}
.qp-kahoot-library-grid.is-list .qp-kahoot-card-brand { position: absolute; left: 0; top: 0; z-index: 2; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.qp-kahoot-library-grid.is-list .qp-kahoot-card-thumb { height: 150px; grid-row: 1 / span 2; }
.qp-kahoot-library-grid.is-list .qp-kahoot-card-body { padding: 18px; }
.qp-kahoot-library-grid.is-list .qp-kahoot-card-mainline h3 { min-height: 0; font-size: 20px; }
.qp-kahoot-library-grid.is-list .qp-kahoot-dropdown { top: 52px; }


@media (max-width: 900px) {
  .qp-library-topbar { align-items: stretch; flex-direction: column; }
  .qp-library-content-shell { padding: 14px; }
  .qp-library-toolbar { align-items: stretch; flex-direction: column; }
  .qp-library-search { width: auto; }
  .qp-library-tabs { width: 100%; overflow-x: auto; }
  .qp-library-tabs button { min-width: max-content; }
  .qp-kahoot-library-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
  .qp-kahoot-library-grid.is-list .qp-kahoot-quiz-card { display: block; }
  .qp-kahoot-library-grid.is-list .qp-kahoot-card-thumb { height: 110px; }
}

/* Version 7: create-start modal like a clean Kahoot-style start screen, adjusted for available QuizPulse features */
.qp-create-modal[hidden] { display: none !important; }
.qp-create-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .16s var(--qp-ease);
}
.qp-create-modal.show { opacity: 1; }
.qp-create-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 6, 28, .62);
  backdrop-filter: blur(6px);
}
body.qp-create-modal-open { overflow: hidden; }
.qp-create-modal-card {
  position: relative;
  width: min(820px, 100%);
  max-height: min(760px, calc(100vh - 34px));
  overflow: hidden;
  border-radius: 8px;
  background: #f1f1f4;
  box-shadow: 0 28px 90px rgba(5, 4, 22, .38);
  transform: translateY(12px) scale(.985);
  transition: transform .2s var(--qp-ease);
}
.qp-create-modal.show .qp-create-modal-card { transform: translateY(0) scale(1); }
.qp-create-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  background: #fff;
  padding: 26px 30px 22px;
  border-bottom: 1px solid #e4e4eb;
}
.qp-create-modal-head h2 {
  margin: 8px 0 6px;
  font-size: 22px;
  color: #2b2d33;
}
.qp-create-modal-head p {
  margin: 0;
  color: #666b76;
  font-weight: 700;
}
.qp-create-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: #f3f4f6;
  color: #111827;
  font-size: 28px;
  line-height: 1;
}
.qp-create-modal-body {
  padding: 34px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  overflow-y: auto;
  max-height: calc(100vh - 230px);
}
.qp-create-option {
  position: relative;
  min-height: 245px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e1e4ec;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px 18px;
  transition: transform .18s var(--qp-ease), box-shadow .18s var(--qp-ease), border-color .18s var(--qp-ease);
}
.qp-create-option:hover,
.qp-create-option:focus-within {
  transform: translateY(-3px);
  border-color: #8b5cf6;
  box-shadow: 0 16px 36px rgba(91, 33, 182, .18);
}
.qp-create-option.featured::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 34px;
  background: #4c1d95;
  border-radius: 8px 8px 0 0;
}
.qp-create-option-tag {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  z-index: 1;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}
.qp-create-option-icon {
  width: 66px;
  height: 66px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
  color: white;
  font-size: 34px;
  box-shadow: 0 14px 28px rgba(109, 40, 217, .22);
  margin-top: 18px;
}
.qp-create-option strong {
  color: #3b3c42;
  font-size: 19px;
  line-height: 1.25;
}
.qp-create-option em {
  color: #6b7280;
  font-style: normal;
  line-height: 1.35;
  font-weight: 650;
}
.qp-create-option-templates {
  grid-column: span 1;
  min-height: 245px;
}
.qp-create-template-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 6px;
}
.qp-create-template-grid a {
  border-radius: 8px;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  color: #4c1d95;
  font-size: 12px;
  font-weight: 950;
  padding: 8px 6px;
  text-align: center;
}
.qp-create-template-grid a:hover { background: #ede9fe; }
.qp-create-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #fff;
  border-top: 1px solid #e4e4eb;
  padding: 18px 30px;
}
.qp-create-modal-foot span {
  color: #737b88;
  font-size: 13px;
  font-weight: 750;
}


@media (max-width: 820px) {
  .qp-create-modal { padding: 10px; align-items: end; }
  .qp-create-modal-card { max-height: calc(100vh - 20px); border-radius: 18px 18px 0 0; }
  .qp-create-modal-head { padding: 20px; }
  .qp-create-modal-body { grid-template-columns: 1fr; padding: 18px; gap: 14px; max-height: calc(100vh - 220px); }
  .qp-create-option { min-height: 190px; }
  .qp-create-modal-foot { padding: 14px 18px; flex-direction: column; align-items: stretch; }
}
.qp-attention-pulse { animation: qpAttentionPulse .7s ease-in-out infinite alternate; }
@keyframes qpAttentionPulse {
  from { box-shadow: 0 0 0 0 rgba(124,58,237,.25), 0 7px 16px rgba(17,24,39,.08); transform: translateY(0); }
  to { box-shadow: 0 0 0 8px rgba(124,58,237,.16), 0 12px 26px rgba(124,58,237,.25); transform: translateY(-1px); }
}

/* quiz_version_11 polish: dynamic scaling, no horizontal overflow, settings */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
img, video, canvas, svg { max-width: 100%; height: auto; }
.qp-dashboard-main, .qp-dashboard-content, .qp-dashboard-topbar, .qp-dashboard-shell, .qp-card, .qp-game-card { min-width: 0; }
.qp-dashboard-topbar { position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px); flex-wrap: wrap; gap: 12px; }
.qp-dashboard-title-group { min-width: min(100%, 280px); }
.qp-dashboard-title-group h1 { font-size: clamp(24px, 4vw, 42px); }
.qp-dashboard-top-actions, .qp-actions { flex-wrap: wrap; min-width: 0; }
.qp-dashboard-content { width: min(1400px, 100%); margin-inline: auto; }
.qp-quick-actions, .qp-dashboard-stats, .qp-settings-grid { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }
.qp-settings-grid { display: grid; gap: 18px; }
.qp-settings-card.big { padding: clamp(18px, 3vw, 28px); border-radius: 26px; }
@media (max-width: 860px) {
  .qp-dashboard-shell { grid-template-columns: 1fr !important; }
  .qp-dashboard-sidebar { position: sticky; top: 0; z-index: 40; width: 100%; min-height: auto; flex-direction: row; align-items: center; overflow-x: auto; border-radius: 0; }
  .qp-dashboard-nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
  .qp-dashboard-nav a { white-space: nowrap; }
  .qp-dashboard-logo { min-width: max-content; }
  .qp-dashboard-topbar { top: 64px; }
  .qp-home-hero-actions { flex-direction: column; align-items: stretch; }
}
@media (max-width: 520px) {
  .qp-dashboard-content { padding-inline: 10px; }
  .qp-btn { width: 100%; justify-content: center; }
  .qp-dashboard-top-actions { width: 100%; }
}


/* Dashboard/settings polish */
.qp-dashboard-sidebar { border-right: 1px solid rgba(109,40,217,.14); box-shadow: 12px 0 30px rgba(42,17,101,.04); }
.qp-dashboard-nav a { border-radius: 16px; }
.qp-dashboard-nav a.active { box-shadow: 0 10px 24px rgba(109,40,217,.16); }
.qp-dashboard-topbar, .qp-library-topbar { border-radius: 0 0 24px 24px; box-shadow: 0 12px 30px rgba(42,17,101,.06); }
.qp-quick-card, .qp-library-card, .qp-settings-card { transition: transform .18s var(--qp-ease), box-shadow .18s var(--qp-ease); }
.qp-quick-card:hover, .qp-library-card:hover, .qp-settings-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(42,17,101,.12); }
.qp-settings-card .qp-select, .qp-settings-card .qp-input { border-radius: 14px; }

/* Student account and teacher access screens */
.qp-auth-body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at top left, rgba(255,255,255,.24), transparent 28%), radial-gradient(circle at 85% 12%, rgba(250,204,21,.35), transparent 22%), linear-gradient(135deg, #25076b 0%, #46178f 46%, #0f172a 100%);
  color: #ffffff;
}
.qp-auth-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 28px;
  align-items: center;
  padding: 34px 0;
}
.qp-auth-shell.single {
  grid-template-columns: minmax(280px, 560px);
  justify-content: center;
}
.qp-auth-hero {
  padding: 26px;
}
.qp-auth-hero h1 {
  font-size: clamp(44px, 7vw, 84px);
  line-height: .92;
  margin: 20px 0 16px;
  letter-spacing: -2px;
}
.qp-auth-hero p {
  max-width: 580px;
  font-size: 20px;
  color: #e0e7ff;
  font-weight: 700;
}
.qp-auth-hero-actions {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.qp-hidden-teacher-link {
  width: 12px;
  height: 12px;
  display: inline-flex;
  opacity: .16;
  color: transparent;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  text-decoration: none;
}
.qp-hidden-teacher-link:hover,
.qp-hidden-teacher-link:focus {
  opacity: .8;
  outline: 2px solid rgba(255,255,255,.55);
}
.qp-auth-card {
  background: rgba(255,255,255,.96);
  color: #111827;
  border-radius: 34px;
  padding: clamp(22px, 4vw, 36px);
  box-shadow: 0 30px 80px rgba(2, 6, 23, .34);
  border: 1px solid rgba(255,255,255,.42);
}
.qp-auth-card.teacher {
  max-width: 560px;
}
.qp-auth-card h1,
.qp-auth-card h2 {
  margin: 10px 0 10px;
  color: #111827;
}
.qp-auth-card h1 { font-size: 44px; }
.qp-auth-card h2 { font-size: 34px; }
.qp-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  background: #eef2ff;
  padding: 8px;
  border-radius: 18px;
  margin-bottom: 22px;
}
.qp-auth-tabs button,
.qp-auth-tabs a {
  border: 0;
  border-radius: 14px;
  padding: 13px 14px;
  font-weight: 1000;
  color: #312e81;
  background: transparent;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.qp-auth-tabs .active {
  color: #ffffff;
  background: linear-gradient(135deg, #46178f, #7c3aed);
  box-shadow: 0 10px 24px rgba(70,23,143,.28);
}
.qp-auth-card .qp-input,
.qp-auth-card .qp-btn {
  width: 100%;
  margin-top: 10px;
}
.qp-auth-card .qp-label {
  margin-top: 14px;
}
.qp-auth-actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 16px;
}
.qp-auth-actions-grid.two {
  grid-template-columns: 1fr 1fr;
}
.qp-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #64748b;
  font-weight: 900;
  margin: 22px 0 14px;
}
.qp-auth-divider::before,
.qp-auth-divider::after {
  content: '';
  height: 1px;
  background: #e2e8f0;
  flex: 1;
}
.qp-auth-warning {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 900;
  border: 1px solid #fed7aa;
}
.qp-pin-input.small {
  font-size: 34px;
  letter-spacing: 8px;
  text-align: center;
}
.qp-account-summary,
.qp-join-account-banner,
.qp-pin-confirm-card {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 20px;
  padding: 14px;
  margin: 14px 0;
}
.qp-account-summary strong,
.qp-account-summary span {
  display: block;
}
.qp-account-summary strong {
  font-size: 22px;
}
.qp-account-summary span {
  color: #64748b;
  font-weight: 900;
}
.qp-join-account-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #111827;
  margin-bottom: 18px;
}
.qp-join-account-banner.guest {
  background: #fff7ed;
  border-color: #fed7aa;
}
.qp-join-account-banner a {
  color: #46178f;
  font-weight: 1000;
  text-decoration: none;
}
.qp-btn.danger {
  background: #ef4444;
  color: #fff;
  border-color: #dc2626;
}
.qp-btn.white-outline {
  background: #ffffff;
  color: #46178f;
  border: 2px solid #c4b5fd;
}
@media (max-width: 860px) {
  .qp-auth-shell { grid-template-columns: 1fr; }
  .qp-auth-hero { padding: 14px 4px 0; }
  .qp-auth-hero h1 { font-size: 48px; }
  .qp-auth-tabs { grid-template-columns: 1fr; }
  .qp-auth-actions-grid.two { grid-template-columns: 1fr; }
}


/* v1.1.1 auth layout fixes: no overlapping Guest/Back buttons */
.qp-auth-card .qp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.qp-auth-tabs {
  grid-template-columns: 1fr 1fr;
}
.qp-auth-footer-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.qp-auth-hero-hidden-actions {
  min-height: 28px;
}
.qp-auth-card.teacher .qp-btn + .qp-btn,
.qp-auth-card.teacher .qp-btn + a.qp-btn,
.qp-auth-card .qp-pin-confirm-card .qp-btn + .qp-btn {
  margin-top: 10px;
}
@media (max-width: 860px) {
  .qp-auth-tabs { grid-template-columns: 1fr 1fr; }
}

/* QuizPulse v1.3: SQLite storage, accounts, templates, email and mobile polish */
.qp-auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(139,92,246,.45), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(37,99,235,.25), transparent 26%),
    linear-gradient(135deg, #46178f 0%, #2e1065 52%, #111827 100%);
  color: #fff;
}
.qp-auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 520px);
  gap: clamp(24px, 6vw, 72px);
  align-items: center;
  padding: clamp(22px, 5vw, 72px);
}
.qp-auth-shell.single { grid-template-columns: minmax(320px, 640px); justify-content: center; }
.qp-auth-hero h1 { font-size: clamp(46px, 7vw, 86px); line-height: .96; margin: 18px 0; letter-spacing: -.05em; }
.qp-auth-hero p { max-width: 670px; color: rgba(255,255,255,.88); font-size: clamp(17px, 2vw, 22px); line-height: 1.45; font-weight: 800; }
.qp-auth-card {
  color: #111827;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 34px;
  padding: clamp(22px, 3vw, 36px);
  box-shadow: 0 28px 80px rgba(8,7,30,.35);
}
.qp-auth-card h1,
.qp-auth-card h2 { color: #111827; margin: 18px 0 12px; letter-spacing: -.03em; }
.qp-auth-tabs { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 8px; padding: 7px; border-radius: 22px; background: #f1f5ff; margin-bottom: 22px; }
.qp-auth-tabs button,
.qp-auth-tab-link { border:0; background: transparent; border-radius: 16px; padding: 13px 12px; font-weight: 950; color: #2e1065; text-align: center; }
.qp-auth-tabs button.active { color: #fff; background: linear-gradient(135deg, #6d28d9, #2563eb); box-shadow: 0 12px 25px rgba(109,40,217,.25); }
.qp-auth-warning { margin: 10px 0 18px; padding: 14px; border-radius: 16px; background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; font-weight: 900; }
.qp-auth-footer-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.qp-auth-footer-actions.stacked { display: grid; grid-template-columns: 1fr 1fr; }
.qp-auth-actions-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.qp-auth-actions-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.qp-auth-divider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 18px 0; color: #6b7280; font-weight: 900; }
.qp-auth-divider::before,.qp-auth-divider::after { content:''; height:1px; background:#e5e7eb; }
.qp-white-outline,.qp-btn.white-outline { background:#fff; color:#2e1065; }
.qp-profile-orb { width: 72px; height: 72px; border-radius: 24px; display:grid; place-items:center; font-size: 38px; background: linear-gradient(135deg,#ede9fe,#dbeafe); border: 1px solid #ddd6fe; box-shadow: var(--qp-shadow-soft); margin: 0 auto 12px; }
.qp-profile-orb.big { width:86px; height:86px; font-size:48px; margin:0; }
.qp-auth-avatar-picker { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; margin: 8px 0 16px; }
.qp-auth-avatar { border:2px solid #e5e7eb; border-radius:16px; background:#fff; padding:9px 6px; display:grid; place-items:center; gap:4px; font-weight:900; color:#4b5563; }
.qp-auth-avatar span { font-size:28px; }
.qp-auth-avatar small { font-size:11px; }
.qp-auth-avatar.active { border-color:#6d28d9; background:#f5f3ff; color:#4c1d95; box-shadow: 0 0 0 4px rgba(109,40,217,.10); }
.qp-account-settings-head { display:flex; gap:16px; align-items:center; }
.qp-account-summary { margin: 16px 0; padding:16px; border-radius:20px; background:#f8f7ff; border:1px solid #ddd6fe; display:grid; gap:4px; }
.qp-account-summary strong { font-size:22px; color:#2e1065; }
.qp-account-summary span { color:#6b7280; font-weight:850; }
.qp-pin-confirm-card { margin:16px 0; padding:16px; border-radius:20px; background:#f0fdf4; border:1px solid #bbf7d0; }

.qp-dashboard-hero-v12 .qp-home-hero-actions .qp-btn { min-width: 140px; text-align: center; }
.qp-system-stats { margin-top: -6px; }
.qp-system-stats .qp-status-text.ok { color: #059669; }
.qp-system-stats .qp-status-text.warn { color: #d97706; }
.qp-template-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 14px; }
.qp-template-card { background:#fff; border:1px solid #e2d8ff; border-radius:22px; padding:18px; box-shadow:0 12px 25px rgba(42,17,101,.07); display:flex; flex-direction:column; gap:12px; }
.qp-template-card h3 { margin:0; color:#22125d; font-size:21px; }
.qp-template-card p { margin:0; color:#6b7280; line-height:1.45; font-weight:700; }
.qp-template-meta { display:flex; align-items:baseline; gap:8px; color:#5b21b6; font-weight:900; margin-top:auto; }
.qp-template-meta b { font-size:28px; }
.qp-system-list { display:grid; gap:8px; margin-top:12px; }
.qp-system-row { display:flex; justify-content:space-between; gap:16px; align-items:center; padding:10px 12px; border-radius:14px; background:#fff; border:1px solid #e5e7eb; color:#4b5563; }
.qp-system-row b { color:#111827; text-align:right; overflow-wrap:anywhere; }
.qp-system-row.ok { background:#ecfdf5; border-color:#bbf7d0; }
.qp-system-row.warn { background:#fff7ed; border-color:#fed7aa; }
.qp-settings-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:16px; }
.qp-settings-card.big { margin-top:0; }
.qp-check-row { display:flex; gap:10px; align-items:flex-start; font-weight:900; color:#111827; }


@media (max-width: 920px) {
  .qp-auth-shell { grid-template-columns: 1fr; padding: 20px; gap: 22px; }
  .qp-auth-hero { text-align:center; }
  .qp-auth-hero p { margin-inline:auto; }
  .qp-auth-card { border-radius: 26px; }
  .qp-settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { overflow-x:hidden; }
  .qp-btn { width: auto; min-height: 46px; }
  .qp-auth-shell { padding: 12px; align-items:start; }
  .qp-auth-hero h1 { font-size: 42px; }
  .qp-auth-hero p { font-size: 16px; }
  .qp-auth-card { padding: 18px; border-radius: 22px; }
  .qp-auth-tabs { grid-template-columns: 1fr; }
  .qp-auth-footer-actions.stacked,
  .qp-auth-actions-grid,
  .qp-auth-actions-grid.two { grid-template-columns: 1fr; }
  .qp-auth-avatar-picker { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .qp-account-settings-head { align-items:flex-start; }
  .qp-profile-orb.big { width:62px; height:62px; font-size:34px; border-radius:18px; }
  .qp-dashboard-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .qp-dashboard-stats div { padding: 13px; }
  .qp-dashboard-stats strong { font-size: 22px; }
  .qp-template-grid { grid-template-columns: 1fr; }
  .qp-system-row { display:grid; gap:3px; }
  .qp-system-row b { text-align:left; }
  .qp-dashboard-top-actions .qp-btn { flex: 1 1 auto; text-align:center; }
  .qp-student-shell { padding: 12px !important; }
  .qp-student-card, .qp-game-card { border-radius: 22px !important; padding: 16px !important; }
  .qp-game-answers { grid-template-columns: 1fr !important; }
  .qp-game-answer { min-height: 92px !important; }
  .qp-student-question-title { font-size: clamp(28px, 9vw, 42px) !important; }
  .qp-timer { width: 58px !important; height: 58px !important; font-size: 24px !important; }
}


[data-app-theme].active { outline: 3px solid var(--qp-purple-2); box-shadow: 0 0 0 5px rgba(29,155,210,.14); }

/* v1.4 academic statistics */
.qp-stat-create-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:16px; }
.qp-stat-filters { display:grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap:12px; align-items:end; margin: 16px 0; }
.qp-stat-filters label { display:flex; flex-direction:column; gap:6px; font-weight:800; color:var(--qp-text, #1f2937); }
.qp-stat-filters label span { font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:var(--qp-muted, #64748b); }
.qp-stat-summary { padding:12px 14px; border-radius:16px; background:rgba(124,58,237,.10); border:1px solid rgba(124,58,237,.18); font-weight:800; margin-bottom:12px; }
.qp-stat-table-wrap { overflow:auto; border-radius:18px; border:1px solid rgba(15,23,42,.10); background:#fff; box-shadow:0 12px 30px rgba(15,23,42,.08); }

.qp-stat-table { width:100%; border-collapse:collapse; min-width:720px; }
.qp-stat-table th { text-align:left; padding:14px 16px; font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:#64748b; background:rgba(248,250,252,.95); position:sticky; top:0; }

.qp-stat-table td { padding:14px 16px; border-top:1px solid rgba(15,23,42,.08); }

.qp-stat-profile { width:46px; height:46px; border-radius:16px; display:grid; place-items:center; font-size:26px; background:linear-gradient(135deg,#ede9fe,#fff7ed); box-shadow:inset 0 0 0 1px rgba(124,58,237,.18); }
.qp-empty-cell { text-align:center; color:#64748b; padding:26px !important; }
.qp-location-card { display:grid; grid-template-columns: 1.2fr 1fr 1fr; gap:12px; align-items:end; margin: 0 0 14px; padding:12px; border-radius:18px; background:rgba(255,255,255,.82); border:1px solid rgba(124,58,237,.16); box-shadow:0 10px 24px rgba(15,23,42,.08); }
.qp-location-card > div { display:flex; flex-direction:column; gap:3px; }
.qp-location-card > div b { font-size:16px; }
.qp-location-card > div span { color:#64748b; font-size:13px; }
.qp-location-card label { display:flex; flex-direction:column; gap:5px; font-weight:800; font-size:12px; text-transform:uppercase; color:#64748b; }
.qp-location-chip { margin-bottom:12px; padding:12px 14px; border-radius:16px; background:rgba(255,255,255,.85); border:1px solid rgba(124,58,237,.16); font-weight:800; }
.qp-location-chip.student { background:linear-gradient(135deg,rgba(16,185,129,.16),rgba(59,130,246,.12)); }
@media (max-width: 900px) { .qp-stat-create-grid, .qp-stat-filters, .qp-location-card { grid-template-columns: 1fr; } }

/* v1.5 account/library redesign */
.qp-auth-warning.soft { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.22); color: #1e3a8a; }
.qp-create-course-grid { display:grid; grid-template-columns: minmax(180px,1fr) minmax(180px,1fr) auto; gap:14px; align-items:end; }
.qp-library-v15 .qp-library-toolbar { margin-bottom: 18px; }
.qp-course-tree { display:grid; gap:16px; }
.qp-course-node, .qp-subject-node { background:#fff; border:1px solid rgba(15,23,42,.10); border-radius:22px; padding:12px; box-shadow:0 12px 28px rgba(15,23,42,.06); }
.qp-course-node > summary, .qp-subject-node > summary { cursor:pointer; list-style:none; display:flex; justify-content:space-between; gap:14px; align-items:center; padding:12px 14px; border-radius:16px; font-weight:900; color:#312e81; background:linear-gradient(135deg,#f8fafc,#eef2ff); }
.qp-course-node > summary::-webkit-details-marker, .qp-subject-node > summary::-webkit-details-marker { display:none; }
.qp-subject-node { margin:12px; background:#f8fafc; }
.qp-library-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap:16px; }
.qp-library-grid.small-grid { margin-top:12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.qp-library-card { background:#fff; border:1px solid rgba(15,23,42,.10); border-radius:22px; padding:16px; box-shadow:0 10px 24px rgba(15,23,42,.07); display:grid; gap:10px; }
.qp-library-card h3 { margin:0; color:#1e1b4b; }
.qp-library-card p { margin:0; color:#64748b; min-height:38px; }
.qp-library-card-top, .qp-library-meta { display:flex; justify-content:space-between; gap:10px; align-items:center; color:#64748b; font-size:13px; }
.qp-actions.wrap { flex-wrap:wrap; }
.qp-location-card-new { display:grid; gap:12px; }
.qp-location-choice-row { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:12px; }
.qp-location-choice { display:grid; gap:4px; border:1px solid rgba(99,102,241,.18); border-radius:18px; padding:12px; background:#fff; cursor:pointer; }
.qp-location-choice input { display:none; }
.qp-location-choice span { font-weight:900; color:#312e81; }
.qp-location-choice small { color:#64748b; }
.qp-location-choice.active { background:linear-gradient(135deg,#ede9fe,#dbeafe); border-color:#7c3aed; box-shadow:0 10px 24px rgba(124,58,237,.14); }
.qp-course-name-fields { grid-template-columns: repeat(2, minmax(0,1fr)); gap:12px; }
.qp-course-name-fields small { grid-column:1/-1; }
.qp-stat-table-only { display:grid; gap:16px; }
.qp-stat-filter-row { display:grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap:12px; align-items:end; }
.qp-stat-filter-row label { display:grid; gap:6px; font-weight:800; color:#334155; }
.qp-table-wrap { overflow:auto; border-radius:22px; border:1px solid rgba(15,23,42,.10); background:#fff; }
.qp-stat-table { width:100%; border-collapse:collapse; min-width:760px; }
.qp-stat-table th { background:#4c1d95; color:#fff; text-align:left; padding:14px; font-size:14px; }
.qp-stat-table td { padding:14px; border-top:1px solid rgba(15,23,42,.08); color:#1e293b; }
.qp-stat-table tr:nth-child(even) td { background:#f8fafc; }
.qp-stat-avatar { display:inline-grid; place-items:center; width:42px; height:42px; border-radius:16px; background:linear-gradient(135deg,#ede9fe,#dbeafe); font-size:22px; }
.qp-empty-cell { text-align:center; color:#64748b !important; padding:26px !important; }
@media (max-width: 900px){
  .qp-create-course-grid, .qp-location-choice-row, .qp-course-name-fields, .qp-stat-filter-row { grid-template-columns:1fr; }
  .qp-library-grid, .qp-library-grid.small-grid { grid-template-columns:1fr; }
}


/* v1.5.2 cleanup polish */
.qp-btn.full { width: 100%; justify-content: center; }
.qp-demo-accounts { margin-top: 14px; }
.qp-auth-actions-grid.clean { grid-template-columns: 1fr auto; }
.qp-auth-tabs { grid-template-columns: 1fr 1fr; }
.qp-dashboard-top-actions .qp-theme-toggle { min-width: 88px; }
.qp-stat-table-only .qp-stat-filter-row { align-items: end; }
@media (max-width: 760px) {
  .qp-auth-actions-grid.clean { grid-template-columns: 1fr; }
}


.qp-save-modal-overlay,
.qp-done-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(10px);
}
.qp-save-modal {
  width: min(760px, 96vw);
  max-height: min(780px, 92vh);
  overflow: auto;
  border-radius: 30px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(15,23,42,.12);
  box-shadow: 0 35px 90px rgba(15, 23, 42, .34);
  padding: 24px;
  position: relative;
  animation: qpPopIn .25s ease both;
}
.qp-save-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.12);
  background: #f8fafc;
  color: #0f172a;
  font-weight: 950;
  cursor: pointer;
}
.qp-save-modal-head h2 { margin: 12px 0 6px; font-size: clamp(28px, 4vw, 42px); color:#0f172a; }
.qp-save-modal-head p { margin: 0; color:#475569; font-weight: 700; }
.qp-save-choice-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:14px; margin:20px 0; }
.qp-save-choice {
  text-align:left;
  border: 2px solid rgba(15,23,42,.10);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-radius: 22px;
  padding: 18px;
  cursor: pointer;
  display:grid;
  gap:8px;
  color:#0f172a;
  min-height: 150px;
}
.qp-save-choice:hover { border-color:#8b5cf6; transform: translateY(-1px); }
.qp-save-choice.active { border-color:#7c3aed; background: linear-gradient(180deg, #f4efff, #ffffff); box-shadow:0 14px 35px rgba(124,58,237,.16); }
.qp-save-choice:disabled { opacity:.48; cursor:not-allowed; transform:none; }
.qp-save-choice-icon { font-size:34px; }
.qp-save-choice b { font-size:20px; color:#0f172a; }
.qp-save-choice small { color:#475569; font-weight:700; }
.qp-save-course-panel { gap:8px; padding:18px; border-radius:22px; background:#f8fafc; border:1px solid rgba(15,23,42,.10); margin-bottom:18px; }
.qp-save-empty-folder { display:grid; gap:8px; color:#0f172a; }
.qp-save-modal-actions { display:flex; justify-content:flex-end; gap:12px; }
.qp-done-overlay { pointer-events:none; opacity:0; transition:opacity .24s ease; background: rgba(15,23,42,.18); }
.qp-done-overlay.show { opacity:1; }
.qp-done-box {
  min-width: min(360px, 90vw);
  text-align:center;
  background:#ffffff;
  color:#0f172a;
  border-radius:30px;
  padding:30px 26px;
  box-shadow:0 30px 75px rgba(15,23,42,.28);
  transform: translateY(12px) scale(.94);
  transition: transform .24s ease;
}
.qp-done-overlay.show .qp-done-box { transform: translateY(0) scale(1); }
.qp-done-mark { width:78px; height:78px; margin:0 auto 12px; display:grid; place-items:center; border-radius:50%; background:linear-gradient(135deg,#22c55e,#16a34a); color:white; font-size:46px; font-weight:950; box-shadow:0 16px 35px rgba(34,197,94,.34); }
.qp-done-box h2 { margin:0 0 6px; font-size:38px; color:#0f172a; }
.qp-done-box p { margin:0; color:#475569; font-weight:800; }
@media (max-width: 760px) { .qp-save-choice-grid { grid-template-columns: 1fr; } .qp-save-modal { padding:18px; border-radius:24px; } }


/* QuizPulse clean-fast merged compatibility styles */

/* Merged mobile performance styles */
/* QuizPulse v1.6: professional UI cleanup + mobile-first performance layer */
:root {
  --qp-v16-radius: 18px;
  --qp-v16-card: #ffffff;
  --qp-v16-line: rgba(15, 23, 42, .10);
  --qp-v16-shadow: 0 12px 30px rgba(15, 23, 42, .08);
}

html { text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
img, video, canvas, svg { max-width: 100%; height: auto; }
button, a, input, select, textarea { touch-action: manipulation; }
.qp-btn { min-height: 42px; }
.qp-dashboard-main,
.qp-dashboard-content,
.qp-library-content-shell,
.qp-settings-card,
.qp-dashboard-settings,
.qp-game-card,
.qp-card,
.qp-editor,
.qp-question-stage { min-width: 0; }

/* Cleaner pages */
.qp-dashboard-topbar,
.qp-library-topbar,
.qp-dashboard-settings,
.qp-template-card,
.qp-library-card,
.qp-course-node,
.qp-subject-node,
.qp-settings-card,
.qp-stat-table-only,
.qp-auth-card,
.qp-game-card {
  border: 1px solid var(--qp-v16-line);
  box-shadow: var(--qp-v16-shadow);
}
.qp-dashboard-content,
.qp-library-content-shell { width: min(100%, 1500px); }
.qp-dashboard-hero-simple { overflow: hidden; }
.qp-dashboard-hero-simple h2,
.qp-dashboard-title-group h1,
.qp-library-title-group h1 { letter-spacing: -.04em; }
.qp-template-card,
.qp-library-card,
.qp-settings-card,
.qp-course-node,
.qp-subject-node { content-visibility: auto; contain-intrinsic-size: 260px; }

/* Statistics table is a clean, focused table */
.qp-stat-table-only { background: #fff; border-radius: 24px; padding: clamp(14px, 2vw, 24px); }
.qp-stat-filter-row { align-items: end; }
.qp-table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; border-radius: 18px; }
.qp-stat-table { min-width: 680px; border-collapse: separate; border-spacing: 0; }
.qp-stat-table th { position: sticky; top: 0; z-index: 1; background: #f8fafc; color: #0f172a; }
.qp-stat-table td, .qp-stat-table th { padding: 14px 16px; }
.qp-stat-table tbody tr:nth-child(even) { background: #f8fafc; }

/* Faster slow-network mode: less blur, fewer expensive shadows, less animation */
html[data-network="slow"] *,
html[data-network="save-data"] * {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}
html[data-network="slow"] .qp-dashboard-settings,
html[data-network="slow"] .qp-template-card,
html[data-network="slow"] .qp-library-card,
html[data-network="slow"] .qp-settings-card,
html[data-network="slow"] .qp-game-card,
html[data-network="save-data"] .qp-dashboard-settings,
html[data-network="save-data"] .qp-template-card,
html[data-network="save-data"] .qp-library-card,
html[data-network="save-data"] .qp-settings-card,
html[data-network="save-data"] .qp-game-card {
  box-shadow: 0 3px 12px rgba(15,23,42,.08) !important;
  backdrop-filter: none !important;
}
html[data-network="slow"] .qp-game-body::before,
html[data-network="save-data"] .qp-game-body::before { display: none !important; }

/* Mobile dashboard and account pages */
@media (max-width: 860px) {
  .qp-auth-body { min-height: 100dvh; }
  .qp-auth-shell { display: block !important; width: min(100%, 560px); margin: 0 auto; padding: 14px !important; }
  .qp-auth-hero { min-height: auto !important; padding: 20px 4px 8px !important; }
  .qp-auth-hero h1 { font-size: clamp(38px, 12vw, 62px) !important; line-height: .95; margin: 14px 0 10px; }
  .qp-auth-hero p:not(.qp-pill) { font-size: 16px; max-width: 34rem; }
  .qp-auth-card { border-radius: 26px !important; padding: 16px !important; }
  .qp-auth-tabs { gap: 6px; padding: 6px; }
  .qp-auth-tabs button { min-height: 48px; font-size: 14px; }

  .qp-dashboard-shell,
  .qp-dashboard-clean .qp-dashboard-shell { display: block !important; min-height: 100dvh; padding-bottom: 78px; }
  .qp-dashboard-sidebar {
    position: fixed !important;
    left: 10px; right: 10px; bottom: 10px; top: auto !important;
    height: 64px !important; width: auto !important;
    z-index: 1000;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 24px !important;
    padding: 6px !important;
    background: rgba(255,255,255,.94) !important;
    border: 1px solid rgba(15,23,42,.10) !important;
    box-shadow: 0 16px 40px rgba(15,23,42,.18) !important;
    backdrop-filter: blur(12px);
  }
  .qp-dashboard-logo { display: none !important; }
  .qp-dashboard-nav { display: flex !important; flex-direction: row !important; gap: 4px !important; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .qp-dashboard-nav::-webkit-scrollbar { display: none; }
  .qp-dashboard-nav a {
    min-width: 74px;
    flex: 1 0 auto;
    justify-content: center !important;
    padding: 9px 8px !important;
    border-radius: 18px !important;
    font-size: 11px !important;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
  }
  .qp-dashboard-nav a span { display: block; font-size: 18px; margin-bottom: 2px; }
  .qp-dashboard-main { width: 100%; }
  .qp-dashboard-topbar,
  .qp-library-topbar { position: sticky; top: 0; z-index: 20; border-radius: 0 0 24px 24px !important; padding: 14px !important; gap: 12px; flex-direction: column; align-items: stretch !important; }
  .qp-dashboard-title-group h1,
  .qp-library-title-group h1 { font-size: clamp(26px, 8vw, 42px) !important; }
  .qp-dashboard-title-group p,
  .qp-library-title-group p { font-size: 14px; }
  .qp-dashboard-top-actions,
  .qp-library-view-actions,
  .qp-home-hero-actions { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .qp-dashboard-top-actions .qp-btn,
  .qp-home-hero-actions .qp-btn { width: 100%; justify-content: center; }
  .qp-dashboard-content,
  .qp-library-content-shell { padding: 14px 12px 92px !important; }
  .qp-dashboard-hero-simple,
  .qp-dashboard-hero-v12 { grid-template-columns: 1fr !important; padding: 18px !important; border-radius: 24px !important; }
  .qp-dashboard-hero-simple h2 { font-size: clamp(30px, 10vw, 52px) !important; }
  .qp-dashboard-hero-status { display: none !important; }
  .qp-dashboard-stats,
  .qp-home-stats,
  .qp-system-stats,
  .qp-template-grid,
  .qp-library-grid,
  .qp-library-grid.small-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  .qp-section-title-row { align-items: stretch; flex-direction: column; }
  .qp-template-card,
  .qp-library-card,
  .qp-settings-card,
  .qp-dashboard-settings { border-radius: 22px !important; padding: 14px !important; }
}

/* Mobile library */
@media (max-width: 720px) {
  .qp-library-toolbar,
  .qp-stat-filter-row { display: grid !important; grid-template-columns: 1fr !important; gap: 10px !important; }
  .qp-library-tabs { display: flex; overflow-x: auto; }
  .qp-library-tabs button { min-width: 150px; }
  .qp-library-actions,
  .qp-library-card-top,
  .qp-library-meta { flex-direction: column; align-items: stretch !important; }
  .qp-course-node,
  .qp-subject-node { padding: 12px !important; border-radius: 20px !important; }
}

/* Mobile creator: prioritize editing, stack sidebars, keep actions reachable */
@media (max-width: 980px) {
  .qp-creator-body { overflow: auto !important; }
  .qp-world-topbar { position: sticky; top: 0; z-index: 100; gap: 8px; align-items: stretch !important; flex-wrap: wrap; padding: 8px !important; }
  .qp-top-left, .qp-top-actions, .qp-actions { flex-wrap: wrap; }
  .qp-title-chip { order: 3; width: 100%; min-width: 0; }
  .qp-title-input { font-size: 18px !important; }
  .qp-save-state { display: none; }
  .qp-creator-shell,
  .qp-creator-shell.left-collapsed,
  .qp-creator-shell.right-collapsed,
  .qp-creator-shell.left-collapsed.right-collapsed { display: grid !important; grid-template-columns: 1fr !important; height: auto !important; min-height: 100dvh; padding: 10px !important; gap: 10px !important; }
  .qp-side,
  .qp-advanced { max-height: 280px !important; border-radius: 20px !important; }
  .qp-editor { padding: 10px !important; border-radius: 20px !important; }
  .qp-editor-inner { max-width: 100%; }
  .qp-question-stage { padding: 12px !important; border-radius: 20px !important; }
  .qp-question-title { font-size: clamp(25px, 8vw, 44px) !important; min-height: 72px !important; }
  .qp-media-box { min-height: 120px !important; margin: 12px auto !important; }
  .qp-answer-grid,
  .qp-tf-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  .qp-answer-card { min-height: 104px !important; }
  .qp-properties-shell { grid-template-columns: 1fr !important; }
  .qp-properties-rail { display: grid !important; grid-template-columns: repeat(3, 1fr); border-left: 0 !important; border-top: 1px solid rgba(15,23,42,.1); }
  .qp-rail-btn { min-height: 52px; }
}

/* Mobile student/host game screens */
@media (max-width: 760px) {
  .qp-game-body { min-height: 100dvh; }
  .qp-game-topbar { position: sticky; top: 0; z-index: 50; padding: 8px 10px !important; flex-wrap: wrap; gap: 8px; }
  .qp-game-topbar .qp-brand span:last-child { font-size: 15px; }
  .qp-game-topbar .qp-actions { width: 100%; display: flex; overflow-x: auto; padding-bottom: 2px; }
  .qp-host-layout,
  .qp-student-shell,
  .qp-preview-shell { padding: 8px !important; min-height: calc(100dvh - 88px) !important; }
  .qp-game-card,
  .qp-student-card,
  .qp-card { border-radius: 22px !important; padding: 12px !important; width: 100% !important; }
  .qp-live-question,
  .qp-question-live,
  .qp-preview-question { font-size: clamp(28px, 10vw, 48px) !important; line-height: 1.05 !important; }
  .qp-live-answers,
  .qp-answer-options,
  .qp-player-answer-grid,
  .qp-preview-answers { grid-template-columns: 1fr !important; gap: 10px !important; }
  .qp-answer-option,
  .qp-player-choice,
  .qp-live-answer { min-height: 82px !important; border-radius: 18px !important; font-size: clamp(18px, 6vw, 28px) !important; }
  .qp-host-tabs { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 3px; }
  .qp-host-tabs button { min-width: 110px; }
  .qp-reading-modal-card,
  .qp-question-intro-card { width: min(94vw, 760px) !important; padding: 18px !important; border-radius: 24px !important; }
}

/* Reduce motion for accessibility and battery */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

/* Subject group management */
.qp-group-manager-card {
  grid-column: 1 / -1;
  width: 100%;
}
.qp-group-manager-head,
.qp-group-section-title,
.qp-group-roster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.qp-group-create-row {
  max-width: 720px;
}
.qp-group-manager-grid {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.25fr);
  gap: 18px;
  margin-top: 18px;
}
.qp-group-manager-grid > section {
  min-width: 0;
  border: 1px solid rgba(139, 92, 246, .16);
  border-radius: 24px;
  padding: 16px;
  background: rgba(250, 245, 255, .62);
}
.qp-group-section-title h3,
.qp-group-roster-head h4 {
  margin: 0;
}
.qp-group-section-title > span,
.qp-group-roster-head > span {
  color: #64748b;
  font-weight: 800;
  font-size: .82rem;
}
.qp-group-tree,
.qp-subgroup-list,
.qp-group-roster,
.qp-student-search-results {
  display: grid;
  gap: 9px;
}
.qp-group-tree {
  margin-top: 14px;
}
.qp-group-node {
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 20px;
  padding: 10px;
  background: #fff;
}
.qp-group-node.selected,
.qp-subgroup-row.selected {
  border-color: #7c3aed;
  box-shadow: 0 10px 28px rgba(109, 40, 217, .12);
}
.qp-group-node-main,
.qp-subgroup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.qp-group-node-main > button,
.qp-subgroup-row > button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  min-width: 0;
}
.qp-group-node-main > button > span:last-child,
.qp-subgroup-row > button {
  min-width: 0;
}
.qp-group-node-main b,
.qp-group-node-main small,
.qp-subgroup-row b,
.qp-subgroup-row small,
.qp-group-member-row b,
.qp-group-member-row small,
.qp-student-search-row b,
.qp-student-search-row small {
  display: block;
}
.qp-group-node-main small,
.qp-subgroup-row small,
.qp-group-member-row small,
.qp-student-search-row small {
  color: #64748b;
  font-size: .76rem;
}
.qp-group-node-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid !important;
  place-items: center;
  flex: none;
  color: #fff;
  font-weight: 950;
  background: linear-gradient(135deg, #6d28d9, #8b5cf6);
}
.qp-group-node-actions,
.qp-subgroup-row > div {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.qp-group-node-actions button,
.qp-subgroup-row > div button {
  border: 0;
  border-radius: 10px;
  padding: 7px 8px;
  background: #f5f3ff;
  color: #4c1d95;
  cursor: pointer;
  font-weight: 850;
  font-size: .72rem;
}
.qp-group-node-actions button.danger,
.qp-subgroup-row > div button.danger {
  color: #b91c1c;
  background: #fef2f2;
}
.qp-subgroup-list {
  margin: 9px 0 0 28px;
}
.qp-subgroup-row {
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 15px;
  background: #fafafa;
}
.qp-subgroup-row > button > span {
  color: #7c3aed;
  font-weight: 950;
  font-size: .7rem;
  text-transform: uppercase;
}
.qp-group-search-box {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid rgba(139, 92, 246, .15);
  border-radius: 18px;
  background: #fff;
}
.qp-group-search-box .qp-actions {
  align-items: stretch;
}
.qp-group-search-box .qp-actions .qp-input {
  width: auto;
  min-width: 170px;
}
.qp-student-search-results,
.qp-group-roster {
  max-height: 330px;
  overflow: auto;
  padding-right: 3px;
}
.qp-student-search-row,
.qp-group-member-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 15px;
  background: #fff;
  cursor: pointer;
}
.qp-student-search-row {
  grid-template-columns: auto 1fr;
}
.qp-student-search-row input,
.qp-group-member-row input {
  width: 18px;
  height: 18px;
  accent-color: #7c3aed;
}
.qp-group-member-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #f5f3ff;
}
.qp-group-roster-head {
  margin-bottom: 10px;
}
.qp-group-import-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(15, 23, 42, .68);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity .15s ease;
}
.qp-group-import-overlay[hidden] {
  display: none;
}
.qp-group-import-overlay.show {
  opacity: 1;
}
.qp-group-import-dialog {
  width: min(1180px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border-radius: 28px;
  padding: 22px;
  background: linear-gradient(135deg, #fff, #faf5ff);
  box-shadow: 0 36px 110px rgba(15, 23, 42, .42);
}
.qp-group-import-head,
.qp-group-import-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.qp-group-import-head h2 {
  margin: 8px 0 4px;
}
.qp-group-import-head p,
.qp-group-import-mapping p {
  margin: 0;
  color: #64748b;
}
.qp-group-import-mapping {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(139, 92, 246, .16);
  border-radius: 20px;
  background: rgba(245, 243, 255, .72);
}
.qp-group-import-mapping h3 {
  margin: 0 0 4px;
}
.qp-group-import-mapping > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.qp-group-import-mapping label {
  display: grid;
  gap: 5px;
}
.qp-group-import-mapping label span {
  font-weight: 900;
}
.qp-import-summary,
.qp-import-new-items {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 16px;
  margin-bottom: 12px;
}
.qp-import-summary {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.qp-import-summary.has-errors {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.qp-import-new-items {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
}
.qp-import-new-items span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #fef3c7;
  font-weight: 850;
  font-size: .8rem;
}
.qp-group-import-table-wrap {
  overflow: auto;
  max-height: 48vh;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 18px;
}
.qp-group-import-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}
.qp-group-import-table th,
.qp-group-import-table td {
  padding: 9px;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
  text-align: left;
  vertical-align: middle;
}
.qp-group-import-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}
.qp-group-import-table tr.invalid {
  background: #fff7ed;
}
.qp-group-import-table .qp-input {
  min-width: 150px;
  padding: 9px 10px;
}
.qp-row-valid {
  color: #047857;
  font-weight: 850;
}
.qp-row-error {
  color: #b91c1c;
  font-weight: 850;
  font-size: .8rem;
}
.qp-group-import-actions {
  justify-content: flex-end;
  margin-top: 16px;
}


@media (max-width: 900px) {
  .qp-group-manager-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 680px) {
  .qp-group-import-mapping > div {
    grid-template-columns: 1fr;
  }
  .qp-group-node-main,
  .qp-subgroup-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .qp-subgroup-list {
    margin-left: 10px;
  }
  .qp-group-search-box .qp-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}


/* Merged server-ready styles */
/* QuizPulse v1.9.2 question-engine polish */
:root {
  --qp-mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
}

.qp-server-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border-radius: 28px;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  color: #fff;
  box-shadow: 0 20px 45px rgba(30, 64, 175, .22);
}
.qp-server-hero h2 { margin: 8px 0 6px; font-size: clamp(1.6rem, 4vw, 2.6rem); }
.qp-server-hero p { margin: 0; color: rgba(255,255,255,.88); }
.qp-server-pulse { width: 74px; height: 74px; border-radius: 24px; display:grid; place-items:center; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); font-size: 2.2rem; font-weight: 900; }
.qp-status-grid { margin-top: 18px; }
.qp-link-list { display: grid; gap: 10px; }
.qp-link-row { display: grid; grid-template-columns: 100px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid rgba(15,23,42,.10); border-radius: 16px; background: rgba(255,255,255,.78); }
.qp-link-row span { font-weight: 800; color: #334155; }
.qp-link-row code { overflow-wrap: anywhere; color: #111827; background: #f8fafc; border: 1px solid #e2e8f0; padding: 8px 10px; border-radius: 12px; }
.qp-btn.small { padding: 8px 10px; min-height: 36px; }
.qp-backup-drop { border: 2px dashed rgba(99,102,241,.35); border-radius: 18px; padding: 16px; background: rgba(99,102,241,.06); }
.qp-backup-drop input[type="file"] { width: 100%; }
.qp-backup-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top: 12px; }
.qp-backup-list { display:grid; gap:8px; margin-top:12px; max-height: 220px; overflow:auto; }
.qp-backup-list .qp-system-row { border-radius: 14px; }

/* Mobile-first classroom speed/readability */
@media (max-width: 760px) {
  .qp-dashboard-shell { display: block; min-height: 100dvh; }
  .qp-dashboard-sidebar { position: sticky; top: 0; z-index: 20; width: auto; min-height: auto; border-radius: 0 0 22px 22px; padding: 10px; }
  .qp-dashboard-logo { justify-content: center; margin-bottom: 8px; }
  .qp-dashboard-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .qp-dashboard-nav a { justify-content: center; padding: 10px 8px; font-size: .82rem; border-radius: 14px; }
  .qp-dashboard-nav a span { display:none; }
  .qp-dashboard-main { padding: 12px; }
  .qp-dashboard-topbar { position: static; display: grid; gap: 12px; padding: 14px; border-radius: 22px; }
  .qp-dashboard-top-actions { justify-content: stretch; }
  .qp-dashboard-top-actions .qp-btn { flex: 1; }
  .qp-dashboard-content { padding: 12px 0 calc(18px + var(--qp-mobile-safe-bottom)); }
  .qp-dashboard-hero-simple, .qp-server-hero { grid-template-columns: 1fr; border-radius: 22px; padding: 18px; }
  .qp-home-hero-actions, .qp-actions, .qp-backup-actions { display: grid !important; grid-template-columns: 1fr; width:100%; }
  .qp-btn, button.qp-btn, a.qp-btn { min-height: 48px; font-size: 1rem; }
  .qp-settings-grid, .qp-dashboard-stats, .qp-template-grid { grid-template-columns: 1fr !important; }
  .qp-link-row { grid-template-columns: 1fr; }
  .qp-link-row .qp-btn { width: 100%; }
  .qp-game-card, .qp-student-card { width: min(100%, 96vw); border-radius: 24px; padding: 18px; }
  .qp-answer-grid, .qp-choice-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .qp-answer-card, .qp-choice-card, .qp-player-answer { min-height: 64px; font-size: 1rem; }
}

/* Slow-network mode: fewer expensive effects */
html[data-network="slow"] *, html[data-network="save-data"] * { animation-duration: .001ms !important; transition-duration: .08s !important; }
html[data-network="slow"] .qp-dashboard-hero-simple,
html[data-network="slow"] .qp-settings-card,
html[data-network="save-data"] .qp-dashboard-hero-simple,
html[data-network="save-data"] .qp-settings-card { box-shadow: none !important; backdrop-filter: none !important; }


/* v1.9.5 Minimal App UI: profile moved into main Settings and cards grouped by purpose */
.qp-settings-v193 {
  display: grid;
  gap: 22px;
}
.qp-settings-quick-nav {
  position: sticky;
  top: 10px;
  z-index: 5;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px;
  border-radius: 22px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(221,214,254,.75);
  box-shadow: 0 12px 32px rgba(42,17,101,.08);
  backdrop-filter: blur(14px);
}
.qp-settings-quick-nav a {
  text-decoration: none;
  color: #3b0764;
  font-weight: 1000;
  padding: 10px 14px;
  border-radius: 16px;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
}
.qp-settings-quick-nav a:hover { background: #ede9fe; }
.qp-settings-section {
  scroll-margin-top: 90px;
  display: grid;
  gap: 14px;
}
.qp-settings-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 2px;
}
.qp-settings-section-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: linear-gradient(135deg, #ede9fe, #dbeafe);
  border: 1px solid #ddd6fe;
  box-shadow: 0 12px 28px rgba(42,17,101,.09);
}
.qp-settings-section-head h2 {
  margin: 0;
  color: #22125d;
  letter-spacing: -.03em;
}
.qp-settings-section-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-weight: 800;
}
.qp-settings-v193 .qp-settings-card h3 {
  font-size: 24px;
  margin: 0 0 8px;
  color: #22125d;
  letter-spacing: -.02em;
}
.qp-settings-card-wide { grid-column: 1 / -1; }
.qp-settings-button-grid,
.qp-settings-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.qp-settings-profile-form { margin-top: 14px; }
.qp-settings-profile-actions { margin-top: 12px; }
.qp-settings-v193 .qp-socket-settings-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}


@media (max-width: 720px) {
  .qp-settings-quick-nav { position: static; }
  .qp-settings-section-head { align-items: flex-start; }
  .qp-settings-section-icon { width: 46px; height: 46px; font-size: 24px; border-radius: 16px; }
  .qp-settings-profile-actions .qp-btn,
  .qp-settings-button-grid .qp-btn { flex: 1 1 140px; }
}

/* v1.9.5 Minimal App UI: consistent cards, lighter actions, skeleton states */
:root {
  --qp-card-radius: 22px;
  --qp-card-border: rgba(109, 40, 217, .13);
  --qp-card-shadow: 0 12px 30px rgba(42, 17, 101, .075);
  --qp-card-shadow-hover: 0 18px 42px rgba(42, 17, 101, .11);
}
.qp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  line-height: 1.1;
}
.qp-btn:not(.primary):not(.success):not(.danger):not(.gold):not(.white) {
  background: rgba(255,255,255,.92);
}
.qp-btn.subtle {
  box-shadow: none;
  background: #f8fafc;
  color: #475569;
}
.qp-btn.soft-primary {
  background: #f3edff;
  color: #4c1d95;
  border-color: #ddd6fe;
  box-shadow: none;
}
.qp-section-title-row h2,
.qp-dashboard-title-group h1,
.qp-library-title-group h1 {
  letter-spacing: -.035em;
}
.qp-dashboard-settings,
.qp-template-card,
.qp-library-card,
.qp-kahoot-quiz-card,
.qp-quick-card,
.qp-settings-card,
.qp-card {
  border-radius: var(--qp-card-radius);
  border-color: var(--qp-card-border);
  box-shadow: var(--qp-card-shadow);
}
.qp-template-card:hover,
.qp-library-card:hover,
.qp-kahoot-quiz-card:hover,
.qp-quick-card:hover,
.qp-settings-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--qp-card-shadow-hover);
}
.qp-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 110px;
  background: rgba(255,255,255,.70);
}
.qp-empty::before {
  content: '○';
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: #f5f3ff;
  color: #6d28d9;
  font-weight: 1000;
}
.qp-loading-line,
.qp-skeleton-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #f2eefc 0%, #ffffff 48%, #f2eefc 100%);
  background-size: 220% 100%;
  animation: qpSkeleton 1.25s ease-in-out infinite;
}
.qp-loading-line {
  height: 14px;
  border-radius: 999px;
  min-width: 90px;
}
.qp-skeleton-card {
  min-height: 156px;
  border-radius: var(--qp-card-radius);
  border: 1px solid #e9ddff;
  box-shadow: var(--qp-card-shadow);
}
.qp-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  width: 100%;
}
@keyframes qpSkeleton { to { background-position: -220% 0; } }
.qp-page-intro-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 24px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(109,40,217,.13);
  box-shadow: var(--qp-card-shadow);
  margin-bottom: 18px;
}
.qp-page-intro-card h2 { margin: 0 0 4px; color: #2e1065; }
.qp-page-intro-card p { margin: 0; color: #64748b; font-weight: 750; }
.qp-dashboard-hero-simple {
  border-radius: 26px;
  padding: clamp(24px, 3.5vw, 38px);
}
.qp-dashboard-hero-simple h2 {
  max-width: 760px;
  font-size: clamp(30px, 3.8vw, 48px);
}
.qp-dashboard-hero-status {
  min-height: 150px;
}
.qp-dashboard-hero-status strong { font-size: 52px; }
.qp-home-hero-actions .qp-btn { min-width: 126px; }
.qp-dashboard-stats {
  gap: 14px;
}
.qp-dashboard-stats div {
  background: rgba(255,255,255,.84);
  border-color: rgba(109,40,217,.12);
  box-shadow: 0 8px 20px rgba(42,17,101,.055);
}
.qp-dashboard-stats strong { font-size: 26px; }
.qp-template-card,
.qp-library-card {
  gap: 10px;
}
.qp-template-card h3,
.qp-library-card h3 {
  font-size: 20px;
  line-height: 1.25;
}
.qp-template-card p,
.qp-library-card p {
  min-height: 0;
}
.qp-library-actions,
.qp-actions.wrap {
  gap: 8px;
}
.qp-actions.wrap .qp-btn.small,
.qp-library-actions .qp-btn.small {
  flex: 1 1 auto;
}
.qp-kahoot-card-actions .qp-btn.small:first-child,
.qp-actions.wrap .qp-btn.primary,
.qp-library-actions .qp-btn.primary {
  flex-basis: 100%;
}
.qp-danger-zone,
.qp-settings-card.danger-zone {
  border-style: dashed;
  border-color: rgba(220,38,38,.28);
  background: #fff8f8;
}
.qp-settings-quick-nav {
  gap: 8px;
}
.qp-settings-quick-nav a {
  border-radius: 999px;
  padding: 10px 14px;
}


@media (max-width: 760px) {
  .qp-page-intro-card { align-items: stretch; flex-direction: column; padding: 16px; }
  .qp-dashboard-hero-simple { grid-template-columns: 1fr; }
  .qp-dashboard-hero-status { max-width: none; min-height: 118px; }
  .qp-dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qp-template-card .qp-btn,
  .qp-library-card .qp-btn,
  .qp-home-hero-actions .qp-btn { width: 100%; }
}
@media (max-width: 460px) {
  .qp-dashboard-stats { grid-template-columns: 1fr; }
}

/* v1.9.5 Minimal App UI: keep only necessary visible copy */
.qp-minimal-ui .qp-dashboard-title-group p:empty,
.qp-minimal-ui .qp-section-title-row p:empty,
.qp-minimal-ui .qp-settings-section-head p:empty,
.qp-minimal-ui .qp-settings-card > p:empty,
.qp-minimal-ui .qp-prop-subtitle:empty { display: none !important; }
.qp-minimal-ui .qp-dashboard-title-group p,
.qp-minimal-ui .qp-section-title-row p,
.qp-minimal-ui .qp-settings-section-head p,
.qp-minimal-ui .qp-auth-hero p:not(.qp-pill),
.qp-minimal-ui .qp-template-card p,
.qp-minimal-ui .qp-library-card p,
.qp-minimal-ui .qp-page-intro-card p {
  display: none !important;
}
.qp-minimal-ui .qp-dashboard-hero-simple p:not(.qp-pill),
.qp-minimal-ui .qp-dashboard-hero-status span:last-child,
.qp-minimal-ui .qp-settings-card > .qp-muted,
.qp-minimal-ui .qp-backup-drop .qp-muted,
.qp-minimal-ui .qp-account-settings-head .qp-muted,
.qp-minimal-ui .qp-auth-warning.soft:empty {
  display: none !important;
}
.qp-minimal-ui .qp-dashboard-topbar,
.qp-minimal-ui .qp-section-title-row,
.qp-minimal-ui .qp-settings-section-head {
  margin-bottom: 12px;
}
.qp-minimal-ui .qp-dashboard-title-group h1,
.qp-minimal-ui .qp-section-title-row h2,
.qp-minimal-ui .qp-settings-section-head h2 {
  margin-bottom: 0;
}
.qp-minimal-ui .qp-dashboard-hero-simple {
  min-height: 0;
  padding: clamp(18px, 3vw, 28px);
}
.qp-minimal-ui .qp-dashboard-hero-simple h2 {
  margin-bottom: 14px;
}
.qp-minimal-ui .qp-dashboard-hero-status {
  min-height: 116px;
  padding: 18px;
}
.qp-minimal-ui .qp-dashboard-settings,
.qp-minimal-ui .qp-settings-card,
.qp-minimal-ui .qp-template-card,
.qp-minimal-ui .qp-library-card {
  padding: 18px;
}
.qp-minimal-ui .qp-settings-card h3,
.qp-minimal-ui .qp-library-card h3,
.qp-minimal-ui .qp-template-card h3 {
  margin-bottom: 10px;
}
.qp-minimal-ui .qp-settings-card .qp-label,
.qp-minimal-ui .qp-settings-card label {
  font-size: 13px;
}
.qp-minimal-ui .qp-btn {
  min-height: 40px;
  padding-inline: 14px;
}
.qp-minimal-ui .qp-btn.small { min-height: 34px; padding-inline: 10px; }
.qp-minimal-ui .qp-empty { min-height: 88px; font-weight: 900; }
.qp-minimal-ui .qp-empty::before { width: 34px; height: 34px; border-radius: 13px; }
.qp-minimal-ui .qp-settings-quick-nav a { padding: 8px 12px; }
.qp-minimal-ui .qp-system-row { padding-block: 8px; }
.qp-minimal-ui .qp-dashboard-nav a { min-height: 42px; }


/* v1.9.8 Profile redesign: TryHackMe-inspired structure with QuizPulse identity */
.qp-settings-v195 #profileCard.qp-settings-card.big {
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.qp-profile-redesign {
  display: grid;
  gap: 18px;
}
.qp-profile-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .9fr);
  gap: 28px;
  align-items: center;
  padding: clamp(24px, 4vw, 42px);
  border-radius: 30px;
  color: #fff;
  background:
    radial-gradient(circle at 16% 12%, rgba(167,139,250,.55), transparent 32%),
    radial-gradient(circle at 78% 28%, rgba(255,255,255,.12), transparent 26%),
    linear-gradient(135deg, #180b38 0%, #4c1d95 48%, #7c3aed 100%);
  box-shadow: 0 24px 70px rgba(42,17,101,.24);
  border: 1px solid rgba(255,255,255,.18);
}
.qp-profile-identity {
  display: flex;
  align-items: center;
  gap: clamp(22px, 4vw, 46px);
  min-width: 0;
}
.qp-profile-avatar-stack {
  position: relative;
  flex: 0 0 auto;
  width: clamp(132px, 15vw, 188px);
  height: clamp(132px, 15vw, 188px);
}
.qp-profile-avatar-ring {
  width: 100%;
  height: 100%;
  border-radius: 42px;
  display: grid;
  place-items: center;
  font-size: clamp(68px, 8vw, 102px);
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(237,233,254,.92));
  border: 6px solid rgba(255,255,255,.34);
  box-shadow: 0 24px 60px rgba(0,0,0,.28), inset 0 0 0 1px rgba(109,40,217,.18);
}
.qp-profile-crown {
  position: absolute;
  left: -12px;
  top: -16px;
  z-index: 2;
  width: 60px;
  height: 60px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: linear-gradient(135deg, #facc15, #f97316);
  box-shadow: 0 18px 34px rgba(249,115,22,.35);
  transform: rotate(-10deg);
}
.qp-profile-name-block {
  min-width: 0;
}
.qp-profile-mini-chip,
.qp-profile-role-row span,
.qp-profile-role-row b {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 1000;
}
.qp-profile-mini-chip {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  margin-bottom: 14px;
}
.qp-profile-name-block h2 {
  margin: 0;
  font-size: clamp(38px, 5vw, 64px);
  letter-spacing: -.055em;
  line-height: .95;
  color: #fff;
}
.qp-profile-handle {
  margin-top: 16px;
  color: rgba(255,255,255,.72);
  font-size: clamp(16px, 1.6vw, 22px);
  font-weight: 850;
  overflow-wrap: anywhere;
}
.qp-profile-role-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.qp-profile-role-row span { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.20); }
.qp-profile-role-row b { background: rgba(255,255,255,.92); color: #4c1d95; }
.qp-profile-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.qp-profile-hero-btn {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.12);
  color: #fff;
  text-decoration: none;
  font-weight: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.qp-profile-hero-btn.primary {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #2e1065;
  border-color: rgba(250,204,21,.7);
  box-shadow: 0 14px 30px rgba(245,158,11,.26);
}
.qp-profile-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.qp-profile-stat-card {
  min-height: 132px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border-radius: 20px;
  background: rgba(15,23,42,.36);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.qp-profile-stat-card > span { font-size: 38px; line-height: 1; }
.qp-profile-stat-card div { display: grid; gap: 4px; }
.qp-profile-stat-card small { color: rgba(255,255,255,.82); font-size: 20px; font-weight: 850; }
.qp-profile-stat-card strong { color: #fff; font-size: clamp(30px, 3vw, 44px); line-height: .95; letter-spacing: -.035em; }
.qp-profile-stat-card em { color: #facc15; font-style: normal; font-weight: 1000; text-transform: uppercase; font-size: 13px; }
.qp-profile-tabs {
  display: flex;
  gap: 22px;
  align-items: center;
  overflow-x: auto;
  padding: 14px 4px 0;
  border-bottom: 1px solid #e5e7eb;
}
.qp-profile-tabs a {
  white-space: nowrap;
  text-decoration: none;
  color: #475569;
  font-weight: 950;
  padding: 0 0 14px;
  border-bottom: 3px solid transparent;
}
.qp-profile-tabs a.active { color: #2e1065; border-color: #6d28d9; }
.qp-profile-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .8fr);
  gap: 16px;
}
.qp-profile-panel {
  padding: 20px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid rgba(109,40,217,.14);
  box-shadow: var(--qp-card-shadow);
}
.qp-profile-panel-dark {
  background: #111827;
  color: #fff;
  border-color: rgba(255,255,255,.08);
}
.qp-profile-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-weight: 1000;
  color: #2e1065;
}
.qp-profile-panel-head b {
  border-radius: 999px;
  padding: 7px 12px;
  background: #f5f3ff;
  color: #5b21b6;
}
.qp-profile-panel-dark .qp-profile-panel-head { color: #fff; }
.qp-profile-panel-dark .qp-profile-panel-head b { background: rgba(250,204,21,.16); color: #fde68a; }
.qp-profile-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.qp-profile-activity-list { display: grid; gap: 10px; }
.qp-profile-activity-list div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.08);
}
.qp-profile-activity-list span { color: rgba(255,255,255,.72); font-weight: 850; }
.qp-profile-activity-list b { color: #fff; font-size: 20px; }
.qp-profile-legacy-note {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 18px;
  background: #f8fafc;
  color: #475569;
}
.qp-settings-avatar-picker.qp-auth-avatar-picker { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }


@media (max-width: 1120px) {
  .qp-profile-hero-card { grid-template-columns: 1fr; }
  .qp-profile-stat-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .qp-profile-stat-card { min-height: 120px; flex-direction: column; align-items: flex-start; }
}
@media (max-width: 820px) {
  .qp-profile-identity { flex-direction: column; align-items: flex-start; }
  .qp-profile-stat-grid,
  .qp-profile-lower-grid,
  .qp-profile-form-grid { grid-template-columns: 1fr; }
  .qp-profile-name-block h2 { font-size: clamp(32px, 11vw, 46px); }
  .qp-profile-hero-card { padding: 22px; border-radius: 24px; }
  .qp-profile-avatar-stack { width: 128px; height: 128px; }
  .qp-profile-avatar-ring { border-radius: 32px; font-size: 64px; }
}

/* v1.9.9 Settings Pro Redesign */
.qp-settings-pro-body .qp-dashboard-main { background: linear-gradient(135deg, #f8fafc 0%, #f5f3ff 56%, #eef2ff 100%); }
.qp-settings-pro { display: grid; gap: 18px; }
.qp-settings-pro-topbar { border-bottom-color: rgba(109,40,217,.12); }
.qp-settings-pro-hero,
.qp-settings-tab-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  padding: clamp(22px, 3vw, 34px);
  border-radius: 30px;
  color: #fff;
  background:
    radial-gradient(circle at 14% 18%, rgba(167,139,250,.58), transparent 30%),
    radial-gradient(circle at 82% 16%, rgba(14,165,233,.24), transparent 26%),
    linear-gradient(135deg, #111827 0%, #2e1065 46%, #6d28d9 100%);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 24px 70px rgba(42,17,101,.20);
}
.qp-settings-tab-hero.compact { min-height: 152px; align-items: flex-end; }
.qp-settings-tab-hero span,
.qp-settings-eyebrow {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.92);
  font-weight: 1000;
}
.qp-settings-tab-hero h2,
.qp-settings-pro-hero h2 {
  margin: 10px 0 0;
  color: #fff;
  font-size: clamp(34px, 4vw, 56px);
  letter-spacing: -.055em;
  line-height: .95;
}
.qp-settings-pro-hero p { margin: 10px 0 0; color: rgba(255,255,255,.72); font-weight: 850; font-size: 17px; }
.qp-settings-hero-left { display: flex; align-items: center; gap: 18px; min-width: 0; }
.qp-settings-hero-avatar {
  width: clamp(78px, 8vw, 112px);
  height: clamp(78px, 8vw, 112px);
  border-radius: 26px;
  display: grid;
  place-items: center;
  font-size: clamp(42px, 5vw, 68px);
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(237,233,254,.92));
  color: #4c1d95;
  border: 4px solid rgba(255,255,255,.30);
  box-shadow: 0 20px 45px rgba(0,0,0,.24);
  flex: 0 0 auto;
}
.qp-settings-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(115px, 1fr));
  gap: 12px;
  min-width: min(460px, 44vw);
}
.qp-settings-hero-stats div {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(15,23,42,.40);
  border: 1px solid rgba(255,255,255,.10);
  display: grid;
  gap: 4px;
}
.qp-settings-hero-stats span { color: rgba(255,255,255,.70); font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.qp-settings-hero-stats b { color: #fff; font-weight: 1000; font-size: clamp(20px, 2vw, 30px); }
.qp-settings-pro-tabs {
  position: sticky;
  top: 10px;
  z-index: 4;
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 24px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(109,40,217,.13);
  box-shadow: 0 14px 34px rgba(42,17,101,.08);
  backdrop-filter: blur(14px);
  overflow-x: auto;
}
.qp-settings-pro-tabs button {
  border: 0;
  cursor: pointer;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 16px;
  background: transparent;
  color: #475569;
  font-weight: 1000;
  white-space: nowrap;
}
.qp-settings-pro-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, #4c1d95, #7c3aed);
  box-shadow: 0 12px 26px rgba(109,40,217,.22);
}
.qp-settings-pro-panel { display: grid; gap: 18px; }
.qp-settings-pro-loading {
  min-height: 240px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(109,40,217,.13);
  font-weight: 1000;
  color: #4c1d95;
}
.qp-settings-pro-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(320px,.8fr); gap: 16px; }
.qp-settings-pro-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.qp-settings-account-hero { grid-template-columns: minmax(0, 1.25fr) minmax(320px, .85fr); }
.qp-settings-account-hero .qp-profile-hero-actions { margin-top: 18px; }
.qp-settings-mini-stat {
  min-height: 116px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(15,23,42,.36);
  border: 1px solid rgba(255,255,255,.10);
}
.qp-settings-mini-stat > span { font-size: 32px; }
.qp-settings-mini-stat small { color: rgba(255,255,255,.72); font-size: 15px; font-weight: 900; }
.qp-settings-mini-stat b { display:block; color:#fff; font-size: 30px; font-weight:1000; letter-spacing:-.03em; }
.qp-settings-mini-stat em { color:#facc15; font-style: normal; font-weight:1000; font-size:12px; text-transform: uppercase; }
.qp-settings-simple-list { display: grid; gap: 8px; }
.qp-settings-danger-card details,
.qp-settings-admin-card details,
.qp-settings-details {
  border: 1px solid rgba(109,40,217,.13);
  background: rgba(248,250,252,.85);
  border-radius: 18px;
  padding: 12px 14px;
}
.qp-settings-danger-card summary,
.qp-settings-admin-card summary,
.qp-settings-details summary {
  cursor: pointer;
  font-weight: 1000;
  color: #4c1d95;
}
.qp-settings-danger-card p { color: #64748b; font-weight: 800; margin: 12px 0; }
.qp-theme-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.qp-theme-choice {
  min-height: 145px;
  border: 1px solid rgba(109,40,217,.16);
  border-radius: 22px;
  background: linear-gradient(135deg, #fff, #f5f3ff);
  box-shadow: var(--qp-card-shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 8px;
  color: #2e1065;
  font-weight: 1000;
}
.qp-theme-choice span { font-size: 42px; }
.qp-theme-choice.dark { background: linear-gradient(135deg, #0f172a, #2e1065); color: #fff; }
.qp-theme-choice.alkafeel { background: linear-gradient(135deg, #e0f7ff, #e8fff4); color: #063a59; }
.qp-settings-audio-slot .qp-audio-controls { display: flex; flex-wrap: wrap; gap: 12px; }
.qp-settings-audio-slot .qp-audio-toggle {
  min-height: 52px;
  border-radius: 999px;
  border: 1px solid #ddd6fe;
  background: #f5f3ff;
  color: #4c1d95;
  font-weight: 1000;
  padding: 0 18px;
}
.qp-settings-audio-slot .qp-audio-toggle.is-off { background: #f8fafc; color: #64748b; }
.qp-live-audio-settings-card { grid-column: 1 / -1; }
.qp-live-audio-master { margin: 8px 0 14px; }
.qp-live-audio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.qp-live-audio-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(109,40,217,.14);
  background: linear-gradient(135deg, #fff, #f8fafc);
}
.qp-live-audio-slot.has-custom {
  border-color: rgba(22,163,74,.28);
  background: linear-gradient(135deg, #f0fdf4, #fff);
}
.qp-live-audio-slot b,
.qp-live-audio-slot span,
.qp-live-audio-slot small {
  display: block;
}
.qp-live-audio-slot b { color: #111827; font-weight: 1000; }
.qp-live-audio-slot span {
  max-width: 52ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4c1d95;
  font-weight: 950;
}
.qp-live-audio-slot small { margin-top: 4px; color: #64748b; font-weight: 800; }
.qp-live-audio-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.qp-live-audio-note { margin: 10px 0 0; }
.qp-live-audio-note b { color: #2e1065; }
@media (max-width: 760px) {
  .qp-live-audio-grid { grid-template-columns: 1fr; }
  .qp-live-audio-slot { align-items: stretch; flex-direction: column; }
  .qp-live-audio-actions { justify-content: flex-start; }
}
.qp-settings-preview-card { grid-column: 1 / -1; }
.qp-settings-preview-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 120px;
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, #f5f3ff, #fff);
  border: 1px solid rgba(109,40,217,.13);
}
.qp-settings-preview-mini small { display:block; color:#64748b; font-weight:900; }
.qp-settings-preview-mini b { display:block; margin-top:6px; font-size:24px; color:#2e1065; }
.qp-settings-tab-view { display: grid; gap: 16px; }


@media (max-width: 1120px) {
  .qp-settings-pro-hero { align-items: flex-start; flex-direction: column; }
  .qp-settings-hero-stats { width: 100%; min-width: 0; }
  .qp-settings-pro-grid,
  .qp-settings-pro-grid.two,
  .qp-settings-account-hero { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .qp-settings-pro-tabs { position: static; }
  .qp-settings-hero-left { align-items: flex-start; }
  .qp-settings-hero-stats,
  .qp-theme-choice-grid { grid-template-columns: 1fr; }
  .qp-settings-pro-hero,
  .qp-settings-tab-hero { border-radius: 24px; padding: 20px; }
  .qp-settings-tab-hero.compact { min-height: 130px; }
  .qp-global-values-hero {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
  .qp-global-values-hero h2 {
    font-size: clamp(32px, 11vw, 44px);
    line-height: 1;
  }
  .qp-settings-preview-mini { display: grid; }
}

/* QuizPulse page transitions -------------------------------------------------
   Lightweight transitions for this multi-page app. The JS fallback handles
   browsers that do not support cross-document View Transitions yet. */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: qp-view-out .22s var(--qp-ease) both;
}
::view-transition-new(root) {
  animation: qp-view-in .38s var(--qp-ease) both;
}

html.qp-js-ready body {
  backface-visibility: hidden;
  transform-origin: 50% 44%;
}

html.qp-js-ready body.qp-page-entering {
  opacity: 0;
  transform: translateY(14px) scale(.985);
}

html.qp-js-ready body.qp-page-ready:not(.qp-page-leaving) {
  animation: qp-page-in .42s var(--qp-ease) both;
}

html.qp-js-ready body.qp-page-leaving {
  pointer-events: none;
  animation: qp-page-out .22s var(--qp-ease) both;
}

html.qp-js-ready body.qp-page-leaving .qp-topbar,
html.qp-js-ready body.qp-page-leaving .qp-dashboard-shell,
html.qp-js-ready body.qp-page-leaving .qp-game-shell,
html.qp-js-ready body.qp-page-leaving .qp-container,
html.qp-js-ready body.qp-page-leaving .qp-auth-shell {
  filter: blur(.25px);
}

@keyframes qp-page-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes qp-page-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(.992); }
}

@keyframes qp-view-in {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes qp-view-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(.992); }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-old(root),
  ::view-transition-new(root),
  html.qp-js-ready body.qp-page-ready:not(.qp-page-leaving),
  html.qp-js-ready body.qp-page-leaving {
    animation: none !important;
  }
  html.qp-js-ready body,
  html.qp-js-ready body.qp-page-entering,
  html.qp-js-ready body.qp-page-leaving {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* v1.10.3 UI Consistency Patch: unified action buttons and create flow */
.qp-btn,
button.qp-btn,
a.qp-btn {
  border-radius: 14px;
  font-weight: 900;
  letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
}
.qp-btn.secondary,
.qp-btn:not(.primary):not(.success):not(.danger):not(.ghost):not(.icon) {
  color: #3b0764;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(109,40,217,.16);
  box-shadow: 0 8px 18px rgba(42,17,101,.065);
}
.qp-btn.ghost {
  color: #4c1d95;
  background: rgba(245,243,255,.72);
  border: 1px solid rgba(109,40,217,.14);
  box-shadow: none;
}
.qp-btn.gold,
.qp-btn.white {
  background: rgba(255,255,255,.94);
  color: #3b0764;
  border-color: rgba(109,40,217,.16);
}
.qp-btn.is-loading,
.qp-btn[aria-busy="true"] {
  pointer-events: none;
  opacity: .72;
  cursor: progress;
}
.qp-btn:disabled,
button.qp-btn:disabled {
  opacity: .62;
  cursor: not-allowed;
  transform: none;
}
.qp-dashboard-nav a {
  min-height: 42px;
  white-space: nowrap;
}
.qp-dashboard-nav a[data-create-quiz] {
  font-weight: 1000;
}
.qp-dashboard-top-actions:empty { display: none; }
.qp-create-modal-card {
  border-radius: 28px;
  overflow: hidden;
}
.qp-create-modal-head p:not(.qp-pill) {
  margin: 6px 0 0;
  color: #64748b;
  font-weight: 700;
}
.qp-create-option {
  border-radius: 22px;
  min-height: 250px;
  box-shadow: 0 12px 30px rgba(42,17,101,.075);
}
.qp-create-option.featured::before {
  border-radius: 22px 22px 0 0;
  background: linear-gradient(135deg, #6d28d9, #2563eb);
}
.qp-create-option-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #6d28d9, #2563eb);
  font-size: 12px;
  font-weight: 1000;
  margin-top: 4px;
}
.qp-create-template-grid a {
  min-height: 36px;
  display: grid;
  place-items: center;
  text-decoration: none;
}
.qp-library-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
}
.qp-library-toolbar::before {
  content: 'Search Library';
  font-weight: 950;
  color: #4c1d95;
}


@media (max-width: 720px) {
  .qp-library-toolbar { flex-direction: column; align-items: stretch; }
  .qp-library-toolbar::before { text-align: left; }
}

/* v1.12.0 Question Bank */
.qp-question-bank-page { gap: 18px; }
.qp-question-bank-hero { align-items: center; gap: 18px; }
.qp-question-bank-hero .qp-muted { max-width: 680px; }
.qp-question-bank-actions { display: grid; gap: 10px; min-width: min(420px, 100%); }
.qp-bank-append-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.qp-bank-toolbar-section { padding: 18px; }
.qp-bank-toolbar { display: grid; grid-template-columns: minmax(260px, 2fr) minmax(180px, 1fr) minmax(220px, 1.2fr) auto; gap: 14px; align-items: end; }
.qp-bank-checkline { display: flex; align-items: center; gap: 8px; padding: 12px 8px; font-weight: 800; color: #334155; white-space: nowrap; }
.qp-bank-checkline input { width: 18px; height: 18px; accent-color: #7c3aed; }
.qp-bank-bulk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.qp-question-bank-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.qp-question-bank-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 16px; }
.qp-bank-card { background: #fff; border: 1px solid rgba(124,58,237,.16); border-radius: 22px; padding: 16px; box-shadow: 0 16px 34px rgba(15,23,42,.08); display: grid; gap: 12px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.qp-bank-card:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(15,23,42,.12); }
.qp-bank-card.selected { border-color: #7c3aed; box-shadow: 0 18px 44px rgba(124,58,237,.18); }
.qp-bank-card-top, .qp-bank-type-row, .qp-bank-meta, .qp-bank-source { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qp-bank-card-top { justify-content: space-between; }
.qp-bank-select { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; color: #475569; }
.qp-bank-select input { width: 18px; height: 18px; accent-color: #7c3aed; }
.qp-bank-favorite { width: 36px; height: 36px; border: 1px solid rgba(124,58,237,.18); border-radius: 12px; background: #f8fafc; color: #94a3b8; font-size: 18px; cursor: pointer; }
.qp-bank-favorite.active { color: #f59e0b; background: #fffbeb; border-color: rgba(245,158,11,.35); }
.qp-bank-card h3 { margin: 0; color: #111827; font-size: 18px; line-height: 1.25; }
.qp-bank-card p { margin: 0; color: #64748b; line-height: 1.45; }
.qp-bank-meta { color: #64748b; font-size: 13px; font-weight: 800; }
.qp-bank-meta span { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 999px; padding: 5px 9px; }
.qp-bank-source { display: grid; gap: 2px; padding: 10px 12px; background: #f8fbff; border: 1px solid #e0e7ff; border-radius: 14px; }
.qp-bank-source strong { color: #1e293b; }
.qp-bank-source span { color: #64748b; font-size: 13px; }
.qp-question-bank-preview { position: sticky; top: 18px; background: #fff; border: 1px solid rgba(124,58,237,.16); border-radius: 24px; padding: 18px; box-shadow: 0 16px 34px rgba(15,23,42,.08); min-height: 280px; }
.qp-question-bank-preview h2 { margin: 0 0 8px; color: #111827; }
.qp-bank-preview-card { display: grid; gap: 12px; }
.qp-bank-preview-card h3 { margin: 0; color: #111827; line-height: 1.25; }
.qp-bank-preview-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.qp-bank-preview-meta span { padding: 6px 10px; border-radius: 999px; background: #f1f5f9; color: #475569; font-weight: 900; font-size: 13px; }
.qp-bank-preview-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.qp-bank-preview-list.ordered { list-style: decimal inside; }
.qp-bank-preview-list li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center; padding: 10px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; color: #334155; }
.qp-bank-preview-list.ordered li { display: list-item; }
.qp-bank-preview-list b { color: #16a34a; }
.qp-bank-pair-preview { display: grid; gap: 8px; }
.qp-bank-pair-preview div { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; padding: 10px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; }
.qp-bank-pair-preview span { min-width: 0; overflow-wrap: anywhere; color: #334155; }
.qp-bank-pair-preview b { color: #7c3aed; }
.qp-bank-explanation { padding: 10px 12px; border-left: 4px solid #7c3aed; background: #f5f3ff; border-radius: 12px; }
.qp-bank-card.preview-open {
  grid-column: 1 / -1;
  border-color: rgba(34,153,211,.42);
  box-shadow: 0 18px 44px rgba(34,153,211,.16);
}
.qp-bank-card.preview-open:hover { transform: none; }
.qp-bank-inline-preview { margin-top: 4px; padding: 14px; border: 1px solid rgba(34,153,211,.24); border-radius: 18px; background: linear-gradient(180deg, rgba(239,246,255,.92), rgba(255,255,255,.96)); box-shadow: inset 0 1px 0 rgba(255,255,255,.85); display: grid; gap: 12px; width: 100%; }
.qp-bank-card.preview-open .qp-bank-inline-preview { padding: 18px; }
.qp-bank-card.preview-open .qp-bank-preview-list,
.qp-bank-card.preview-open .qp-bank-pair-preview { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.qp-bank-card.preview-open .qp-bank-preview-list.ordered { display: grid; list-style-position: inside; }
.qp-bank-inline-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid rgba(148,163,184,.22); }
.qp-bank-inline-preview-head .qp-pill { margin: 0 0 6px; }
.qp-bank-inline-preview-head h4 { margin: 0; color: #111827; line-height: 1.25; font-size: 16px; }


@media (max-width: 1180px) {
  .qp-question-bank-layout { grid-template-columns: 1fr; }
  .qp-question-bank-preview { position: static; }
  .qp-bank-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .qp-question-bank-hero { align-items: stretch; }
  .qp-bank-toolbar { grid-template-columns: 1fr; }
  .qp-bank-append-row { grid-template-columns: 1fr; }
  .qp-question-bank-list { grid-template-columns: 1fr; }
  .qp-bank-card.preview-open { grid-column: auto; }
  .qp-bank-card.preview-open .qp-bank-preview-list,
  .qp-bank-card.preview-open .qp-bank-pair-preview { grid-template-columns: 1fr; }
  .qp-bank-inline-preview { padding: 12px; border-radius: 16px; }
  .qp-bank-inline-preview-head { flex-direction: column; align-items: stretch; }
}

/* v1.15.0 Teaching space system */
.qp-academic-workspace{border:1px solid rgba(148,163,184,.22);background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(239,246,255,.88));box-shadow:0 20px 55px rgba(15,23,42,.08)}

.qp-academic-quick-form{display:grid;grid-template-columns:minmax(180px,1fr) minmax(180px,1fr) auto;gap:12px;align-items:end;margin:14px 0 18px}
.qp-academic-quick-form label{display:grid;gap:6px;font-weight:800;color:#334155}

.qp-academic-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px}
.qp-college-card{border:1px solid rgba(148,163,184,.22);border-radius:24px;background:rgba(255,255,255,.74);padding:16px;box-shadow:0 16px 35px rgba(15,23,42,.07)}

.qp-college-head{display:flex;gap:12px;align-items:center;margin-bottom:14px}.qp-college-head h3{margin:0;font-size:1.05rem}.qp-college-head p{margin:2px 0 0;color:#64748b}

.qp-college-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:16px;background:linear-gradient(135deg,#2563eb,#7c3aed);box-shadow:0 12px 25px rgba(37,99,235,.28);font-size:1.25rem}
.qp-subject-list{display:grid;gap:10px}.qp-subject-chip{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid rgba(148,163,184,.18);background:rgba(248,250,252,.92);border-radius:18px;padding:12px}

.qp-subject-chip b{display:block}.qp-subject-chip span{display:block;color:#64748b;font-size:.82rem}
.qp-subject-chip.system{background:linear-gradient(135deg,rgba(236,253,245,.95),rgba(239,246,255,.95))}

.qp-academic-setup-overlay{position:fixed;inset:0;z-index:9999;background:rgba(15,23,42,.58);display:grid;place-items:center;padding:20px;backdrop-filter:blur(10px)}
.qp-academic-setup-card{position:relative;width:min(920px,96vw);max-height:92vh;overflow:auto;border-radius:30px;background:#fff;padding:24px;box-shadow:0 30px 90px rgba(15,23,42,.32)}

.qp-college-select-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px;margin:18px 0}.qp-college-select-card{position:relative;display:grid;gap:8px;border:1px solid rgba(148,163,184,.28);border-radius:20px;padding:14px;cursor:pointer;background:linear-gradient(135deg,#fff,#f8fafc);min-height:118px}

.qp-college-select-card input{position:absolute;right:12px;top:12px;accent-color:#2563eb}.qp-college-select-card span{font-size:1.5rem}.qp-college-select-card:has(input:checked){border-color:#2563eb;box-shadow:0 16px 38px rgba(37,99,235,.18);background:linear-gradient(135deg,#eff6ff,#eef2ff)}

.qp-create-mode-body{grid-template-columns:repeat(2,minmax(240px,1fr))}.qp-create-mode-body .qp-create-option-templates,.qp-create-mode-body>a:last-child{grid-column:auto}.qp-mode-card{min-height:210px}.qp-mode-card .qp-create-option-icon{font-size:2.1rem}.qp-create-option-tag.soft{background:rgba(16,185,129,.12);color:#047857}
.qp-mode-pill{background:linear-gradient(135deg,#e0f2fe,#dbeafe);color:#075985}.qp-mode-pill.bubble{background:linear-gradient(135deg,#fef3c7,#ffedd5);color:#92400e}
@media (max-width:760px){.qp-academic-quick-form{grid-template-columns:1fr}.qp-subject-chip{align-items:flex-start;flex-direction:column}.qp-create-mode-body{grid-template-columns:1fr}}

/* v1.15.0 Teaching space system */
.qp-teaching-space-body .qp-dashboard-sidebar{gap:14px}
.qp-space-chip{appearance:none;border:1px solid rgba(148,163,184,.22);background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(239,246,255,.82));border-radius:20px;padding:12px;display:flex;align-items:center;gap:10px;text-align:left;cursor:pointer;box-shadow:0 14px 32px rgba(15,23,42,.08);color:#0f172a;width:100%}
.qp-space-chip:hover{transform:translateY(-1px);box-shadow:0 18px 38px rgba(37,99,235,.14)}
.qp-space-chip-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:14px;background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;box-shadow:0 12px 24px rgba(37,99,235,.24)}
.qp-space-chip b{display:block;font-size:.92rem;line-height:1.2}.qp-space-chip small{display:block;color:#64748b;font-size:.76rem;line-height:1.2;margin-top:2px}.qp-space-chip em{font-style:normal;margin-left:auto;font-size:.72rem;font-weight:900;color:#2563eb}
.qp-space-hero{background:radial-gradient(circle at 18% 18%,rgba(59,130,246,.16),transparent 30%),linear-gradient(135deg,#ffffff,#f8fafc 48%,#eef2ff)!important;border:1px solid rgba(148,163,184,.18)!important;box-shadow:0 24px 70px rgba(15,23,42,.08)!important}
.qp-space-status strong{font-size:1.42rem!important;line-height:1.1;text-align:center;max-width:220px;word-break:break-word}.qp-space-status span:last-child{text-align:center;color:#64748b}
.qp-subject-command-center{border:1px solid rgba(37,99,235,.12);background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(239,246,255,.84));box-shadow:0 24px 60px rgba(15,23,42,.08)}
.qp-space-action-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;margin-top:16px}.qp-space-action-card{border:1px solid rgba(148,163,184,.2);background:#fff;border-radius:24px;padding:18px;display:grid;gap:8px;text-decoration:none;color:#0f172a;box-shadow:0 16px 34px rgba(15,23,42,.06);cursor:pointer;text-align:left}.qp-space-action-card:hover{transform:translateY(-2px);box-shadow:0 22px 45px rgba(37,99,235,.12)}.qp-space-action-card span{font-size:1.7rem}.qp-space-action-card b{font-size:1.05rem}.qp-space-action-card em{font-style:normal;color:#64748b;line-height:1.35}.qp-space-action-card.featured{background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;border-color:transparent}.qp-space-action-card.featured em{color:rgba(255,255,255,.82)}
.qp-space-setup-overlay{position:fixed;inset:0;z-index:10000;background:rgba(15,23,42,.58);display:grid;place-items:center;padding:18px;backdrop-filter:blur(12px);opacity:0;pointer-events:none;transition:.16s ease}.qp-space-setup-overlay.show{opacity:1;pointer-events:auto}.qp-space-setup-overlay[hidden]{display:none}.qp-space-setup-card{width:min(980px,96vw);max-height:92vh;overflow:auto;border-radius:32px;background:linear-gradient(135deg,#ffffff,#f8fafc);box-shadow:0 35px 100px rgba(15,23,42,.36);border:1px solid rgba(255,255,255,.65);padding:26px}.qp-space-setup-head h2{font-size:clamp(1.6rem,3vw,2.35rem);margin:10px 0 6px}.qp-space-setup-head p{color:#64748b;margin:0;max-width:720px}.qp-space-step{margin-top:18px}.qp-college-select-card{appearance:none;text-align:left}.qp-college-select-card.selected{border-color:#2563eb;box-shadow:0 18px 45px rgba(37,99,235,.2);background:linear-gradient(135deg,#eff6ff,#eef2ff)}.qp-college-select-card small{color:#64748b;font-weight:700}.qp-space-create-row{display:grid;grid-template-columns:minmax(180px,1fr) auto;gap:12px;margin:18px 0 8px}.qp-space-selected-college{border:1px solid rgba(148,163,184,.18);border-radius:18px;padding:12px 14px;background:rgba(239,246,255,.78);display:flex;gap:10px;align-items:center;margin-bottom:14px}.qp-space-selected-college span{color:#64748b;font-weight:800}.qp-space-selected-college b{font-size:1.05rem}.qp-subject-choice-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px}.qp-subject-choice-card{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:stretch;border:1px solid rgba(148,163,184,.2);border-radius:22px;background:#fff;padding:10px;box-shadow:0 14px 30px rgba(15,23,42,.06)}.qp-subject-choice-card.active{border-color:#2563eb;box-shadow:0 18px 40px rgba(37,99,235,.17)}.qp-subject-choice-card.system{background:linear-gradient(135deg,#ecfdf5,#eff6ff)}.qp-subject-main{appearance:none;border:0;background:transparent;text-align:left;display:grid;gap:5px;cursor:pointer;color:#0f172a}.qp-subject-main span{font-size:1.6rem}.qp-subject-main b{font-size:1rem}.qp-subject-main small{color:#64748b;font-weight:800}.qp-subject-choice-card em{align-self:center;font-style:normal;color:#059669;font-weight:900;font-size:.78rem;padding:0 8px}.qp-btn.tiny{padding:7px 9px;border-radius:12px;font-size:.78rem;align-self:center}.qp-space-delete-note{margin-top:12px;color:#64748b;font-size:.86rem}.qp-fixed-save-space{gap:12px}.qp-fixed-save-space.needs-space{border-color:rgba(239,68,68,.24);background:linear-gradient(135deg,#fff7ed,#fee2e2)}


@media (max-width:760px){.qp-space-create-row{grid-template-columns:1fr}.qp-subject-choice-card{grid-template-columns:1fr}.qp-space-action-grid{grid-template-columns:1fr}.qp-space-setup-card{padding:18px;border-radius:24px}.qp-space-chip{padding:10px}}

/* v1.15.1 Teaching Space GUI polish */
:root{
  --qp-space-purple:#6d28d9;
  --qp-space-purple-2:#8b5cf6;
  --qp-space-deep:#3b0764;
  --qp-space-gold:#facc15;
}
.qp-teaching-space-body .qp-dashboard-main,
.qp-question-bank-page,
.qp-library-v15{background:radial-gradient(circle at top left,rgba(124,58,237,.10),transparent 34%),radial-gradient(circle at top right,rgba(250,204,21,.10),transparent 32%)}
.qp-space-chip{border:1px solid rgba(139,92,246,.28)!important;background:linear-gradient(135deg,rgba(76,29,149,.95),rgba(124,58,237,.92))!important;color:#fff!important;box-shadow:0 18px 38px rgba(76,29,149,.25)!important}
.qp-space-chip small,.qp-space-chip em{color:rgba(255,255,255,.78)!important}.qp-space-chip-icon{background:rgba(250,204,21,.18);border:1px solid rgba(250,204,21,.25)}
.qp-space-hero,.qp-subject-context-hero{position:relative;overflow:hidden;border:1px solid rgba(139,92,246,.18)!important;background:linear-gradient(135deg,rgba(76,29,149,.98),rgba(109,40,217,.92) 58%,rgba(17,24,39,.96))!important;color:#fff!important;box-shadow:0 30px 70px rgba(76,29,149,.22)!important}
.qp-space-hero:before,.qp-subject-context-hero:before{content:"";position:absolute;inset:-80px -30px auto auto;width:260px;height:260px;border-radius:50%;background:radial-gradient(circle,rgba(250,204,21,.34),transparent 62%)}
.qp-space-hero .qp-muted,.qp-subject-context-hero .qp-muted,.qp-space-hero p,.qp-subject-context-hero p{color:rgba(255,255,255,.80)!important}.qp-space-status{background:rgba(255,255,255,.12)!important;border:1px solid rgba(255,255,255,.18)!important;backdrop-filter:blur(14px)}
.qp-space-action-card{border:1px solid rgba(139,92,246,.18)!important;background:linear-gradient(135deg,rgba(255,255,255,.98),rgba(250,245,255,.95))!important;box-shadow:0 18px 42px rgba(76,29,149,.10)!important}.qp-space-action-card span{background:linear-gradient(135deg,var(--qp-space-purple),var(--qp-space-purple-2))!important;color:#fff!important}.qp-space-action-card.featured{background:linear-gradient(135deg,rgba(76,29,149,.98),rgba(124,58,237,.94))!important;color:#fff!important}.qp-space-action-card.featured em{color:rgba(255,255,255,.80)!important}.qp-subject-command-center{border-color:rgba(139,92,246,.18)!important;background:linear-gradient(135deg,rgba(255,255,255,.98),rgba(245,243,255,.9))!important}
.qp-college-icon,.qp-college-select-card.selected span:first-child{background:linear-gradient(135deg,var(--qp-space-purple),var(--qp-space-purple-2))!important;box-shadow:0 16px 30px rgba(109,40,217,.28)!important}.qp-college-select-card{transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}.qp-college-select-card:hover{transform:translateY(-2px);box-shadow:0 18px 40px rgba(76,29,149,.13)}.qp-college-select-card.selected{border-color:var(--qp-space-purple)!important;background:linear-gradient(135deg,#faf5ff,#f5f3ff)!important;box-shadow:0 18px 45px rgba(109,40,217,.18)!important}
.qp-space-setup-overlay{background:rgba(15,23,42,.58)}.qp-space-setup-overlay.setup-required{place-items:start center;overflow:auto;background:radial-gradient(circle at top left,rgba(250,204,21,.18),transparent 30%),linear-gradient(135deg,#2e1065,#111827 64%,#0f172a);padding:clamp(18px,4vw,48px)}.qp-space-setup-overlay.setup-required .qp-space-setup-card{width:min(1120px,96vw);max-height:none;margin:auto 0;border:1px solid rgba(255,255,255,.22);background:linear-gradient(135deg,rgba(255,255,255,.98),rgba(250,245,255,.96));box-shadow:0 42px 120px rgba(0,0,0,.38)}.qp-space-setup-head h2{letter-spacing:-.035em}.qp-space-setup-head .qp-pill{background:linear-gradient(135deg,var(--qp-space-purple),var(--qp-space-purple-2));color:#fff;border-color:transparent}.qp-space-create-row{background:rgba(245,243,255,.55);border:1px solid rgba(139,92,246,.14);padding:12px;border-radius:22px}
.qp-subject-choice-card{position:relative;border-color:rgba(139,92,246,.16)!important;background:linear-gradient(135deg,#fff,#faf5ff)!important;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}.qp-subject-choice-card:hover{transform:translateY(-2px);box-shadow:0 18px 42px rgba(76,29,149,.12)}.qp-subject-choice-card.active{border-color:var(--qp-space-purple)!important;box-shadow:0 18px 42px rgba(109,40,217,.18)!important}.qp-subject-choice-card.system{background:linear-gradient(135deg,#fffbeb,#f5f3ff)!important}.qp-subject-main small{color:#6b7280!important}.qp-subject-more{position:relative;align-self:center}.qp-subject-more summary{list-style:none;width:36px;height:36px;border-radius:14px;display:grid;place-items:center;cursor:pointer;font-weight:900;color:#4c1d95;background:#f5f3ff;border:1px solid rgba(139,92,246,.18)}.qp-subject-more summary::-webkit-details-marker{display:none}.qp-subject-more div{position:absolute;right:0;top:42px;z-index:50;min-width:150px;background:#fff;border:1px solid rgba(15,23,42,.12);border-radius:16px;box-shadow:0 18px 42px rgba(15,23,42,.18);padding:8px}.qp-subject-more button{width:100%;border:0;background:transparent;color:#dc2626;font-weight:900;text-align:left;padding:10px 12px;border-radius:12px;cursor:pointer}.qp-subject-more button:hover{background:#fef2f2}.qp-space-delete-note{background:#fff7ed;border:1px solid #fed7aa;border-radius:16px;padding:10px 12px;color:#9a3412!important}
.qp-space-confirm-overlay{position:fixed;inset:0;z-index:11000;display:grid;place-items:center;background:rgba(15,23,42,.55);backdrop-filter:blur(10px);opacity:0;pointer-events:none;transition:.16s ease}.qp-space-confirm-overlay.show{opacity:1;pointer-events:auto}.qp-space-confirm-overlay[hidden]{display:none}.qp-space-confirm-card{width:min(500px,92vw);border-radius:28px;background:linear-gradient(135deg,#fff,#fff7ed);box-shadow:0 34px 100px rgba(15,23,42,.36);border:1px solid rgba(255,255,255,.72);padding:24px;display:grid;grid-template-columns:auto 1fr;gap:16px}.qp-space-confirm-icon{width:54px;height:54px;border-radius:20px;display:grid;place-items:center;background:#fef3c7;color:#92400e;font-size:1.45rem}.qp-space-confirm-card h3{margin:8px 0 6px;font-size:1.45rem}.qp-space-confirm-card p{margin:0;color:#64748b}.qp-space-confirm-actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}.qp-pill.danger{background:#fee2e2!important;color:#991b1b!important;border-color:#fecaca!important}.qp-btn.danger{background:#dc2626!important;color:#fff!important;border-color:#dc2626!important}
.qp-creator-save-banner{position:sticky;top:72px;z-index:35;padding:8px clamp(10px,2vw,20px);background:linear-gradient(135deg,rgba(245,243,255,.96),rgba(255,251,235,.94));border-bottom:1px solid rgba(139,92,246,.14);backdrop-filter:blur(12px)}.qp-creator-save-banner:empty{display:none}.qp-fixed-save-space{display:flex;align-items:center;gap:14px;padding:14px 16px;border-radius:20px;background:linear-gradient(135deg,#fff,#faf5ff)!important;border:1px solid rgba(139,92,246,.18)!important;box-shadow:0 14px 35px rgba(76,29,149,.10);margin:0!important}.qp-save-space-lock{width:42px;height:42px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(135deg,var(--qp-space-purple),var(--qp-space-purple-2));box-shadow:0 14px 26px rgba(109,40,217,.28);color:#fff}.qp-save-space-copy{display:grid;gap:2px;min-width:160px}.qp-save-space-copy b{color:#3b0764}.qp-save-space-copy span{font-size:.84rem;color:#6b7280}.qp-fixed-save-space .qp-location-choice{flex:1;margin:0!important;background:rgba(245,243,255,.72)!important;border-color:rgba(139,92,246,.16)!important}.qp-fixed-save-space.needs-space{background:linear-gradient(135deg,#fff7ed,#fee2e2)!important;border-color:rgba(239,68,68,.24)!important}.qp-creator-body .qp-creator-shell{padding-top:6px}
.qp-subject-context-hero{border-radius:30px;padding:clamp(22px,4vw,34px);display:flex;align-items:center;justify-content:space-between;gap:18px}.qp-context-actions{display:flex;gap:10px;flex-wrap:wrap;position:relative;z-index:1}.qp-library-toolbar{border-radius:22px;border:1px solid rgba(139,92,246,.14);background:rgba(255,255,255,.78);box-shadow:0 12px 32px rgba(76,29,149,.07)}.qp-course-node > summary,.qp-subject-node > summary{color:#4c1d95!important;background:linear-gradient(135deg,#faf5ff,#f5f3ff)!important}.qp-library-card{border-color:rgba(139,92,246,.13)!important;box-shadow:0 16px 36px rgba(76,29,149,.08)!important}.qp-library-card-top .qp-pill,.qp-question-chip{background:#f5f3ff!important;color:#4c1d95!important;border-color:rgba(139,92,246,.16)!important}
.qp-question-bank-hero{border:1px solid rgba(139,92,246,.18)!important;background:linear-gradient(135deg,rgba(76,29,149,.98),rgba(124,58,237,.92),rgba(17,24,39,.96))!important;color:#fff!important}.qp-question-bank-hero .qp-muted,.qp-question-bank-hero p{color:rgba(255,255,255,.82)!important}.qp-space-mini{display:inline-flex;align-items:center;border:1px solid rgba(139,92,246,.18);border-radius:999px;background:#f5f3ff;color:#4c1d95;padding:9px 12px;font-weight:900;font-size:.85rem}.qp-bank-checkline{border:1px solid rgba(139,92,246,.15);background:#faf5ff;border-radius:14px;padding:10px 12px;font-weight:900}.qp-bank-checkline input{accent-color:var(--qp-space-purple)}.qp-bank-card.preview-open{grid-column:1/-1}.qp-bank-inline-preview{border-color:rgba(139,92,246,.18)!important;background:linear-gradient(135deg,#fff,#faf5ff)!important}.qp-bank-preview-card{background:#fff;border:1px solid rgba(139,92,246,.14);border-radius:22px;padding:18px}


@media (max-width:760px){.qp-subject-context-hero{flex-direction:column;align-items:stretch}.qp-fixed-save-space{display:grid;grid-template-columns:auto 1fr}.qp-fixed-save-space .qp-location-choice,.qp-fixed-save-space .qp-btn{grid-column:1/-1}.qp-space-confirm-card{grid-template-columns:1fr}.qp-subject-more{align-self:flex-end}.qp-space-setup-overlay.setup-required{padding:12px}.qp-space-setup-overlay.setup-required .qp-space-setup-card{border-radius:24px}}

/* v1.20.0 student dashboard: compact, focused home screen */
.qp-student-dashboard-home[hidden],
.qp-shared-dashboard[hidden] { display: none !important; }

.qp-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.qp-student-dashboard-body {
  --qp-student-bg: #f6f5fb;
  --qp-student-card: #ffffff;
  --qp-student-text: #171326;
  --qp-student-muted: #716b82;
  --qp-student-line: #ebe8f2;
  --qp-student-purple: #6428f5;
  --qp-student-purple-dark: #4a16c8;
  background: var(--qp-student-bg) !important;
}

.qp-student-dashboard-body .qp-dashboard-shell {
  grid-template-columns: 84px minmax(0, 1fr) !important;
  min-height: 100vh;
  background: var(--qp-student-bg) !important;
}

.qp-student-dashboard-body .qp-dashboard-sidebar {
  width: 84px !important;
  padding: 18px 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #1d114d !important;
  box-shadow: none !important;
}

.qp-student-dashboard-body .qp-dashboard-logo {
  justify-content: center !important;
  margin: 0 0 18px !important;
  font-size: 0 !important;
}

.qp-student-dashboard-body .qp-dashboard-logo > span:last-child { display: none !important; }
.qp-student-dashboard-body .qp-dashboard-logo-icon {
  width: 48px !important;
  height: 48px !important;
  border-radius: 15px !important;
  background: var(--qp-student-purple) !important;
  color: #fff !important;
  font-size: 14px !important;
}

.qp-student-dashboard-body .qp-dashboard-nav { gap: 8px !important; }
.qp-student-dashboard-body .qp-dashboard-nav a,
.qp-student-dashboard-body .qp-dashboard-side-bottom a {
  min-height: 48px !important;
  justify-content: center !important;
  gap: 0 !important;
  padding: 8px !important;
  border-radius: 14px !important;
  color: rgba(255, 255, 255, .68) !important;
  font-size: 0 !important;
  background: transparent !important;
}

.qp-student-dashboard-body .qp-dashboard-nav a span,
.qp-student-dashboard-body .qp-dashboard-side-bottom a span {
  display: grid !important;
  width: 32px !important;
  height: 32px !important;
  place-items: center !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .08) !important;
  color: inherit !important;
  font-size: 12px !important;
  font-weight: 950 !important;
}

.qp-student-dashboard-body .qp-dashboard-nav a:hover,
.qp-student-dashboard-body .qp-dashboard-nav a.active {
  color: #fff !important;
  background: rgba(255, 255, 255, .12) !important;
}

.qp-student-dashboard-body .qp-dashboard-nav a.active span {
  background: var(--qp-student-purple) !important;
  color: #fff !important;
}

.qp-student-dashboard-body .qp-dashboard-main {
  min-width: 0;
  padding: 22px clamp(20px, 4vw, 56px) 48px !important;
  background: var(--qp-student-bg) !important;
}

.qp-student-dashboard-body .qp-dashboard-topbar {
  min-height: 44px !important;
  justify-content: flex-end !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.qp-student-dashboard-body .qp-dashboard-title-group {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
}

.qp-student-dashboard-body .qp-dashboard-content {
  width: 100% !important;
  max-width: 1180px !important;
  margin: 0 auto !important;
  padding: 18px 0 0 !important;
}

.qp-student-dashboard-home { display: block; color: var(--qp-student-text); }
.qp-student-welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.qp-student-kicker,
.qp-student-welcome h2,
.qp-student-welcome p { margin: 0; }
.qp-student-kicker {
  color: var(--qp-student-purple);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.qp-student-welcome h2 {
  margin-top: 5px;
  color: var(--qp-student-text);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.06;
  letter-spacing: -.04em;
}
.qp-student-welcome > div > p:last-child {
  margin-top: 8px;
  color: var(--qp-student-muted);
  font-weight: 700;
}
.qp-student-profile-link {
  flex: 0 0 auto;
  padding: 10px 15px;
  border: 1px solid var(--qp-student-line);
  border-radius: 12px;
  background: var(--qp-student-card);
  color: var(--qp-student-text);
  font-weight: 900;
  text-decoration: none;
}

.qp-student-bento {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(310px, .82fr);
  gap: 18px;
  align-items: start;
}

.qp-student-join-card {
  min-height: 216px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 4vw, 38px);
  overflow: hidden;
  position: relative;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--qp-student-purple), #7c3aed 58%, var(--qp-student-purple-dark));
  color: #fff;
  box-shadow: 0 20px 45px rgba(94, 38, 220, .22);
}
.qp-student-join-card::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -80px;
  top: -110px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(255, 255, 255, .04), 0 0 0 84px rgba(255, 255, 255, .035);
  pointer-events: none;
}
.qp-student-card-label {
  display: inline-block;
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, .76);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.qp-student-join-card h2 { position: relative; z-index: 1; margin: 6px 0 4px; color: #fff; font-size: clamp(25px, 3vw, 36px); }
.qp-student-join-card p { position: relative; z-index: 1; margin: 0; color: rgba(255, 255, 255, .8); font-weight: 700; }
.qp-student-join-form {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 10px;
  margin-top: 24px;
}
.qp-student-join-form input {
  min-width: 0;
  height: 50px;
  padding: 0 17px;
  border: 2px solid transparent;
  border-radius: 14px;
  outline: none;
  background: #fff;
  color: #181126;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .04em;
}
.qp-student-join-form input:focus { border-color: #fbbf24; box-shadow: 0 0 0 4px rgba(251, 191, 36, .22); }
.qp-student-join-form button {
  height: 50px;
  padding: 0 21px;
  border: 0;
  border-radius: 14px;
  background: #20b862;
  color: #fff;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}
.qp-student-join-form button:hover { background: #159951; transform: translateY(-1px); }
.qp-student-join-card > small { position: relative; z-index: 1; margin-top: 8px; color: rgba(255, 255, 255, .68); font-weight: 750; }

.qp-student-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.qp-student-metrics article {
  min-height: 102px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--qp-student-line);
  border-radius: 22px;
  background: var(--qp-student-card);
  box-shadow: 0 12px 30px rgba(42, 31, 73, .055);
}
.qp-student-metrics article:last-child { grid-column: 1 / -1; min-height: 96px; }
.qp-student-metrics span { color: var(--qp-student-muted); font-size: 13px; font-weight: 850; }
.qp-student-metrics strong { color: var(--qp-student-purple); font-size: 34px; line-height: 1; }
.qp-student-metrics article:nth-child(2) strong { color: #f59e0b; }
.qp-student-metrics article:nth-child(3) strong { color: #16a34a; }

.qp-student-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.qp-student-shortcuts a {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 11px;
  row-gap: 2px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--qp-student-line);
  border-radius: 18px;
  background: var(--qp-student-card);
  color: var(--qp-student-text);
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(42, 31, 73, .04);
}
.qp-student-shortcuts a:hover { border-color: rgba(100, 40, 245, .35); transform: translateY(-2px); }
.qp-student-shortcuts a > span {
  grid-row: 1 / 3;
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 12px;
  background: #f0eaff;
  color: var(--qp-student-purple);
  font-size: 12px;
  font-weight: 950;
}
.qp-student-shortcuts b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.qp-student-shortcuts small { overflow: hidden; color: var(--qp-student-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; }

.qp-student-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--qp-student-line);
  border-radius: 24px;
  background: var(--qp-student-card);
  box-shadow: 0 12px 32px rgba(42, 31, 73, .045);
}
.qp-student-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}
.qp-student-panel > header span { color: var(--qp-student-purple); font-size: 11px; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.qp-student-panel > header h2 { margin: 2px 0 0; color: var(--qp-student-text); font-size: 20px; }
.qp-student-panel > header a,
.qp-student-panel > header button {
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: #f2eff8;
  color: var(--qp-student-purple);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}
.qp-student-subjects-panel { grid-column: 1; }
.qp-student-recent-panel { grid-column: 2; }
.qp-student-live-panel { grid-column: 1 / -1; }
.qp-student-subject-list,
.qp-student-quiz-list,
.qp-student-live-list { display: grid; gap: 9px; }

.qp-student-row-card {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 11px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--qp-student-line);
  border-radius: 15px;
  background: #fbfaff;
}
.qp-student-row-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: #ede7ff;
  color: var(--qp-student-purple);
  font-size: 12px;
  font-weight: 950;
}
.qp-student-row-card h3 { overflow: hidden; margin: 0; color: var(--qp-student-text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.qp-student-row-card p { overflow: hidden; margin: 3px 0 0; color: var(--qp-student-muted); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.qp-student-row-card div > small { display: block; overflow: hidden; margin-top: 4px; color: var(--qp-student-purple); font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.qp-student-row-card > strong { color: var(--qp-student-text); font-size: 15px; text-align: center; }
.qp-student-row-card > strong small { display: block; margin-top: 1px; color: var(--qp-student-muted); font-size: 9px; font-weight: 750; }
.qp-student-row-card > a,
.qp-student-live-row > a {
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--qp-student-purple);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

.qp-student-live-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid #dcfce7;
  border-radius: 14px;
  background: #f6fff9;
}
.qp-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 5px rgba(34, 197, 94, .12); }
.qp-student-live-row h3 { margin: 0; color: var(--qp-student-text); font-size: 14px; }
.qp-student-live-row p { margin: 3px 0 0; color: var(--qp-student-muted); font-size: 11px; font-weight: 750; }

html[data-theme="dark"] body.qp-student-dashboard-body {
  --qp-student-bg: #0f0d18;
  --qp-student-card: #181522;
  --qp-student-text: #f4f1fb;
  --qp-student-muted: #aaa3b8;
  --qp-student-line: #2d2938;
}
html[data-theme="dark"] .qp-student-row-card { background: #1d1928; }
html[data-theme="dark"] .qp-student-row-icon,
html[data-theme="dark"] .qp-student-shortcuts a > span { background: #2a2142; }
html[data-theme="dark"] .qp-student-panel > header a,
html[data-theme="dark"] .qp-student-panel > header button { background: #282334; }
html[data-theme="dark"] .qp-student-live-row { border-color: #21462f; background: #14251b; }

@media (max-width: 980px) {
  .qp-student-bento { grid-template-columns: 1fr; }
  .qp-student-join-card,
  .qp-student-metrics,
  .qp-student-shortcuts,
  .qp-student-subjects-panel,
  .qp-student-recent-panel,
  .qp-student-live-panel { grid-column: 1; }
  .qp-student-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qp-student-metrics article:last-child { grid-column: auto; min-height: 102px; }
}

@media (max-width: 760px) {
  .qp-student-dashboard-body .qp-dashboard-shell { display: block !important; }
  .qp-student-dashboard-body .qp-dashboard-sidebar {
    position: sticky !important;
    top: 0 !important;
    z-index: 30 !important;
    width: 100% !important;
    min-height: 0 !important;
    padding: 8px 10px !important;
    border-radius: 0 0 18px 18px !important;
  }
  .qp-student-dashboard-body .qp-dashboard-logo { display: none !important; }
  .qp-student-dashboard-body .qp-dashboard-nav {
    display: flex !important;
    gap: 7px !important;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .qp-student-dashboard-body .qp-dashboard-nav::-webkit-scrollbar { display: none; }
  .qp-student-dashboard-body .qp-dashboard-nav a { flex: 0 0 48px; min-height: 44px !important; }
  .qp-student-dashboard-body .qp-dashboard-main { padding: 12px 14px 32px !important; }
  .qp-student-dashboard-body .qp-dashboard-topbar { min-height: 38px !important; }
  .qp-student-dashboard-body .qp-dashboard-content { padding-top: 10px !important; }
  .qp-student-welcome { align-items: flex-start; }
  .qp-student-welcome > div > p:last-child { display: none; }
  .qp-student-profile-link { padding: 8px 11px; font-size: 12px; }
  .qp-student-shortcuts { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .qp-student-welcome h2 { font-size: 28px; }
  .qp-student-join-card { min-height: 0; padding: 22px; border-radius: 22px; }
  .qp-student-join-form { grid-template-columns: 1fr; }
  .qp-student-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qp-student-metrics article,
  .qp-student-metrics article:last-child { min-height: 86px; padding: 13px 10px; border-radius: 17px; }
  .qp-student-metrics span { font-size: 10px; }
  .qp-student-metrics strong { font-size: 27px; }
  .qp-student-panel { padding: 15px; border-radius: 20px; }
  .qp-student-row-card { grid-template-columns: auto minmax(0, 1fr) auto; }
  .qp-student-row-card > strong { display: none; }
  .qp-student-row-card > a { grid-column: 3; }
}

/* v1.15.2 user-friendly UX polish */
.qp-top-space-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, .28);
  background: rgba(255,255,255,.84);
  color: var(--qp-text, #111827);
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
  font-weight: 800;
}
.qp-top-space-chip small { display:block; font-size:11px; font-weight:700; color: var(--qp-muted, #64748b); line-height:1.1; }
.qp-top-space-chip b { display:block; font-size:13px; line-height:1.1; }
.qp-top-space-chip em { font-style:normal; font-size:11px; opacity:.8; }

.qp-start-panel {
  display:grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap:18px;
  align-items:center;
  border: 1px solid rgba(148, 163, 184, .22);
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,250,252,.90));
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
  margin-bottom: 18px;
}
.qp-start-panel h2 { margin:0 0 6px; font-size:24px; }
.qp-start-panel p { margin:0; color: var(--qp-muted, #64748b); font-weight:700; }
.qp-start-steps { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.qp-start-step { min-width:150px; padding:13px 14px; border-radius:18px; background:rgba(255,255,255,.72); border:1px solid rgba(148,163,184,.20); text-decoration:none; color:inherit; display:flex; flex-direction:column; gap:3px; }
.qp-start-step span { font-size:22px; }
.qp-start-step b { font-size:14px; }
.qp-start-step small { color:var(--qp-muted,#64748b); font-weight:700; }
.qp-start-step.primary { background: linear-gradient(135deg, rgba(79,70,229,.14), rgba(6,182,212,.12)); border-color: rgba(79,70,229,.22); }

.qp-friendly-empty {
  grid-column: 1/-1;
  text-align:center;
  border:1px dashed rgba(148,163,184,.45);
  border-radius:22px;
  padding:28px 20px;
  background:rgba(248,250,252,.72);
  color:var(--qp-text,#111827);
}
.qp-friendly-empty .icon { font-size:34px; display:block; margin-bottom:6px; }
.qp-friendly-empty h3 { margin: 0 0 6px; font-size:20px; }
.qp-friendly-empty p { margin:0 auto 14px; max-width:520px; color:var(--qp-muted,#64748b); font-weight:700; }
.qp-card-menu { position:relative; }
.qp-card-menu > summary { list-style:none; cursor:pointer; }
.qp-card-menu > summary::-webkit-details-marker { display:none; }
.qp-card-menu-panel {
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  z-index:20;
  min-width:165px;
  display:grid;
  gap:6px;
  padding:8px;
  border-radius:16px;
  background:#fff;
  border:1px solid rgba(148,163,184,.25);
  box-shadow:0 18px 38px rgba(15,23,42,.18);
}
.qp-card-menu-panel .qp-btn { justify-content:flex-start; width:100%; }
.qp-global-confirm { position:fixed; inset:0; z-index:9999; display:grid; place-items:center; padding:18px; opacity:0; pointer-events:none; transition:.16s ease; }
.qp-global-confirm[hidden] { display:none !important; }
.qp-global-confirm.show { opacity:1; pointer-events:auto; }
.qp-global-confirm-backdrop { position:absolute; inset:0; background:rgba(15,23,42,.58); backdrop-filter:blur(8px); }
.qp-global-confirm-card { position:relative; width:min(460px, 100%); border-radius:26px; background:var(--qp-card,#fff); color:var(--qp-text,#111827); border:1px solid rgba(148,163,184,.25); box-shadow:0 28px 70px rgba(15,23,42,.25); padding:22px; display:grid; grid-template-columns:auto 1fr; gap:16px; }
.qp-global-confirm-icon { width:46px; height:46px; border-radius:16px; display:grid; place-items:center; background:rgba(239,68,68,.12); color:#dc2626; font-weight:900; font-size:24px; }
.qp-global-confirm-card.is-success { border-color:rgba(16,185,129,.32); box-shadow:0 28px 70px rgba(15,23,42,.25),0 0 0 5px rgba(16,185,129,.08); }
.qp-global-confirm-card.is-success .qp-global-confirm-icon { background:#dcfce7; color:#15803d; box-shadow:inset 0 0 0 1px rgba(22,163,74,.2); animation:qp-success-pop .34s ease-out; }
.qp-global-confirm-card.is-success .qp-pill { background:#dcfce7; color:#166534; }
@keyframes qp-success-pop { 0% { transform:scale(.72); opacity:.3; } 70% { transform:scale(1.08); } 100% { transform:scale(1); opacity:1; } }
.qp-global-confirm-copy h3 { margin:4px 0 6px; font-size:22px; }
.qp-global-confirm-copy p:last-child { margin:0; color:var(--qp-muted,#64748b); font-weight:700; line-height:1.5; }
.qp-global-confirm-actions { grid-column:1/-1; display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.qp-global-confirm-actions [hidden] { display:none !important; }
.qp-global-confirm-input { margin-top:10px; width:100%; display:block; }
.qp-role-choice-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:18px 0; }
.qp-role-choice { border:1px solid rgba(148,163,184,.25); border-radius:20px; background:rgba(255,255,255,.82); padding:16px 12px; text-align:left; cursor:pointer; box-shadow:0 12px 24px rgba(15,23,42,.06); transition:.16s ease; color:inherit; }
.qp-role-choice:hover { transform:translateY(-2px); border-color:rgba(79,70,229,.35); }
.qp-role-choice span { font-size:30px; display:block; margin-bottom:8px; }
.qp-role-choice b { display:block; font-size:16px; }
.qp-role-choice small { color:var(--qp-muted,#64748b); font-weight:700; }
.qp-auth-back-row { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; }
.qp-student-fast-note { text-align:center; color:var(--qp-muted,#64748b); font-weight:800; margin-top:10px; }
@media (max-width: 860px) {
  .qp-start-panel { grid-template-columns:1fr; }
  .qp-start-steps { justify-content:stretch; }
  .qp-start-step { flex:1; min-width:120px; }
  .qp-role-choice-grid { grid-template-columns:1fr; }
  .qp-top-space-chip { width:100%; justify-content:center; }
}

/* v1.15.4 inline teaching-space selector and stable card layout */
.qp-dashboard-content > .qp-space-setup-overlay{
  position:static!important;
  inset:auto!important;
  z-index:auto!important;
  display:block!important;
  place-items:unset!important;
  width:100%!important;
  margin:0 0 18px!important;
  padding:0!important;
  background:transparent!important;
  backdrop-filter:none!important;
  opacity:1!important;
  pointer-events:auto!important;
  overflow:visible!important;
  transition:none!important;
}
.qp-dashboard-content > .qp-space-setup-overlay[hidden]{display:none!important}
.qp-dashboard-content > .qp-space-setup-overlay.show{opacity:1!important;pointer-events:auto!important}
.qp-dashboard-content > .qp-space-setup-overlay.setup-required{
  background:transparent!important;
  padding:0!important;
  overflow:visible!important;
}
.qp-dashboard-content > .qp-space-setup-overlay .qp-space-setup-card,
.qp-dashboard-content > .qp-space-setup-overlay.setup-required .qp-space-setup-card{
  width:100%!important;
  max-width:none!important;
  max-height:none!important;
  overflow:visible!important;
  margin:0!important;
  border-radius:30px!important;
  padding:24px!important;
  background:linear-gradient(135deg,#ffffff,#faf5ff)!important;
  border:1px solid rgba(139,92,246,.18)!important;
  box-shadow:0 20px 60px rgba(76,29,149,.12)!important;
}
.qp-dashboard-content > .qp-space-setup-overlay .qp-space-setup-head{
  display:grid;
  gap:6px;
}
.qp-dashboard-content > .qp-space-setup-overlay .qp-space-setup-head h2{
  margin:4px 0 0;
}
body.qp-space-setup-required{overflow:auto!important}

@media (max-width:760px){
  .qp-dashboard-content > .qp-space-setup-overlay .qp-space-setup-card,
  .qp-dashboard-content > .qp-space-setup-overlay.setup-required .qp-space-setup-card{
    border-radius:24px!important;
    padding:18px!important;
  }
}

/* v1.20.0 concise copy and high-contrast admin/status labels */
.qp-admin-users-page .qp-step-number {
  color: #111827 !important;
  background: #f3f4f6 !important;
  border: 1px solid #d1d5db !important;
  box-shadow: none !important;
}

.qp-admin-users-page .qp-user-import-step h3 { color: #111827 !important; }

.qp-question-bank-hero .qp-pill.inverse,
.qp-server-hero .qp-pill.inverse {
  color: #111827 !important;
  background: #ffffff !important;
  border-color: rgba(17, 24, 39, .18) !important;
}

#libraryCollegeHeading:empty,
#statusSub:empty,
#adminImportPlacementSummary[hidden] { display: none !important; }

/* Final shared-shell layer. Keep the QuizPulse home brand visible above stable labels. */
@media (min-width: 1181px) {
  .qp-dashboard-clean .qp-dashboard-shell {
    grid-template-columns: var(--qp-app-sidebar-width, 216px) minmax(0, 1fr) !important;
  }

  .qp-dashboard-clean .qp-dashboard-sidebar {
    width: var(--qp-app-sidebar-width, 216px) !important;
    padding: 16px 12px !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-height: 54px !important;
    margin: 0 0 8px !important;
    padding: 6px 8px !important;
    gap: 10px !important;
    color: #ffffff !important;
    font-size: 21px !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo > span:last-child,
  .qp-dashboard-clean .qp-dashboard-logo-title {
    display: inline-flex !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    color: #ffffff !important;
    font-size: 21px !important;
    clip: auto !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo-icon {
    display: grid !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    place-items: center !important;
    font-size: 21px !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav {
    justify-items: stretch !important;
    grid-auto-rows: 48px !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link {
    display: flex !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 48px !important;
    padding: 5px 8px !important;
    gap: 10px !important;
    font-size: 14px !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav .qp-nav-label {
    position: static !important;
    display: inline !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    color: inherit !important;
    font-size: 14px !important;
    clip: auto !important;
    white-space: nowrap !important;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .qp-mobile-menu-btn {
    gap: 8px !important;
    min-width: 86px !important;
    min-height: 44px !important;
    padding: 10px 12px !important;
    border: 1px solid rgba(109, 40, 217, .18) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    color: #46178f !important;
    font: inherit !important;
    font-weight: 950 !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08) !important;
  }

  .qp-mobile-menu-btn span { font-size: 20px !important; line-height: 1 !important; }
  .qp-mobile-menu-btn b { font-size: 13px !important; }
}

@media (max-width: 520px) {
  #adminUserRoleBadge,
  #academicRoleBadge { display: none !important; }
}

/* Final shared sidebar layer: keep QuizPulse and every short label fully visible. */
@media (min-width: 1181px) {
  .qp-dashboard-clean .qp-dashboard-sidebar {
    display: flex !important;
    flex-direction: column !important;
    width: var(--qp-app-sidebar-width, 216px) !important;
    padding: 16px 12px !important;
  }

  .qp-dashboard-clean .qp-dashboard-sidebar .qp-dashboard-logo {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 54px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    margin: 0 0 8px !important;
    padding: 6px 8px !important;
    color: #ffffff !important;
    font-size: 21px !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo-title,
  .qp-dashboard-clean .qp-dashboard-logo > span:last-child {
    position: static !important;
    display: inline-flex !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    color: #ffffff !important;
    font-size: 21px !important;
    white-space: nowrap !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo-title strong { color: #c4b5fd !important; }

  .qp-dashboard-clean .qp-dashboard-nav {
    display: grid !important;
    grid-auto-rows: 48px !important;
    width: 100% !important;
    justify-items: stretch !important;
    gap: 7px !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 48px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 5px 8px !important;
    font-size: 14px !important;
    white-space: nowrap !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav .qp-nav-label {
    position: static !important;
    display: block !important;
    flex: 1 1 auto !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    color: inherit !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }
}

.qp-academic-builder-grid .step {
  color: #111827 !important;
  background: #f3f4f6 !important;
  border: 1px solid #d1d5db !important;
  box-shadow: none !important;
}

/* v1.15.4 college page */
.qp-college-page .qp-college-layout{display:grid;grid-template-columns:minmax(260px,.95fr) minmax(320px,1.2fr);gap:18px;align-items:start}.qp-college-manager-card{width:auto;max-height:none;overflow:visible;box-shadow:0 20px 55px rgba(76,29,149,.10)}.qp-college-page-grid{grid-template-columns:1fr}.qp-college-manage-card{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;min-height:auto;padding:12px}.qp-college-main-btn{appearance:none;border:0;background:transparent;text-align:left;display:grid;grid-template-columns:auto 1fr;column-gap:10px;row-gap:3px;align-items:center;cursor:pointer;color:inherit}.qp-college-main-btn span{grid-row:1/3}.qp-college-main-btn b{font-size:1rem}.qp-college-main-btn small{font-weight:800;color:#64748b}.qp-college-hero .qp-dashboard-hero-status strong{font-size:clamp(1.5rem,3vw,2.4rem);line-height:1.05}.qp-college-page .qp-subject-choice-card{grid-template-columns:1fr auto}.qp-college-page .qp-btn.tiny.danger{background:#fee2e2;color:#b91c1c;border-color:#fecaca}.qp-college-page .qp-btn.tiny.danger:hover{background:#fecaca}.qp-dashboard-nav a[href="/college"] span{font-size:1.05em}@media (max-width:980px){.qp-college-page .qp-college-layout{grid-template-columns:1fr}}@media (max-width:640px){.qp-college-manage-card,.qp-college-page .qp-subject-choice-card{grid-template-columns:1fr}.qp-college-page .qp-btn.tiny.danger{justify-self:start}.qp-college-main-btn{grid-template-columns:auto 1fr}}


.qp-space-selection-actions{margin:12px 0 2px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}.qp-space-selection-actions[hidden]{display:none}.qp-space-selection-actions small{color:#64748b;font-weight:800}.qp-space-selection-actions .qp-btn.subtle{background:#f8fafc;color:#334155;border:1px solid rgba(148,163,184,.35)}.qp-space-selection-actions .qp-btn.subtle:hover{background:#eef2ff;color:#3730a3}


/* v1.16.0: always show the current logged-in profile in the top-right area. */
.qp-account-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--qp-text, #0f172a);
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(124,58,237,.18);
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
}
.qp-account-chip:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(15,23,42,.12); }
.qp-account-chip-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(124,58,237,.14), rgba(14,165,233,.12));
  font-size: 18px;
}
.qp-account-chip small,
.qp-account-chip em {
  display: block;
  font-size: 11px;
  line-height: 1.1;
  color: var(--qp-muted, #64748b);
  font-style: normal;
  font-weight: 700;
}
.qp-account-chip b { display: block; font-size: 13px; line-height: 1.15; }


@media (max-width: 760px) {
  .qp-account-chip { width: 100%; justify-content: center; }
}

/* v1.16.10: graphics stability fix
   Some Chromium/Windows GPUs flicker when interactive cards combine
   content-visibility:auto + hover transforms + heavy shadows. Keep the same
   style, but make interactive cards render normally and use paint-safe hover. */
.qp-template-card,
.qp-library-card,
.qp-kahoot-quiz-card,
.qp-quick-card,
.qp-settings-card,
.qp-bank-card,
.qp-course-node,
.qp-subject-node,
.qp-college-select-card,
.qp-subject-choice-card,
.qp-space-action-card,
.qp-role-choice,
.qp-account-chip {
  content-visibility: visible !important;
  contain-intrinsic-size: auto !important;
  backface-visibility: hidden;
  transform: translateZ(0);
}
@media (hover: hover) and (pointer: fine) {
  .qp-template-card:hover,
  .qp-library-card:hover,
  .qp-kahoot-quiz-card:hover,
  .qp-quick-card:hover,
  .qp-settings-card:hover,
  .qp-bank-card:hover,
  .qp-college-select-card:hover,
  .qp-subject-choice-card:hover,
  .qp-space-action-card:hover,
  .qp-role-choice:hover,
  .qp-account-chip:hover {
    transform: translateZ(0) !important;
  }
}
.qp-dashboard-topbar,
.qp-library-topbar,
.qp-dashboard-sidebar,
.qp-card-menu,
.qp-kahoot-dropdown,
.qp-subject-more div {
  backface-visibility: hidden;
  transform: translateZ(0);
}
@supports (backdrop-filter: blur(1px)) {
  html[data-network="slow"] .qp-dashboard-topbar,
  html[data-network="save-data"] .qp-dashboard-topbar,
  html[data-network="slow"] .qp-library-topbar,
  html[data-network="save-data"] .qp-library-topbar {
    backdrop-filter: none !important;
  }
}

/* v1.17.0: public/private quiz visibility controls */
.qp-pill.success{background:#dcfce7;color:#166534;border-color:rgba(22,101,52,.18)}
.qp-pill.danger{background:#fee2e2;color:#991b1b;border-color:rgba(153,27,27,.18)}
.qp-visibility-field{display:flex;flex-direction:column;gap:5px;font-weight:800;font-size:12px;text-transform:uppercase;color:#64748b;min-width:145px}
.qp-visibility-field .qp-select{min-width:145px;text-transform:none;font-weight:800}

/* v1.17.1: cleaner Create Quiz window and public/private control for all roles */
.qp-create-modal-card-clean {
  width: min(760px, 100%);
  border-radius: 30px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid rgba(255,255,255,.72);
}
.qp-create-mode-body-clean {
  grid-template-columns: repeat(2, minmax(240px, 1fr)) !important;
  gap: 18px;
  padding: 26px;
  max-height: none;
}
.qp-create-mode-body-clean .qp-create-option {
  min-height: 230px;
  border-radius: 26px;
  border: 1px solid rgba(148,163,184,.22);
  box-shadow: 0 18px 44px rgba(15,23,42,.08);
  text-decoration: none;
}
.qp-create-mode-body-clean .qp-create-option:hover,
.qp-create-mode-body-clean .qp-create-option:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 26px 60px rgba(91,33,182,.16);
}
.qp-create-mode-body-clean .qp-create-option-icon {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  margin-top: 18px;
}
.qp-create-modal-foot-clean {
  justify-content: center;
  text-align: center;
  padding: 15px 24px 20px;
}
.qp-create-modal-foot-clean span {
  max-width: 620px;
}
.qp-visibility-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: min(360px, 100%);
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(248,250,252,.92);
  border: 1px solid rgba(148,163,184,.22);
}
.qp-visibility-copy { display: grid; gap: 2px; min-width: 0; }
.qp-visibility-copy b {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #334155;
}
.qp-visibility-copy span {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}
.qp-visibility-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 5px;
  padding: 5px;
  border-radius: 999px;
  background: #e2e8f0;
}
.qp-visibility-switch button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  padding: 9px 11px;
  font-weight: 950;
  cursor: pointer;
  white-space: nowrap;
}
.qp-visibility-switch button.active {
  background: #fff;
  color: #4c1d95;
  box-shadow: 0 6px 18px rgba(15,23,42,.12);
}


@media (max-width: 760px) {
  .qp-create-mode-body-clean { grid-template-columns: 1fr !important; }
  .qp-visibility-card { grid-template-columns: 1fr; }
  .qp-visibility-switch { width: 100%; }
}

/* v1.17.9 Admin Center */
.qp-admin-center-body .qp-dashboard-content { max-width: 1280px; }
.qp-admin-content .qp-dashboard-settings { overflow: visible; }
.qp-admin-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap:16px; }
.qp-admin-toolbar { display:grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap:10px; align-items:center; margin-bottom:16px; }
.qp-admin-switch { display:flex; gap:8px; margin:0 0 14px; }
.qp-admin-table-wrap { overflow:auto; border:1px solid rgba(124, 58, 237, .14); border-radius:18px; background:rgba(255,255,255,.88); box-shadow:0 14px 34px rgba(31, 41, 55, .06); }
.qp-admin-table { width:100%; border-collapse:separate; border-spacing:0; min-width:760px; }
.qp-admin-table th, .qp-admin-table td { padding:14px 16px; text-align:left; border-bottom:1px solid rgba(124,58,237,.12); vertical-align:middle; }
.qp-admin-table th { font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:#6d28d9; background:rgba(124,58,237,.06); }
.qp-admin-table tr:last-child td { border-bottom:0; }
.qp-admin-table small, .qp-admin-owner { display:block; color:#64748b; margin-top:4px; font-size:12px; }
.qp-admin-user-cell { display:flex; gap:10px; align-items:center; }
.qp-admin-user-cell > span { width:38px; height:38px; display:grid; place-items:center; border-radius:14px; background:linear-gradient(135deg,#ede9fe,#fff7ed); font-size:22px; }
.qp-admin-profile-link { color:#5b21b6; font-weight:800; text-decoration:none; }
.qp-admin-profile-link:hover, .qp-admin-profile-link:focus-visible { text-decoration:underline; text-underline-offset:2px; }
.qp-admin-edit-form { display:grid; grid-template-columns: repeat(5, minmax(140px, 1fr)) auto; gap:10px; align-items:end; }
.qp-admin-edit-form label { font-weight:800; font-size:12px; color:#334155; display:grid; gap:6px; }
.qp-admin-visibility { font-weight:900; font-size:12px; padding:6px 10px; border-radius:999px; text-transform:capitalize; }
.qp-admin-visibility.public { background:#ecfeff; color:#0369a1; }
.qp-admin-visibility.private { background:#fff7ed; color:#c2410c; }
.qp-admin-live-card.is-private, .qp-admin-quiz-card.is-private { border-color:rgba(249,115,22,.28); }
.qp-admin-live-meta { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.qp-admin-live-meta span { border:1px solid rgba(124,58,237,.14); background:rgba(124,58,237,.05); border-radius:999px; padding:6px 10px; font-size:12px; font-weight:800; color:#4338ca; }
.qp-admin-current-question { border:1px dashed rgba(124,58,237,.22); background:rgba(248,250,252,.8); border-radius:16px; padding:12px; margin:10px 0; }
.qp-admin-current-question b, .qp-admin-current-question small { display:block; }
.qp-admin-current-question small { color:#64748b; margin-top:4px; }
.qp-admin-player-list { display:grid; gap:6px; max-height:180px; overflow:auto; padding:8px; border-radius:14px; background:rgba(15,23,42,.03); }
.qp-admin-player-list span { display:flex; justify-content:space-between; gap:8px; font-size:12px; font-weight:800; }
.qp-admin-player-list em { color:#64748b; font-style:normal; white-space:nowrap; }
.qp-admin-spectator { width:min(1040px, calc(100% - 32px)); max-height:min(860px, calc(100dvh - 32px)); padding:0; border:0; border-radius:8px; background:#f8fafc; color:#111827; box-shadow:0 28px 90px rgba(15,23,42,.36); }
.qp-admin-spectator::backdrop { background:rgba(15,23,42,.62); backdrop-filter:blur(4px); }
.qp-admin-spectator > section { display:grid; gap:16px; padding:20px; max-height:inherit; overflow:auto; }
.qp-admin-spectator header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; position:sticky; top:-20px; z-index:2; padding:20px 0 12px; background:#f8fafc; }
.qp-admin-spectator header h2, .qp-admin-spectator header p { margin:4px 0 0; }
.qp-admin-spectator header p { color:#64748b; font-weight:700; }
.qp-admin-spectator-stats { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:10px; }
.qp-admin-spectator-stats > div { display:grid; gap:3px; padding:12px 14px; border:1px solid #dbe2ea; border-radius:8px; background:#fff; }
.qp-admin-spectator-stats span { color:#64748b; font-size:11px; font-weight:800; text-transform:uppercase; }
.qp-admin-spectator-stats strong { font-size:22px; }
.qp-admin-spectator-question { display:grid; gap:7px; min-height:116px; align-content:center; padding:18px 20px; border:1px solid #dbe2ea; border-radius:8px; background:#fff; }
.qp-admin-spectator-question h3, .qp-admin-spectator-question p { margin:0; }
.qp-admin-spectator-question > span { color:#6328d7; font-size:11px; font-weight:850; text-transform:uppercase; }
.qp-admin-spectator-columns { display:grid; grid-template-columns:1fr 1fr; gap:14px; min-height:260px; }
.qp-admin-spectator-columns > section { min-width:0; padding:14px; border:1px solid #dbe2ea; border-radius:8px; background:#fff; }
.qp-admin-spectator-columns h3 { margin:0 0 10px; }
.qp-admin-spectator-list { display:grid; gap:6px; }
.qp-admin-spectator-list > div { display:grid; grid-template-columns:28px minmax(0,1fr) auto; align-items:center; gap:8px; min-height:42px; padding:7px 9px; border-radius:6px; background:#f8fafc; }
.qp-admin-spectator-list b { color:#7c3aed; }
html[data-theme="dark"] .qp-admin-spectator, html[data-theme="dark"] .qp-admin-spectator header { background:#0f172a; color:#f8fafc; }
html[data-theme="dark"] .qp-admin-spectator-stats > div, html[data-theme="dark"] .qp-admin-spectator-question, html[data-theme="dark"] .qp-admin-spectator-columns > section { border-color:#334155; background:#111827; }
html[data-theme="dark"] .qp-admin-spectator-list > div { background:#1e293b; }
@media (max-width:700px) {
  .qp-admin-spectator { width:100%; height:100dvh; max-height:100dvh; border-radius:0; }
  .qp-admin-spectator > section { padding:14px; }
  .qp-admin-spectator header { top:-14px; padding:14px 0 10px; }
  .qp-admin-spectator-stats { grid-template-columns:1fr 1fr; }
  .qp-admin-spectator-columns { grid-template-columns:1fr; }
}

/* Admin Host POV uses the real Host renderer inside a locked, read-only frame. */
.qp-admin-spectator { width:min(1500px, calc(100% - 24px)); height:min(930px, calc(100dvh - 24px)); max-height:none; overflow:hidden; }
.qp-admin-spectator > section { grid-template-rows:auto minmax(0,1fr); gap:0; height:100%; max-height:none; padding:0; overflow:hidden; }
.qp-admin-spectator header { position:relative; top:auto; align-items:center; padding:12px 16px; border-bottom:1px solid #dbe2ea; }
.qp-admin-spectator header .qp-actions { flex-wrap:nowrap; }
.qp-admin-host-pov { display:block; width:100%; height:100%; min-height:0; border:0; background:#24134e; }
.qp-admin-host-spectator #hostApp button,
.qp-admin-host-spectator #hostApp a,
.qp-admin-host-spectator #hostApp input,
.qp-admin-host-spectator #hostApp select,
.qp-admin-host-spectator #hostApp textarea,
.qp-admin-host-spectator #hostApp summary { cursor:default !important; }
.qp-admin-host-spectator .qp-host-phase-arrow,
.qp-admin-host-spectator .qp-host-livebar-tools,
.qp-admin-host-spectator .qp-final-actions { opacity:.42; }
.qp-host-spectator-embedded .qp-game-topbar { display:none !important; }
.qp-host-spectator-embedded .qp-host-layout { min-height:100dvh; padding:0 !important; }
.qp-host-spectator-embedded .qp-host-layout > #hostApp { min-height:100dvh; border-radius:0 !important; }
html[data-theme="dark"] .qp-admin-spectator header { border-color:#334155; }
@media (max-width:700px) {
  .qp-admin-spectator { width:100%; height:100dvh; }
  .qp-admin-spectator header { padding:10px 12px; }
  .qp-admin-spectator header h2 { font-size:18px; }
  .qp-admin-spectator header p { font-size:11px; }
  .qp-admin-spectator header .qp-btn.danger { min-height:38px; padding:8px 10px; font-size:12px; }
}
.qp-admin-mini-empty { color:#64748b; font-size:12px; padding:8px; border-radius:12px; background:rgba(15,23,42,.03); }


@media (max-width: 900px) {
  .qp-admin-toolbar { grid-template-columns:1fr; }
  .qp-admin-edit-form { grid-template-columns:1fr; }
}

/* v1.17.9 High Performance mode controls */
.qp-performance-choice { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.qp-performance-choice button { border:1px solid rgba(124,58,237,.22); background:#fff; color:#4c1d95; border-radius:14px; padding:9px 12px; font-weight:950; cursor:pointer; box-shadow:0 6px 16px rgba(76,29,149,.08); }
.qp-performance-choice button.active { background:linear-gradient(135deg,#6d28d9,#8b5cf6); color:#fff; border-color:transparent; }
.qp-performance-choice.compact button { padding:6px 9px; border-radius:999px; font-size:12px; }
.qp-live-performance-mini { display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; margin:10px auto; padding:8px 10px; border:1px solid rgba(124,58,237,.14); background:rgba(255,255,255,.72); border-radius:18px; color:#4c1d95; font-weight:900; width:max-content; max-width:100%; }


html[data-qp-performance="high"] { scroll-behavior:auto !important; }
html[data-qp-performance="high"] :is(
  #hostApp > *,
  #playerApp > *,
  .qp-waiting-dots span,
  .qp-boost,
  .qp-confetti,
  .qp-pulse-bg,
  .qp-avatar-emoji,
  .qp-player-avatar,
  .qp-simple-avatar,
  .qp-lobby-player-avatar,
  .qp-lb-row,
  .qp-winner-card,
  .qp-winner-avatar,
  .qp-top10-theater,
  .qp-top10-card,
  .qp-top10-avatar,
  .qp-avatar-premium,
  .qp-hotspot-correct-area,
  .qp-rank-change
) { animation:none !important; }
html[data-qp-performance="high"] .qp-winner-card::before { animation:none !important; }
html[data-qp-performance="high"] .qp-lobby-grid { display:none !important; }


/* v1.18.0 dashboard shell refresh: Kahoot-inspired, existing items only */
:root {
  --qp-shell-topbar-h: 76px;
  --qp-shell-sidebar-w: 232px;
  --qp-shell-bg: #f3f4f6;
  --qp-shell-surface: #ffffff;
  --qp-shell-surface-2: #fbfbfe;
  --qp-shell-text: #1f2937;
  --qp-shell-muted: #5f6675;
  --qp-shell-line: rgba(15, 23, 42, .10);
  --qp-shell-primary: var(--qp-purple, #5b21b6);
  --qp-shell-primary-2: var(--qp-purple-2, #7c3aed);
  --qp-shell-primary-soft: rgba(109, 40, 217, .11);
  --qp-shell-shadow: 0 8px 26px rgba(17, 24, 39, .08);
}


body.qp-dashboard-clean,
body.qp-home-dashboard-body {
  background: var(--qp-shell-bg) !important;
}
.qp-dashboard-clean .qp-dashboard-shell {
  grid-template-columns: var(--qp-shell-sidebar-w) minmax(0, 1fr) !important;
  min-height: 100vh !important;
}
.qp-dashboard-clean .qp-dashboard-sidebar {
  position: fixed !important;
  left: 0 !important;
  top: var(--qp-shell-topbar-h) !important;
  width: var(--qp-shell-sidebar-w) !important;
  height: calc(100vh - var(--qp-shell-topbar-h)) !important;
  min-height: 0 !important;
  z-index: 41 !important;
  padding: 10px 14px 16px !important;
  gap: 10px !important;
  border-right: 1px solid var(--qp-shell-line) !important;
  border-radius: 0 !important;
  background: var(--qp-shell-surface) !important;
  box-shadow: 10px 0 26px rgba(17, 24, 39, .045) !important;
  overflow-y: auto !important;
  scrollbar-width: thin;
}
.qp-dashboard-clean .qp-dashboard-sidebar .qp-dashboard-logo {
  display: none !important;
}
.qp-dashboard-clean .qp-dashboard-main {
  grid-column: 2 !important;
  min-height: 100vh !important;
  padding-top: var(--qp-shell-topbar-h) !important;
  background: var(--qp-shell-bg) !important;
}
.qp-dashboard-clean .qp-dashboard-topbar {
  position: fixed !important;
  inset: 0 0 auto 0 !important;
  min-height: var(--qp-shell-topbar-h) !important;
  height: var(--qp-shell-topbar-h) !important;
  z-index: 70 !important;
  padding: 0 20px !important;
  gap: 18px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--qp-shell-line) !important;
  border-radius: 0 !important;
  background: var(--qp-shell-surface) !important;
  color: var(--qp-shell-text) !important;
  box-shadow: var(--qp-shell-shadow) !important;
  backdrop-filter: blur(16px);
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
}
.qp-topbar-brand {
  width: calc(var(--qp-shell-sidebar-w) - 6px);
  min-width: calc(var(--qp-shell-sidebar-w) - 6px);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--qp-shell-primary) !important;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -.05em;
  text-decoration: none;
  white-space: nowrap;
}
.qp-topbar-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--qp-shell-primary), var(--qp-shell-primary-2));
  color: #fff;
  box-shadow: 0 10px 20px rgba(109, 40, 217, .22);
}
.qp-topbar-brand strong { color: var(--qp-shell-primary-2); font-weight: 950; }
.qp-dashboard-clean .qp-dashboard-title-group {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
.qp-dashboard-clean .qp-dashboard-title-group h1 {
  color: var(--qp-shell-text) !important;
  font-size: 20px !important;
  letter-spacing: -.035em !important;
  line-height: 1.05 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qp-dashboard-clean .qp-dashboard-title-group p {
  color: var(--qp-shell-muted) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qp-dashboard-clean .qp-dashboard-top-actions {
  margin-left: auto !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  flex-wrap: nowrap !important;
}
.qp-dashboard-clean .qp-dashboard-top-actions .qp-btn,
.qp-dashboard-clean .qp-dashboard-top-actions a.qp-btn,
.qp-dashboard-clean .qp-dashboard-top-actions button.qp-btn {
  min-height: 42px;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  font-weight: 900 !important;
  box-shadow: none !important;
}
.qp-dashboard-clean .qp-theme-toggle {
  background: var(--qp-shell-primary-soft) !important;
  color: var(--qp-shell-primary) !important;
  border-color: transparent !important;
}
.qp-dashboard-clean .qp-dashboard-nav {
  display: grid !important;
  gap: 4px !important;
  align-content: start;
}
.qp-dashboard-clean .qp-dashboard-nav a,
.qp-dashboard-clean .qp-dashboard-side-bottom a {
  min-height: 44px;
  padding: 11px 13px !important;
  gap: 12px !important;
  border-radius: 6px !important;
  color: var(--qp-shell-text) !important;
  background: transparent !important;
  font-weight: 820 !important;
  letter-spacing: -.01em;
  text-decoration: none;
  transition: background .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.qp-dashboard-clean .qp-dashboard-nav a span,
.qp-dashboard-clean .qp-dashboard-side-bottom a span {
  width: 23px !important;
  height: 23px !important;
  display: inline-grid !important;
  place-items: center !important;
  color: var(--qp-shell-primary) !important;
  flex: 0 0 23px;
}
.qp-dashboard-clean .qp-dashboard-nav a:hover,
.qp-dashboard-clean .qp-dashboard-side-bottom a:hover {
  background: var(--qp-shell-primary-soft) !important;
  color: var(--qp-shell-primary) !important;
  transform: none !important;
}
.qp-dashboard-clean .qp-dashboard-nav a.active {
  background: linear-gradient(135deg, var(--qp-shell-primary), var(--qp-shell-primary-2)) !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(109, 40, 217, .22) !important;
  transform: none !important;
}
.qp-dashboard-clean .qp-dashboard-nav a.active span {
  color: #fff !important;
}
.qp-dashboard-clean .qp-space-chip,
.qp-dashboard-clean .qp-top-space-chip {
  border-radius: 12px !important;
  border: 1px solid var(--qp-shell-line) !important;
  background: var(--qp-shell-surface-2) !important;
  color: var(--qp-shell-text) !important;
  box-shadow: none !important;
}
.qp-dashboard-clean .qp-top-space-chip {
  min-height: 42px;
  padding: 7px 10px !important;
}
.qp-dashboard-clean .qp-dashboard-content,
.qp-library-content-shell {
  width: min(100%, 1520px) !important;
  padding: 26px 28px 46px !important;
}
.qp-dashboard-clean .qp-dashboard-settings,
.qp-dashboard-clean .qp-dashboard-stats div,
.qp-dashboard-clean .qp-template-card,
.qp-dashboard-clean .qp-library-card,
.qp-dashboard-clean .qp-course-node,
.qp-dashboard-clean .qp-subject-node,
.qp-dashboard-clean .qp-settings-card,
.qp-dashboard-clean .qp-stat-table-only,
.qp-dashboard-clean .qp-admin-table-wrap,
.qp-dashboard-clean .qp-admin-grid > *,
.qp-dashboard-clean .qp-empty {
  border-color: var(--qp-shell-line) !important;
  box-shadow: 0 8px 20px rgba(17, 24, 39, .055) !important;
}
.qp-dashboard-clean .qp-section-title-row h2 { color: var(--qp-shell-text) !important; }


/* Keep creator/host top bars visually aligned with the dashboard shell without adding actions */
.qp-world-topbar,
.qp-game-topbar,
.qp-topbar {
  border-bottom: 1px solid var(--qp-shell-line, rgba(15,23,42,.10)) !important;
  background: var(--qp-shell-surface, #fff) !important;
  color: var(--qp-shell-text, #1f2937) !important;
  box-shadow: var(--qp-shell-shadow, 0 8px 26px rgba(17,24,39,.08)) !important;
}
.qp-world-topbar .qp-brand,
.qp-game-topbar .qp-brand,
.qp-topbar .qp-brand {
  color: var(--qp-shell-primary, #5b21b6) !important;
  font-weight: 950 !important;
}
.qp-world-topbar .qp-logo,
.qp-game-topbar .qp-logo,
.qp-topbar .qp-logo {
  background: linear-gradient(135deg, var(--qp-shell-primary, #5b21b6), var(--qp-shell-primary-2, #7c3aed)) !important;
  color: #fff !important;
}
.qp-world-topbar .qp-title-chip {
  border-color: var(--qp-shell-line, rgba(15,23,42,.10)) !important;
  background: var(--qp-shell-surface-2, #fbfbfe) !important;
  box-shadow: none !important;
}
.qp-world-topbar .qp-actions .qp-btn,
.qp-game-topbar .qp-actions .qp-btn,
.qp-topbar .qp-actions .qp-btn {
  border-radius: 10px !important;
}

@media (max-width: 980px) {
  :root { --qp-shell-topbar-h: auto; --qp-shell-sidebar-w: 0px; }
  .qp-dashboard-clean .qp-dashboard-shell { display: block !important; }
  .qp-dashboard-clean .qp-dashboard-main { padding-top: 0 !important; }
  .qp-dashboard-clean .qp-dashboard-topbar {
    position: sticky !important;
    top: 0 !important;
    height: auto !important;
    min-height: 72px !important;
    padding: 12px !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
  }
  .qp-topbar-brand {
    width: auto;
    min-width: 0;
    font-size: 21px;
  }
  .qp-topbar-brand-icon { width: 34px; height: 34px; }
  .qp-dashboard-clean .qp-dashboard-title-group {
    order: 3;
    flex: 1 0 100% !important;
  }
  .qp-dashboard-clean .qp-dashboard-title-group h1,
  .qp-dashboard-clean .qp-dashboard-title-group p { white-space: normal; }
  /* nowrap + justify-content:flex-end made overflowing header actions escape past
     the start edge, where they were clipped and unreachable. Wrap onto a second
     row instead of hiding them behind a scroll strip. */
  .qp-dashboard-clean .qp-dashboard-top-actions {
    margin-left: auto !important;
    flex-wrap: wrap !important;
    max-width: 100%;
  }
  .qp-dashboard-clean .qp-dashboard-sidebar {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    top: auto !important;
    width: auto !important;
    height: 66px !important;
    padding: 6px !important;
    border-radius: 24px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: color-mix(in srgb, var(--qp-shell-surface) 94%, transparent) !important;
    box-shadow: 0 16px 40px rgba(15,23,42,.18) !important;
    backdrop-filter: blur(12px);
  }
  .qp-dashboard-clean .qp-dashboard-nav {
    display: flex !important;
    flex-direction: row !important;
    gap: 5px !important;
    width: 100% !important;
    overflow-x: auto !important;
    scrollbar-width: none;
  }
  .qp-dashboard-clean .qp-dashboard-nav::-webkit-scrollbar { display: none; }
  .qp-dashboard-clean .qp-dashboard-nav a {
    flex: 1 0 74px !important;
    min-width: 74px !important;
    min-height: 50px !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 2px !important;
    padding: 7px 8px !important;
    border-radius: 17px !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    text-align: center !important;
    white-space: nowrap !important;
  }
  .qp-dashboard-clean .qp-dashboard-nav a span {
    width: auto !important;
    height: auto !important;
    font-size: 18px !important;
  }
  .qp-dashboard-clean .qp-space-chip { display: none !important; }
  .qp-dashboard-clean .qp-dashboard-content,
  .qp-library-content-shell { padding: 14px 12px 92px !important; }
  .qp-world-topbar,
  .qp-game-topbar,
  .qp-topbar { flex-wrap: wrap !important; height: auto !important; min-height: 64px !important; }
}

/* v1.18.1 full app style refresh: same QuizPulse items, one Kahoot-inspired visual language across pages */
:root {
  --qp-style-bg: #f2f2f5;
  --qp-style-surface: #ffffff;
  --qp-style-surface-2: #f8f7fb;
  --qp-style-text: #1d1b2f;
  --qp-style-muted: #5e6272;
  --qp-style-border: #e1ddec;
  --qp-style-accent: #46178f;
  --qp-style-accent-2: #6d28d9;
  --qp-style-accent-3: #7c3aed;
  --qp-style-accent-soft: #f0e7ff;
  --qp-style-shadow: 0 2px 8px rgba(15, 23, 42, .10);
  --qp-style-shadow-lift: 0 12px 30px rgba(42, 17, 101, .16);
  --qp-style-radius: 8px;
  --qp-style-radius-lg: 12px;
}


body.qp-home-dashboard-body,
body.qp-dashboard-clean,
body.qp-library-page-body,
body.qp-settings-pro-body,
body.qp-server-status-body,
body.qp-admin-center-body,
body.qp-teaching-space-body {
  background: var(--qp-style-bg) !important;
  color: var(--qp-style-text) !important;
}

/* Global shell: sidebar + header like the reference, but with existing QuizPulse menu items */
.qp-dashboard-clean .qp-dashboard-topbar {
  background: var(--qp-style-surface) !important;
  border-bottom: 1px solid var(--qp-style-border) !important;
  color: var(--qp-style-text) !important;
  box-shadow: var(--qp-style-shadow) !important;
}
.qp-dashboard-clean .qp-dashboard-sidebar {
  background: var(--qp-style-surface) !important;
  border-right: 1px solid var(--qp-style-border) !important;
  box-shadow: 2px 0 10px rgba(15,23,42,.05) !important;
}
.qp-topbar-brand {
  color: var(--qp-style-accent) !important;
  font-size: 25px !important;
  font-weight: 1000 !important;
  letter-spacing: -.06em !important;
}
.qp-topbar-brand-icon,
.qp-dashboard-logo-icon,
.qp-logo {
  border-radius: 7px !important;
  background: linear-gradient(135deg, var(--qp-style-accent), var(--qp-style-accent-2)) !important;
  color: #fff !important;
}
.qp-dashboard-clean .qp-dashboard-title-group h1,
.qp-library-title-group h1 {
  color: var(--qp-style-text) !important;
  font-weight: 950 !important;
}
.qp-dashboard-clean .qp-dashboard-title-group p,
.qp-library-title-group p,
.qp-muted {
  color: var(--qp-style-muted) !important;
}
.qp-dashboard-clean .qp-dashboard-nav a,
.qp-dashboard-clean .qp-dashboard-side-bottom a {
  border-radius: 5px !important;
  color: var(--qp-style-text) !important;
  font-weight: 800 !important;
}
.qp-dashboard-clean .qp-dashboard-nav a span,
.qp-dashboard-clean .qp-dashboard-side-bottom a span {
  color: var(--qp-style-accent) !important;
}
.qp-dashboard-clean .qp-dashboard-nav a:hover,
.qp-dashboard-clean .qp-dashboard-side-bottom a:hover {
  background: var(--qp-style-accent-soft) !important;
  color: var(--qp-style-accent) !important;
}
.qp-dashboard-clean .qp-dashboard-nav a.active {
  background: var(--qp-style-accent) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--qp-style-accent) 28%, transparent) !important;
}
.qp-dashboard-clean .qp-dashboard-nav a.active span { color: #fff !important; }
.qp-dashboard-content { background: transparent !important; }

/* Search/toolbars: consistent top-page controls */
.qp-search-wrap,
.qp-library-search,
.qp-admin-toolbar,
.qp-stat-filter-row,
.qp-create-course-grid,
.qp-location-card,
.qp-location-card-new {
  border-radius: var(--qp-style-radius-lg) !important;
}
.qp-search-wrap,
.qp-library-search {
  background: var(--qp-style-surface) !important;
  border: 1px solid #bfc4d2 !important;
  color: var(--qp-style-muted) !important;
  box-shadow: none !important;
}

.qp-search-wrap input,
.qp-library-search input { color: var(--qp-style-text) !important; }

/* Buttons: cleaner rectangular app style */
.qp-btn,
.qp-auth-tabs button,
.qp-auth-tab-link,
.qp-library-tabs button,
.qp-card-menu-btn,
.qp-create-close,
.qp-audio-toggle,
.qp-performance-choice button {
  border-radius: 6px !important;
  font-weight: 950 !important;
}
.qp-btn {
  background: var(--qp-style-surface) !important;
  border: 1px solid var(--qp-style-border) !important;
  color: var(--qp-style-text) !important;
  box-shadow: 0 2px 5px rgba(15,23,42,.08) !important;
}
.qp-btn:hover { transform: translateY(-1px) !important; box-shadow: var(--qp-style-shadow) !important; }
.qp-btn.primary,
.qp-auth-tabs .active,
.qp-btn.success,
.qp-dashboard-clean .qp-dashboard-top-actions .qp-btn.primary {
  background: var(--qp-style-accent) !important;
  border-color: var(--qp-style-accent) !important;
  color: #fff !important;
}
.qp-btn.danger { background: #e11d48 !important; border-color: #e11d48 !important; color: #fff !important; }
.qp-btn.ghost,
.qp-btn.subtle { background: transparent !important; box-shadow: none !important; }
.qp-theme-toggle,
.qp-dashboard-clean .qp-theme-toggle {
  background: var(--qp-style-accent-soft) !important;
  color: var(--qp-style-accent) !important;
  border-color: transparent !important;
}
.qp-pill,
.qp-status,
.qp-question-chip {
  border-radius: 999px !important;
  background: var(--qp-style-accent-soft) !important;
  color: var(--qp-style-accent) !important;
  font-weight: 950 !important;
}

/* Cards/sections: every page uses the same crisp card language */
.qp-dashboard-settings,
.qp-dashboard-library,
.qp-settings-card,
.qp-settings-card.big,
.qp-quick-card,
.qp-template-card,
.qp-library-card,
.qp-kahoot-quiz-card,
.qp-admin-table-wrap,
.qp-admin-grid > article,
.qp-admin-grid > div,
.qp-course-node,
.qp-subject-node,
.qp-location-choice,
.qp-table-wrap,
.qp-stat-table-only,
.qp-stat-table-wrap,
.qp-empty,
.qp-server-hero,
.qp-settings-pro-hero,
.qp-settings-pro-panel,
.qp-settings-pro-tabs,
.qp-status-grid > article {
  background: var(--qp-style-surface) !important;
  border: 1px solid var(--qp-style-border) !important;
  border-radius: var(--qp-style-radius-lg) !important;
  box-shadow: var(--qp-style-shadow) !important;
  color: var(--qp-style-text) !important;
}
.qp-quick-card:hover,
.qp-template-card:hover,
.qp-library-card:hover,
.qp-kahoot-quiz-card:hover,
.qp-settings-card:hover,
.qp-admin-grid > article:hover,
.qp-admin-grid > div:hover,
.qp-location-choice:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--qp-style-shadow-lift) !important;
}
.qp-dashboard-stats,
.qp-settings-hero-stats {
  gap: 14px !important;
}
.qp-dashboard-stats div,
.qp-settings-hero-stats div,
.qp-server-pulse {
  background: var(--qp-style-surface) !important;
  border: 1px solid var(--qp-style-border) !important;
  border-radius: var(--qp-style-radius-lg) !important;
  box-shadow: var(--qp-style-shadow) !important;
}
.qp-dashboard-stats strong,
.qp-settings-hero-stats b,
.qp-server-pulse {
  color: var(--qp-style-accent) !important;
}
.qp-dashboard-stats span,
.qp-settings-hero-stats span,
.qp-library-card p,
.qp-template-card p,
.qp-kahoot-owner,
.qp-system-row,
.qp-settings-card p {
  color: var(--qp-style-muted) !important;
}
.qp-section-title-row h2,
.qp-dashboard-settings h2,
.qp-settings-card h2,
.qp-settings-card h3,
.qp-template-card h3,
.qp-library-card h3,
.qp-kahoot-card-mainline h3,
.qp-course-node > summary,
.qp-subject-node > summary,
.qp-location-choice span {
  color: var(--qp-style-text) !important;
}

/* Dashboard hero/quick cards use stronger purple panels like the reference, but no new features */
.qp-dashboard-hero-simple,
.qp-kahootlike-hero,
.qp-server-hero,
.qp-settings-pro-hero {
  border-radius: 12px !important;
  background:
    radial-gradient(circle at 14% 10%, color-mix(in srgb, #ffffff 20%, transparent), transparent 28%),
    linear-gradient(135deg, var(--qp-style-accent) 0%, var(--qp-style-accent-2) 58%, var(--qp-style-accent-3) 100%) !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: var(--qp-style-shadow-lift) !important;
}
.qp-dashboard-hero-simple h2,
.qp-dashboard-hero-simple p,
.qp-settings-pro-hero h2,
.qp-settings-pro-hero p,
.qp-server-hero h2,
.qp-server-hero p { color: #fff !important; }
.qp-dashboard-hero-status,
.qp-settings-hero-avatar,
.qp-server-pulse {
  background: rgba(255,255,255,.16) !important;
  border: 1px solid rgba(255,255,255,.22) !important;
  color: #fff !important;
}
.qp-quick-card span,
.qp-profile-orb,
.qp-stat-avatar,
.qp-stat-profile,
.qp-library-generated-thumb {
  background: var(--qp-style-accent-soft) !important;
  color: var(--qp-style-accent) !important;
}
.qp-feature-card.ai,
.qp-feature-card.types,
.qp-feature-card.teams {
  background: linear-gradient(145deg, var(--qp-style-accent), var(--qp-style-accent-2)) !important;
}

/* Library / Question Bank card presentation */
.qp-library-tabs,
.qp-settings-pro-tabs {
  background: var(--qp-style-surface) !important;
  border: 1px solid var(--qp-style-border) !important;
  border-radius: 8px !important;
  overflow: hidden;
}
.qp-library-tabs button,
.qp-settings-pro-tabs button,
.qp-settings-pro-tabs a {
  background: transparent !important;
  color: var(--qp-style-text) !important;
  border-color: var(--qp-style-border) !important;
}
.qp-library-tabs button.active,
.qp-settings-pro-tabs button.active,
.qp-settings-pro-tabs a.active {
  background: var(--qp-style-accent-soft) !important;
  color: var(--qp-style-accent) !important;
}
.qp-kahoot-quiz-card,
.qp-library-card { overflow: hidden !important; }
.qp-kahoot-card-thumb,
.qp-library-generated-thumb {
  border-radius: 0 !important;
}
.qp-kahoot-question-badge { background: #111827 !important; color: #fff !important; }
.qp-kahoot-dropdown {
  background: var(--qp-style-surface) !important;
  border-color: var(--qp-style-border) !important;
  border-radius: 10px !important;
  box-shadow: var(--qp-style-shadow-lift) !important;
}
.qp-kahoot-dropdown a,
.qp-kahoot-dropdown button { color: var(--qp-style-text) !important; }
.qp-kahoot-dropdown a:hover,
.qp-kahoot-dropdown button:hover { background: var(--qp-style-accent-soft) !important; color: var(--qp-style-accent) !important; }

/* Tables and admin pages */
.qp-admin-table,
.qp-stat-table {
  background: var(--qp-style-surface) !important;
  color: var(--qp-style-text) !important;
}
.qp-admin-table th,
.qp-stat-table th {
  background: var(--qp-style-accent) !important;
  color: #fff !important;
}
.qp-admin-table td,
.qp-stat-table td {
  border-color: var(--qp-style-border) !important;
  color: var(--qp-style-text) !important;
}
.qp-admin-table tr:nth-child(even) td,
.qp-stat-table tr:nth-child(even) td {
  background: var(--qp-style-surface-2) !important;
}
.qp-admin-toolbar {
  background: var(--qp-style-surface-2) !important;
  border: 1px solid var(--qp-style-border) !important;
  padding: 12px !important;
}
.qp-admin-switch { display: flex; gap: 8px; flex-wrap: wrap; }

/* Forms */
.qp-input,
.qp-select,
.qp-textarea,
input.qp-input,
select.qp-select,
textarea.qp-textarea {
  background: var(--qp-style-surface) !important;
  border: 1px solid #cfd4df !important;
  border-radius: 6px !important;
  color: var(--qp-style-text) !important;
  box-shadow: none !important;
}
.qp-input:focus,
.qp-select:focus,
.qp-textarea:focus {
  border-color: var(--qp-style-accent-2) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--qp-style-accent-2) 18%, transparent) !important;
}


/* Auth/profile pages follow the same brand language */
.qp-auth-body {
  background:
    radial-gradient(circle at 18% 8%, color-mix(in srgb, var(--qp-style-accent-2) 36%, transparent), transparent 28%),
    linear-gradient(135deg, var(--qp-style-accent) 0%, #21104a 58%, #0f172a 100%) !important;
}
.qp-auth-card {
  border-radius: 12px !important;
  background: var(--qp-style-surface) !important;
  color: var(--qp-style-text) !important;
  box-shadow: 0 28px 80px rgba(2, 6, 23, .28) !important;
}
.qp-auth-card h1,
.qp-auth-card h2,
.qp-auth-card .qp-label { color: var(--qp-style-text) !important; }
.qp-auth-tabs {
  border-radius: 8px !important;
  background: var(--qp-style-surface-2) !important;
  border: 1px solid var(--qp-style-border) !important;
}
.qp-account-summary,
.qp-join-account-banner,
.qp-pin-confirm-card {
  background: var(--qp-style-surface-2) !important;
  border-color: var(--qp-style-border) !important;
  color: var(--qp-style-text) !important;
}

/* Responsive polish */
@media (max-width: 980px) {
  .qp-dashboard-clean .qp-dashboard-sidebar {
    background: color-mix(in srgb, var(--qp-style-surface) 95%, transparent) !important;
    border: 1px solid var(--qp-style-border) !important;
  }
  .qp-dashboard-clean .qp-dashboard-nav a.active {
    background: var(--qp-style-accent) !important;
  }
  .qp-dashboard-clean .qp-dashboard-topbar { box-shadow: var(--qp-style-shadow) !important; }
  .qp-auth-shell { padding: 18px !important; }
}
@media (max-width: 560px) {
  .qp-dashboard-clean .qp-dashboard-top-actions .qp-btn { min-height: 38px !important; padding: 8px 10px !important; }
  .qp-topbar-brand { font-size: 20px !important; }
  .qp-dashboard-clean .qp-dashboard-title-group h1 { font-size: 22px !important; }
}

/* v1.18.2 Library page: Kahoot-inspired browser layout using existing QuizPulse actions */
.qp-library-refresh {
  gap: 16px !important;
  background: var(--qp-style-bg) !important;
}
.qp-library-headline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--qp-style-surface) !important;
  border: 1px solid var(--qp-style-border) !important;
  border-radius: 14px !important;
  box-shadow: var(--qp-style-shadow) !important;
}
.qp-library-headline h2 {
  margin: 6px 0 4px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -.045em;
  color: var(--qp-style-text) !important;
}
.qp-library-headline p:not(.qp-pill) { margin: 0; color: var(--qp-style-muted) !important; }
.qp-library-headline-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.qp-library-browser {
  background: transparent;
  display: grid;
  gap: 14px;
}
.qp-library-refresh .qp-library-tabs {
  display: inline-flex !important;
  align-self: start;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--qp-style-border) !important;
  background: var(--qp-style-surface) !important;
  border-radius: 0 !important;
  box-shadow: var(--qp-style-shadow) !important;
  margin: 0 !important;
}
.qp-library-refresh .qp-library-tabs button {
  min-width: 112px;
  padding: 13px 18px !important;
  border: 0 !important;
  border-right: 1px solid var(--qp-style-border) !important;
  border-radius: 0 !important;
  background: var(--qp-style-surface) !important;
  color: var(--qp-style-text) !important;
  font-weight: 900 !important;
  cursor: pointer;
}
.qp-library-refresh .qp-library-tabs button:last-child { border-right: 0 !important; }
.qp-library-refresh .qp-library-tabs button.active {
  color: var(--qp-style-accent) !important;
  background: var(--qp-style-accent-soft) !important;
}
.qp-library-refresh .qp-library-toolbar {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 16px !important;
}
.qp-library-refresh .qp-library-toolbar::before { content: none !important; display: none !important; }
.qp-library-refresh .qp-library-search {
  width: min(360px, 100%) !important;
  min-height: 46px !important;
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 0 14px !important;
  border: 1px solid var(--qp-style-border) !important;
  border-radius: 4px !important;
  background: var(--qp-style-surface) !important;
  color: var(--qp-style-muted) !important;
  box-shadow: var(--qp-style-shadow) !important;
}
.qp-library-refresh .qp-library-search span { font-size: 24px; line-height: 1; }
.qp-library-refresh .qp-library-search input {
  width: 100%;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: var(--qp-style-text) !important;
  font: inherit;
}
.qp-library-refresh .qp-library-view-actions {
  display: inline-flex !important;
  gap: 8px !important;
  align-items: center;
}
.qp-library-refresh .qp-library-view-actions button {
  width: 42px !important;
  height: 42px !important;
  border: 0 !important;
  border-radius: 8px !important;
  display: grid;
  place-items: center;
  background: transparent !important;
  color: var(--qp-style-muted) !important;
  font-size: 25px;
  line-height: 1;
  box-shadow: none !important;
  cursor: pointer;
}
.qp-library-refresh .qp-library-view-actions button.active {
  background: var(--qp-style-accent-soft) !important;
  color: var(--qp-style-accent) !important;
}
.qp-library-refresh .qp-library-status-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--qp-style-muted) !important;
  margin: 0 !important;
}
.qp-library-refresh .qp-library-status-row p { margin: 0; font-weight: 800; }
.qp-library-section { display: grid; gap: 12px; }
.qp-library-section-title { margin-top: 2px; }
.qp-library-section-title[hidden] { display: none !important; }
.qp-library-section-title h2 { margin: 0; color: var(--qp-style-text) !important; }
.qp-library-subject-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.qp-library-subject-choice {
  min-height: 68px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--qp-style-border);
  border-radius: 8px;
  background: var(--qp-style-surface);
  color: var(--qp-style-text);
  box-shadow: var(--qp-style-shadow);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.qp-library-subject-choice:hover { transform: translateY(-1px); border-color: var(--qp-style-accent); }
.qp-library-subject-choice:focus-visible { outline: 3px solid var(--qp-style-accent-soft); outline-offset: 2px; }
.qp-library-subject-choice.active { border-color: var(--qp-style-accent); background: var(--qp-style-accent-soft); }
.qp-library-subject-choice span { font-weight: 950; }
.qp-library-subject-choice small { color: var(--qp-style-muted); font-weight: 750; }
.qp-library-subject-results { display: grid; gap: 12px; margin-top: 4px; }
.qp-library-subject-results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qp-library-subject-results-head h3 { margin: 0; color: var(--qp-style-text); font-size: 20px; }
.qp-library-course-wrap { margin-top: 0 !important; }
.qp-library-refresh .qp-kahoot-library-grid,
.qp-library-course-wrap .qp-kahoot-library-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(192px, 1fr)) !important;
  gap: 12px !important;
  align-items: start !important;
}
.qp-library-refresh .qp-kahoot-library-grid.is-list,
.qp-library-course-wrap .qp-kahoot-library-grid.is-list {
  display: flex !important;
  flex-direction: column !important;
}
.qp-library-refresh .qp-kahoot-quiz-card,
.qp-library-course-wrap .qp-kahoot-quiz-card {
  position: relative !important;
  min-height: 250px;
  background: var(--qp-style-surface) !important;
  border: 1px solid var(--qp-style-border) !important;
  border-radius: 8px !important;
  box-shadow: var(--qp-style-shadow) !important;
  color: var(--qp-style-text) !important;
  overflow: visible !important;
  transition: transform .16s ease, box-shadow .16s ease !important;
}
.qp-library-refresh .qp-kahoot-quiz-card:hover,
.qp-library-course-wrap .qp-kahoot-quiz-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--qp-style-shadow-lift) !important;
}
.qp-library-refresh .qp-kahoot-card-brand,
.qp-library-course-wrap .qp-kahoot-card-brand {
  height: 24px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  color: var(--qp-style-muted) !important;
  font-size: 12px;
  font-weight: 750;
}
.qp-library-refresh .qp-kahoot-card-thumb,
.qp-library-course-wrap .qp-kahoot-card-thumb {
  position: relative;
  display: block;
  height: 118px;
  overflow: hidden !important;
  border-radius: 0 !important;
  background: #777;
  text-decoration: none;
}
.qp-library-refresh .qp-kahoot-card-thumb img,
.qp-library-course-wrap .qp-kahoot-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  transition: none;
}
.qp-library-refresh .qp-kahoot-quiz-card:hover .qp-kahoot-card-thumb img,
.qp-library-course-wrap .qp-kahoot-quiz-card:hover .qp-kahoot-card-thumb img { transform: none; }
.qp-library-refresh .qp-library-generated-thumb,
.qp-library-course-wrap .qp-library-generated-thumb {
  height: 100% !important;
  display: grid !important;
  place-items: center !important;
  color: rgba(255,255,255,.94) !important;
  text-align: center;
  background: radial-gradient(circle at 22% 18%, rgba(255,255,255,.24), transparent 24%), linear-gradient(135deg, var(--qp-style-accent), var(--qp-style-accent-2)) !important;
}
.qp-library-refresh .qp-library-generated-thumb span,
.qp-library-course-wrap .qp-library-generated-thumb span { font-size: 30px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.22)); }
.qp-library-refresh .qp-library-generated-thumb b,
.qp-library-course-wrap .qp-library-generated-thumb b { font-size: 18px; opacity: .86; }
.qp-kahoot-unsaved {
  position: absolute;
  left: 6px;
  top: 7px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 4px;
  background: #e11d48;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}
.qp-library-refresh .qp-kahoot-question-badge,
.qp-library-course-wrap .qp-kahoot-question-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  background: rgba(2,6,23,.92) !important;
  color: #fff !important;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 950;
}
.qp-library-refresh .qp-kahoot-card-body,
.qp-library-course-wrap .qp-kahoot-card-body { padding: 10px 9px 12px !important; }
.qp-library-refresh .qp-kahoot-card-mainline,
.qp-library-course-wrap .qp-kahoot-card-mainline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: start;
}
.qp-library-refresh .qp-kahoot-card-mainline h3,
.qp-library-course-wrap .qp-kahoot-card-mainline h3 {
  min-height: 43px;
  margin: 0 !important;
  color: var(--qp-style-text) !important;
  font-size: 16px !important;
  line-height: 1.32;
  word-break: break-word;
}
.qp-library-refresh .qp-card-menu-btn,
.qp-library-course-wrap .qp-card-menu-btn {
  width: 28px;
  height: 32px;
  border: 0 !important;
  border-radius: 7px;
  background: transparent !important;
  color: var(--qp-style-text) !important;
  font-size: 22px;
  cursor: pointer;
}
.qp-library-refresh .qp-card-menu-btn:hover,
.qp-library-course-wrap .qp-card-menu-btn:hover { background: var(--qp-style-accent-soft) !important; color: var(--qp-style-accent) !important; }
.qp-library-refresh .qp-kahoot-owner,
.qp-library-course-wrap .qp-kahoot-owner { margin: 5px 0 0 !important; color: var(--qp-style-muted) !important; font-size: 13px; }
.qp-library-refresh .qp-kahoot-card-status,
.qp-library-course-wrap .qp-kahoot-card-status { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.qp-mini-status {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--qp-style-surface-2);
  border: 1px solid var(--qp-style-border);
  color: var(--qp-style-muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qp-mini-status.published { background: rgba(34,197,94,.13); color: #15803d; border-color: rgba(34,197,94,.28); }
.qp-mini-status.draft { background: rgba(245,158,11,.14); color: #b45309; border-color: rgba(245,158,11,.30); }
.qp-mini-status.private { background: rgba(225,29,72,.12); color: #be123c; border-color: rgba(225,29,72,.28); }
.qp-mini-status.public { background: rgba(14,165,233,.12); color: #0369a1; border-color: rgba(14,165,233,.26); }


.qp-library-refresh .qp-kahoot-dropdown,
.qp-library-course-wrap .qp-kahoot-dropdown {
  position: absolute !important;
  right: 8px !important;
  top: 170px !important;
  z-index: 120 !important;
  min-width: 190px !important;
  display: grid;
  gap: 2px;
  padding: 6px !important;
  background: var(--qp-style-surface) !important;
  border: 1px solid var(--qp-style-border) !important;
  border-radius: 9px !important;
  box-shadow: var(--qp-style-shadow-lift) !important;
}
.qp-library-refresh .qp-kahoot-dropdown[hidden],
.qp-library-course-wrap .qp-kahoot-dropdown[hidden] { display: none !important; }
.qp-library-refresh .qp-kahoot-dropdown a,
.qp-library-refresh .qp-kahoot-dropdown button,
.qp-library-refresh .qp-dropdown-label,
.qp-library-course-wrap .qp-kahoot-dropdown a,
.qp-library-course-wrap .qp-kahoot-dropdown button,
.qp-library-course-wrap .qp-dropdown-label {
  width: 100%;
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 11px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: var(--qp-style-text) !important;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.qp-library-refresh .qp-dropdown-label,
.qp-library-course-wrap .qp-dropdown-label { cursor: default; color: var(--qp-style-muted) !important; font-size: 12px; }
.qp-library-refresh .qp-kahoot-dropdown a:hover,
.qp-library-refresh .qp-kahoot-dropdown button:hover,
.qp-library-course-wrap .qp-kahoot-dropdown a:hover,
.qp-library-course-wrap .qp-kahoot-dropdown button:hover { background: var(--qp-style-accent-soft) !important; color: var(--qp-style-accent) !important; }
.qp-library-refresh .qp-kahoot-dropdown .danger,
.qp-library-course-wrap .qp-kahoot-dropdown .danger { color: #dc2626 !important; }
.qp-dropdown-separator { height: 1px; background: var(--qp-style-border); margin: 4px 2px; }
.qp-library-refresh .qp-kahoot-library-grid.is-list .qp-kahoot-quiz-card,
.qp-library-course-wrap .qp-kahoot-library-grid.is-list .qp-kahoot-quiz-card {
  min-height: auto;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}
.qp-library-refresh .qp-kahoot-library-grid.is-list .qp-kahoot-card-brand,
.qp-library-course-wrap .qp-kahoot-library-grid.is-list .qp-kahoot-card-brand {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  color: #fff !important;
  text-shadow: 0 1px 4px rgba(0,0,0,.45);
}
.qp-library-refresh .qp-kahoot-library-grid.is-list .qp-kahoot-card-thumb,
.qp-library-course-wrap .qp-kahoot-library-grid.is-list .qp-kahoot-card-thumb { height: 150px; grid-row: 1 / span 2; }
.qp-library-refresh .qp-kahoot-library-grid.is-list .qp-kahoot-card-body,
.qp-library-course-wrap .qp-kahoot-library-grid.is-list .qp-kahoot-card-body { padding: 18px !important; }
.qp-library-refresh .qp-kahoot-library-grid.is-list .qp-kahoot-card-mainline h3,
.qp-library-course-wrap .qp-kahoot-library-grid.is-list .qp-kahoot-card-mainline h3 { min-height: 0; font-size: 20px !important; }
.qp-library-refresh .qp-kahoot-library-grid.is-list .qp-kahoot-dropdown,
.qp-library-course-wrap .qp-kahoot-library-grid.is-list .qp-kahoot-dropdown { top: 50px !important; }

@media (max-width: 980px) {
  .qp-library-headline { flex-direction: column; align-items: stretch; }
  .qp-library-headline-actions { justify-content: flex-start; }
  .qp-library-refresh .qp-library-toolbar { align-items: stretch !important; flex-direction: column !important; }
  .qp-library-refresh .qp-library-search { width: auto !important; }
  .qp-library-refresh .qp-library-view-actions { justify-content: flex-end; }
  .qp-library-refresh .qp-kahoot-library-grid,
  .qp-library-course-wrap .qp-kahoot-library-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)) !important; }
  .qp-library-refresh .qp-kahoot-library-grid.is-list .qp-kahoot-quiz-card,
  .qp-library-course-wrap .qp-kahoot-library-grid.is-list .qp-kahoot-quiz-card { display: block; }
  .qp-library-refresh .qp-kahoot-library-grid.is-list .qp-kahoot-card-thumb,
  .qp-library-course-wrap .qp-kahoot-library-grid.is-list .qp-kahoot-card-thumb { height: 118px; }
}
@media (max-width: 560px) {
  .qp-library-refresh .qp-library-tabs { width: 100% !important; }
  .qp-library-refresh .qp-library-tabs button { min-width: 140px; }
  .qp-library-refresh .qp-library-status-row { align-items: stretch; flex-direction: column; }
  .qp-library-refresh .qp-kahoot-library-grid,
  .qp-library-course-wrap .qp-kahoot-library-grid { grid-template-columns: 1fr !important; }
  .qp-library-subject-picker { grid-template-columns: 1fr; }
}
.qp-library-context-strip {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--qp-style-border);
  border-radius: 999px;
  background: var(--qp-style-surface);
  color: var(--qp-style-muted);
  box-shadow: var(--qp-style-shadow);
}
.qp-library-context-strip span { color: var(--qp-style-text); font-weight: 950; }
.qp-library-context-strip small { color: var(--qp-style-muted); font-weight: 700; }
@media (max-width: 560px) {
  .qp-library-context-strip { width: auto; align-items: flex-start; flex-direction: column; border-radius: 12px; }
}


/* v1.18.35 readable theme text + compact host audio controls */
.qp-btn.tiny.danger-lite,
.qp-btn.danger-lite {
  background: rgba(239,68,68,.14) !important;
  color: #fee2e2 !important;
  border-color: rgba(248,113,113,.35) !important;
}
.qp-audio-test-row { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.qp-host-sfx-controls-v1835 label {
  grid-template-columns: 84px minmax(120px, 1fr) auto;
  gap: 8px;
}
.qp-host-sfx-controls-v1835 .qp-btn.tiny { padding: 7px 10px; }
.qp-setup-dynamic-card,
.qp-setup-dynamic-card * {
  color: #ffffff;
}
.qp-setup-dynamic-card select,
.qp-setup-dynamic-card option,
.qp-setup-dynamic-card input,
.qp-lobby-mini-menu select,
.qp-lobby-mini-menu option,
.qp-lobby-mini-menu input {
  color: var(--qp-text) !important;
  background: var(--qp-panel) !important;
}
.qp-lobby-mini-menu,
.qp-player-search-menu,
.qp-player-menu {
  color: var(--qp-text) !important;
  background: color-mix(in srgb, var(--qp-panel) 94%, transparent) !important;
  border-color: var(--qp-border) !important;
}
.qp-lobby-mini-menu *,
.qp-player-search-menu *,
.qp-player-menu * {
  color: inherit;
}
.qp-lobby-mini-menu .qp-muted,
.qp-player-search-menu .qp-muted,
.qp-player-menu .qp-muted,
.qp-muted,
small {
  color: var(--qp-muted) !important;
}


.qp-dashboard-main,
.qp-dashboard-main h1,
.qp-dashboard-main h2,
.qp-dashboard-main h3,
.qp-dashboard-main p,
.qp-library-card h3,
.qp-settings-card h3,
.qp-stat-table td,
.qp-stat-table th {
  color: var(--qp-text);
}
@media (max-width: 760px) {
  .qp-host-sfx-controls-v1835 label { grid-template-columns: 1fr; }
}


/* v1.18.36 Alkafeel/light host setup readability fix */
.qp-host-setup-v1834,
.qp-host-setup-v1834 * {
  color: var(--qp-text, #0f172a);
}
.qp-host-setup-hero-v1834 {
  background: linear-gradient(135deg, rgba(230,243,255,.95), rgba(238,245,255,.92)) !important;
  border: 1px solid rgba(0,119,173,.14) !important;
}
.qp-host-setup-hero-v1834 h1,
.qp-host-setup-hero-v1834 strong,
.qp-host-setup-hero-v1834 b {
  color: var(--qp-text, #0f172a) !important;
}
.qp-host-setup-hero-v1834 p,
.qp-host-setup-v1834 .qp-muted,
.qp-host-setup-v1834 small {
  color: var(--qp-muted, #475569) !important;
}
.qp-setup-dynamic-card {
  background: rgba(255,255,255,.96) !important;
  border: 1px solid var(--qp-border, #d7dce8) !important;
  box-shadow: 0 16px 38px rgba(15,23,42,.08) !important;
  color: var(--qp-text, #0f172a) !important;
}
.qp-setup-dynamic-card,
.qp-setup-dynamic-card * {
  color: var(--qp-text, #0f172a) !important;
}
.qp-setup-dynamic-card summary span:first-child {
  background: var(--qp-purple-3, #e0f2fe) !important;
  color: var(--qp-purple, #0077ad) !important;
}
.qp-setup-dynamic-card summary b,
.qp-inline-details > summary {
  color: var(--qp-text, #0f172a) !important;
}
.qp-setup-dynamic-card summary em,
.qp-field-stack span,
.qp-audio-health-row,
.qp-audio-health-row span,
.qp-inline-details,
.qp-inline-details p {
  color: var(--qp-muted, #475569) !important;
}
.qp-setup-dynamic-card summary::after {
  color: var(--qp-muted, #475569) !important;
}
.qp-inline-details,
.qp-audio-health {
  background: var(--qp-panel-2, #f8fafc) !important;
  border-color: var(--qp-border, #d7dce8) !important;
}
.qp-audio-health-row b {
  color: var(--qp-text, #0f172a) !important;
  background: rgba(14,165,216,.12) !important;
}
.qp-audio-health-row.ok b { color: #166534 !important; background: rgba(34,197,94,.16) !important; }
.qp-audio-health-row.warn b { color: #92400e !important; background: rgba(245,158,11,.18) !important; }


/* v1.18.39 speed patch: page navigation must feel instant. */
@view-transition { navigation: none; }
::view-transition-old(root),
::view-transition-new(root),
html.qp-js-ready body.qp-page-ready:not(.qp-page-leaving),
html.qp-js-ready body.qp-page-leaving {
  animation: none !important;
}
html.qp-js-ready body,
html.qp-js-ready body.qp-page-entering,
html.qp-js-ready body.qp-page-leaving {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}
/* The one-device switch on the security page. */
.qp-security-policy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border: 1px solid var(--qp-border, #d8deea);
  border-radius: 14px;
  background: var(--qp-surface, #fff);
  cursor: pointer;
}
.qp-security-policy-copy { display: grid; gap: 4px; }
.qp-security-policy-copy b { font-size: 15px; font-weight: 900; }
.qp-security-policy-copy small {
  max-width: 62ch;
  color: var(--qp-muted, #64748b);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}
/* A real switch rather than a stretched checkbox: this is an on/off policy,
   and it should look like one at a glance. */
.qp-security-policy-row input[type="checkbox"] {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--qp-border, #cbd5e1);
  border-radius: 999px;
  background: #e2e8f0;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.qp-security-policy-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .3);
  transition: transform .18s ease;
}
.qp-security-policy-row input[type="checkbox"]:checked {
  background: #6d28d9;
  border-color: #6d28d9;
}
.qp-security-policy-row input[type="checkbox"]:checked::after { transform: translateX(20px); }
.qp-security-policy-row input[type="checkbox"]:focus-visible { outline: 2px solid #6d28d9; outline-offset: 3px; }
.qp-security-policy-row input[type="checkbox"]:disabled { opacity: .6; cursor: progress; }
.qp-security-policy-state {
  margin: 10px 2px 0;
  color: var(--qp-muted, #64748b);
  font-size: 12px;
  font-weight: 800;
}

/* Why the last session ended. Shown once, above the sign-in form, so a student
   whose account was opened on another device is not left guessing. */
.qp-auth-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(251, 191, 36, .45);
  border-radius: 12px;
  background: rgba(251, 191, 36, .12);
  text-align: left;
}
.qp-auth-notice span { font-size: 20px; line-height: 1; }
.qp-auth-notice p {
  margin: 0;
  color: var(--qp-text, #172033);
  font-size: 13px;
  font-weight: 800;
}

.qp-auth-managed-note {
  margin: 14px 0 0;
  color: var(--qp-muted, #64748b);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.qp-user-import-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid rgba(109, 40, 217, .18);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(109, 40, 217, .09), rgba(37, 99, 235, .07));
}

.qp-user-import-card h2 {
  margin: 8px 0;
}

.qp-user-import-card p {
  margin: 5px 0;
}

.qp-user-import-card code {
  padding: 2px 6px;
  border-radius: 7px;
  background: rgba(109, 40, 217, .1);
  color: #5b21b6;
  font-weight: 900;
}

.qp-user-import-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 26px;
  color: var(--qp-text, #111827);
  background: var(--qp-card, #fff);
  box-shadow: 0 30px 90px rgba(15, 23, 42, .34);
}

.qp-user-import-dialog::backdrop {
  background: rgba(15, 23, 42, .66);
  backdrop-filter: blur(5px);
}

.qp-user-import-shell {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.qp-user-import-shell > header,
.qp-user-import-shell > footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.qp-user-import-shell h2,
.qp-user-import-shell h3 {
  margin: 7px 0;
}

.qp-user-import-help,
.qp-user-import-validation {
  padding: 13px 15px;
  border-radius: 14px;
  background: rgba(37, 99, 235, .08);
  color: #1e3a8a;
  font-weight: 800;
}

.qp-user-mapping-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.qp-user-mapping-item {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--qp-border, #e2e8f0);
  border-radius: 16px;
  background: var(--qp-card, #fff);
}

.qp-user-mapping-source {
  overflow: hidden;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qp-user-mapping-item small {
  overflow: hidden;
  color: var(--qp-muted, #64748b);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qp-user-import-preview {
  min-width: 0;
}

.qp-user-import-validation.error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.qp-user-import-validation.success {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}


@media (max-width: 760px) {
  .qp-user-import-card,
  .qp-user-import-shell > header,
  .qp-user-import-shell > footer {
    align-items: stretch;
    flex-direction: column;
  }

  .qp-user-mapping-grid {
    grid-template-columns: 1fr;
  }

  .qp-user-import-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 20px;
  }

  .qp-user-import-shell {
    padding: 16px;
  }
}

/* Expanded subject statistics */
.qp-stat-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
  align-items: end;
}
.qp-stat-filter-row label {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.qp-stat-filter-row label > span {
  color: #64748b;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.qp-stat-expand {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(124, 58, 237, .22);
  border-radius: 11px;
  background: #f5f3ff;
  color: #5b21b6;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}
.qp-stat-student-row td > small {
  display: block;
}
.qp-zero-attempt {
  width: max-content;
  margin-top: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: .68rem;
  font-weight: 850;
}
.qp-stat-attempts {
  margin-top: 3px;
  color: #64748b;
  font-size: .7rem;
}
.qp-stat-group-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.qp-stat-group-chip {
  display: inline-flex;
  padding: 4px 7px;
  border: 1px solid rgba(124, 58, 237, .18);
  border-radius: 999px;
  background: #f5f3ff;
  color: #5b21b6;
  font-size: .7rem;
  font-weight: 850;
}
.qp-stat-group-chip.muted {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}
.qp-stat-detail-row > td {
  padding: 0 16px 16px !important;
  background: #fafafa;
}
.qp-stat-quiz-details {
  padding: 15px;
  overflow: auto;
  border: 1px solid rgba(124, 58, 237, .14);
  border-radius: 17px;
  background: #fff;
}
.qp-stat-quiz-details h4 {
  margin: 0 0 12px;
}
.qp-stat-quiz-details table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}
.qp-stat-quiz-details th,
.qp-stat-quiz-details td {
  padding: 10px;
  border-top: 1px solid rgba(148, 163, 184, .18);
  text-align: left;
  vertical-align: top;
}
.qp-stat-quiz-details th {
  color: #64748b;
  font-size: .68rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}


/* v1.19.1 light-only app theme cleanup */
.qp-theme-toggle { display: none !important; }


/* v1.19.2 phase 2: final light-only GUI cleanup layer
   This layer intentionally sits at the end of the global stylesheet so the app has one active visual source. */
:root,
html[data-theme="light"] {
  color-scheme: light;
  --qp-bg: #f6f7fb;
  --qp-bg-2: #eef2ff;
  --qp-panel: #ffffff;
  --qp-panel-2: #f8fafc;
  --qp-text: #111827;
  --qp-muted: #64748b;
  --qp-soft: #e5e7eb;
  --qp-border: #d8dce8;
  --qp-purple: #5b21b6;
  --qp-purple-2: #7c3aed;
  --qp-purple-3: #f1edff;
  --qp-blue: #2563eb;
  --qp-green: #059669;
  --qp-yellow: #d97706;
  --qp-red: #dc2626;
  --qp-dark: #111827;
  --qp-radius: 22px;
  --qp-card-shadow: 0 12px 30px rgba(42, 17, 101, .075);
  --qp-card-shadow-hover: 0 18px 42px rgba(42, 17, 101, .11);
  --qp-shadow: 0 18px 45px rgba(17, 24, 39, .11);
  --qp-shadow-soft: 0 10px 25px rgba(17, 24, 39, .075);
}

html,
body {
  color-scheme: light;
}

body:not(.qp-game-body) {
  color: var(--qp-text);
  background:
    radial-gradient(circle at 0 0, rgba(124, 58, 237, .12), transparent 34%),
    linear-gradient(135deg, var(--qp-bg), var(--qp-bg-2));
}

.qp-theme-toggle,
[data-app-theme],
.qp-theme-choice.dark,
.qp-theme-choice.alkafeel,
.qp-theme-chip.dark,
.qp-theme-chip.alkafeel {
  display: none !important;
}

.qp-card,
.qp-profile-panel,
.qp-profile-panel-dark,
.qp-settings-card,
.qp-settings-admin-card,
.qp-user-import-card,
.qp-admin-live-card,
.qp-admin-quiz-card,
.qp-bank-card,
.qp-library-card,
.qp-kahoot-quiz-card,
.qp-college-manager-card,
.qp-group-manager-card,
.qp-subject-choice-card,
.qp-space-setup-card,
.qp-space-confirm-card,
.qp-global-confirm-card,
.qp-create-modal-card,
.qp-create-modal-card-clean {
  background: rgba(255, 255, 255, .96);
  color: var(--qp-text);
  border: 1px solid rgba(109, 40, 217, .12);
  box-shadow: var(--qp-card-shadow);
}

.qp-card:hover,
.qp-kahoot-quiz-card:hover,
.qp-library-card:hover,
.qp-bank-card:hover,
.qp-subject-choice-card:hover {
  box-shadow: var(--qp-card-shadow-hover);
}

.qp-profile-panel-dark .qp-profile-panel-head,
.qp-profile-panel-dark .qp-profile-panel-head b,
.qp-profile-activity-list span,
.qp-profile-activity-list b {
  color: var(--qp-text);
}

.qp-profile-activity-list div {
  background: var(--qp-panel-2);
  border-color: rgba(100, 116, 139, .16);
}

.qp-topbar,
.qp-dashboard-topbar,
.qp-dashboard-sidebar,
.qp-library-topbar,
.qp-settings-pro-topbar,
.qp-world-topbar,
.qp-creator-topbar-v18 {
  background: rgba(255, 255, 255, .92);
  color: var(--qp-text);
  border-color: rgba(109, 40, 217, .12);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
  backdrop-filter: blur(16px);
}

.qp-dashboard-nav a,
.qp-settings-pro-tabs button,
.qp-library-tabs button,
.qp-admin-switch button {
  color: #334155;
  background: transparent;
  border-color: transparent;
}

.qp-dashboard-nav a.active,
.qp-dashboard-nav a:hover,
.qp-settings-pro-tabs button.active,
.qp-settings-pro-tabs button:hover,
.qp-library-tabs button.active,
.qp-library-tabs button:hover,
.qp-admin-switch button.active,
.qp-admin-switch button:hover {
  color: var(--qp-purple);
  background: var(--qp-purple-3);
  border-color: rgba(124, 58, 237, .18);
}

.qp-btn,
.qp-link-btn,
.qp-lobby-lite-btn,
.qp-scroll-btn,
.qp-rail-btn {
  color: var(--qp-text);
  background: #ffffff;
  border: 1px solid var(--qp-border);
  box-shadow: 0 8px 18px rgba(17, 24, 39, .075);
}

.qp-btn.primary,
.qp-prop-primary,
.qp-lobby-start,
.qp-waiting-start {
  color: #ffffff;
  background: linear-gradient(135deg, var(--qp-purple), var(--qp-blue));
  border-color: transparent;
}

.qp-btn.success { color: #ffffff; background: linear-gradient(135deg, #059669, #10b981); border-color: transparent; }
.qp-btn.danger { color: #ffffff; background: linear-gradient(135deg, #dc2626, #f97316); border-color: transparent; }
.qp-btn.ghost { background: transparent; box-shadow: none; }

.qp-btn:focus-visible,
.qp-link-btn:focus-visible,
.qp-dashboard-nav a:focus-visible,
.qp-input:focus-visible,
.qp-select:focus-visible,
.qp-textarea:focus-visible,
.qp-answer-input:focus-visible,
.qp-title-input:focus-visible,
.qp-mini-search:focus-visible,
.qp-mini-select:focus-visible {
  outline: 3px solid rgba(124, 58, 237, .26);
  outline-offset: 2px;
}

.qp-input,
.qp-select,
.qp-textarea,
.qp-mini-search,
.qp-mini-select,
.qp-title-input,
.qp-answer-input,
.qp-points-input,
.qp-global-confirm-input,
.qp-user-mapping-item select,
.qp-admin-edit-form input,
.qp-admin-edit-form select,
.qp-group-create-row input,
.qp-group-import-mapping select {
  color: var(--qp-text);
  background: #ffffff;
  border-color: var(--qp-border);
}

.qp-input::placeholder,
.qp-textarea::placeholder,
.qp-title-input::placeholder,
.qp-answer-input::placeholder,
.qp-mini-search::placeholder {
  color: #94a3b8;
}

.qp-label,
.qp-section-title,
.qp-section-heading,
.qp-profile-panel-head,
.qp-settings-eyebrow,
.qp-prop-label,
.qp-prop-mini-title {
  color: var(--qp-text);
}

.qp-muted,
.qp-prop-subtitle,
.qp-settings-details,
.qp-user-import-help,
.qp-access-note,
.qp-empty,
.qp-friendly-empty {
  color: var(--qp-muted);
}

.qp-pill,
.qp-space-chip,
.qp-stat-group-chip,
.qp-summary-badge,
.qp-mode-pill,
.qp-correct-pill {
  background: var(--qp-purple-3);
  color: var(--qp-purple);
  border-color: rgba(124, 58, 237, .18);
}

.qp-table-wrap,
.qp-admin-table-wrap,
.qp-user-import-preview,
.qp-group-import-table-wrap,
.qp-stat-quiz-details {
  background: #ffffff;
  border: 1px solid rgba(100, 116, 139, .14);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
}

.qp-admin-table,
.qp-stat-table,
.qp-group-import-table,
.qp-user-import-preview table,
.qp-stat-quiz-details table {
  color: var(--qp-text);
}

.qp-admin-table th,
.qp-stat-table th,
.qp-group-import-table th,
.qp-user-import-preview th,
.qp-stat-quiz-details th {
  background: #f8fafc;
  color: #475569;
  border-bottom: 1px solid rgba(100, 116, 139, .16);
}

.qp-admin-table td,
.qp-stat-table td,
.qp-group-import-table td,
.qp-user-import-preview td,
.qp-stat-quiz-details td {
  border-top: 1px solid rgba(100, 116, 139, .12);
}

.qp-create-modal-backdrop,
.qp-global-confirm-backdrop,
.qp-group-import-overlay,
.qp-space-setup-overlay,
.qp-space-confirm-overlay {
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(10px);
}

.qp-user-import-shell,
.qp-group-import-dialog,
.qp-create-modal-card,
.qp-create-modal-card-clean,
.qp-global-confirm-card,
.qp-space-confirm-card {
  max-height: calc(100dvh - 28px);
}

.qp-user-import-dialog,
.qp-group-import-dialog,
.qp-create-modal-body,
.qp-create-mode-body,
.qp-create-mode-body-clean {
  overflow: auto;
}

.qp-row-valid { background: rgba(16, 185, 129, .08); }
.qp-row-error { background: rgba(239, 68, 68, .08); }

@media (max-width: 860px) {
  body:not(.qp-game-body) {
    background: linear-gradient(180deg, #f8fafc, #eef2ff);
  }
  .qp-container,
  .qp-dashboard-main,
  .qp-library-v15,
  .qp-settings-pro,
  .qp-statistics-page,
  .qp-question-bank-page,
  .qp-admin-content {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  .qp-topbar,
  .qp-dashboard-topbar,
  .qp-library-topbar,
  .qp-settings-pro-topbar,
  .qp-world-topbar,
  .qp-creator-topbar-v18 {
    border-radius: 0 0 22px 22px;
  }
  .qp-card,
  .qp-profile-panel,
  .qp-settings-card,
  .qp-user-import-card,
  .qp-admin-live-card,
  .qp-admin-quiz-card,
  .qp-bank-card,
  .qp-kahoot-quiz-card {
    border-radius: 20px;
  }
  .qp-btn {
    min-height: 44px;
  }
}

/* v1.19.3 phase 3: Admin Users college/group import flow */
.qp-user-import-flow-card {
  display: grid;
  grid-template-columns: minmax(260px, .82fr) minmax(420px, 1.18fr);
  gap: 18px;
  align-items: stretch;
}
.qp-user-import-flow-head {
  display: grid;
  align-content: start;
  gap: 8px;
}
.qp-user-import-steps {
  display: grid;
  gap: 12px;
}
.qp-user-import-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 22px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}
.qp-user-import-step h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}
.qp-user-import-step p {
  margin: 0 0 10px;
}
.qp-step-number {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 1000;
  color: #fff;
  background: linear-gradient(135deg, var(--qp-primary), var(--qp-primary-2));
  box-shadow: 0 12px 26px rgba(37, 99, 235, .22);
}
.qp-admin-import-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}
.qp-admin-import-row .qp-placement-pill {
  grid-column: 1 / -1;
}
.qp-user-import-conflicts {
  flex: 0 0 auto;
  margin: 0 24px;
  padding: 16px;
  border: 1px solid rgba(245, 158, 11, .34);
  border-radius: 16px;
  background: #fffbeb;
}
.qp-user-import-conflicts h3,
.qp-user-import-conflicts p {
  margin: 5px 0 0;
}
.qp-import-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.qp-import-choice {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 13px 14px;
  text-align: start;
  color: #334155;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.qp-import-choice span {
  color: #64748b;
  font-size: .8rem;
  line-height: 1.45;
}
.qp-import-choice:hover,
.qp-import-choice:focus-visible,
.qp-import-choice.active {
  border-color: var(--qp-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--qp-primary) 14%, transparent);
}
.qp-import-choice.active {
  color: var(--qp-primary);
  background: color-mix(in srgb, var(--qp-primary) 6%, #fff);
}
.qp-placement-pill {
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, .14);
  background: #eff6ff;
  color: #1e3a8a;
  font-size: .8rem;
  font-weight: 900;
  white-space: normal;
  line-height: 1.2;
}
.qp-admin-edit-note {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, .22);
  color: #475569;
}
.qp-user-import-dialog {
  max-height: calc(100dvh - 24px);
}
.qp-user-import-shell {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}
.qp-user-import-shell > header,
.qp-user-import-shell > footer {
  flex: 0 0 auto;
  position: sticky;
  z-index: 2;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
}
.qp-user-import-shell > header { top: 0; }
.qp-user-import-shell > footer { bottom: 0; }
.qp-user-import-help,
.qp-user-mapping-grid,
.qp-user-import-preview,
.qp-user-import-conflicts,
.qp-user-import-validation {
  flex: 0 0 auto;
}
.qp-user-import-shell {
  overflow-y: auto;
}
@media (max-width: 980px) {
  .qp-user-import-flow-card {
    grid-template-columns: 1fr;
  }
  .qp-admin-import-row {
    grid-template-columns: 1fr;
  }
  .qp-admin-import-row .qp-placement-pill {
    grid-column: auto;
  }
  .qp-import-choice-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .qp-user-import-step {
    grid-template-columns: 1fr;
  }
  .qp-step-number {
    width: 30px;
    height: 30px;
    border-radius: 12px;
  }
  .qp-placement-pill {
    max-width: none;
  }
}


/* v1.19.4 phase 4: Admin Users mobile/table cleanup */
.qp-admin-users-page .qp-admin-toolbar {
  grid-template-columns: minmax(220px, 1fr) auto;
}
.qp-admin-users-page .qp-admin-toolbar .qp-input {
  min-width: 0;
}
.qp-admin-users-page .qp-admin-users-table-wrap,
.qp-admin-users-page .qp-admin-import-preview-table-wrap {
  max-width: 100%;
}
.qp-admin-users-page .qp-admin-users-table td,
.qp-admin-users-page .qp-admin-import-preview-table td {
  overflow-wrap: anywhere;
}
.qp-admin-users-page .qp-admin-edit-form {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}
.qp-admin-users-page .qp-admin-edit-form .qp-actions {
  grid-column: 1 / -1;
}
.qp-admin-users-page .qp-user-import-flow-head .qp-pill,
.qp-admin-users-page .qp-user-import-step .qp-muted {
  width: fit-content;
}
.qp-admin-users-page .qp-user-import-step .qp-actions.wrap,
.qp-admin-users-page .qp-user-import-shell > footer.qp-actions.wrap {
  gap: 10px;
}
.qp-admin-users-page .qp-user-mapping-item select {
  width: 100%;
}
.qp-admin-users-page .qp-user-import-preview {
  overflow: visible;
}

@media (max-width: 980px) {
  .qp-admin-users-page .qp-admin-edit-form {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 720px) {
  .qp-admin-users-page .qp-dashboard-title-group h1 {
    font-size: clamp(1.7rem, 9vw, 2.35rem);
  }
  .qp-admin-users-page .qp-dashboard-title-group p {
    font-size: .95rem;
    line-height: 1.45;
  }
  .qp-admin-users-page .qp-user-import-card {
    padding: 16px;
    gap: 14px;
  }
  .qp-admin-users-page .qp-user-import-flow-head {
    gap: 6px;
  }
  .qp-admin-users-page .qp-user-import-flow-head h2 {
    font-size: 1.32rem;
    line-height: 1.15;
  }
  .qp-admin-users-page .qp-user-import-step {
    padding: 13px;
    border-radius: 18px;
  }
  .qp-admin-users-page .qp-admin-import-row {
    gap: 8px;
  }
  .qp-admin-users-page .qp-admin-import-row .qp-btn,
  .qp-admin-users-page #adminUserImportButton,
  .qp-admin-users-page #adminUserRefresh {
    width: 100%;
  }
  .qp-admin-users-page .qp-admin-toolbar {
    grid-template-columns: 1fr;
  }
  .qp-admin-users-page .qp-admin-users-table-wrap,
  .qp-admin-users-page .qp-admin-import-preview-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .qp-admin-users-page .qp-admin-users-table,
  .qp-admin-users-page .qp-admin-import-preview-table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
  }
  .qp-admin-users-page .qp-admin-users-table thead,
  .qp-admin-users-page .qp-admin-import-preview-table thead {
    display: none;
  }
  .qp-admin-users-page .qp-admin-users-table tbody,
  .qp-admin-users-page .qp-admin-users-table tr,
  .qp-admin-users-page .qp-admin-users-table td,
  .qp-admin-users-page .qp-admin-import-preview-table tbody,
  .qp-admin-users-page .qp-admin-import-preview-table tr,
  .qp-admin-users-page .qp-admin-import-preview-table td {
    display: block;
    width: 100%;
  }
  .qp-admin-users-page .qp-admin-users-table tr,
  .qp-admin-users-page .qp-admin-import-preview-table tr {
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
  }
  .qp-admin-users-page .qp-admin-users-table td,
  .qp-admin-users-page .qp-admin-import-preview-table td {
    display: grid;
    grid-template-columns: minmax(82px, .36fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 9px 0;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, .14);
    text-align: left;
  }
  .qp-admin-users-page .qp-admin-users-table td:last-child,
  .qp-admin-users-page .qp-admin-import-preview-table td:last-child {
    border-bottom: 0;
  }
  .qp-admin-users-page .qp-admin-users-table td::before,
  .qp-admin-users-page .qp-admin-import-preview-table td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: .72rem;
    font-weight: 1000;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.25;
  }
  .qp-admin-users-page .qp-admin-users-table td[colspan],
  .qp-admin-users-page .qp-admin-import-preview-table td[colspan] {
    display: block;
    padding: 14px;
    text-align: center;
    border: 0;
  }
  .qp-admin-users-page .qp-admin-users-table td[colspan]::before,
  .qp-admin-users-page .qp-admin-import-preview-table td[colspan]::before {
    content: none;
  }
  .qp-admin-users-page .qp-admin-user-cell {
    align-items: flex-start;
    min-width: 0;
  }
  .qp-admin-users-page .qp-admin-user-cell > span {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 20px;
  }
  .qp-admin-users-page .qp-admin-user-cell b,
  .qp-admin-users-page .qp-admin-user-cell small,
  .qp-admin-users-page .qp-admin-mobile-break {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .qp-admin-users-page .qp-placement-pill {
    max-width: 100%;
    width: fit-content;
    border-radius: 14px;
  }
  .qp-admin-users-page .qp-admin-users-table td[data-label="Actions"] .qp-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .qp-admin-users-page .qp-admin-users-table td[data-label="Actions"] .qp-btn {
    width: 100%;
  }
  .qp-admin-users-page .qp-admin-edit-form {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .qp-admin-users-page .qp-admin-edit-form label {
    font-size: .76rem;
  }
  .qp-admin-users-page .qp-admin-edit-form .qp-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .qp-admin-users-page .qp-user-import-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .qp-admin-users-page .qp-user-import-shell {
    height: 100dvh;
    max-height: 100dvh;
    padding: 0;
    gap: 0;
  }
  .qp-admin-users-page .qp-user-import-shell > header,
  .qp-admin-users-page .qp-user-import-shell > footer {
    padding: 14px;
    gap: 10px;
  }
  .qp-admin-users-page .qp-user-import-shell > header {
    border-bottom: 1px solid rgba(148, 163, 184, .18);
  }
  .qp-admin-users-page .qp-user-import-shell > footer {
    border-top: 1px solid rgba(148, 163, 184, .18);
  }
  .qp-admin-users-page .qp-user-import-shell > footer .qp-btn {
    width: 100%;
  }
  .qp-admin-users-page .qp-user-import-help,
  .qp-admin-users-page .qp-user-mapping-grid,
  .qp-admin-users-page .qp-user-import-preview,
  .qp-admin-users-page .qp-user-import-conflicts,
  .qp-admin-users-page .qp-user-import-validation {
    margin: 12px 14px 0;
  }
  .qp-admin-users-page .qp-user-mapping-grid {
    gap: 10px;
  }
  .qp-admin-users-page .qp-user-mapping-item {
    padding: 12px;
    border-radius: 15px;
  }
  .qp-admin-users-page .qp-user-mapping-source,
  .qp-admin-users-page .qp-user-mapping-item small {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .qp-admin-users-page .qp-user-import-validation {
    margin-bottom: 12px;
  }
}

@media (max-width: 420px) {
  .qp-admin-users-page .qp-admin-users-table td,
  .qp-admin-users-page .qp-admin-import-preview-table td {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .qp-admin-users-page .qp-admin-users-table td[data-label="Actions"] .qp-actions {
    grid-template-columns: 1fr;
  }
}

/* v1.19.5 phase 5: mobile sidebar/navigation cleanup */
.qp-mobile-menu-btn,
.qp-mobile-nav-backdrop {
  display: none;
}

@media (max-width: 980px) {
  body.qp-has-mobile-nav {
    overflow-x: hidden;
  }

  body.qp-mobile-nav-open {
    overflow: hidden;
    touch-action: none;
  }

  .qp-mobile-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 86px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(109, 40, 217, .18);
    border-radius: 14px;
    background: #ffffff;
    color: var(--qp-style-accent, #46178f);
    font: inherit;
    font-weight: 950;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .qp-mobile-menu-btn span {
    font-size: 20px;
    line-height: 1;
  }

  .qp-mobile-menu-btn b {
    font-size: 13px;
    letter-spacing: -.02em;
  }

  .qp-mobile-menu-btn:focus-visible {
    outline: 3px solid rgba(124, 58, 237, .32);
    outline-offset: 3px;
  }

  .qp-mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 88;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    background: rgba(15, 23, 42, .42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
  }

  body.qp-mobile-nav-open .qp-mobile-nav-backdrop {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .qp-dashboard-clean .qp-dashboard-topbar {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    position: sticky !important;
    top: 0 !important;
    min-height: 68px !important;
    height: auto !important;
    padding: 10px 12px !important;
    gap: 10px !important;
    border-radius: 0 0 20px 20px !important;
    flex-wrap: nowrap !important;
    z-index: 80 !important;
  }

  .qp-dashboard-clean .qp-dashboard-title-group {
    order: initial !important;
    grid-column: 2 !important;
    min-width: 0 !important;
    flex: initial !important;
  }

  .qp-dashboard-clean .qp-dashboard-title-group h1 {
    font-size: clamp(18px, 5vw, 22px) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .qp-dashboard-clean .qp-dashboard-title-group p {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 12px !important;
  }

  .qp-dashboard-clean .qp-dashboard-top-actions {
    grid-column: 3 !important;
    justify-self: end !important;
    margin-left: 0 !important;
    max-width: min(42vw, 230px) !important;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .qp-dashboard-clean .qp-dashboard-top-actions::-webkit-scrollbar {
    display: none;
  }

  .qp-dashboard-clean .qp-dashboard-top-actions:empty {
    display: none !important;
  }

  .qp-dashboard-clean .qp-dashboard-main {
    padding-top: 0 !important;
  }

  .qp-dashboard-clean .qp-dashboard-content,
  .qp-library-content-shell {
    padding: 16px 12px 32px !important;
  }

  .qp-dashboard-clean .qp-dashboard-sidebar {
    position: fixed !important;
    left: 0 !important;
    right: auto !important;
    top: 0 !important;
    bottom: 0 !important;
    width: min(86vw, 330px) !important;
    max-width: 330px !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    padding: 16px 14px 18px !important;
    border-radius: 0 28px 28px 0 !important;
    border-right: 1px solid rgba(148, 163, 184, .24) !important;
    background: #ffffff !important;
    box-shadow: 24px 0 60px rgba(15, 23, 42, .22) !important;
    display: grid !important;
    grid-template-rows: auto auto 1fr !important;
    align-items: start !important;
    justify-content: stretch !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    z-index: 95 !important;
    transform: translateX(-112%) !important;
    opacity: .98;
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease, visibility .22s ease;
    -webkit-overflow-scrolling: touch;
  }

  body.qp-mobile-nav-open.qp-dashboard-clean .qp-dashboard-sidebar {
    transform: translateX(0) !important;
    visibility: visible;
    pointer-events: auto;
  }

  .qp-dashboard-clean .qp-dashboard-sidebar .qp-dashboard-logo {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 0 0 8px;
    padding: 8px 10px;
    color: var(--qp-style-accent, #46178f) !important;
    font-size: 22px;
    font-weight: 1000;
    text-decoration: none;
  }

  .qp-dashboard-clean .qp-space-chip {
    display: flex !important;
    margin: 0 0 10px !important;
    min-height: 56px !important;
    border-radius: 18px !important;
  }

  .qp-dashboard-clean .qp-space-chip[style*="display:none"],
  .qp-dashboard-clean .qp-space-chip[style*="display: none"],
  .qp-dashboard-clean .qp-space-chip[hidden] {
    display: none !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav {
    display: grid !important;
    grid-auto-rows: minmax(48px, auto) !important;
    gap: 7px !important;
    width: 100% !important;
    overflow: visible !important;
    padding: 4px 0 16px !important;
    scrollbar-width: thin;
  }

  .qp-dashboard-clean .qp-dashboard-nav a,
  .qp-dashboard-clean .qp-dashboard-side-bottom a {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    min-width: 0 !important;
    width: 100% !important;
    min-height: 48px !important;
    padding: 12px 13px !important;
    gap: 12px !important;
    border-radius: 16px !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    text-align: left !important;
    white-space: normal !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a span,
  .qp-dashboard-clean .qp-dashboard-side-bottom a span {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    display: inline-grid !important;
    place-items: center !important;
    font-size: 19px !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.active {
    box-shadow: 0 10px 22px rgba(70, 23, 143, .22) !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a[style*="display:none"],
  .qp-dashboard-clean .qp-dashboard-nav a[style*="display: none"],
  .qp-dashboard-clean .qp-dashboard-nav a[hidden] {
    display: none !important;
  }
}

@media (max-width: 520px) {
  .qp-dashboard-clean .qp-dashboard-topbar {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  .qp-dashboard-clean .qp-dashboard-top-actions {
    grid-column: 1 / -1 !important;
    justify-self: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .qp-dashboard-clean .qp-dashboard-top-actions .qp-btn,
  .qp-dashboard-clean .qp-dashboard-top-actions a.qp-btn,
  .qp-dashboard-clean .qp-top-space-chip {
    width: 100%;
    justify-content: center;
  }
}

/* v1.19.8 Phase 8: mobile cleanup for Library and Statistics */
.qp-library-refresh,
.qp-statistics-page {
  min-width: 0;
}

.qp-library-browser,
.qp-library-course-wrap,
.qp-stat-table-only {
  min-width: 0;
}

.qp-stat-filter-row {
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)) !important;
}

.qp-stat-filter-row label,
.qp-stat-filter-row .qp-input,
.qp-stat-filter-row .qp-select,
.qp-library-search,
.qp-library-search input {
  min-width: 0;
  width: 100%;
}

.qp-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.qp-stat-table td,
.qp-stat-table th,
.qp-kahoot-quiz-card,
.qp-kahoot-card-mainline h3,
.qp-mini-status,
.qp-section-heading p,
.qp-stat-summary {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 760px) {
  .qp-library-context-strip,
  .qp-library-browser,
  .qp-library-course-wrap,
  .qp-stat-table-only {
    border-radius: 20px !important;
    padding: 13px !important;
  }

  .qp-library-context-strip {
    display: grid;
    gap: 3px;
  }

  .qp-library-context-strip span,
  .qp-library-context-strip small {
    white-space: normal !important;
  }

  .qp-library-tabs {
    display: flex !important;
    gap: 8px !important;
    padding: 4px !important;
    overflow-x: auto !important;
    scroll-snap-type: x proximity;
    border-radius: 16px !important;
  }

  .qp-library-tabs button {
    flex: 0 0 auto !important;
    min-width: auto !important;
    scroll-snap-align: start;
    padding: 10px 13px !important;
    border-radius: 12px !important;
  }

  .qp-library-toolbar,
  .qp-library-status-row,
  .qp-library-view-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    align-items: stretch !important;
  }

  .qp-library-search {
    width: 100% !important;
  }

  .qp-library-view-actions {
    grid-template-columns: 1fr 1fr !important;
  }

  .qp-library-view-actions button,
  .qp-library-status-row .qp-btn {
    min-height: 44px;
    width: 100%;
  }

  .qp-kahoot-library-grid,
  .qp-kahoot-library-grid.small-grid,
  .qp-kahoot-library-grid.is-list {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .qp-kahoot-library-grid.is-list .qp-kahoot-quiz-card,
  .qp-kahoot-quiz-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
    max-width: 100% !important;
    border-radius: 20px !important;
    overflow: hidden;
  }

  .qp-kahoot-library-grid.is-list .qp-kahoot-card-thumb,
  .qp-kahoot-card-thumb {
    height: clamp(130px, 42vw, 190px) !important;
  }

  .qp-kahoot-card-body {
    padding: 13px !important;
    min-width: 0 !important;
  }

  .qp-kahoot-card-mainline {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px !important;
    align-items: start !important;
  }

  .qp-kahoot-card-mainline h3 {
    min-height: 0 !important;
    font-size: clamp(18px, 5vw, 22px) !important;
    line-height: 1.15 !important;
  }

  .qp-kahoot-owner {
    white-space: normal !important;
  }

  .qp-kahoot-card-status {
    gap: 6px !important;
  }

  .qp-mini-status {
    max-width: 100%;
    white-space: normal !important;
    line-height: 1.2;
  }

  .qp-card-menu-btn {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
  }

  .qp-kahoot-dropdown {
    position: static !important;
    width: auto !important;
    margin: 0 13px 13px !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    border: 1px solid rgba(15, 23, 42, .10) !important;
    background: #fff !important;
  }

  .qp-kahoot-dropdown a,
  .qp-kahoot-dropdown button {
    min-height: 44px !important;
    padding: 11px 12px !important;
  }

  .qp-course-node summary,
  .qp-subject-node summary {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  .qp-stat-filter-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .qp-stat-filter-row .qp-btn,
  .qp-statistics-page .qp-dashboard-top-actions .qp-btn {
    min-height: 44px;
  }

  .qp-stat-summary {
    font-size: 13px;
    line-height: 1.35;
  }

  .qp-table-wrap {
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .qp-stat-table,
  .qp-stat-table thead,
  .qp-stat-table tbody,
  .qp-stat-table tr,
  .qp-stat-table td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .qp-stat-table thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
  }

  .qp-stat-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: transparent !important;
  }

  .qp-stat-table tbody {
    display: grid !important;
    gap: 12px !important;
  }

  .qp-stat-table tr:not([hidden]) {
    display: grid !important;
    gap: 8px !important;
    padding: 13px !important;
    border: 1px solid rgba(15, 23, 42, .10) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06) !important;
  }

  .qp-stat-table td {
    display: grid !important;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: center !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #1f2937 !important;
  }

  .qp-stat-table td[data-label]::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .qp-stat-table td:not([data-label]) {
    display: block !important;
  }

  .qp-stat-table .qp-empty-cell {
    display: block !important;
    text-align: center !important;
    padding: 18px !important;
  }

  .qp-stat-table .qp-empty-cell::before {
    content: none !important;
  }

  .qp-stat-student-row td[data-label="Name"] b {
    font-size: 16px;
  }

  .qp-stat-expand {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
  }

  .qp-stat-avatar {
    width: 40px !important;
    height: 40px !important;
  }

  .qp-stat-group-chips {
    justify-content: flex-start !important;
  }

  .qp-stat-detail-row td {
    display: block !important;
  }

  .qp-stat-quiz-details {
    padding: 4px 0 0 !important;
  }

  .qp-stat-quiz-details h4 {
    margin: 0 0 10px !important;
    font-size: 16px !important;
  }

  .qp-stat-quiz-details table,
  .qp-stat-quiz-details thead,
  .qp-stat-quiz-details tbody,
  .qp-stat-quiz-details tr,
  .qp-stat-quiz-details td {
    display: block !important;
    width: 100% !important;
  }

  .qp-stat-quiz-details thead {
    display: none !important;
  }

  .qp-stat-quiz-details tbody {
    display: grid !important;
    gap: 9px !important;
  }

  .qp-stat-quiz-details tr {
    display: grid !important;
    gap: 7px !important;
    padding: 10px !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
    border: 1px solid rgba(15, 23, 42, .08) !important;
  }

  .qp-stat-quiz-details td {
    display: grid !important;
    grid-template-columns: minmax(96px, 35%) minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  .qp-stat-quiz-details td[data-label]::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
}

@media (max-width: 430px) {
  .qp-stat-table td,
  .qp-stat-quiz-details td {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
    align-items: start !important;
  }

  .qp-library-tabs button {
    padding-inline: 11px !important;
  }
}

/* v1.20.0 unified navigation and accessible color system */
:root {
  --qp-style-accent: #5b21b6;
  --qp-purple: #5b21b6;
  --qp-purple-dark: #43168c;
  --qp-blue: #1d4ed8;
  --qp-green: #15803d;
  --qp-text: #171326;
  --qp-muted: #625d70;
  --qp-border: #e7e3ee;
  --qp-surface: #ffffff;
  --qp-page: #f7f7fc;
}

.qp-dashboard-clean,
.qp-home-dashboard-body {
  background: var(--qp-page) !important;
}

.qp-dashboard-clean .qp-dashboard-main {
  background: var(--qp-page) !important;
}

.qp-btn.primary,
button.qp-btn.primary,
a.qp-btn.primary {
  border-color: #5b21b6 !important;
  background: #5b21b6 !important;
  color: #ffffff !important;
}

.qp-btn.primary:hover,
button.qp-btn.primary:hover,
a.qp-btn.primary:hover {
  border-color: #43168c !important;
  background: #43168c !important;
}

.qp-btn.success,
button.qp-btn.success,
a.qp-btn.success {
  border-color: #15803d !important;
  background: #15803d !important;
  color: #ffffff !important;
}

.qp-dashboard-clean .qp-dashboard-nav .qp-nav-icon {
  display: grid !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  margin: 0 !important;
  place-items: center !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, .08) !important;
  color: inherit !important;
  font-size: 21px !important;
  line-height: 1 !important;
}

.qp-dashboard-clean .qp-dashboard-nav .qp-nav-label {
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  line-height: 1.2 !important;
}

@media (min-width: 981px) {
  .qp-dashboard-clean .qp-dashboard-shell {
    grid-template-columns: 84px minmax(0, 1fr) !important;
  }

  .qp-dashboard-clean .qp-dashboard-sidebar {
    position: sticky !important;
    top: 0 !important;
    z-index: 60 !important;
    width: 84px !important;
    height: 100vh !important;
    min-height: 100vh !important;
    padding: 16px 10px !important;
    gap: 10px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #17123b !important;
    box-shadow: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo {
    justify-content: center !important;
    min-height: 50px !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    font-size: 0 !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo > span:last-child {
    display: none !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo-icon {
    display: grid !important;
    width: 46px !important;
    height: 46px !important;
    place-items: center !important;
    border-radius: 14px !important;
    background: #5b21b6 !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 1000 !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav {
    display: grid !important;
    grid-auto-rows: 48px !important;
    justify-items: center !important;
    width: 100% !important;
    gap: 7px !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link {
    position: relative !important;
    display: grid !important;
    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 5px !important;
    place-items: center !important;
    border-radius: 14px !important;
    background: transparent !important;
    color: rgba(255, 255, 255, .74) !important;
    font-size: 0 !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link:hover {
    background: rgba(255, 255, 255, .11) !important;
    color: #ffffff !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link.active {
    background: #5b21b6 !important;
    color: #ffffff !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .24) !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link.active .qp-nav-icon {
    background: transparent !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav .qp-nav-label {
    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;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link:focus-visible {
    outline: 3px solid #fbbf24 !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
  }
}

@media (max-width: 980px) {
  .qp-dashboard-clean .qp-dashboard-sidebar {
    background: #17123b !important;
    border-color: rgba(255, 255, 255, .12) !important;
  }

  .qp-dashboard-clean .qp-dashboard-sidebar .qp-dashboard-logo,
  .qp-dashboard-clean .qp-dashboard-sidebar .qp-dashboard-logo > span:last-child {
    color: #ffffff !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link {
    color: rgba(255, 255, 255, .78) !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link:hover {
    background: rgba(255, 255, 255, .10) !important;
    color: #ffffff !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link.active {
    background: #5b21b6 !important;
    color: #ffffff !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav .qp-nav-label {
    display: inline !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link.active .qp-nav-icon {
    background: rgba(255, 255, 255, .12) !important;
  }
}

.qp-student-shortcuts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.qp-student-shortcuts a:nth-child(2) > span {
  background: #fff4d6;
  color: #8a4b00;
}

@media (max-width: 980px) {
  .qp-student-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .qp-student-shortcuts { grid-template-columns: 1fr; }
}

/* v1.20.0 unified shell: one sidebar, one home link, no header overlap */
:root { --qp-app-sidebar-width: 216px; }

.qp-topbar-brand { display: none !important; }

@media (min-width: 1181px) {
  .qp-dashboard-clean .qp-dashboard-shell {
    display: grid !important;
    grid-template-columns: var(--qp-app-sidebar-width) minmax(0, 1fr) !important;
    align-items: start !important;
    width: 100% !important;
    min-height: 100vh !important;
    overflow: visible !important;
  }

  .qp-dashboard-clean .qp-dashboard-sidebar {
    position: sticky !important;
    inset: 0 auto auto 0 !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: var(--qp-app-sidebar-width) !important;
    height: 100vh !important;
    min-height: 100vh !important;
    padding: 16px 12px !important;
    gap: 10px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #17123b !important;
    box-shadow: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 60 !important;
  }

  .qp-dashboard-clean .qp-dashboard-main {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .qp-dashboard-clean .qp-dashboard-topbar {
    position: sticky !important;
    inset: 0 auto auto 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    z-index: 50 !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-height: 54px !important;
    margin: 0 0 8px !important;
    padding: 6px 8px !important;
    gap: 10px !important;
    border-radius: 16px !important;
    color: #ffffff !important;
    font-size: 21px !important;
    font-weight: 1000 !important;
    text-decoration: none !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo:hover,
  .qp-dashboard-clean .qp-dashboard-logo.active {
    background: rgba(255, 255, 255, .10) !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo-icon {
    display: grid !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    place-items: center !important;
    border-radius: 13px !important;
    background: #5b21b6 !important;
    color: #ffffff !important;
    font-size: 21px !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo > span:last-child,
  .qp-dashboard-clean .qp-dashboard-logo-title {
    display: inline-flex !important;
    align-items: baseline !important;
    color: #ffffff !important;
    font-size: 21px !important;
    line-height: 1 !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo-title strong { color: #c4b5fd !important; }

  .qp-dashboard-clean .qp-dashboard-nav {
    display: grid !important;
    grid-auto-rows: 48px !important;
    justify-items: stretch !important;
    width: 100% !important;
    gap: 7px !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 5px 8px !important;
    gap: 10px !important;
    border-radius: 14px !important;
    background: transparent !important;
    color: rgba(255, 255, 255, .78) !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav .qp-nav-icon {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav .qp-nav-label {
    position: static !important;
    display: inline !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: auto !important;
    color: inherit !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link:hover {
    background: rgba(255, 255, 255, .10) !important;
    color: #ffffff !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link.active {
    background: #5b21b6 !important;
    color: #ffffff !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .20) !important;
  }
}

@media (max-width: 1180px) {
  body.qp-has-mobile-nav { overflow-x: hidden !important; }
  body.qp-mobile-nav-open { overflow: hidden !important; touch-action: none; }

  .qp-dashboard-clean .qp-dashboard-shell {
    display: block !important;
    width: 100% !important;
    overflow-x: clip !important;
  }

  .qp-dashboard-clean .qp-dashboard-main {
    width: 100% !important;
    margin: 0 !important;
  }

  .qp-dashboard-clean .qp-dashboard-sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: min(86vw, 310px) !important;
    max-width: 310px !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    padding: 16px 14px 18px !important;
    border: 0 !important;
    border-radius: 0 26px 26px 0 !important;
    background: #17123b !important;
    box-shadow: 24px 0 60px rgba(15, 23, 42, .28) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform: translateX(-112%) !important;
    visibility: hidden !important;
    opacity: 1 !important;
    pointer-events: none !important;
    z-index: 110 !important;
    transition: transform .2s ease, visibility .2s ease !important;
  }

  body.qp-mobile-nav-open.qp-dashboard-clean .qp-dashboard-sidebar {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-height: 54px !important;
    margin: 0 0 10px !important;
    padding: 6px 8px !important;
    gap: 10px !important;
    color: #ffffff !important;
    font-size: 21px !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo > span:last-child,
  .qp-dashboard-clean .qp-dashboard-logo-title {
    display: inline-flex !important;
    color: #ffffff !important;
    font-size: 21px !important;
  }

  .qp-dashboard-clean .qp-dashboard-logo-title strong { color: #c4b5fd !important; }

  .qp-dashboard-clean .qp-dashboard-nav {
    display: grid !important;
    grid-auto-rows: minmax(48px, auto) !important;
    gap: 7px !important;
    width: 100% !important;
    padding: 0 0 14px !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link {
    display: flex !important;
    width: 100% !important;
    min-height: 48px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 5px 8px !important;
    gap: 10px !important;
    color: rgba(255, 255, 255, .80) !important;
    font-size: 15px !important;
  }

  .qp-dashboard-clean .qp-dashboard-nav .qp-nav-label {
    position: static !important;
    display: inline !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    color: inherit !important;
    font-size: 15px !important;
  }

  .qp-mobile-menu-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .qp-mobile-nav-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 105 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    background: rgba(15, 12, 31, .52) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.qp-mobile-nav-open .qp-mobile-nav-backdrop {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
}

/* v1.20 shared academic workspace */
.qp-academic-workspace { display:grid; gap:20px; }
.qp-academic-hero { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:clamp(22px,4vw,38px); border-radius:28px; color:#fff; background:linear-gradient(135deg,#4c1d95,#7c3aed 58%,#1e3a8a); box-shadow:0 24px 65px rgba(76,29,149,.24); }
.qp-academic-hero h2 { margin:10px 0 6px; font-size:clamp(2rem,4vw,3.5rem); }
.qp-academic-hero p { margin:0; color:rgba(255,255,255,.82); max-width:680px; }
.qp-academic-hero-metrics { display:flex; gap:10px; flex-wrap:wrap; }
.qp-academic-hero-metrics span { min-width:120px; padding:14px 16px; border:1px solid rgba(255,255,255,.2); border-radius:18px; background:rgba(255,255,255,.12); text-align:center; }
.qp-academic-hero-metrics b { display:block; font-size:1.8rem; }
.qp-academic-builder,.qp-subject-create,.qp-subject-list-section { padding:22px; border:1px solid rgba(124,58,237,.15); border-radius:26px; background:#fff; box-shadow:0 16px 42px rgba(15,23,42,.07); }
.qp-academic-builder > header,.qp-subject-create > header,.qp-subject-list-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:18px; }
.qp-academic-builder h2,.qp-subject-create h2,.qp-subject-list-head h2 { margin:8px 0 4px; }
.qp-academic-builder header p,.qp-subject-create header p { margin:0; color:#64748b; }
.qp-academic-builder-grid { display:grid; grid-template-columns:repeat(4,minmax(190px,1fr)); gap:12px; }
.qp-academic-builder-grid article { display:grid; gap:9px; align-content:start; padding:15px; border:1px solid rgba(148,163,184,.2); border-radius:20px; background:linear-gradient(145deg,#fff,#faf5ff); }
.qp-academic-builder-grid h3 { margin:0; }
.qp-academic-builder-grid .step { width:30px; height:30px; display:grid; place-items:center; border-radius:10px; color:#fff; font-weight:900; background:#7c3aed; }
.qp-academic-builder-grid .inline { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px; }
.qp-academic-builder-grid .inline.secondary { padding-top:8px; border-top:1px solid rgba(148,163,184,.18); }
.qp-subject-create form { display:grid; grid-template-columns:repeat(5,minmax(145px,1fr)); gap:12px; align-items:end; }
.qp-subject-create form > label { display:grid; gap:6px; }
.qp-subject-create form > label > span,.qp-academic-search > span { font-size:.72rem; font-weight:900; letter-spacing:.06em; text-transform:uppercase; color:#64748b; }
.qp-subject-create fieldset { grid-column:1/-2; min-width:0; padding:12px; border:1px solid rgba(124,58,237,.16); border-radius:18px; }
.qp-subject-create legend { padding:0 7px; color:#4c1d95; font-weight:900; }
.qp-checkline { display:flex!important; align-items:center; gap:8px; }
.qp-checkline input,.qp-subject-group-choices input { width:18px; height:18px; accent-color:#7c3aed; }
.qp-subject-group-choices { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.qp-subject-group-choices label { display:flex; align-items:center; gap:8px; padding:9px 11px; border:1px solid rgba(148,163,184,.2); border-radius:14px; background:#fafafa; }
.qp-subject-group-choices label.section { margin-left:20px; border-style:dashed; background:#f5f3ff; }
.qp-subject-group-choices b,.qp-subject-group-choices small { display:block; }
.qp-subject-group-choices small { color:#64748b; font-size:.7rem; }
#subjectTeacherSelect { min-height:118px; }
.qp-roster-dialog { width:min(820px,calc(100vw - 28px)); max-height:88vh; padding:0; border:0; border-radius:24px; box-shadow:0 30px 90px rgba(15,23,42,.28); }
.qp-roster-dialog::backdrop { background:rgba(15,23,42,.58); backdrop-filter:blur(4px); }
.qp-roster-shell { display:grid; gap:16px; padding:22px; }
.qp-roster-shell > header { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; }
.qp-roster-shell h2 { margin:7px 0 3px; }
.qp-roster-controls { display:grid; grid-template-columns:minmax(180px,.8fr) minmax(240px,1.2fr); gap:12px; }
.qp-roster-controls label { display:grid; gap:6px; }
.qp-roster-controls label > span { font-size:.74rem; font-weight:900; text-transform:uppercase; color:#64748b; }
.qp-roster-results { display:grid; gap:8px; max-height:42vh; overflow:auto; padding:2px; }
.qp-roster-student { display:grid; grid-template-columns:auto auto minmax(0,1fr) auto; gap:10px; align-items:center; padding:11px 12px; border:1px solid #e2e8f0; border-radius:15px; background:#fff; cursor:pointer; }
.qp-roster-student.assigned { border-color:#c4b5fd; background:#f5f3ff; }
.qp-roster-student input { width:18px; height:18px; accent-color:#7c3aed; }
.qp-roster-student .avatar { font-size:1.35rem; }
.qp-roster-student b,.qp-roster-student small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.qp-roster-student small { color:#64748b; }
.qp-roster-student em { font-style:normal; font-size:.72rem; font-weight:900; color:#6d28d9; }
.qp-academic-search { display:grid; gap:5px; min-width:min(330px,100%); }
.qp-subject-context-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(290px,1fr)); gap:14px; }
.qp-subject-context-card { display:grid; gap:13px; padding:17px; border:1px solid rgba(124,58,237,.14); border-radius:22px; background:linear-gradient(145deg,#fff,#faf5ff); box-shadow:0 12px 28px rgba(76,29,149,.07); }
.qp-subject-context-main { display:flex; gap:12px; align-items:flex-start; }
.qp-subject-context-icon { width:44px; height:44px; flex:none; display:grid; place-items:center; border-radius:15px; color:#fff; font-weight:1000; background:linear-gradient(135deg,#6d28d9,#8b5cf6); }
.qp-subject-context-card h3 { margin:7px 0 3px; font-size:1.2rem; }
.qp-subject-context-card p { margin:0; color:#64748b; }
.qp-subject-context-groups { display:flex; gap:6px; flex-wrap:wrap; }
.qp-subject-context-groups span { padding:5px 8px; border-radius:999px; background:#ede9fe; color:#5b21b6; font-size:.75rem; font-weight:850; }
.qp-subject-context-metrics { display:flex; gap:16px; padding:10px 0; border-top:1px solid rgba(148,163,184,.16); border-bottom:1px solid rgba(148,163,184,.16); }
.qp-subject-context-metrics b { font-size:1.08rem; }
html[data-theme="dark"] .qp-academic-builder,html[data-theme="dark"] .qp-subject-create,html[data-theme="dark"] .qp-subject-list-section,html[data-theme="dark"] .qp-academic-builder-grid article,html[data-theme="dark"] .qp-subject-context-card { background:linear-gradient(145deg,#111827,#1e1b4b); color:#e5e7eb; border-color:rgba(255,255,255,.12); }
html[data-theme="dark"] .qp-academic-builder header p,html[data-theme="dark"] .qp-subject-create header p,html[data-theme="dark"] .qp-subject-context-card p { color:#cbd5e1; }
@media (max-width:1100px){.qp-academic-builder-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.qp-subject-create form{grid-template-columns:repeat(2,minmax(0,1fr))}.qp-subject-create fieldset{grid-column:1/-1}}
@media (max-width:700px){.qp-academic-hero,.qp-academic-builder>header,.qp-subject-create>header,.qp-subject-list-head{align-items:stretch;flex-direction:column}.qp-academic-builder-grid,.qp-subject-create form{grid-template-columns:1fr}.qp-subject-create fieldset{grid-column:1}.qp-academic-builder-grid .inline{grid-template-columns:1fr}.qp-academic-search{min-width:0}.qp-academic-hero-metrics span{flex:1}.qp-roster-controls{grid-template-columns:1fr}.qp-roster-student{grid-template-columns:auto auto minmax(0,1fr)}.qp-roster-student em{grid-column:3}}

/* v1.20 shared role-scoped dashboard */
.qp-shared-dashboard { display:grid; gap:20px; }
.qp-shared-dashboard-hero { display:flex; align-items:center; justify-content:space-between; gap:24px; }
.qp-shared-dashboard-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px; }
.qp-dashboard-subject-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.qp-dashboard-context-section .qp-subject-context-card { margin:0; }
@media (max-width:900px){.qp-dashboard-subject-grid{grid-template-columns:1fr}.qp-shared-dashboard-hero{align-items:flex-start;flex-direction:column}.qp-shared-dashboard-actions{justify-content:flex-start}}
.qp-save-location-dialog { width:min(660px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); border:0; border-radius:20px; padding:0; background:transparent; }
.qp-save-location-dialog::backdrop { background:rgba(15,23,42,.68); backdrop-filter:blur(8px); }
.qp-save-location-card { display:grid; gap:14px; max-height:calc(100dvh - 24px); overflow-y:auto; padding:24px; border:1px solid rgba(124,58,237,.18); border-radius:20px; background:#fff; box-shadow:0 34px 100px rgba(15,23,42,.38); }
.qp-save-location-card h2,.qp-save-location-card p { margin:0; }
.qp-save-location-card p { color:#64748b; }
.qp-save-location-card label { display:grid; gap:6px; }
.qp-save-location-card label>span { font-size:.75rem; font-weight:900; letter-spacing:.06em; text-transform:uppercase; color:#64748b; }
.qp-save-location-actions { display:grid; grid-template-columns:auto minmax(0,1fr) minmax(0,1fr); flex-wrap:nowrap; }
.qp-save-location-actions .qp-btn { width:100%; white-space:nowrap; }
.qp-save-thumbnail-preview { display:grid; overflow:hidden; max-height:520px; opacity:1; transform:translateY(0); transition:max-height .24s ease,opacity .18s ease,transform .24s ease; }
.qp-save-thumbnail-preview[hidden] { display:none; }
.qp-save-thumbnail-card { width:min(100%,420px); min-height:0; margin:0 auto; border:1px solid #e2e8f0; border-radius:8px; overflow:hidden; box-shadow:0 14px 32px rgba(15,23,42,.14); }
.qp-save-thumbnail-card:hover { transform:none; }
.qp-save-thumbnail-card .qp-kahoot-card-thumb { height:auto; aspect-ratio:16/9; }
.qp-save-thumbnail-card .qp-kahoot-card-thumb img { width:100%; height:100%; object-fit:fill; transform:none !important; }
.qp-save-thumbnail-card .qp-kahoot-card-mainline { grid-template-columns:minmax(0,1fr); }
.qp-save-thumbnail-card .qp-kahoot-card-mainline h3 { display:-webkit-box; min-height:0; overflow:hidden; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.qp-save-thumbnail-owner { margin:7px 0 9px !important; color:#64748b; font-size:.82rem; }
html[data-theme="dark"] .qp-save-location-card { background:#111827; color:#e5e7eb; }
html[data-theme="dark"] .qp-save-thumbnail-card { border-color:#334155; background:#0f172a; }
html[data-theme="dark"] .qp-save-thumbnail-card .qp-kahoot-card-mainline h3 { color:#f8fafc; }

@media (max-width:700px) {
  .qp-save-location-dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); }
  .qp-save-location-card { max-height:calc(100dvh - 16px); padding:18px; border-radius:16px; }
  .qp-save-location-actions { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .qp-save-location-actions .qp-btn { min-height:46px; padding:9px 7px; font-size:.84rem; }
}

@media (max-width: 760px) {
  .qp-stat-table tr[hidden] {
    display: none !important;
  }
}

/* v1.19.10 phase 9: final GUI consistency pass
   Scope: global light-only polish. Keeps page logic and previous page-specific fixes intact. */
html[data-theme="light"] {
  color-scheme: light;
}

body.qp-minimal-ui {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.qp-dashboard-clean,
.qp-home-dashboard-body {
  background:
    radial-gradient(circle at 8% 0%, rgba(109, 40, 217, .10), transparent 32%),
    radial-gradient(circle at 100% 12%, rgba(37, 99, 235, .08), transparent 28%),
    #f7f8fc;
}

:where(.qp-dashboard-shell, .qp-dashboard-main, .qp-dashboard-content, .qp-dashboard-topbar, .qp-dashboard-settings,
  .qp-card, .qp-game-card, .qp-profile-panel, .qp-settings-card, .qp-admin-card,
  .qp-library-browser, .qp-kahoot-card, .qp-dashboard-hero-simple, .qp-server-hero, .qp-college-layout) {
  min-width: 0;
}

:where(.qp-dashboard-content, .qp-dashboard-settings, .qp-card, .qp-profile-panel, .qp-settings-card,
  .qp-admin-card, .qp-library-browser, .qp-kahoot-card, .qp-server-hero, .qp-college-card, .qp-course-node, .qp-subject-node) {
  overflow-wrap: anywhere;
  word-break: normal;
}

:where(.qp-dashboard-title-group h1, .qp-dashboard-title-group p, .qp-section-title-row h2, .qp-section-title-row p,
  .qp-card h1, .qp-card h2, .qp-card h3, .qp-profile-panel h2, .qp-profile-panel h3,
  .qp-muted, .qp-pill, .qp-summary-badge, .qp-space-chip, .qp-top-space-chip, .qp-account-chip b,
  .qp-account-chip em, td, th, label, small, em, b) {
  overflow-wrap: anywhere;
}

.qp-dashboard-topbar {
  align-items: center;
  gap: 12px;
}

.qp-dashboard-title-group {
  min-width: 0;
}

.qp-dashboard-title-group h1 {
  line-height: 1.05;
  letter-spacing: -.03em;
}

.qp-dashboard-top-actions,
.qp-actions,
.qp-admin-toolbar,
.qp-question-bank-actions,
.qp-settings-profile-actions,
.qp-library-actions,
.qp-link-row {
  min-width: 0;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.qp-btn,
button.qp-btn,
a.qp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
}

.qp-btn.small,
button.qp-btn.small,
a.qp-btn.small {
  min-height: 38px;
}

.qp-input,
.qp-select,
.qp-textarea,
input.qp-input,
select.qp-select,
textarea.qp-textarea {
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
}

textarea.qp-textarea,
.qp-textarea {
  resize: vertical;
  overflow: auto;
}

:where(.qp-btn, button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid rgba(37, 99, 235, .34);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, .10);
}

.qp-table-wrap,
.qp-admin-table-wrap,
.qp-stat-table-wrap {
  max-width: 100%;
}

.qp-table-wrap table,
.qp-admin-table-wrap table,
.qp-stat-table-wrap table {
  width: 100%;
}

.qp-toast {
  width: min(92vw, 520px);
  text-align: center;
}

.qp-account-chip {
  max-width: min(300px, 44vw);
}

.qp-account-chip span:last-child {
  min-width: 0;
}

.qp-account-chip b,
.qp-account-chip em,
.qp-account-chip small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qp-empty {
  line-height: 1.45;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

@media (max-width: 900px) {
  .qp-dashboard-content {
    padding-inline: clamp(10px, 3vw, 18px);
  }

  .qp-dashboard-topbar {
    border-radius: 0 0 22px 22px;
  }

  .qp-dashboard-title-group h1 {
    font-size: clamp(26px, 7vw, 38px);
  }

  .qp-dashboard-title-group p {
    font-size: 14px;
    line-height: 1.35;
  }
}

@media (max-width: 760px) {
  .qp-dashboard-shell {
    width: 100%;
    overflow-x: clip;
  }

  .qp-dashboard-main {
    width: 100%;
  }

  .qp-dashboard-topbar {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 12px !important;
  }

  .qp-dashboard-topbar .qp-topbar-brand {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .qp-dashboard-title-group {
    grid-column: 1 / -1;
  }

  .qp-dashboard-top-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .qp-dashboard-top-actions .qp-btn,
  .qp-admin-toolbar .qp-btn,
  .qp-question-bank-actions .qp-btn,
  .qp-settings-profile-actions .qp-btn,
  .qp-library-actions .qp-btn {
    flex: 1 1 150px;
  }

  .qp-dashboard-settings,
  .qp-profile-panel,
  .qp-settings-card,
  .qp-card,
  .qp-library-browser,
  .qp-server-hero,
  .qp-dashboard-hero-simple {
    border-radius: 20px !important;
  }

  .qp-account-chip {
    max-width: 100%;
    width: 100%;
  }

  .qp-toast {
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 430px) {
  .qp-dashboard-content {
    padding-inline: 8px;
  }

  .qp-dashboard-top-actions .qp-btn,
  .qp-admin-toolbar .qp-btn,
  .qp-question-bank-actions .qp-btn,
  .qp-settings-profile-actions .qp-btn,
  .qp-library-actions .qp-btn {
    flex-basis: 100%;
  }

  .qp-pill,
  .qp-summary-badge,
  .qp-space-chip,
  .qp-top-space-chip {
    max-width: 100%;
  }
}

/* Final concise-copy contrast overrides. */
.qp-admin-users-page .qp-step-number {
  color: #111827 !important;
  background: #f3f4f6 !important;
  border: 1px solid #d1d5db !important;
  box-shadow: none !important;
}
.qp-admin-users-page .qp-user-import-step h3 { color: #111827 !important; }
.qp-question-bank-hero .qp-pill.inverse,
.qp-server-hero .qp-pill.inverse {
  color: #111827 !important;
  background: #ffffff !important;
  border-color: rgba(17, 24, 39, .18) !important;
}
#libraryCollegeHeading:empty,
#statusSub:empty,
#adminImportPlacementSummary[hidden] { display: none !important; }

/* Shop: compact catalog shared by students and the system admin. */
.qp-shop-body {
  --qp-shop-purple: #5b21b6;
  --qp-shop-violet: #7c3aed;
  --qp-shop-ink: #201244;
  --qp-shop-gold: #f8b817;
  background: #f5f2fb !important;
}
.qp-shop-body [hidden] { display: none !important; }
.qp-shop-topbar { align-items: center; }
.qp-shop-wallet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #eadcfb;
  border-radius: 999px;
  color: var(--qp-shop-ink);
  background: #fff;
  box-shadow: 0 8px 24px rgba(76, 29, 149, .10);
  font-size: 18px;
}
.qp-shop-wallet span { font-size: 24px; filter: drop-shadow(0 3px 4px rgba(180, 112, 0, .24)); }
.qp-shop-wallet strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.qp-shop-page {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding-bottom: 56px !important;
}
.qp-shop-hero {
  position: relative;
  min-height: 224px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(28px, 4vw, 54px);
  border-radius: 30px;
  color: #fff;
  background:
    radial-gradient(circle at 76% 28%, rgba(255,255,255,.18), transparent 23%),
    radial-gradient(circle at 12% 92%, rgba(216,180,254,.26), transparent 34%),
    linear-gradient(130deg, #4c1d95 0%, #7c3aed 55%, #312e81 100%);
  box-shadow: 0 24px 60px rgba(67, 27, 130, .24);
}
.qp-shop-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .24;
  background-image: radial-gradient(circle, #fff 1px, transparent 1.5px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, transparent, #000 72%, transparent);
  pointer-events: none;
}
.qp-shop-hero-copy { position: relative; z-index: 1; }
.qp-shop-kicker {
  display: block;
  margin-bottom: 4px;
  color: #ddd6fe;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.qp-shop-hero h2 { margin: 0 0 20px; color: #fff; font-size: clamp(30px, 4vw, 48px); }
.qp-shop-equipped {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 210px;
  padding: 10px 18px 10px 10px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px;
  background: rgba(26, 10, 66, .38);
  backdrop-filter: blur(12px);
}
.qp-shop-equipped-emoji {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 17px;
  background: rgba(255,255,255,.15);
  font-size: 38px;
}
.qp-shop-equipped div { min-width: 0; display: grid; gap: 3px; }
.qp-shop-equipped strong { color: #fff; font-size: 17px; }
.qp-shop-equipped small { min-height: 16px; color: #f5d0fe; font-weight: 800; }
.qp-shop-coin-art {
  position: relative;
  z-index: 1;
  width: clamp(160px, 24vw, 320px);
  height: 140px;
  flex: 0 0 auto;
}
.qp-shop-coin-art span {
  position: absolute;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 13px 12px rgba(31, 12, 69, .36));
  font-size: clamp(58px, 7vw, 96px);
}
.qp-shop-coin-art span:nth-child(1) { right: 8%; bottom: 2%; transform: rotate(8deg); }
.qp-shop-coin-art span:nth-child(2) { right: 34%; top: 0; font-size: clamp(46px, 5.6vw, 78px); transform: rotate(-12deg); }
.qp-shop-coin-art span:nth-child(3) { right: 51%; bottom: 0; font-size: clamp(40px, 5vw, 68px); transform: rotate(-22deg); }
.qp-shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 18px;
}
.qp-shop-tabs { display: flex; flex-wrap: wrap; gap: 9px; }
.qp-shop-tabs button {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid #e2d8f3;
  border-radius: 13px;
  color: #5b4b72;
  background: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
.qp-shop-tabs button:hover { border-color: #a78bfa; color: #5b21b6; }
.qp-shop-tabs button.active { border-color: #6d28d9; color: #fff; background: #6d28d9; box-shadow: 0 8px 20px rgba(109,40,217,.22); }
.qp-shop-search {
  min-width: min(280px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #e2d8f3;
  border-radius: 13px;
  background: #fff;
}
.qp-shop-search input { width: 100%; min-height: 44px; border: 0; outline: 0; color: var(--qp-shop-ink); background: transparent; font: inherit; font-weight: 750; }
.qp-shop-redeem {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  margin-bottom: 20px;
  padding: 9px;
  border: 1px solid #e6d8f7;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(76, 29, 149, .08);
}
.qp-shop-redeem > span { padding-left: 8px; font-size: 25px; }
.qp-shop-redeem input { min-width: 0; flex: 1; min-height: 42px; border: 0; outline: 0; font: inherit; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.qp-shop-redeem button,
.qp-shop-admin-primary {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  padding: 9px 18px;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.qp-shop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.qp-shop-item {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 22px 18px 16px;
  border: 1px solid #e4d9f3;
  border-radius: 22px;
  color: var(--qp-shop-ink);
  background:
    radial-gradient(circle at 80% 17%, rgba(196,181,253,.48), transparent 23%),
    linear-gradient(155deg, #fff 0%, #f8f5ff 100%);
  box-shadow: 0 12px 32px rgba(67, 27, 130, .09);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.qp-shop-item:hover { transform: translateY(-4px); border-color: #c4b5fd; box-shadow: 0 18px 38px rgba(67,27,130,.16); }
.qp-shop-item.is-equipped { border-color: #7c3aed; box-shadow: 0 0 0 2px rgba(124,58,237,.12), 0 18px 40px rgba(67,27,130,.17); }
.qp-shop-item-spark { position: absolute; top: 18px; right: 18px; color: #f59e0b; font-size: 20px; }
.qp-shop-owned-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  background: #16a34a;
  font-size: 11px;
  font-weight: 900;
}
.qp-shop-item-visual {
  min-height: 126px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  font-size: clamp(72px, 7vw, 104px);
  line-height: 1;
  filter: drop-shadow(0 12px 10px rgba(55, 31, 99, .12));
}
.qp-shop-animated-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  box-shadow: 0 7px 18px rgba(76,29,149,.22);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.qp-shop-item.is-premium-character {
  border-color: #c4b5fd;
  background:
    radial-gradient(circle at 78% 14%, rgba(250,204,21,.24), transparent 24%),
    radial-gradient(circle at 16% 82%, rgba(45,212,191,.18), transparent 28%),
    linear-gradient(155deg, #fff 0%, #f5f0ff 100%);
  box-shadow: 0 15px 38px rgba(76,29,149,.14);
}
.qp-shop-item.is-premium-character .qp-shop-item-spark { display: none; }

/* Premium equipped characters use composited motion only, so they stay light in lists and live games. */
.qp-avatar-premium {
  position: relative;
  isolation: isolate;
  overflow: visible;
  color: transparent !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
  font-size: 0 !important;
  transform-origin: 50% 72%;
  will-change: transform, filter;
  animation: qp-premium-generic 2.8s ease-in-out infinite;
}
.qp-avatar-premium::after {
  position: absolute;
  z-index: 2;
  top: 2%;
  right: 1%;
  display: grid;
  width: 1.1em;
  height: 1.1em;
  place-items: center;
  border-radius: 50%;
  pointer-events: none;
  font-size: 15px;
  line-height: 1;
}
.qp-avatar-nova {
  background-image: url('/assets/characters/nova-mage.png') !important;
  animation: qp-premium-nova 2.8s ease-in-out infinite;
}
.qp-avatar-nova::after {
  content: '✦';
  color: #fef08a;
  background: #7c3aed;
  box-shadow: 0 0 12px #c4b5fd;
  animation: qp-premium-orbit 2.8s linear infinite;
}
.qp-avatar-storm {
  background-image: url('/assets/characters/storm-dragon.png') !important;
  animation: qp-premium-storm 2.25s cubic-bezier(.45,0,.2,1) infinite;
}
.qp-avatar-storm::after {
  content: 'ϟ';
  color: #082f49;
  background: #67e8f9;
  box-shadow: 0 0 13px #38bdf8;
  animation: qp-premium-flash 2.25s steps(1,end) infinite;
}
.qp-avatar-solar {
  background-image: url('/assets/characters/solar-guardian.png') !important;
  animation: qp-premium-solar 2.6s ease-in-out infinite;
}
.qp-avatar-solar::after {
  content: '★';
  color: #7c2d12;
  background: #fde047;
  box-shadow: 0 0 15px #f59e0b;
  animation: qp-premium-star 2.6s ease-in-out infinite;
}
.qp-avatar-shadow {
  background-image: url('/assets/characters/shadow-commander.png') !important;
  animation: qp-premium-shadow 2.8s ease-in-out infinite;
}
.qp-avatar-crimson {
  background-image: url('/assets/characters/crimson-seer.png') !important;
  animation: qp-premium-crimson 2.5s ease-in-out infinite;
}
.qp-avatar-void {
  background-image: url('/assets/characters/void-captain.png') !important;
  animation: qp-premium-void 2.7s ease-in-out infinite;
}
.qp-avatar-diamond {
  background-image: url('/assets/characters/diamond-princess.png') !important;
  animation: qp-premium-diamond 3s ease-in-out infinite;
}
.qp-avatar-shadow::after,
.qp-avatar-crimson::after,
.qp-avatar-void::after,
.qp-avatar-diamond::after {
  content: '';
  display: none;
}
@keyframes qp-premium-shadow {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 6px 8px rgba(76,29,149,.28)); }
  50% { transform: translateY(-4%); filter: drop-shadow(0 10px 14px rgba(76,29,149,.52)); }
}
@keyframes qp-premium-crimson {
  0%, 100% { transform: translateY(0) rotate(-.5deg); filter: drop-shadow(0 6px 8px rgba(190,18,60,.28)); }
  50% { transform: translateY(-5%) rotate(.5deg); filter: drop-shadow(0 11px 16px rgba(225,29,72,.54)); }
}
@keyframes qp-premium-void {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 5px 8px rgba(14,165,233,.25)); }
  50% { transform: translateY(-3%) scale(1.02); filter: drop-shadow(0 10px 15px rgba(14,165,233,.48)); }
}
@keyframes qp-premium-diamond {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 6px 9px rgba(37,99,235,.25)); }
  50% { transform: translateY(-4%) scale(1.025); filter: drop-shadow(0 11px 17px rgba(56,189,248,.56)); }
}
@keyframes qp-premium-generic {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 6px 9px rgba(91,33,182,.24)); }
  50% { transform: translateY(-4%) scale(1.018); filter: drop-shadow(0 11px 16px rgba(109,40,217,.42)); }
}
@keyframes qp-premium-nova {
  0%, 100% { transform: translateY(0) rotate(-1deg); filter: drop-shadow(0 5px 7px rgba(109,40,217,.24)); }
  50% { transform: translateY(-6%) rotate(1deg); filter: drop-shadow(0 8px 12px rgba(109,40,217,.44)); }
}
@keyframes qp-premium-orbit {
  0% { transform: translate(-10%, 16%) rotate(0deg) scale(.82); }
  50% { transform: translate(-155%, 225%) rotate(180deg) scale(1.08); }
  100% { transform: translate(-10%, 16%) rotate(360deg) scale(.82); }
}
@keyframes qp-premium-storm {
  0%, 76%, 100% { transform: translateY(0) rotate(0); filter: drop-shadow(0 5px 7px rgba(2,132,199,.24)); }
  82% { transform: translateY(-4%) rotate(-3deg); filter: drop-shadow(0 8px 13px rgba(2,132,199,.55)); }
  88% { transform: translateY(-2%) rotate(3deg); }
  94% { transform: translateY(-4%) rotate(-1deg); }
}
@keyframes qp-premium-flash {
  0%, 76%, 100% { opacity: .55; transform: scale(.8); }
  82%, 94% { opacity: 1; transform: scale(1.18); }
}
@keyframes qp-premium-solar {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 5px 8px rgba(245,158,11,.25)); }
  50% { transform: translateY(-4%) scale(1.035); filter: drop-shadow(0 9px 15px rgba(245,158,11,.52)); }
}
@keyframes qp-premium-star {
  0%, 100% { transform: rotate(-12deg) scale(.82); opacity: .72; }
  50% { transform: rotate(12deg) scale(1.14); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .qp-avatar-premium,
  .qp-avatar-premium::after { animation: none !important; }
}
.qp-shop-reward-card { grid-column: 1 / -1; }
.qp-shop-reward-grid { display:grid; grid-template-columns:repeat(5,minmax(80px,1fr)); gap:9px; }
.qp-shop-reward-grid label { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:6px; padding:7px 9px; border:1px solid #ddd6fe; border-radius:9px; background:#faf8ff; }
.qp-shop-reward-grid label span { color:#6d28d9; font-size:12px; font-weight:900; }
.qp-shop-reward-grid input { width:100%; min-width:0; border:0; outline:0; background:transparent; font:inherit; font-weight:800; }
@media (max-width:700px) { .qp-shop-reward-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.qp-shop-title-preview {
  max-width: 100%;
  padding: 16px 18px;
  border: 2px solid #c4b5fd;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
  box-shadow: 0 12px 28px rgba(91, 33, 182, .26);
  font-size: clamp(18px, 2vw, 27px);
  font-weight: 950;
  line-height: 1.15;
  text-align: center;
}
.qp-shop-item h3 { overflow: hidden; margin: 0; font-size: 18px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.qp-shop-item > small { display: block; margin-top: 4px; color: #79698f; font-weight: 750; text-transform: capitalize; }
.qp-shop-item footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; }
.qp-shop-price { display: inline-flex; align-items: center; gap: 5px; color: #322254; font-size: 17px; font-weight: 950; }
.qp-shop-price span { font-size: 21px; }
.qp-shop-buy,
.qp-shop-equip,
.qp-shop-owned {
  min-width: 90px;
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  padding: 7px 13px;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.qp-shop-equip { background: #4338ca; }
.qp-shop-owned { min-width: 104px; color: #166534; background: #dcfce7; cursor: default; }
.qp-shop-admin-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 0 0 22px; }
.qp-shop-admin-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 13px;
  padding: 20px;
  border: 1px solid #e4d9f3;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(67,27,130,.08);
}
.qp-shop-admin-card header { display: flex; align-items: center; gap: 9px; }
.qp-shop-admin-card header span { font-size: 24px; }
.qp-shop-admin-card h2 { margin: 0; color: var(--qp-shop-ink); font-size: 19px; }
.qp-shop-admin-card label { display: grid; gap: 6px; min-width: 0; color: #625273; font-size: 12px; font-weight: 900; }
.qp-shop-admin-card input,
.qp-shop-admin-card select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid #ded3ed;
  border-radius: 10px;
  color: var(--qp-shop-ink);
  background: #fbfaff;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
}
.qp-shop-admin-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.qp-shop-segments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 4px; border-radius: 12px; background: #f2edf9; }
.qp-shop-segments button { min-height: 38px; border: 0; border-radius: 9px; color: #6b5c7c; background: transparent; font: inherit; font-weight: 900; cursor: pointer; }
.qp-shop-segments button.active { color: #fff; background: #6d28d9; box-shadow: 0 5px 14px rgba(109,40,217,.2); }
.qp-shop-stage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.qp-shop-gift-character-preview {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding: 8px 12px;
  border: 1px solid #e5dcf1;
  border-radius: 10px;
  background: #faf8fd;
  overflow: hidden;
}
.qp-shop-gift-character-preview[hidden] { display: none; }
.qp-shop-gift-character-avatar {
  display: block;
  width: 72px;
  height: 72px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  font-size: 42px;
}
.qp-shop-gift-character-preview strong,
.qp-shop-gift-character-preview small { display: block; min-width: 0; }
.qp-shop-gift-character-preview strong { color: var(--qp-shop-ink); font-size: 14px; }
.qp-shop-gift-character-preview small { margin-top: 3px; color: #756785; font-size: 11px; font-weight: 750; }
.qp-shop-admin-note { margin: 0; padding: 10px 12px; border-radius: 10px; color: #5b4a72; background: #f7f4fb; font-size: 12px; font-weight: 750; line-height: 1.45; }
.qp-shop-all-toggle { display: flex !important; flex-direction: row; align-items: center; min-height: 42px; }
.qp-shop-all-toggle input { width: 20px; min-height: 20px; }
.qp-shop-code-result { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border-radius: 12px; color: #4c1d95; background: #f3e8ff; }
.qp-shop-code-result strong { font-size: clamp(16px, 2vw, 21px); letter-spacing: .08em; }
.qp-shop-code-result button { border: 0; border-radius: 8px; padding: 7px 11px; color: #fff; background: #6d28d9; font-weight: 900; cursor: pointer; }
.qp-shop-student-results { display: grid; gap: 5px; max-height: 240px; overflow: auto; }
.qp-shop-student-results > button { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; padding: 8px; border: 1px solid #ede7f6; border-radius: 11px; color: var(--qp-shop-ink); background: #fbfaff; text-align: left; cursor: pointer; }
.qp-shop-student-results > button:hover { border-color: #a78bfa; background: #f5f3ff; }
.qp-shop-student-results > button > span:first-child { font-size: 28px; text-align: center; }
.qp-shop-student-results > button > span:nth-child(2) { display: grid; min-width: 0; }
.qp-shop-student-results small { color: #786b88; }
.qp-shop-student-results em { color: #8a5b00; font-size: 12px; font-style: normal; font-weight: 900; }
.qp-shop-selected { display: flex; flex-wrap: wrap; gap: 6px; }
.qp-shop-selected button { border: 0; border-radius: 999px; padding: 6px 10px; color: #5b21b6; background: #ede9fe; font-weight: 850; cursor: pointer; }
.qp-shop-admin-price { display: grid; grid-template-columns: auto minmax(0, 1fr) 36px 36px; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #ece5f6; }
.qp-shop-admin-price > span { font-size: 20px; }
.qp-shop-admin-price input[type="number"] { width: 100%; min-width: 0; min-height: 36px; padding: 6px 8px; border: 1px solid #ded3ed; border-radius: 8px; font: inherit; font-weight: 850; }
.qp-shop-admin-price > button { width: 36px; height: 36px; border: 0; border-radius: 8px; color: #fff; background: #6d28d9; font-weight: 950; cursor: pointer; }
.qp-shop-admin-price label { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: #f3e8ff; cursor: pointer; }
.qp-shop-admin-price label input { position: absolute; opacity: 0; }
.qp-shop-admin-price label:has(input:not(:checked)) { opacity: .45; filter: grayscale(1); }
.qp-shop-empty { grid-column: 1 / -1; min-height: 220px; display: grid; place-items: center; }

.qp-shop-gift-notice {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(25, 10, 53, .62);
  backdrop-filter: blur(8px);
}
.qp-shop-gift-notice section {
  position: relative;
  width: min(430px, 100%);
  overflow: hidden;
  padding: 36px 28px 30px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 28px;
  color: #fff;
  background: radial-gradient(circle at 50% 0, #a78bfa, transparent 38%), linear-gradient(145deg, #6d28d9, #312e81);
  box-shadow: 0 30px 90px rgba(19,7,45,.45);
  text-align: center;
}
.qp-shop-gift-notice section > button { position: absolute; top: 12px; right: 13px; width: 36px; height: 36px; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.15); font-size: 24px; cursor: pointer; }
.qp-shop-gift-spark { position: absolute; left: 20%; top: 28%; color: #fde68a; font-size: 32px; }
.qp-shop-gift-coin { font-size: 92px; filter: drop-shadow(0 14px 14px rgba(28,9,67,.35)); }
.qp-shop-gift-notice strong { display: block; margin-top: -5px; font-size: 42px; }
.qp-shop-gift-notice p { margin: 10px auto 22px; color: #ede9fe; font-weight: 750; }
.qp-shop-gift-notice a { display: inline-flex; min-height: 43px; align-items: center; padding: 9px 18px; border-radius: 11px; color: #5b21b6; background: #fff; font-weight: 950; text-decoration: none; }

@media (max-width: 1180px) {
  .qp-shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .qp-shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qp-shop-admin-tools { grid-template-columns: 1fr; }
  .qp-shop-toolbar { align-items: stretch; flex-direction: column; }
  .qp-shop-search { width: 100%; }
}
@media (max-width: 640px) {
  .qp-shop-page { padding-inline: 14px !important; }
  .qp-shop-hero { min-height: 190px; padding: 24px 20px; border-radius: 22px; }
  .qp-shop-coin-art { width: 105px; height: 110px; }
  .qp-shop-coin-art span:nth-child(2), .qp-shop-coin-art span:nth-child(3) { display: none; }
  .qp-shop-equipped { min-width: 0; max-width: calc(100vw - 180px); }
  .qp-shop-equipped-emoji { width: 48px; height: 48px; font-size: 32px; }
  .qp-shop-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qp-shop-tabs button { min-width: 0; padding-inline: 8px; }
  .qp-shop-grid { gap: 11px; }
  .qp-shop-item { padding: 17px 12px 12px; border-radius: 17px; }
  .qp-shop-item-visual { min-height: 92px; font-size: 64px; }
  .qp-shop-title-preview { padding: 12px 10px; font-size: 16px; }
  .qp-shop-item h3 { font-size: 15px; }
  .qp-shop-item > small { font-size: 11px; }
  .qp-shop-item footer { align-items: stretch; flex-direction: column; margin-top: 12px; }
  .qp-shop-buy, .qp-shop-equip, .qp-shop-owned { width: 100%; min-width: 0; }
  .qp-shop-admin-row { grid-template-columns: 1fr 1fr; }
  .qp-shop-stage-grid { grid-template-columns: 1fr; }
  .qp-shop-redeem { max-width: none; }
}
@media (max-width: 390px) {
  .qp-shop-coin-art { display: none; }
  .qp-shop-equipped { max-width: 100%; }
  .qp-shop-redeem { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .qp-shop-redeem button { grid-column: 1 / -1; }
}
@media (max-width: 340px) {
  .qp-shop-grid { grid-template-columns: 1fr; }
}

/* News feed for students, teachers, and admin announcements. */
.qp-news-body {
  --qp-news-ink: #21143f;
  --qp-news-purple: #6d28d9;
  --qp-news-soft: #f4efff;
  background: #f6f2fb !important;
}
.qp-news-body [hidden] { display: none !important; }
.qp-news-page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding-bottom: 56px !important;
}
.qp-news-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: clamp(24px, 4vw, 42px);
  border-radius: 30px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 18%, rgba(255,255,255,.22), transparent 25%),
    radial-gradient(circle at 10% 90%, rgba(216,180,254,.30), transparent 34%),
    linear-gradient(135deg, #4c1d95 0%, #7c3aed 56%, #312e81 100%);
  box-shadow: 0 24px 60px rgba(67, 27, 130, .20);
}
.qp-news-hero > div {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.qp-news-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(255,255,255,.17);
  font-size: 32px;
}
.qp-news-hero h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}
.qp-news-hero p {
  margin: 0;
  color: #ede9fe;
  font-weight: 800;
}
.qp-news-count {
  min-width: 76px;
  min-height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 26px;
  color: #4c1d95;
  background: #fff;
  font-size: 30px;
  font-weight: 950;
  box-shadow: 0 16px 34px rgba(31,12,69,.18);
}
.qp-news-admin-panel {
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid #e4d9f3;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(67,27,130,.09);
}
.qp-news-admin-panel form {
  display: grid;
  gap: 12px;
}
.qp-news-admin-panel .qp-input,
.qp-news-admin-panel .qp-textarea {
  border-color: #e0d4ef;
  color: var(--qp-news-ink);
  background: #fbfaff;
}
.qp-news-admin-panel .qp-textarea {
  min-height: 132px;
  resize: vertical;
}
.qp-news-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.qp-news-pin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: #5b4b72;
  font-weight: 900;
}
.qp-news-pin input {
  width: 19px;
  height: 19px;
  accent-color: var(--qp-news-purple);
}
.qp-news-feed {
  display: grid;
  gap: 14px;
}
.qp-news-card {
  min-width: 0;
  overflow: hidden;
  padding: 22px;
  border: 1px solid #e5daf4;
  border-radius: 24px;
  color: var(--qp-news-ink);
  background:
    radial-gradient(circle at 92% 12%, rgba(196,181,253,.25), transparent 23%),
    linear-gradient(160deg, #fff 0%, #faf7ff 100%);
  box-shadow: 0 13px 34px rgba(67,27,130,.08);
}
.qp-news-card.pinned {
  border-color: #c4b5fd;
  box-shadow: 0 0 0 2px rgba(124,58,237,.10), 0 16px 38px rgba(67,27,130,.12);
}
.qp-news-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.qp-news-card h3 {
  margin: 5px 0 0;
  color: var(--qp-news-ink);
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.1;
}
.qp-news-card time {
  flex: 0 0 auto;
  color: #7b6b8e;
  font-size: 12px;
  font-weight: 900;
}
.qp-news-pin-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  background: #6d28d9;
  font-size: 11px;
  font-weight: 950;
}
.qp-news-body-copy {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}
.qp-news-body-copy p {
  margin: 0;
  color: #372857;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.58;
}
.qp-news-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #eee6f7;
  color: #7b6b8e;
  font-size: 12px;
  font-weight: 900;
}
.qp-news-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.qp-news-actions button {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 7px 11px;
  color: #5b21b6;
  background: #ede9fe;
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}
.qp-news-actions button[data-news-delete] {
  color: #991b1b;
  background: #fee2e2;
}
@media (max-width: 640px) {
  .qp-news-page { padding-inline: 14px !important; }
  .qp-news-hero { align-items: flex-start; flex-direction: column; border-radius: 22px; }
  .qp-news-count { min-width: 58px; min-height: 58px; border-radius: 19px; font-size: 23px; }
  .qp-news-form-row,
  .qp-news-card header,
  .qp-news-card footer { align-items: stretch; flex-direction: column; }
  .qp-news-card { padding: 18px; border-radius: 20px; }
}

.qp-live-player-title {
  max-width: 100%;
  overflow: hidden;
  color: #fbbf24;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qp-simple-player-card .qp-live-player-title { color: #7c3aed; }
.qp-top10-card .qp-live-player-title,
.qp-winner-card .qp-live-player-title { margin-top: 2px; text-align: center; }
.qp-join-account-banner > span { display: grid; gap: 2px; }
.qp-join-account-banner small { color: #7c3aed; font-weight: 900; }
.qp-avatar-grid.single { grid-template-columns: minmax(180px, 260px); justify-content: center; }
.qp-live-coin-reward {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px auto;
  padding: 9px 16px;
  border: 1px solid rgba(253,230,138,.5);
  border-radius: 999px;
  color: #fff7c2;
  background: rgba(120,53,15,.42);
  box-shadow: 0 9px 25px rgba(0,0,0,.18);
  font-size: 22px;
}
.qp-live-coin-reward span { font-size: 28px; }

/* Academic management and manual account creation. */
.qp-academic-manage-body,
.qp-manual-user-body { background: #f6f4fb !important; }
.qp-academic-manage-page [hidden],
.qp-manual-user-page [hidden] { display: none !important; }
.qp-academic-manage-page,
.qp-manual-user-page { width: min(1480px, 100%); margin: 0 auto; }
.qp-academic-manage-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 30px;
  border-radius: 24px;
  color: #fff;
  background: radial-gradient(circle at 80% 0, rgba(255,255,255,.18), transparent 28%), linear-gradient(130deg, #4c1d95, #7c3aed 58%, #312e81);
  box-shadow: 0 18px 46px rgba(76,29,149,.20);
}
.qp-academic-manage-hero > div:first-child { display: flex; align-items: center; gap: 17px; }
.qp-academic-manage-hero > div:first-child > span { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 18px; background: rgba(255,255,255,.14); font-size: 34px; }
.qp-academic-manage-hero small,
.qp-manual-user-card header small { color: #ddd6fe; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.qp-academic-manage-hero h2 { margin: 3px 0 0; color: #fff; font-size: clamp(24px, 3vw, 38px); }
.qp-academic-manage-metrics { display: flex; gap: 10px; }
.qp-academic-manage-metrics span { min-width: 104px; padding: 13px 16px; border: 1px solid rgba(255,255,255,.18); border-radius: 15px; background: rgba(29,10,69,.28); font-weight: 800; }
.qp-academic-manage-metrics b { display: block; color: #fff; font-size: 24px; }
.qp-academic-manage-toolbar { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(260px, 1.2fr) auto; align-items: end; gap: 12px; margin: 22px 0; }
.qp-academic-manage-toolbar label { display: grid; gap: 6px; color: #5b4a70; font-size: 12px; font-weight: 900; }
.qp-academic-manage-panel { margin-top: 18px; padding: 20px; border: 1px solid #e6def0; border-radius: 21px; background: #fff; box-shadow: 0 10px 30px rgba(49,27,81,.07); }
.qp-academic-manage-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.qp-academic-manage-panel h2 { margin: 5px 0 0; color: #23143f; font-size: 21px; }
.qp-structure-type { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 9px; color: #4c1d95; background: #ede9fe; font-weight: 900; text-transform: capitalize; white-space: nowrap; }
.qp-structure-type.department { color: #075985; background: #e0f2fe; }
.qp-structure-type.stage { color: #166534; background: #dcfce7; }
.qp-structure-type.subject { color: #9a3412; background: #ffedd5; }
.qp-count-chip { display: inline-flex; padding: 5px 8px; border-radius: 8px; color: #5f536d; background: #f5f2f8; font-size: 12px; font-weight: 850; white-space: nowrap; }
.qp-mini-people { display: flex; flex-wrap: wrap; gap: 5px; min-width: 150px; }
.qp-mini-people span { max-width: 150px; overflow: hidden; padding: 4px 7px; border-radius: 999px; color: #5b21b6; background: #f3e8ff; font-size: 11px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.qp-mini-people em { color: #8a8094; font-size: 12px; font-style: normal; }
.qp-mini-people small { align-self: center; color: #5b21b6; font-weight: 900; }
.qp-table-icon-actions { display: flex; justify-content: flex-end; gap: 6px; }
.qp-icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; flex: 0 0 auto; border: 1px solid #e4d9ef; border-radius: 9px; color: #5b21b6; background: #faf8fd; font-size: 17px; font-weight: 950; text-decoration: none; cursor: pointer; }
.qp-icon-btn:hover { border-color: #a78bfa; background: #f3e8ff; }
.qp-icon-btn.danger { color: #b91c1c; background: #fff1f2; }
.qp-icon-btn.danger:hover { border-color: #fca5a5; background: #fee2e2; }
.qp-academic-assignment-tabs { display: inline-flex; padding: 4px; border-radius: 11px; background: #f2edf8; }
.qp-academic-assignment-tabs button { min-height: 36px; padding: 7px 13px; border: 0; border-radius: 8px; color: #6b5e79; background: transparent; font: inherit; font-weight: 900; cursor: pointer; }
.qp-academic-assignment-tabs button.active { color: #fff; background: #6d28d9; box-shadow: 0 5px 14px rgba(109,40,217,.22); }
.qp-academic-people-toolbar { max-width: 480px; margin-bottom: 14px; }
.qp-academic-structure-table td,
.qp-academic-people-table td { vertical-align: middle; }
.qp-academic-assignment-dialog { width: min(660px, calc(100vw - 28px)); max-height: min(760px, calc(100vh - 28px)); padding: 0; border: 0; border-radius: 22px; box-shadow: 0 35px 100px rgba(25,11,47,.34); }
.qp-academic-assignment-dialog::backdrop { background: rgba(25,11,47,.56); backdrop-filter: blur(6px); }
.qp-academic-assignment-shell { display: grid; gap: 18px; padding: 22px; }
.qp-academic-assignment-shell > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.qp-academic-assignment-shell h2 { margin: 5px 0 0; color: #21133c; }
.qp-academic-assignment-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.qp-academic-assignment-fields label { display: grid; gap: 6px; color: #5d506b; font-size: 12px; font-weight: 900; }
.qp-academic-teacher-choices { display: grid; gap: 7px; max-height: 420px; overflow: auto; }
.qp-academic-teacher-choices label { display: grid; grid-template-columns: 22px 42px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px; border: 1px solid #e7deef; border-radius: 12px; cursor: pointer; }
.qp-academic-teacher-choices label:has(input:checked) { border-color: #8b5cf6; background: #f5f3ff; }
.qp-academic-teacher-choices label > span:nth-of-type(1) { font-size: 28px; }
.qp-academic-teacher-choices label > span:nth-of-type(2) { display: grid; }
.qp-academic-teacher-choices small { color: #756680; }

.qp-manual-user-page { display: grid; justify-items: center; }
.qp-manual-user-card { width: min(900px, 100%); display: grid; gap: 22px; padding: clamp(20px, 4vw, 34px); border: 1px solid #e6ddef; border-radius: 24px; background: #fff; box-shadow: 0 18px 50px rgba(49,27,81,.10); }
.qp-manual-user-card > header { display: flex; align-items: center; gap: 15px; }
.qp-manual-user-card > header > span { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #7c3aed, #4c1d95); font-size: 28px; }
.qp-manual-user-card header small { color: #7c3aed; }
.qp-manual-user-card h2 { margin: 3px 0 0; color: #21133c; font-size: 27px; }
.qp-manual-user-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.qp-manual-user-grid label,
.qp-manual-assignment-grid label { display: grid; gap: 6px; color: #5b4f68; font-size: 12px; font-weight: 900; }
.qp-manual-password small { color: #8b7d96; }
#manualCoinsField { align-content: end; grid-template-columns: 32px minmax(0, 1fr); align-items: center; }
#manualCoinsField > span { font-size: 24px; }
.qp-manual-assignment { padding: 18px; border: 1px solid #e8dff1; border-radius: 18px; background: #faf8fd; }
.qp-manual-assignment > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.qp-manual-assignment h3 { margin: 2px 0 0; color: #2b1948; font-size: 19px; }
.qp-manual-assignment small { color: #7c3aed; font-weight: 900; text-transform: uppercase; }
.qp-manual-assignment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.qp-manual-assignment-grid.disabled { opacity: .45; }
.qp-manual-create-btn { width: 100%; min-height: 49px; }
.qp-manual-user-success { width: min(620px, 100%); display: grid; justify-items: center; gap: 14px; padding: 40px 24px; border: 1px solid #d8f0df; border-radius: 24px; background: #fff; box-shadow: 0 18px 50px rgba(29,78,46,.10); text-align: center; }
.qp-manual-user-success[hidden] { display: none; }
.qp-manual-success-icon { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #16a34a; font-size: 34px; font-weight: 950; }
.qp-manual-user-success h2 { margin: 0; color: #14532d; }
.qp-manual-user-success > div:not(.qp-actions) { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.qp-manual-user-success > div:not(.qp-actions) span,
.qp-manual-user-success > div:not(.qp-actions) b { padding: 6px 9px; border-radius: 9px; color: #5a486a; background: #f5f1f8; }

@media (max-width: 900px) {
  .qp-academic-manage-toolbar { grid-template-columns: 1fr 1fr; }
  .qp-academic-manage-toolbar .qp-btn { grid-column: 1 / -1; }
  .qp-manual-assignment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .qp-academic-manage-body .qp-dashboard-top-actions > .qp-btn,
  .qp-academic-manage-body #academicManageRole,
  .qp-manual-user-body .qp-dashboard-top-actions > .qp-btn,
  .qp-manual-user-body #manualUserRoleBadge { display: none !important; }
  .qp-academic-manage-hero { align-items: stretch; flex-direction: column; padding: 22px; }
  .qp-academic-manage-metrics { width: 100%; }
  .qp-academic-manage-metrics span { min-width: 0; flex: 1; }
  .qp-academic-manage-toolbar,
  .qp-manual-user-grid,
  .qp-manual-assignment-grid,
  .qp-academic-assignment-fields { grid-template-columns: 1fr; }
  .qp-academic-manage-panel { padding: 14px; }
  .qp-academic-people-head { align-items: stretch !important; flex-direction: column; }
  .qp-academic-assignment-tabs { width: 100%; }
  .qp-academic-assignment-tabs button { flex: 1; }
  .qp-table-icon-actions { justify-content: flex-start; }
}

/* v1.20.1: faster shell, full-height sidebar, and admin-only quiet high-performance mode */
@media (min-width: 1181px) {
  .qp-dashboard-clean .qp-dashboard-shell {
    grid-template-columns: var(--qp-app-sidebar-width, 216px) minmax(0, 1fr) !important;
  }

  .qp-dashboard-clean .qp-dashboard-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: var(--qp-app-sidebar-width, 216px) !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    transition: width .12s ease !important;
  }

  .qp-dashboard-clean .qp-dashboard-main {
    grid-column: 2 !important;
  }

  body.qp-sidebar-collapsed .qp-dashboard-shell {
    grid-template-columns: 76px minmax(0, 1fr) !important;
  }

  body.qp-sidebar-collapsed .qp-dashboard-sidebar {
    width: 76px !important;
    padding-inline: 9px !important;
  }

  body.qp-sidebar-collapsed .qp-dashboard-logo {
    justify-content: center !important;
    padding-inline: 0 !important;
  }

  body.qp-sidebar-collapsed .qp-dashboard-logo-title,
  body.qp-sidebar-collapsed .qp-dashboard-logo > span:last-child,
  body.qp-sidebar-collapsed .qp-dashboard-nav .qp-nav-label {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    max-width: 0 !important;
    opacity: 0 !important;
  }

  body.qp-sidebar-collapsed .qp-dashboard-nav a.qp-nav-link {
    justify-content: center !important;
    padding-inline: 5px !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  body.qp-sidebar-collapsed .qp-dashboard-logo-icon,
  body.qp-sidebar-collapsed .qp-dashboard-nav .qp-nav-icon {
    margin-inline: auto !important;
  }
}

.qp-sidebar-collapse-btn {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  font-weight: 1000;
  line-height: 1;
  transition: background .1s ease, transform .1s ease;
}

.qp-sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, .14);
}

@media (max-width: 1180px) {
  .qp-sidebar-collapse-btn { display: none !important; }
}

.qp-dashboard-nav a.qp-nav-link,
.qp-dashboard-clean .qp-dashboard-nav a.qp-nav-link,
.qp-dashboard-sidebar,
.qp-dashboard-topbar {
  transition-duration: .1s !important;
}

body.qp-high-performance *,
body.qp-high-performance *::before,
body.qp-high-performance *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}

.qp-text-danger {
  color: #b42318 !important;
  font-weight: 800;
}

/* v1.20.34: public quiz discovery and fair first-attempt statistics */
.qp-public-discovery-card .qp-kahoot-card-body { display: grid; gap: 10px; }
.qp-public-preview-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}
/* v1.20.83: responsive quiz library and shared elevated action menu */
.qp-library-refresh .qp-kahoot-library-grid,
.qp-library-course-wrap .qp-kahoot-library-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  gap: 16px !important;
}
.qp-library-refresh .qp-kahoot-library-grid.is-subject-browser {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 18px !important;
}
.qp-library-subject-picker {
  display: flex !important;
  width: 100%;
  min-width: 0;
  gap: 9px;
  padding: 2px 1px 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.qp-library-subject-picker::-webkit-scrollbar,
.qp-library-refresh .qp-library-tabs::-webkit-scrollbar { display: none; }
.qp-library-subject-choice {
  flex: 0 0 auto;
  min-height: 42px;
  max-width: 230px;
  padding: 9px 15px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  border-radius: 999px;
  box-shadow: none;
  scroll-snap-align: start;
}
.qp-library-subject-choice span {
  max-width: 196px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qp-library-subject-choice.active {
  border-color: var(--qp-style-accent);
  background: var(--qp-style-accent) !important;
  color: #fff !important;
}
.qp-library-subject-quiz-grid { width: 100%; }
.qp-library-refresh .qp-kahoot-quiz-card,
.qp-library-course-wrap .qp-kahoot-quiz-card {
  min-height: 0;
  overflow: hidden !important;
}
.qp-library-refresh .qp-kahoot-card-thumb,
.qp-library-course-wrap .qp-kahoot-card-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}
.qp-library-refresh .qp-kahoot-title-link,
.qp-library-course-wrap .qp-kahoot-title-link {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.qp-library-refresh .qp-kahoot-title-link:hover,
.qp-library-course-wrap .qp-kahoot-title-link:hover { color: var(--qp-style-accent); }
.qp-library-refresh .qp-kahoot-card-mainline h3,
.qp-library-course-wrap .qp-kahoot-card-mainline h3 {
  display: -webkit-box;
  min-height: 42px;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.qp-library-refresh .qp-kahoot-owner,
.qp-library-course-wrap .qp-kahoot-owner {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qp-library-action-menu {
  position: fixed;
  z-index: 10051;
  width: min(230px, calc(100vw - 24px));
  display: grid;
  gap: 2px;
  padding: 7px;
  border: 1px solid var(--qp-style-border);
  border-radius: 8px;
  background: var(--qp-style-surface);
  color: var(--qp-style-text);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .22);
}
.qp-library-action-menu[hidden],
.qp-library-menu-backdrop[hidden] { display: none !important; }
.qp-library-action-menu a,
.qp-library-action-menu button,
.qp-library-action-menu .qp-dropdown-label {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--qp-style-text);
  font: inherit;
  font-weight: 800;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.qp-library-action-menu a span,
.qp-library-action-menu button span {
  width: 22px;
  flex: 0 0 22px;
  text-align: center;
}
.qp-library-action-menu a:hover,
.qp-library-action-menu button:hover,
.qp-library-action-menu a:focus-visible,
.qp-library-action-menu button:focus-visible {
  outline: 0;
  background: var(--qp-style-accent-soft);
  color: var(--qp-style-accent);
}
.qp-library-action-menu .qp-dropdown-label {
  min-height: auto;
  color: var(--qp-style-muted);
  font-size: 12px;
  cursor: default;
}
.qp-library-action-menu .danger { color: #dc2626; }
.qp-library-menu-backdrop { position: fixed; inset: 0; z-index: 10050; background: rgba(15, 23, 42, .46); }
.qp-library-refresh-button { display: inline-flex; align-items: center; gap: 7px; }
.qp-library-refresh-button > span[aria-hidden] { font-size: 19px; line-height: 1; }

@media (min-width: 701px) and (max-width: 1100px) {
  .qp-library-refresh .qp-kahoot-library-grid,
  .qp-library-course-wrap .qp-kahoot-library-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important; }
}

@media (max-width: 700px) {
  .qp-library-refresh { padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important; }
  .qp-library-refresh .qp-library-tabs {
    width: 100% !important;
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .qp-library-refresh .qp-library-tabs button {
    flex: 0 0 auto !important;
    min-width: auto !important;
    padding-inline: 15px !important;
    scroll-snap-align: start;
  }
  .qp-library-refresh .qp-library-toolbar { display: block !important; }
  .qp-library-refresh .qp-library-view-actions { display: none !important; }
  .qp-library-refresh .qp-library-status-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }
  .qp-library-refresh .qp-library-status-row p {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .qp-library-refresh-button {
    width: 42px !important;
    min-width: 42px;
    height: 42px;
    padding: 0 !important;
    justify-content: center;
  }
  .qp-library-refresh-button .qp-refresh-label { display: none; }
  .qp-library-subject-choice { max-width: min(230px, 76vw); }
  .qp-library-refresh .qp-kahoot-library-grid,
  .qp-library-course-wrap .qp-kahoot-library-grid,
  .qp-library-refresh .qp-kahoot-library-grid.is-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }
  .qp-library-refresh .qp-kahoot-library-grid.is-subject-browser { gap: 14px !important; }
  .qp-library-refresh .qp-kahoot-quiz-card,
  .qp-library-course-wrap .qp-kahoot-quiz-card,
  .qp-library-refresh .qp-kahoot-library-grid.is-list .qp-kahoot-quiz-card {
    min-height: 104px !important;
    display: grid !important;
    grid-template-columns: 112px minmax(0, 1fr) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
  }
  .qp-library-refresh .qp-kahoot-card-brand,
  .qp-library-course-wrap .qp-kahoot-card-brand { display: none !important; }
  .qp-library-refresh .qp-kahoot-card-thumb,
  .qp-library-course-wrap .qp-kahoot-card-thumb,
  .qp-library-refresh .qp-kahoot-library-grid.is-list .qp-kahoot-card-thumb {
    width: 112px !important;
    height: 100% !important;
    min-height: 104px;
    aspect-ratio: auto;
    grid-column: 1;
    grid-row: 1;
  }
  .qp-library-refresh .qp-kahoot-card-body,
  .qp-library-course-wrap .qp-kahoot-card-body,
  .qp-library-refresh .qp-kahoot-library-grid.is-list .qp-kahoot-card-body {
    min-width: 0 !important;
    padding: 11px 10px !important;
    grid-column: 2;
    grid-row: 1;
  }
  .qp-library-refresh .qp-kahoot-card-mainline h3,
  .qp-library-course-wrap .qp-kahoot-card-mainline h3 {
    display: block !important;
    min-height: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 16px !important;
    line-height: 1.3 !important;
  }
  .qp-library-refresh .qp-kahoot-owner,
  .qp-library-course-wrap .qp-kahoot-owner {
    margin-top: 4px !important;
    font-size: 12px !important;
  }
  .qp-library-refresh .qp-kahoot-card-status,
  .qp-library-course-wrap .qp-kahoot-card-status {
    height: 25px;
    flex-wrap: nowrap !important;
    overflow: hidden;
    margin-top: 7px !important;
  }
  .qp-library-refresh .qp-meta-subject,
  .qp-library-refresh .qp-meta-date,
  .qp-library-course-wrap .qp-meta-subject,
  .qp-library-course-wrap .qp-meta-date { display: none !important; }
  .qp-library-refresh .qp-mini-status,
  .qp-library-course-wrap .qp-mini-status {
    max-width: 82px;
    white-space: nowrap !important;
  }
  .qp-library-refresh .qp-card-menu-btn,
  .qp-library-course-wrap .qp-card-menu-btn {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
  }
  .qp-library-action-menu[data-mobile] {
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100% !important;
    max-height: min(72dvh, 620px);
    overflow-y: auto;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    border-width: 1px 0 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -18px 44px rgba(15, 23, 42, .28);
  }
  .qp-library-action-menu[data-mobile]::before {
    content: '';
    width: 42px;
    height: 4px;
    margin: 1px auto 7px;
    border-radius: 999px;
    background: var(--qp-style-border);
  }
  .qp-library-action-menu[data-mobile] a,
  .qp-library-action-menu[data-mobile] button { min-height: 50px; }
}

/* v1.20.91: mobile-first Library hierarchy and fixed quiz rows. */
.qp-library-controls {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.qp-library-scopes {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(560px, 100%);
  padding: 4px;
  border: 1px solid var(--qp-style-border);
  border-radius: 12px;
  background: var(--qp-style-surface-2);
}

.qp-library-scopes button {
  min-width: 0;
  min-height: 42px;
  padding: 8px 12px;
  overflow: hidden;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--qp-style-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.qp-library-scopes button.active {
  background: var(--qp-style-surface);
  color: var(--qp-style-accent);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .1);
}

.qp-library-refresh .qp-kahoot-library-grid,
.qp-library-course-wrap .qp-kahoot-library-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
}

.qp-library-refresh .qp-kahoot-card-thumb,
.qp-library-course-wrap .qp-kahoot-card-thumb {
  height: auto;
  aspect-ratio: 16 / 9;
}

.qp-library-refresh .qp-kahoot-card-mainline h3,
.qp-library-course-wrap .qp-kahoot-card-mainline h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.qp-library-refresh .qp-kahoot-owner,
.qp-library-course-wrap .qp-kahoot-owner {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qp-library-subject-picker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.qp-library-subject-picker::-webkit-scrollbar { display: none; }
.qp-library-subject-choice {
  flex: 0 0 auto;
  min-height: 42px;
  max-width: min(280px, 78vw);
  padding: 8px 14px;
  border-radius: 999px;
  scroll-snap-align: start;
}
.qp-library-subject-choice span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qp-library-skeleton-row {
  min-height: 112px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
  border: 1px solid var(--qp-style-border);
  border-radius: 8px;
  background: var(--qp-style-surface);
}
.qp-library-skeleton-row > span,
.qp-library-skeleton-row b,
.qp-library-skeleton-row i {
  display: block;
  background: linear-gradient(90deg, var(--qp-style-surface-2), var(--qp-style-surface), var(--qp-style-surface-2));
  background-size: 220% 100%;
  animation: qp-library-skeleton 1.2s ease-in-out infinite;
}
.qp-library-skeleton-row > div { display: grid; align-content: center; gap: 9px; padding: 12px 12px 12px 0; }
.qp-library-skeleton-row b { width: 72%; height: 17px; border-radius: 6px; }
.qp-library-skeleton-row i { width: 54%; height: 11px; border-radius: 6px; }
@keyframes qp-library-skeleton { to { background-position: -220% 0; } }

@media (max-width: 700px) {
  .qp-library-refresh { padding: 10px 12px calc(86px + env(safe-area-inset-bottom)) !important; }

  .qp-library-page-body .qp-dashboard-topbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: 56px !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 64px !important;
    padding: 4px 14px !important;
  }
  .qp-library-page-body .qp-dashboard-title-group h1 { margin: 0 !important; font-size: 22px !important; }
  .qp-library-page-body .qp-dashboard-title-group {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: center !important;
  }
  .qp-library-page-body .qp-dashboard-title-group p,
  .qp-library-page-body .qp-dashboard-topbar .qp-account-chip,
  .qp-library-page-body .qp-dashboard-topbar .qp-top-space-chip { display: none !important; }
  .qp-library-page-body .qp-dashboard-top-actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: auto !important;
    justify-self: end !important;
  }
  .qp-library-page-body .qp-dashboard-top-actions [data-create-quiz] {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    overflow: hidden;
    font-size: 0 !important;
    border-radius: 12px !important;
  }
  .qp-library-page-body .qp-dashboard-top-actions [data-create-quiz]::before {
    content: '+';
    font-size: 25px;
    line-height: 1;
  }

  .qp-library-browser { gap: 10px !important; }
  .qp-library-controls {
    position: sticky;
    z-index: 40;
    top: 0;
    gap: 8px;
    margin: 0 -2px;
    padding: 6px 2px 9px;
    background: color-mix(in srgb, var(--qp-style-page) 94%, transparent);
    backdrop-filter: blur(10px);
  }
  .qp-library-scopes { width: 100%; }
  .qp-library-scopes button { min-height: 40px; padding-inline: 8px; font-size: 12px; }
  .qp-library-refresh .qp-library-tabs {
    gap: 6px !important;
    padding: 0 1px 2px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .qp-library-refresh .qp-library-tabs button {
    min-height: 38px !important;
    padding: 7px 13px !important;
    border: 1px solid var(--qp-style-border) !important;
    border-radius: 999px !important;
    background: var(--qp-style-surface) !important;
    font-size: 12px !important;
  }
  .qp-library-refresh .qp-library-tabs button.active {
    border-color: var(--qp-style-accent) !important;
    background: var(--qp-style-accent) !important;
    color: #fff !important;
  }
  .qp-library-refresh .qp-library-toolbar { margin: 0 !important; }
  .qp-library-refresh .qp-library-search {
    min-height: 44px !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .08) !important;
  }
  .qp-library-refresh .qp-library-status-row { min-height: 44px; margin: 0 !important; }
  .qp-library-refresh .qp-library-status-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .qp-library-refresh .qp-library-refresh-button {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    font-size: 20px;
  }
  .qp-library-refresh .qp-library-view-actions { display: none !important; }
  .qp-library-refresh .qp-library-section-title { display: none !important; }

  .qp-library-refresh .qp-kahoot-quiz-card,
  .qp-library-course-wrap .qp-kahoot-quiz-card,
  .qp-library-refresh .qp-kahoot-library-grid.is-list .qp-kahoot-quiz-card {
    width: 100% !important;
    height: 116px !important;
    min-height: 116px !important;
    max-height: 116px !important;
    grid-template-columns: 112px minmax(0, 1fr) !important;
  }
  .qp-library-refresh .qp-kahoot-card-thumb,
  .qp-library-course-wrap .qp-kahoot-card-thumb,
  .qp-library-refresh .qp-kahoot-library-grid.is-list .qp-kahoot-card-thumb {
    width: 112px !important;
    height: 116px !important;
    min-height: 116px !important;
    max-height: 116px !important;
    aspect-ratio: auto !important;
  }
  .qp-library-refresh .qp-kahoot-card-body,
  .qp-library-course-wrap .qp-kahoot-card-body,
  .qp-library-refresh .qp-kahoot-library-grid.is-list .qp-kahoot-card-body {
    height: 116px !important;
    padding: 10px !important;
    overflow: hidden !important;
  }
  .qp-library-refresh .qp-kahoot-card-mainline,
  .qp-library-course-wrap .qp-kahoot-card-mainline { grid-template-columns: minmax(0, 1fr) 40px !important; }
  .qp-library-refresh .qp-kahoot-card-mainline h3,
  .qp-library-course-wrap .qp-kahoot-card-mainline h3 {
    display: block !important;
    min-height: 0 !important;
    overflow: hidden !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .qp-library-refresh .qp-card-menu-btn,
  .qp-library-course-wrap .qp-card-menu-btn {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    margin: -3px -3px 0 0;
  }
  .qp-library-refresh .qp-kahoot-card-status,
  .qp-library-course-wrap .qp-kahoot-card-status {
    flex-wrap: nowrap !important;
    height: 22px !important;
    margin-top: 6px !important;
    overflow: hidden !important;
  }
  .qp-library-refresh .qp-mini-status,
  .qp-library-course-wrap .qp-mini-status { padding: 2px 6px; font-size: 10px; }

  .qp-library-skeleton-row { height: 116px; min-height: 116px; }
  .qp-library-subject-choice { max-width: 72vw; }
}

@media (prefers-reduced-motion: reduce) {
  .qp-library-skeleton-row > span,
  .qp-library-skeleton-row b,
  .qp-library-skeleton-row i { animation: none; }
}

.qp-library-refresh .qp-library-mine-filters[hidden] {
  display: none !important;
}

.qp-leaderboard-page {
  display: grid;
  gap: 20px;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}
.qp-stats-topbar .qp-dashboard-top-actions { align-items: center; }
.qp-stats-wallet {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  font-weight: 850;
  white-space: nowrap;
}
.qp-stats-wallet::before { content: ''; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: #f59e0b; }
.qp-stats-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 4px;
  width: min(640px, 100%);
  padding: 4px;
  border-radius: 12px;
  background: #eef0f5;
}
.qp-stats-mode-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.qp-stats-mode-tabs button.active {
  background: #fff;
  color: #6d28d9;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .08);
}
.qp-stats-scope {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.qp-stats-scope[hidden] { display: none; }
.qp-stats-scope summary {
  cursor: pointer;
  padding: 13px 16px;
  color: #334155;
  font-size: 13px;
  font-weight: 850;
}
.qp-stats-scope-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 0 16px 16px;
}
.qp-stats-scope-grid label { display: grid; gap: 6px; min-width: 0; }
.qp-stats-scope-grid label > span { color: #64748b; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.qp-stats-metrics {
  display: grid;
  grid-template-columns: 1.45fr repeat(3, 1fr);
  gap: 14px;
}
.qp-stats-metric {
  min-height: 126px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}
.qp-stats-metric > span {
  display: block;
  margin-bottom: 12px;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}
.qp-stats-metric strong { display: block; color: #6d28d9; font-size: 30px; line-height: 1.05; }
.qp-stats-metric small { display: block; margin-top: 6px; color: #64748b; font-size: 11px; line-height: 1.35; }
.qp-stats-metric.primary { border: 0; background: #17122f; }
.qp-stats-metric.primary > span, .qp-stats-metric.primary small { color: #d8d4ec; }
.qp-stats-metric.primary strong { color: #fff; }
.qp-stats-metric.positive strong { color: #059669; }
.qp-stats-metric.coins strong { color: #d97706; }
.qp-stats-metric > .qp-stats-coin-icon {
  margin-bottom: 12px;
  color: inherit;
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 3px 4px rgba(180, 112, 0, .24));
}
.qp-stats-leaderboard-shell {
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
}
.qp-stats-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 12px;
}
.qp-stats-toolbar h2 { margin: 0 0 4px; color: #111827; font-size: 19px; }
.qp-stats-toolbar p { margin: 0; color: #64748b; font-size: 12px; }
.qp-stats-toolbar-actions { display: flex; align-items: center; gap: 10px; }
.qp-stats-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 260px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #d7dce8;
  border-radius: 10px;
  background: #fff;
  color: #64748b;
}
.qp-stats-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font: inherit; }
.qp-stats-rule {
  margin-bottom: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 750;
}
.qp-stats-rule[hidden] { display: none; }
.qp-stats-table-wrap { overflow-x: auto; }
.qp-stats-table { width: 100%; border-collapse: separate; border-spacing: 0 7px; }
.qp-stats-table th { padding: 0 12px 5px; color: #64748b; font-size: 10px; text-align: left; text-transform: uppercase; }
.qp-stats-table td {
  padding: 10px 12px;
  border-top: 1px solid #edf0f5;
  border-bottom: 1px solid #edf0f5;
  background: #fff;
  vertical-align: middle;
}
.qp-stats-table td:first-child { border-left: 1px solid #edf0f5; border-radius: 12px 0 0 12px; }
.qp-stats-table td:last-child { border-right: 1px solid #edf0f5; border-radius: 0 12px 12px 0; }
.qp-stats-table tr.is-current td { border-color: #7c3aed; background: #ede9fe; }
.qp-stats-table tr.is-current td:first-child { border-left-width: 2px; }
.qp-stats-table tr.is-current td:last-child { border-right-width: 2px; }
.qp-stats-rank, .qp-stats-avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #111827;
  font-weight: 900;
}
.qp-stats-rank.top-rank { background: #fef3c7; }
.qp-stats-avatar { border-radius: 50%; background: #ede9fe; color: #6d28d9; font-size: 21px; }
.qp-stats-player { display: grid; gap: 3px; min-width: 180px; }
.qp-stats-player b { color: #111827; font-size: 14px; }
.qp-stats-player b em { display: inline-block; margin-left: 7px; padding: 3px 6px; border-radius: 999px; background: #6d28d9; color: #fff; font-size: 9px; font-style: normal; text-transform: uppercase; }
.qp-stats-player small, .qp-stats-table td > small { display: block; margin-top: 3px; color: #64748b; font-size: 10px; }
.qp-stats-positive { color: #059669; }
.qp-stats-coins { color: #d97706; }

@media (max-width: 900px) {
  .qp-stats-scope-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qp-stats-scope-grid .qp-btn { grid-column: 1 / -1; }
  .qp-stats-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qp-stats-metric.primary { grid-column: span 2; }
}

@media (max-width: 700px) {
  .qp-leaderboard-page { gap: 14px; padding-left: 14px !important; padding-right: 14px !important; }
  .qp-stats-topbar { padding-left: 16px !important; padding-right: 16px !important; }
  .qp-stats-wallet { min-height: 38px; padding: 8px 10px; font-size: 11px; }
  .qp-stats-mode-tabs { display: flex; width: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .qp-stats-mode-tabs::-webkit-scrollbar { display: none; }
  .qp-stats-mode-tabs button { flex: 0 0 auto; min-width: 116px; scroll-snap-align: start; }
  .qp-stats-scope-grid { grid-template-columns: 1fr; }
  .qp-stats-scope-grid .qp-btn { grid-column: auto; min-height: 44px; }
  .qp-stats-metrics { gap: 9px; }
  .qp-stats-metric { min-height: 100px; padding: 14px; }
  .qp-stats-metric strong { font-size: 24px; }
  .qp-stats-metric.primary { grid-column: auto; }
  .qp-stats-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
  .qp-stats-toolbar-actions { width: 100%; align-items: stretch; }
  .qp-stats-search { flex: 1 1 auto; width: auto; min-width: 0; }
  .qp-stats-search input { position: static; width: 100%; height: auto; opacity: 1; }
  .qp-stats-toolbar-actions .qp-btn { flex: 0 0 auto; min-height: 42px; white-space: nowrap; }
  .qp-stats-leaderboard-shell { padding: 10px 0 0; border: 0; background: transparent; }
  .qp-stats-rule { margin-left: 0; margin-right: 0; }
  .qp-stats-table, .qp-stats-table tbody, .qp-stats-table tr, .qp-stats-table td { display: block; width: 100%; }
  .qp-stats-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .qp-stats-table tbody { display: grid; gap: 10px; }
  .qp-stats-table tr {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    grid-template-areas: "rank player points" "rank top coins";
    gap: 5px 10px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
  }
  .qp-stats-table tr.is-current { border: 2px solid #7c3aed; background: #ede9fe; }
  .qp-stats-table tr.is-empty { display: block; padding: 0; }
  .qp-stats-table tr.is-empty .qp-empty-cell { display: block; width: 100%; padding: 24px 16px !important; text-align: center; overflow-wrap: normal; }
  .qp-stats-table td { padding: 0; border: 0 !important; border-radius: 0 !important; background: transparent !important; }
  .qp-stats-table td:nth-child(1) { grid-area: rank; }
  .qp-stats-table td:nth-child(2) { grid-area: player; }
  .qp-stats-table td:nth-child(3) { grid-area: points; text-align: right; }
  .qp-stats-table td:nth-child(4) { grid-area: top; }
  .qp-stats-table td:nth-child(5) { grid-area: coins; text-align: right; }
  .qp-stats-player { min-width: 0; }
  .qp-stats-player b, .qp-stats-player small { overflow-wrap: anywhere; }
}

.qp-settings-panel-action {
  min-height: 34px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: #f5f3ff;
  color: #5b21b6;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.qp-settings-profile-form .qp-input:focus,
.qp-settings-profile-form .qp-input:focus-visible {
  border-color: #8b5cf6;
  outline: 0;
  box-shadow: none;
}

/* v1.20.33: role-aware swipeable phone navigation. */
.qp-mobile-bottom-nav {
  display: none;
}

.qp-mobile-bottom-toggle {
  display: none;
}

@media (max-width: 700px) {
  body.qp-has-mobile-bottom-nav {
    --qp-mobile-bottom-nav-height: 78px;
  }

  body.qp-has-mobile-bottom-nav .qp-mobile-menu-btn,
  body.qp-has-mobile-bottom-nav.qp-creator-with-app-nav #globalMenuBtn {
    display: none !important;
  }

  body.qp-creator-with-app-nav .qp-mobile-bottom-nav,
  body.qp-creator-with-app-nav .qp-mobile-bottom-toggle {
    display: none !important;
  }

  body.qp-has-mobile-bottom-nav .qp-mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 104;
    display: flex;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    min-height: var(--qp-mobile-bottom-nav-height);
    margin: 0;
    padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
    background: rgba(255, 255, 255, .98);
    border-top: 1px solid rgba(124, 58, 237, .16);
    box-shadow: 0 -12px 30px rgba(15, 23, 42, .12);
    transition: transform .22s ease, opacity .18s ease, visibility .18s ease;
  }

  body.qp-has-mobile-bottom-nav .qp-mobile-bottom-toggle {
    position: fixed;
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(var(--qp-mobile-bottom-nav-height) + 5px + env(safe-area-inset-bottom));
    z-index: 105;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(124, 58, 237, .22);
    border-radius: 999px;
    background: color-mix(in srgb, var(--qp-style-surface) 68%, transparent);
    color: var(--qp-style-accent);
    font: inherit;
    font-size: 18px;
    font-weight: 950;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .14);
    backdrop-filter: blur(8px);
    -webkit-tap-highlight-color: transparent;
    transition: bottom .22s ease, background-color .16s ease, opacity .16s ease;
  }

  body.qp-has-mobile-bottom-nav .qp-mobile-bottom-toggle:focus-visible {
    outline: 3px solid rgba(124, 58, 237, .3);
    outline-offset: 2px;
  }

  body.qp-has-mobile-bottom-nav.qp-mobile-bottom-nav-hidden .qp-mobile-bottom-nav {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 18px));
  }

  body.qp-has-mobile-bottom-nav.qp-mobile-bottom-nav-hidden .qp-mobile-bottom-toggle {
    bottom: calc(8px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--qp-style-surface) 60%, transparent);
    opacity: .82;
  }

  body.qp-has-mobile-bottom-nav .qp-mobile-bottom-nav::-webkit-scrollbar {
    display: none;
  }

  .qp-mobile-bottom-link {
    flex: 0 0 76px;
    min-width: 76px;
    min-height: 60px;
    padding: 6px 5px;
    display: grid;
    grid-template-rows: 28px minmax(16px, auto);
    place-items: center;
    align-content: center;
    gap: 2px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #5b6474;
    text-align: center;
    text-decoration: none;
    scroll-snap-align: center;
    -webkit-tap-highlight-color: transparent;
  }

  .qp-mobile-bottom-link:hover,
  .qp-mobile-bottom-link:focus-visible {
    color: #4c1d95;
    background: #f5f3ff;
  }

  .qp-mobile-bottom-link:focus-visible {
    outline: 3px solid rgba(124, 58, 237, .30);
    outline-offset: -3px;
  }

  .qp-mobile-bottom-link.active {
    color: #ffffff;
    background: #5b21b6;
    border-color: #5b21b6;
    box-shadow: 0 7px 16px rgba(91, 33, 182, .25);
  }

  .qp-mobile-bottom-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    font-size: 20px;
    line-height: 1;
  }

  .qp-mobile-bottom-label {
    display: block;
    width: 100%;
    overflow: hidden;
    color: inherit;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.qp-has-mobile-bottom-nav .qp-dashboard-content {
    padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
  }

  body.qp-has-mobile-bottom-nav.qp-mobile-bottom-nav-hidden .qp-dashboard-content {
    padding-bottom: calc(48px + env(safe-area-inset-bottom)) !important;
  }

  body.qp-has-mobile-bottom-nav .qp-toast {
    bottom: calc(92px + env(safe-area-inset-bottom));
  }

  body.qp-has-mobile-bottom-nav.qp-mobile-bottom-nav-hidden .qp-toast {
    bottom: calc(48px + env(safe-area-inset-bottom));
  }

  body.qp-creator-body .qp-mobile-bottom-toggle,
  body.qp-chat-keyboard-open .qp-mobile-bottom-toggle {
    display: none !important;
  }
}

/* Versioned Theme Engine --------------------------------------------------- */
html[data-qp-theme-active="1"] {
  --qp-bg: var(--qpt-background, #f5f3ff);
  --qp-bg-2: var(--qpt-background, #eef2ff);
  --qp-panel: var(--qpt-surface, #fff);
  --qp-panel-2: var(--qpt-surface-alt, #fafafa);
  --qp-text: var(--qpt-text, #111827);
  --qp-muted: var(--qpt-muted, #6b7280);
  --qp-border: var(--qpt-border, #d7dce8);
  --qp-soft: var(--qpt-border, #e5e7eb);
  --qp-purple: var(--qpt-primary, #6d28d9);
  --qp-purple-2: var(--qpt-primary, #8b5cf6);
  --qp-purple-3: color-mix(in srgb, var(--qpt-primary, #6d28d9) 11%, white);
  --qp-blue: var(--qpt-info, #2563eb);
  --qp-green: var(--qpt-success, #059669);
  --qp-yellow: var(--qpt-warning, #d97706);
  --qp-red: var(--qpt-danger, #dc2626);
  --qp-radius: var(--qpt-card-radius, 22px);
  --qp-shell-bg: var(--qpt-background, #f3f4f6);
  --qp-shell-surface: var(--qpt-surface, #fff);
  --qp-shell-surface-2: var(--qpt-surface-alt, #fbfbfe);
  --qp-shell-text: var(--qpt-text, #1f2937);
  --qp-shell-muted: var(--qpt-muted, #5f6675);
  --qp-shell-line: var(--qpt-border, rgba(15,23,42,.1));
  --qp-shell-primary: var(--qpt-primary, #5b21b6);
  --qp-shell-primary-2: var(--qpt-primary, #7c3aed);
  --qp-shell-primary-soft: color-mix(in srgb, var(--qpt-primary, #6d28d9) 11%, transparent);
  --qp-student-bg: var(--qpt-background, #f7f6fb);
  --qp-student-card: var(--qpt-surface, #fff);
  --qp-student-text: var(--qpt-text, #221f2e);
  --qp-student-muted: var(--qpt-muted, #736d7c);
  --qp-student-line: var(--qpt-border, #ebe8f2);
  --qp-student-purple: var(--qpt-primary, #6428f5);
  --qp-student-purple-dark: color-mix(in srgb, var(--qpt-primary, #6428f5) 82%, black);
  font-size: calc(16px * var(--qpt-font-scale, 1));
}
html[data-qp-theme-active="1"] body:not(.qp-game-body) {
  color: var(--qpt-text) !important;
  background: var(--qpt-background) !important;
}
html[data-qp-theme-active="1"] body,
html[data-qp-theme-active="1"] button,
html[data-qp-theme-active="1"] input,
html[data-qp-theme-active="1"] select,
html[data-qp-theme-active="1"] textarea { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
html[data-qp-font-family="system"] body { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
html[data-qp-font-family="academic-serif"] h1,
html[data-qp-font-family="academic-serif"] h2,
html[data-qp-font-family="academic-serif"] h3 { font-family: Georgia, Cambria, "Times New Roman", serif; letter-spacing: -.018em; }
html[data-qp-theme-active="1"] .qp-dashboard-sidebar,
html[data-qp-theme-active="1"] .qp-dashboard-topbar,
html[data-qp-theme-active="1"] .qp-topbar { border-color: var(--qpt-border) !important; background: var(--qpt-surface) !important; color: var(--qpt-text) !important; }
html[data-qp-theme-active="1"] .qp-dashboard-main,
html[data-qp-theme-active="1"] .qp-dashboard-content { background: var(--qpt-background) !important; color: var(--qpt-text) !important; }
html[data-qp-theme-active="1"] body.qp-dashboard-clean .qp-dashboard-hero-simple { color: var(--qpt-primary-text) !important; background: var(--qpt-primary) !important; }
html[data-qp-theme-active="1"] body.qp-dashboard-clean .qp-dashboard-hero-simple :is(h1,h2,h3,p) { color: var(--qpt-primary-text) !important; }
html[data-qp-theme-active="1"] body.qp-dashboard-clean .qp-dashboard-hero-simple .qp-pill.inverse { color: var(--qpt-primary) !important; background: var(--qpt-surface) !important; }
html[data-qp-theme-active="1"] body.qp-dashboard-clean .qp-dashboard-stats strong { color: var(--qpt-primary) !important; }
html[data-qp-theme-active="1"] :is(.qp-card,.qp-profile-panel,.qp-dashboard-card,.qp-student-panel,.qp-student-row-card,.qp-settings-card,.qp-stat-card,.qp-shop-card,.qp-subject-card,.qp-library-card,.qp-grade-card,.qp-review-card,.qp-support-card) {
  border-color: var(--qpt-border) !important;
  border-width: var(--qpt-border-width, 1px) !important;
  border-radius: var(--qpt-card-radius, 18px) !important;
  background: var(--qpt-surface) !important;
  color: var(--qpt-text) !important;
}
html[data-qp-theme-active="1"] :is(.qp-muted,small,.qp-card p,.qp-profile-panel p) { color: var(--qpt-muted); }
html[data-qp-theme-active="1"] :is(.qp-btn,button.qp-btn,.qp-input,.qp-select,.qp-textarea) { border-radius: var(--qpt-control-radius, 12px) !important; }
html[data-qp-theme-active="1"] :is(.qp-input,.qp-select,.qp-textarea,input:not([type="checkbox"]):not([type="radio"]),select,textarea) { border-color: var(--qpt-border); color: var(--qpt-text); background-color: var(--qpt-surface); }
html[data-qp-theme-active="1"] :is(.qp-input,.qp-select,.qp-textarea,input,select,textarea):focus { border-color: var(--qpt-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--qpt-primary) 18%, transparent); }
html[data-qp-theme-active="1"] :is(.qp-btn.primary,.qp-primary-btn,.qp-dashboard-primary-action) { border-color: var(--qpt-primary) !important; color: var(--qpt-primary-text) !important; background: var(--qpt-primary) !important; }
html[data-qp-theme-active="1"] :is(.qp-btn.success,.qp-progress-fill,progress::-webkit-progress-value) { background: var(--qpt-success) !important; }
html[data-qp-theme-active="1"] :is(.qp-btn.danger,.danger.qp-btn) { background: var(--qpt-danger) !important; }
html[data-qp-theme-active="1"] :is(table,th,td,.qp-table-row) { border-color: var(--qpt-border) !important; }
html[data-qp-theme-active="1"] thead,
html[data-qp-theme-active="1"] th { color: var(--qpt-muted) !important; background: var(--qpt-surface-alt) !important; }
html[data-qp-theme-active="1"] .qp-dashboard-nav a { color: var(--qpt-muted) !important; }
html[data-qp-theme-active="1"] .qp-dashboard-nav a.active,
html[data-qp-theme-active="1"] .qp-dashboard-nav a:hover { color: var(--qpt-primary) !important; background: color-mix(in srgb, var(--qpt-primary) 10%, var(--qpt-surface)) !important; }
html[data-qp-theme-active="1"] .qp-dashboard-nav .qp-nav-icon svg { display: block; width: 20px; height: 20px; }
html[data-qp-theme-active="1"] body.qp-dashboard-clean .qp-dashboard-sidebar .qp-dashboard-logo,
html[data-qp-theme-active="1"] body.qp-dashboard-clean .qp-dashboard-sidebar .qp-dashboard-logo-title { color: var(--qpt-primary) !important; }
html[data-qp-theme-active="1"] body.qp-dashboard-clean .qp-dashboard-sidebar .qp-dashboard-logo-title strong { color: var(--qpt-accent) !important; }
html[data-qp-theme-active="1"] body.qp-dashboard-clean .qp-dashboard-sidebar .qp-dashboard-nav a { color: var(--qpt-muted) !important; background: transparent !important; }
html[data-qp-theme-active="1"] body.qp-dashboard-clean .qp-dashboard-sidebar .qp-dashboard-nav a .qp-nav-icon { color: var(--qpt-primary) !important; background: var(--qpt-surface-alt) !important; }
html[data-qp-theme-active="1"] body.qp-dashboard-clean .qp-dashboard-sidebar .qp-dashboard-nav a.active,
html[data-qp-theme-active="1"] body.qp-dashboard-clean .qp-dashboard-sidebar .qp-dashboard-nav a:hover { color: var(--qpt-primary) !important; background: color-mix(in srgb, var(--qpt-primary) 10%, var(--qpt-surface)) !important; }
html[data-qp-theme-active="1"] body.qp-dashboard-clean .qp-dashboard-sidebar .qp-dashboard-nav a.active .qp-nav-icon { color: var(--qpt-primary-text) !important; background: var(--qpt-primary) !important; }
html[data-qp-theme-active="1"] body.qp-dashboard-clean .qp-dashboard-sidebar .qp-sidebar-collapse-btn { color: var(--qpt-primary) !important; background: var(--qpt-surface-alt) !important; }
html[data-qp-shadow="none"] :is(.qp-card,.qp-profile-panel,.qp-btn) { box-shadow: none !important; }
html[data-qp-shadow="subtle"] :is(.qp-card,.qp-profile-panel,.qp-dashboard-card,.qp-student-panel) { box-shadow: 0 8px 24px rgba(23,32,51,.06) !important; }
html[data-qp-shadow="medium"] :is(.qp-card,.qp-profile-panel,.qp-dashboard-card,.qp-student-panel) { box-shadow: 0 16px 38px rgba(23,32,51,.12) !important; }
html[data-qp-density="compact"] :is(.qp-card,.qp-profile-panel,.qp-dashboard-card) { padding: 14px !important; }
html[data-qp-density="spacious"] :is(.qp-card,.qp-profile-panel,.qp-dashboard-card) { padding: 28px !important; }
html[data-qp-button-shape="pill"] .qp-btn { border-radius: 999px !important; }
html[data-qp-button-shape="square"] .qp-btn { border-radius: 4px !important; }
html[data-qp-button-style="outline"] .qp-btn.primary { color: var(--qpt-primary) !important; background: transparent !important; }
html[data-qp-button-style="soft"] .qp-btn.primary { color: var(--qpt-primary) !important; background: color-mix(in srgb, var(--qpt-primary) 13%, var(--qpt-surface)) !important; }
html[data-qp-card-style="flat"] :is(.qp-card,.qp-profile-panel,.qp-dashboard-card,.qp-student-panel) { border-color: transparent !important; box-shadow: none !important; }
html[data-qp-card-style="outlined"] :is(.qp-card,.qp-profile-panel,.qp-dashboard-card,.qp-student-panel) { box-shadow: none !important; }
html[data-qp-table-style="striped"] tbody tr:nth-child(even) { background: var(--qpt-surface-alt) !important; }
html[data-qp-table-style="grid"] :is(th,td) { border: var(--qpt-border-width, 1px) solid var(--qpt-border) !important; }
html[data-qp-input-style="filled"] :is(.qp-input,.qp-select,.qp-textarea,input,select,textarea) { border-color: transparent; background: var(--qpt-surface-alt); }
html[data-qp-input-style="underlined"] :is(.qp-input,.qp-select,.qp-textarea,input,select,textarea) { border-width: 0 0 var(--qpt-border-width, 1px); border-radius: 0 !important; box-shadow: none; }
html[data-qp-nav-style="filled"] .qp-dashboard-nav a.active { color: var(--qpt-primary-text) !important; background: var(--qpt-primary) !important; }
html[data-qp-nav-style="pill"] .qp-dashboard-nav a { border-radius: 999px !important; }
html[data-qp-progress-style="square"] :is(progress,.qp-progress,.qp-progress-fill) { border-radius: 2px !important; }
/* Reduced motion is intentionally scoped. A universal selector here used to
   participate in every live-game style recalculation and also removed the
   compositor smoothing from functional progress indicators. */
html[data-qp-motion="reduced"] { scroll-behavior: auto !important; }
html[data-qp-motion="reduced"] :is(
  .qp-step,
  .qp-avatar-emoji,
  .qp-player-avatar,
  .qp-simple-avatar,
  .qp-boost,
  .qp-winner-card,
  .qp-winner-avatar,
  .qp-top10-theater,
  .qp-top10-card,
  .qp-top10-avatar,
  .qp-waiting-dots span,
  .qp-correct-reveal,
  .qp-reveal-answer.is-correct,
  .qp-map-correct-ring,
  .qp-lobby-player-avatar,
  .qp-hotspot-correct-area,
  .qp-rank-change,
  .qp-quiz-intro,
  .qp-avatar-premium
) { animation: none !important; }
html[data-qp-motion="reduced"] :is(#hostApp > *, #playerApp > *) { animation: none !important; }
html[data-qp-motion="reduced"] .qp-winner-card::before { animation: none !important; }

/* Theme Generator --------------------------------------------------------- */
.qp-theme-generator { display: grid; gap: 18px; color: #172033; }
.qp-theme-generator-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 24px; border: 1px solid #dfe4e8; border-radius: 20px; background: linear-gradient(135deg,#fff 0%,#f7f5ef 60%,#eef7f4 100%); box-shadow: 0 10px 30px rgba(23,32,51,.06); }
.qp-theme-generator-hero span,.qp-theme-panel-title > span { color: #c54f0a; font-size: 11px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.qp-theme-generator-hero h2 { margin: 5px 0 6px; color: #172033; font-size: clamp(26px,4vw,38px); letter-spacing: -.035em; }
.qp-theme-generator-hero p,.qp-theme-panel-title p { max-width: 720px; margin: 0; color: #667085; line-height: 1.55; }
.qp-theme-hero-status { min-width: 210px; padding: 13px 15px; border: 1px solid #dfe4e8; border-radius: 14px; background: rgba(255,255,255,.8); }
.qp-theme-hero-status small,.qp-theme-hero-status b { display: block; }
.qp-theme-hero-status small { color: #667085; font-size: 11px; }
.qp-theme-hero-status b { margin-top: 3px; color: #1e3a5f; }
.qp-theme-workspace { display: grid; grid-template-columns: minmax(230px,280px) minmax(0,1fr); gap: 18px; align-items: start; }
.qp-theme-library { position: sticky; top: 94px; display: grid; gap: 12px; max-height: calc(100vh - 120px); padding: 14px; border: 1px solid #dfe4e8; border-radius: 18px; background: #fff; overflow: hidden; }
.qp-theme-library-head,.qp-theme-card-head,.qp-theme-editor-head,.qp-theme-preview-toolbar,.qp-theme-assignment-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qp-theme-library-head span,.qp-theme-library-head b { display: block; }
.qp-theme-library-head span { color: #667085; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.qp-theme-library-list { display: grid; gap: 9px; overflow: auto; }
.qp-theme-library-card { display: grid; gap: 8px; width: 100%; padding: 13px; border: 1px solid #e2e7eb; border-radius: 14px; color: #172033; background: #fff; text-align: left; box-shadow: none; }
.qp-theme-library-card:hover { border-color: #aab8c6; transform: none; }
.qp-theme-library-card.active { border-color: #1e3a5f; box-shadow: 0 0 0 2px rgba(30,58,95,.12); }
.qp-theme-card-head small,.qp-theme-status { padding: 4px 8px; border-radius: 999px; color: #586474; background: #eef1f4; font-size: 10px; font-weight: 850; }
.qp-theme-card-head small.is-published,.qp-theme-status.is-published { color: #087356; background: #e2f7f0; }
.qp-theme-card-head small.is-published_with_draft,.qp-theme-status.is-published_with_draft { color: #925000; background: #fff1d6; }
.qp-theme-card-head small.is-archived,.qp-theme-status.is-archived { color: #667085; background: #e8eaed; }
.qp-theme-card-swatches { display: flex; gap: 4px; }
.qp-theme-card-swatches i { width: 25px; height: 8px; border-radius: 999px; background: var(--swatch,#dfe4e8); }
.qp-theme-card-swatches i.classic:nth-child(1) { background:#6d28d9; }.qp-theme-card-swatches i.classic:nth-child(2) { background:#2563eb; }.qp-theme-card-swatches i.classic:nth-child(3) { background:#f5f3ff; }
.qp-theme-card-description { overflow: hidden; color: #667085; font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.qp-theme-card-meta { color: #8892a0; font-size: 10px; font-weight: 750; }
.qp-theme-main { display: grid; gap: 14px; min-width: 0; }
.qp-theme-editor-head { align-items: flex-start; padding: 14px; border: 1px solid #dfe4e8; border-radius: 18px; background: #fff; }
.qp-theme-name-fields { display: grid; flex: 1; grid-template-columns: minmax(160px,.55fr) minmax(220px,1fr); gap: 8px; }
.qp-theme-editor-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.qp-theme-delete-panel { display:grid; grid-template-columns:minmax(180px,1fr) minmax(220px,320px) auto; align-items:end; gap:12px; padding:12px 14px; border:1px solid color-mix(in srgb,var(--qpt-danger,#b42318) 24%,#dfe4e8); border-radius:8px; background:color-mix(in srgb,var(--qpt-danger,#b42318) 4%,#fff); }
.qp-theme-delete-panel > span { display:grid; gap:3px; }
.qp-theme-delete-panel small { color:#667085; }
.qp-theme-delete-panel label { display:grid; gap:5px; color:#475467; font-size:12px; font-weight:700; }
.qp-theme-editor-body { display: grid; grid-template-columns: minmax(300px,.78fr) minmax(360px,1.22fr); gap: 14px; }
.qp-theme-controls,.qp-theme-preview,.qp-theme-publish-panel,.qp-theme-history { min-width: 0; padding: 14px; border: 1px solid #dfe4e8; border-radius: 18px; background: #fff; }
.qp-theme-editor-sections { display: flex; gap: 6px; padding-bottom: 12px; overflow: auto; }
.qp-theme-editor-sections button,.qp-theme-preview-toolbar button,.qp-theme-assignment-mode button { min-height: 34px; padding: 7px 10px; border: 1px solid #dfe4e8; border-radius: 9px; color: #667085; background: #fff; font-size: 11px; font-weight: 850; white-space: nowrap; }
.qp-theme-editor-sections button.active,.qp-theme-preview-toolbar button.active,.qp-theme-assignment-mode button[aria-checked="true"] { border-color: #1e3a5f; color: #fff; background: #1e3a5f; }
.qp-theme-control-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.qp-theme-control { display: grid; gap: 6px; min-width: 0; }
.qp-theme-control > span:first-child { color: #4c5867; font-size: 11px; font-weight: 850; }
.qp-theme-color-row,.qp-theme-number-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.qp-theme-color-row input[type="color"] { flex: 0 0 42px; width: 42px; height: 42px; padding: 3px; border: 1px solid #dfe4e8; border-radius: 10px; background: #fff; }
.qp-theme-color-row .qp-input,.qp-theme-number-row .qp-input,.qp-theme-number-row .qp-select { min-width: 0; height: 42px; padding: 8px 10px; border-width: 1px; font-size: 12px; }
.qp-theme-reset { flex: 0 0 auto; min-height: 34px; padding: 6px 8px; border: 0; border-radius: 8px; color: #1e3a5f; background: #edf2f7; font-size: 10px; font-weight: 850; }
.qp-theme-accessibility { display: grid; gap: 6px; margin-top: 14px; padding: 12px; border-radius: 12px; background: #f7f8fa; }
.qp-theme-accessibility span { font-size: 11px; font-weight: 800; }.qp-theme-accessibility .pass { color:#087356; }.qp-theme-accessibility .fail { color:#b42318; }.qp-theme-accessibility .unknown { color:#667085; }
.qp-theme-preview { display: grid; gap: 10px; overflow: hidden; }
.qp-theme-preview-toolbar { align-items: center; }
.qp-theme-preview-toolbar > div { display: flex; gap: 5px; }
.qp-theme-preview-frame { width: 100%; min-height: 465px; margin: 0 auto; border: 9px solid #172033; border-radius: 19px; background: #f6f5f1; overflow: auto; transition: width .2s ease; }
.qp-theme-preview-frame.is-tablet { width: min(100%,720px); }.qp-theme-preview-frame.is-mobile { width: min(100%,390px); }
.qp-theme-preview-frame iframe { display: block; width: 100%; min-height: 600px; border: 0; background: #fff; }
.qp-theme-page-picker { display: flex; align-items: center; gap: 9px; color: #667085; font-size: 11px; font-weight: 800; }.qp-theme-page-picker .qp-select { max-width: 260px; }
.qp-theme-gallery { min-height: 465px; padding: 18px; color: var(--qpt-text,#172033); background: var(--qpt-background,#f6f5f1); }
.qp-theme-gallery-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 10px 12px; border: var(--qpt-border-width,1px) solid var(--qpt-border,#dde3e8); border-radius: var(--qpt-control-radius,12px); background: var(--qpt-surface,#fff); }
.qp-theme-gallery-nav b span { color: var(--qpt-accent,#c54f0a); }.qp-theme-gallery-nav > span { color: var(--qpt-muted,#667085); font-size: 11px; }.qp-theme-gallery button { border: 0; border-radius: var(--qpt-control-radius,12px); padding: 8px 10px; color: var(--qpt-primary-text,#fff); background: var(--qpt-primary,#1e3a5f); font-size: 10px; font-weight: 850; }
.qp-theme-gallery-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.qp-theme-gallery article { padding: 14px; border: var(--qpt-border-width,1px) solid var(--qpt-border,#dde3e8); border-radius: var(--qpt-card-radius,18px); background: var(--qpt-surface,#fff); }
.qp-theme-gallery article small,.qp-theme-gallery article span { color: var(--qpt-muted,#667085); }.qp-theme-gallery article strong { display:block; margin:7px 0; font-size:24px; }
.qp-theme-gallery .progress-card div { height:7px; margin-top:13px; border-radius:999px; background:var(--qpt-surface-alt,#f0f4f3); overflow:hidden; }.qp-theme-gallery .progress-card div i { display:block; width:67%; height:100%; background:var(--qpt-success,#168565); }
.qp-theme-gallery .chart-card,.qp-theme-gallery .table-card { grid-column: 1/-1; }.qp-theme-gallery article header { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.qp-theme-gallery .chart-bars { display:flex; align-items:end; gap:7px; height:80px; margin-top:10px; }.qp-theme-gallery .chart-bars i { flex:1; border-radius:6px 6px 2px 2px; background:color-mix(in srgb,var(--qpt-accent,#c54f0a) 42%,white); }.qp-theme-gallery .chart-bars i:nth-child(1){height:30%}.qp-theme-gallery .chart-bars i:nth-child(2){height:48%}.qp-theme-gallery .chart-bars i:nth-child(3){height:42%}.qp-theme-gallery .chart-bars i:nth-child(4){height:67%}.qp-theme-gallery .chart-bars i:nth-child(5){height:76%;background:var(--qpt-accent,#c54f0a)}.qp-theme-gallery .chart-bars i:nth-child(6){height:58%}
.qp-theme-gallery table { width:100%; margin-top:8px; border-collapse:collapse; font-size:10px; }.qp-theme-gallery th,.qp-theme-gallery td { padding:7px; border-bottom:1px solid var(--qpt-border,#dde3e8); text-align:left; }.qp-theme-gallery td span { padding:3px 6px; border-radius:999px; color:var(--qpt-success,#168565); background:color-mix(in srgb,var(--qpt-success,#168565) 10%,white); }
.qp-theme-lifecycle-grid { display:grid; grid-template-columns:1.2fr .8fr; gap:14px; }.qp-theme-panel-title h3 { margin:4px 0 5px; color:#172033; }.qp-theme-panel-title p { font-size:12px; }
.qp-theme-assignment-mode { display:flex; gap:7px; margin:14px 0; }.qp-theme-page-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; max-height:280px; overflow:auto; }.qp-theme-page-groups fieldset { display:grid; gap:6px; margin:0; padding:10px; border:1px solid #e0e5e9; border-radius:12px; }.qp-theme-page-groups legend { padding:0 5px; color:#1e3a5f; font-size:11px; font-weight:900; }.qp-theme-page-groups label { display:flex; align-items:center; gap:6px; color:#5c6775; font-size:11px; font-weight:750; }.qp-theme-page-groups input { accent-color:#1e3a5f; }
.qp-theme-global-warning { display:grid; gap:3px; padding:13px; border:1px solid #f1caa5; border-radius:12px; color:#7a3d00; background:#fff8ee; }.qp-theme-global-warning span { font-size:11px; }
.qp-theme-assignment-actions { margin-top:14px; padding-top:12px; border-top:1px solid #e5e9ed; }.qp-theme-assignment-actions > span { color:#7b8491; font-size:10px; }
.qp-theme-history-list { display:grid; gap:7px; margin-top:14px; }.qp-theme-history-list > div { display:flex; align-items:center; justify-content:space-between; gap:9px; padding:9px 10px; border:1px solid #e5e9ed; border-radius:11px; }.qp-theme-history-list b,.qp-theme-history-list small { display:block; }.qp-theme-history-list b { color:#344054; font-size:11px; text-transform:capitalize; }.qp-theme-history-list small { margin-top:2px; color:#8b93a0; font-size:9px; }
@media (max-width: 1500px) { .qp-theme-workspace { grid-template-columns:1fr; }.qp-theme-library { position:static; max-height:none; }.qp-theme-library-list { grid-template-columns:repeat(2,minmax(0,1fr)); }.qp-theme-editor-head { align-items:stretch; flex-direction:column; }.qp-theme-editor-actions { justify-content:flex-start; }.qp-theme-editor-body { grid-template-columns:1fr; } }
@media (max-width: 760px) { .qp-theme-generator-hero,.qp-theme-editor-head { align-items:stretch; flex-direction:column; }.qp-theme-hero-status { min-width:0; }.qp-theme-library-list,.qp-theme-name-fields,.qp-theme-lifecycle-grid,.qp-theme-page-groups,.qp-theme-delete-panel { grid-template-columns:1fr; }.qp-theme-control-grid { grid-template-columns:1fr; }.qp-theme-preview-toolbar { align-items:flex-start; flex-direction:column; }.qp-theme-preview-frame { min-height:420px; border-width:6px; }.qp-theme-gallery-grid { grid-template-columns:1fr; }.qp-theme-gallery .chart-card,.qp-theme-gallery .table-card { grid-column:auto; }.qp-theme-gallery-nav > span { display:none; } }

body.qp-high-performance .qp-live-stage,
body.qp-high-performance .qp-host-stage,
body.qp-high-performance .qp-dashboard-card,
body.qp-high-performance .qp-profile-panel {
  filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}

/* v1.20.13: Admin live final ceremony background picker. */
.qp-admin-final-bg-grid {
  display: grid;
  grid-template-columns: minmax(240px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.qp-admin-final-bg-preview {
  min-height: 180px;
  display: grid;
  align-items: end;
  overflow: hidden;
  border: 1px solid #e5d7f2;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(70, 23, 143, .10), rgba(70, 23, 143, .48)),
    var(--qp-admin-final-bg, linear-gradient(135deg, #aee2de 0%, #f9d5bc 48%, #f3e59b 49%, #84bf59 100%));
  background-size: cover;
  background-position: center;
  box-shadow: 0 18px 44px rgba(45, 23, 78, .12);
}

.qp-admin-final-bg-preview span {
  display: block;
  margin: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  color: #3b235d;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.qp-admin-final-bg-preview.is-empty span {
  color: #6b5b78;
}

.qp-admin-final-bg-controls {
  display: grid;
  align-content: center;
  gap: 12px;
}

.qp-admin-final-bg-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.qp-admin-final-bg-preset {
  position: relative;
  min-height: 112px;
  padding: 0;
  overflow: hidden;
  border: 3px solid transparent;
  border-radius: 14px;
  background: var(--qp-final-preset);
  background-size: cover;
  background-position: center;
  box-shadow: 0 10px 24px rgba(45, 23, 78, .12);
  cursor: pointer;
}

.qp-admin-final-bg-preset::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(20, 10, 40, .72));
  pointer-events: none;
}

.qp-admin-final-bg-preset span {
  position: absolute;
  z-index: 1;
  left: 10px;
  right: 10px;
  bottom: 9px;
  color: #fff;
  font-weight: 950;
  text-align: left;
}

.qp-admin-final-bg-preset.active {
  border-color: #6d28d9;
  box-shadow: 0 0 0 3px rgba(109, 40, 217, .18), 0 12px 28px rgba(45, 23, 78, .18);
}

.qp-admin-final-bg-preset:focus-visible {
  outline: 3px solid rgba(109, 40, 217, .28);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .qp-admin-final-bg-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qp-admin-final-bg-grid {
    grid-template-columns: 1fr;
  }
}

/* v1.20.37: glanceable statistics with progressive disclosure. */
.qp-stats-view-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.qp-stats-filter-tools,
.qp-stats-filter-chips,
.qp-stats-dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qp-stats-filter-chips {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.qp-stats-filter-chips button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  max-width: 190px;
  padding: 7px 10px;
  border: 1px solid #ddd6fe;
  border-radius: 999px;
  background: #f5f3ff;
  color: #5b21b6;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.qp-stats-filter-chips button span { flex: 0 0 auto; }

.qp-stats-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #d7dce8;
  border-radius: 10px;
  background: #fff;
  color: #24144f;
  font: inherit;
  font-size: 19px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 9px rgba(15, 23, 42, .06);
}

.qp-stats-icon-btn[hidden] { display: none !important; }
.qp-stats-icon-btn:hover { border-color: #8b5cf6; color: #6d28d9; }
.qp-stats-icon-btn:focus-visible { outline: 3px solid rgba(109, 40, 217, .22); outline-offset: 2px; }
.qp-stats-icon-btn.has-filters::after {
  content: attr(data-count);
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #6d28d9;
  color: #fff;
  font-size: 9px;
}

.qp-stats-filter-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 48px));
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: #111827;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
}

.qp-stats-filter-dialog::backdrop { background: rgba(15, 12, 35, .48); backdrop-filter: blur(3px); }
.qp-stats-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f0;
}
.qp-stats-dialog-header h2 { margin: 0; font-size: 18px; }
.qp-stats-dialog-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #334155;
  font-size: 17px;
  cursor: pointer;
}
.qp-stats-filter-dialog .qp-stats-scope-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 18px;
}
.qp-stats-dialog-actions { justify-content: flex-end; padding: 0 18px 18px; }
.qp-stats-dialog-actions form { margin: 0; }

.qp-stats-wallet { gap: 7px; }
.qp-stats-wallet::before { display: none; }
.qp-stats-wallet > span { font-size: 18px; line-height: 1; }
.qp-stats-wallet strong { font-variant-numeric: tabular-nums; }

.qp-stats-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.qp-stats-metric,
.qp-stats-metric.primary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 104px;
  padding: 18px;
}
.qp-stats-metric > .qp-stats-metric-icon {
  display: block;
  margin: 0;
  color: inherit;
  font-size: 30px;
  line-height: 1;
  text-transform: none;
  filter: drop-shadow(0 4px 6px rgba(15, 23, 42, .14));
}
.qp-stats-metric strong { margin: 0; font-size: clamp(26px, 2.2vw, 34px); }

.qp-stats-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.qp-stats-podium[hidden] { display: none; }
.qp-stats-podium-card {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}
.qp-stats-podium-card.rank-1 { border-color: #f7d774; background: #fffdf3; }
.qp-stats-podium-card.rank-2 { border-color: #cbd5e1; background: #f8fafc; }
.qp-stats-podium-card.rank-3 { border-color: #f0b38d; background: #fff8f3; }
.qp-stats-podium-rank { font-size: 15px; font-weight: 950; color: #24144f; }
.qp-stats-podium-player { display: grid; min-width: 0; }
.qp-stats-profile-link { color: inherit; text-decoration: none; }
.qp-stats-profile-link:hover b { color: #6d28d9; text-decoration: underline; text-underline-offset: 3px; }
.qp-stats-profile-link:focus-visible { outline: 3px solid rgba(109, 40, 217, .2); outline-offset: 3px; border-radius: 8px; }
.qp-stats-podium-player b,
.qp-stats-podium-player small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-stats-podium-player b { color: #111827; font-size: 13px; }
.qp-stats-podium-player small { color: #64748b; font-size: 10px; }
.qp-stats-podium-card > strong { color: #6d28d9; font-size: 14px; white-space: nowrap; }

.qp-stats-toolbar { align-items: center; }
.qp-stats-table { min-width: 650px; }
.qp-stats-table th:nth-child(n+3),
.qp-stats-table td:nth-child(n+3) { text-align: right; }
.qp-stats-table th:nth-child(n+3) { font-size: 17px; text-transform: none; }
.qp-stats-table tr[hidden] { display: none !important; }
.qp-stats-player-row td { transition: border-color .16s ease, background .16s ease; }
.qp-stats-player-row:has(.qp-stats-player-toggle[aria-expanded="true"]) td { border-color: #c4b5fd; background: #faf8ff; }
.qp-stats-player-cell { display: grid; grid-template-columns: minmax(0, 1fr) 36px; align-items: center; gap: 6px; min-width: 0; }
.qp-stats-player-cell > .qp-stats-profile-link { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qp-stats-player-toggle {
  display: grid;
  place-items: center;
  align-items: center;
  width: 34px;
  height: 34px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.qp-stats-player-toggle:hover { background: #ede9fe; }
.qp-stats-player-toggle:focus-visible { outline: 3px solid rgba(109, 40, 217, .2); outline-offset: 3px; border-radius: 8px; }
.qp-stats-row-chevron { color: #64748b; font-size: 18px; transition: transform .16s ease; }
.qp-stats-player-toggle[aria-expanded="true"] .qp-stats-row-chevron { transform: rotate(180deg); }
.qp-stats-movement {
  display: inline-block;
  min-width: 30px;
  margin-left: 7px;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}
.qp-stats-movement.up { color: #059669; }
.qp-stats-movement.down { color: #dc2626; }
.qp-stats-movement.same { color: #94a3b8; }
.qp-stats-detail-row td {
  padding: 0 10px 10px !important;
  border: 0 !important;
  background: transparent !important;
}
.qp-stats-contributions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #ddd6fe;
  border-radius: 10px;
  background: #faf8ff;
  list-style: none;
}
.qp-stats-contributions li { display: flex; justify-content: space-between; gap: 12px; min-width: 0; }
.qp-stats-contributions li span { overflow: hidden; color: #475569; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.qp-stats-contributions li strong { color: #6d28d9; font-size: 11px; white-space: nowrap; }

.qp-stats-pinned {
  position: sticky;
  z-index: 4;
  bottom: 12px;
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 2px solid #7c3aed;
  border-radius: 12px;
  background: #ede9fe;
  box-shadow: 0 12px 28px rgba(76, 29, 149, .2);
}
.qp-stats-pinned[hidden] { display: none; }
.qp-stats-pinned b { color: #3b0764; }
.qp-stats-pinned > strong { color: #6d28d9; white-space: nowrap; }

.qp-stats-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px;
}
.qp-stats-empty > span { font-size: 30px; }
.qp-stats-empty strong { color: #334155; font-size: 14px; }
.qp-stats-empty a {
  padding: 8px 11px;
  border-radius: 8px;
  background: #6d28d9;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}

@media (max-width: 900px) {
  .qp-stats-metric.primary { grid-column: auto; }
  .qp-stats-view-controls { align-items: flex-start; }
  .qp-stats-filter-tools { max-width: 42%; }
  .qp-stats-podium { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .qp-stats-view-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .qp-stats-mode-tabs { min-width: 0; }
  .qp-stats-filter-tools { max-width: none; }
  .qp-stats-filter-chips { display: none; }
  .qp-stats-filter-dialog {
    width: 100%;
    max-width: none;
    max-height: min(78vh, 620px);
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
  }
  .qp-stats-filter-dialog .qp-stats-scope-grid { grid-template-columns: 1fr; padding: 14px 16px; }
  .qp-stats-dialog-actions { position: sticky; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #e2e8f0; }
  .qp-stats-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .qp-stats-metric,
  .qp-stats-metric.primary {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 7px;
    min-height: 84px;
    padding: 10px 6px;
    text-align: center;
  }
  .qp-stats-metric > .qp-stats-metric-icon { font-size: 23px; }
  .qp-stats-metric strong { font-size: clamp(18px, 6vw, 24px); }
  .qp-stats-podium {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .qp-stats-podium::-webkit-scrollbar { display: none; }
  .qp-stats-podium-card { flex: 0 0 min(245px, 82vw); scroll-snap-align: start; }
  .qp-stats-toolbar-actions { display: grid; grid-template-columns: minmax(0, 1fr) 42px; }
  .qp-stats-toolbar-actions .qp-stats-icon-btn { min-height: 42px; }
  .qp-stats-table-wrap { overflow: visible; }
  .qp-stats-table { display: block; min-width: 0; }
  .qp-stats-table tbody { display: grid; gap: 8px; }
  .qp-stats-table tr.qp-stats-player-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto auto auto;
    grid-template-areas: "rank player points top coins";
    gap: 6px;
    padding: 10px;
  }
  .qp-stats-table tr.qp-stats-player-row td { display: block; width: auto; }
  .qp-stats-table tr.qp-stats-player-row td:nth-child(1) { grid-area: rank; }
  .qp-stats-table tr.qp-stats-player-row td:nth-child(2) { display: block; grid-area: player; }
  .qp-stats-table tr.qp-stats-player-row td:nth-child(3) { grid-area: points; }
  .qp-stats-table tr.qp-stats-player-row td:nth-child(4) { grid-area: top; }
  .qp-stats-table tr.qp-stats-player-row td:nth-child(5) { display: block; grid-area: coins; text-align: right; }
  .qp-stats-table tr.qp-stats-player-row td:nth-child(3)::before { content: '\26A1'; }
  .qp-stats-table tr.qp-stats-player-row td:nth-child(4)::before { content: '\1F3AF'; }
  .qp-stats-table tr.qp-stats-player-row td:nth-child(5)::before { content: '\1FA99'; }
  .qp-stats-table tr.qp-stats-player-row td:nth-child(n+3)::before { display: block; margin-bottom: 2px; font-size: 11px; }
  .qp-stats-table tr.qp-stats-player-row td:nth-child(n+3) strong { font-size: 11px; }
  .qp-stats-table tr.qp-stats-detail-row { display: block; width: 100%; margin-top: -8px; }
  .qp-stats-table tr.qp-stats-detail-row[hidden] { display: none !important; }
  .qp-stats-table tr.qp-stats-detail-row td { display: block; width: 100%; }
  .qp-stats-player-cell { grid-template-columns: minmax(0, 1fr) 30px; gap: 3px; }
  .qp-stats-player-cell > .qp-stats-profile-link { gap: 7px; }
  .qp-stats-player-cell .qp-stats-avatar { width: 36px; height: 36px; font-size: 18px; }
  .qp-stats-player-cell .qp-stats-player b { font-size: 12px; }
  .qp-stats-player-toggle { width: 30px; height: 34px; }
  .qp-stats-row-chevron { font-size: 15px; }
  .qp-stats-rank { width: 38px; height: 38px; font-size: 11px; }
  .qp-stats-movement { min-width: 0; margin: 2px 0 0; font-size: 8px; }
  .qp-stats-contributions { grid-template-columns: 1fr; }
  .qp-stats-pinned { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
.qp-message-notification-stack {
  position: fixed;
  z-index: 10020;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  width: min(390px, calc(100vw - 36px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.qp-message-notification {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid rgba(109, 40, 217, .18);
  border-radius: 16px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 48px rgba(20, 13, 48, .22), 0 2px 8px rgba(20, 13, 48, .08);
  opacity: 0;
  transform: translate3d(22px, -6px, 0) scale(.98);
  transition: opacity .18s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
  pointer-events: auto;
}

.qp-message-notification.is-visible { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
.qp-message-notification.is-leaving { opacity: 0; transform: translate3d(18px, 0, 0) scale(.98); }

.qp-message-notification-open {
  min-width: 0;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 14px 8px 14px 14px;
  background: transparent;
  color: #171329;
  text-align: left;
  cursor: pointer;
}

.qp-message-notification-open:hover { background: #f8f5ff; }
.qp-message-notification-open:focus-visible,
.qp-message-notification-action:focus-visible { outline: 3px solid rgba(109, 40, 217, .28); outline-offset: -3px; }

.qp-message-notification-avatar {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #eee8ff;
  font-size: 26px;
}

.qp-message-notification-avatar img { width: 100%; height: 100%; object-fit: cover; }
.qp-message-notification-copy { min-width: 0; display: grid; gap: 4px; }
.qp-message-notification-copy strong,
.qp-message-notification-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-message-notification-copy strong { font-size: 15px; font-weight: 800; }
.qp-message-notification-copy small { color: #625b78; font-size: 13px; line-height: 1.35; }

.qp-message-notification-actions {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 9px 0 0;
}

.qp-message-notification-action {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #625b78;
  font-size: 16px;
  cursor: pointer;
}

.qp-message-notification-action:hover { background: #eee8ff; color: #5520b7; }

@media (max-width: 700px) {
  .qp-message-notification-stack {
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    left: 10px;
    width: auto;
  }
  .qp-message-notification { min-height: 74px; border-radius: 14px; }
  .qp-message-notification-open { grid-template-columns: 44px minmax(0, 1fr); padding: 11px 6px 11px 11px; }
  .qp-message-notification-avatar { width: 44px; height: 44px; font-size: 23px; }
  .qp-message-notification-actions { padding-top: 7px; padding-right: 7px; }
}
/* Phone headers rely on the dedicated Subjects page for academic context. */
@media (max-width: 700px) {
  .qp-dashboard-clean .qp-dashboard-top-actions .qp-top-space-chip,
  .qp-dashboard-clean #topSpaceSwitch {
    display: none !important;
  }

  .qp-dashboard-clean .qp-dashboard-top-actions {
    width: auto !important;
    justify-self: end !important;
  }

  .qp-dashboard-clean .qp-dashboard-top-actions .qp-btn,
  .qp-dashboard-clean .qp-dashboard-top-actions a.qp-btn {
    width: auto !important;
  }
}

/* -- Beautiful Accounts, the admin side ----------------------------------- */

.qp-beautiful-admin-count { font-size: 26px; font-weight: 900; }
.qp-beautiful-admin-block { margin-top: 18px; }
.qp-beautiful-admin-block h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  opacity: .7;
}
.qp-beautiful-admin-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.qp-beautiful-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(127, 127, 127, .22);
  border-radius: 12px;
}
.qp-beautiful-admin-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qp-beautiful-admin-who i { font-size: 22px; font-style: normal; }
.qp-beautiful-admin-who b { display: block; font-size: 14px; font-weight: 900; }
.qp-beautiful-admin-who small { display: block; font-size: 12px; font-weight: 700; opacity: .68; }
.qp-beautiful-admin-meta { font-size: 12px; font-weight: 700; opacity: .6; white-space: nowrap; }
