/* Conceptum Quiz Suite student UI — v1.3.0 mobile-first */
.cqs-public {
  --cqs-border: #e2e8f0;
  --cqs-soft: #f6f8fc;
  --cqs-success: #0f9f65;
  --cqs-danger: #c81e1e;
  --cqs-warning: #d97706;
  --cqs-shadow: 0 12px 34px rgba(15, 23, 42, .08);
  position: relative;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px;
  color: var(--cqs-text);
  background: #edf3fa;
  border-radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.cqs-public *,
.cqs-public *::before,
.cqs-public *::after { box-sizing: border-box; }
.cqs-public img,
.cqs-public video { max-width: 100%; height: auto; }
.cqs-public a { color: var(--cqs-primary); }
.cqs-public :focus-visible { outline: 3px solid color-mix(in srgb, var(--cqs-primary) 35%, transparent); outline-offset: 2px; }
.cqs-public [hidden] { display: none !important; }

.cqs-skip-link {
  position: absolute;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 8px;
  transform: translateY(-160%);
}
.cqs-skip-link:focus { transform: translateY(0); }

.cqs-student-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 720px;
  overflow: hidden;
  background: #fbfdff;
  border: 1px solid #e3eaf3;
  border-radius: 18px;
  box-shadow: var(--cqs-shadow);
}

.cqs-student-side {
  padding: 20px 14px;
  background: #fff;
  border-right: 1px solid var(--cqs-border);
}
.cqs-student-brand,
.cqs-mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cqs-text) !important;
  text-decoration: none !important;
}
.cqs-student-brand {
  min-height: 66px;
  padding: 5px 8px 18px;
  margin-bottom: 14px;
  border-bottom: 1px solid #edf1f6;
}
.cqs-brand-mark {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--cqs-primary);
  border-radius: 12px;
  font-weight: 800;
}
.cqs-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.cqs-student-brand-copy { display: grid; min-width: 0; gap: 1px; line-height: 1.25; }
.cqs-student-brand-copy strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.cqs-student-brand-copy small { color: var(--cqs-muted); font-size: 10px; }
.cqs-student-brand-short { display: none; }

.cqs-student-side nav { display: grid; gap: 7px; }
.cqs-student-side nav a {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  color: var(--cqs-text);
  border: 1px solid transparent;
  border-radius: 11px;
  text-decoration: none;
  font-weight: 600;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.cqs-student-side nav a:hover { color: var(--cqs-primary); background: #f6f9ff; border-color: #dbe7f9; transform: translateX(2px); }
.cqs-student-side nav a.is-active { color: var(--cqs-primary); background: #edf3ff; border-color: #cfddfb; }
.cqs-nav-icon { display: grid; place-items: center; }
.cqs-nav-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.cqs-student-main { min-width: 0; padding: 0 26px 34px; }
.cqs-mobile-appbar,
.cqs-mobile-bottom-nav { display: none; }
.cqs-page-header {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--cqs-border);
}
.cqs-page-intro { min-width: 0; }
.cqs-page-kicker { margin-bottom: 7px; color: var(--cqs-primary); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cqs-page-header h2 { margin: 0; color: #0f172a; font-size: clamp(28px, 3vw, 38px); line-height: 1.12; letter-spacing: -.035em; }
.cqs-student-user { display: flex; min-height: 46px; flex: 0 0 auto; align-items: center; gap: 10px; padding: 8px 14px; background: #fff; border: 1px solid #dce5f0; border-radius: 999px; box-shadow: 0 6px 18px rgba(15, 23, 42, .05); }
.cqs-student-user span { max-width: 160px; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.cqs-student-user a { font-size: 12px; font-weight: 800; text-decoration: none; }
.cqs-page-body { padding-top: 20px; }

/* Shared cards and controls */
.cqs-public-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cqs-public-grid > article,
.cqs-public-card,
.cqs-center-card,
.cqs-result-card,
.cqs-wallet,
.cqs-attempt > section,
.cqs-attempt > aside {
  min-width: 0;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--cqs-border);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .045);
}
.cqs-public-grid > article { display: flex; min-height: 250px; flex-direction: column; align-items: flex-start; }
.cqs-public-grid > article > .cqs-public-btn { margin-top: auto; }
.cqs-public-grid h3,
.cqs-public-card h3 { margin: 8px 0 10px; font-size: clamp(21px, 2.3vw, 28px); line-height: 1.25; letter-spacing: -.025em; }
.cqs-kicker { color: var(--cqs-primary); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }

.cqs-public button,
.cqs-public-btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  color: #fff;
  background: var(--cqs-primary);
  border: 1px solid var(--cqs-primary);
  border-radius: 11px;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--cqs-primary) 19%, transparent);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.cqs-public button:hover,
.cqs-public-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px color-mix(in srgb, var(--cqs-primary) 26%, transparent); }
.cqs-public button:disabled { cursor: not-allowed; opacity: .55; }
.cqs-public-btn.alt { color: var(--cqs-primary); background: #fff; border-color: var(--cqs-primary); box-shadow: none; }
.cqs-public-btn.alt:hover { color: var(--cqs-primary); background: #f5f9ff; }
.cqs-public-btn.is-disabled { pointer-events: none; opacity: .45; }
.cqs-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }

.cqs-public input:not([type="radio"]):not([type="checkbox"]),
.cqs-public select,
.cqs-public textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--cqs-text);
  background: #fff;
  border: 1px solid #cfd9e6;
  border-radius: 10px;
  font: inherit;
}
.cqs-public textarea { min-height: 130px; resize: vertical; }
.cqs-public input:focus,
.cqs-public select:focus,
.cqs-public textarea:focus { border-color: var(--cqs-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cqs-primary) 12%, transparent); outline: 0; }

.cqs-public-alert { margin: 14px 0; padding: 12px 14px; color: #7c2d12; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; }
.cqs-empty-public,
.cqs-review-box { padding: 36px 16px; color: var(--cqs-muted); background: var(--cqs-soft); border-radius: 12px; text-align: center; }

/* Home */
.cqs-hero { position: relative; overflow: hidden; margin-bottom: 20px; padding: 30px; color: #fff; background: var(--cqs-primary); border-radius: 18px; box-shadow: 0 14px 30px color-mix(in srgb, var(--cqs-primary) 22%, transparent); }
.cqs-hero::after { position: absolute; right: -55px; bottom: -70px; width: 180px; height: 180px; background: color-mix(in srgb, var(--cqs-accent) 48%, transparent); border-radius: 50%; content: ""; }
.cqs-hero > * { position: relative; z-index: 1; }
.cqs-hero h3 { margin: 0 0 6px; color: #fff; font-size: clamp(26px, 3vw, 34px); line-height: 1.2; }
.cqs-hero p { margin: 0 0 22px; }
.cqs-hero input { max-width: 640px; border: 0 !important; box-shadow: none !important; }
.cqs-quiz-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.cqs-quiz-meta span,
.cqs-section-pill { display: inline-flex; padding: 5px 9px; color: #475569; background: #f3f6fa; border: 1px solid #e5eaf1; border-radius: 999px; font-size: 12px; font-weight: 700; }

/* Details, auth and confirmations */
.cqs-center-card { max-width: 580px; margin: 24px auto; padding: 28px; text-align: center; }
.cqs-center-card form { display: grid; gap: 12px; margin-top: 18px; }
.cqs-center-card label { display: grid; gap: 6px; text-align: left; }
.cqs-center-card > button,
.cqs-center-card form > button { justify-self: center; }
.cqs-gift,
.cqs-lock { font-size: 52px; line-height: 1; }
.cqs-rules { max-width: 460px; margin: 16px auto 22px; padding-left: 22px; line-height: 1.75; text-align: left; }
.cqs-login-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.cqs-login-actions a { font-size: 13px; font-weight: 700; text-decoration: none; }
.cqs-check-inline { display: flex !important; grid-template-columns: auto 1fr !important; align-items: center !important; gap: 8px !important; }
.cqs-check-inline input { width: 18px !important; height: 18px !important; min-height: 0 !important; }
.cqs-detail-title h3 { margin: 12px 0; font-size: clamp(26px, 3vw, 34px); }
.cqs-detail-list p { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0; padding: 15px 0; border-bottom: 1px solid #e8edf3; }
.cqs-detail-list p b { flex: 0 0 auto; text-align: right; }

/* Attempt */
.cqs-attempt { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; gap: 18px; }
.cqs-attempt > section { padding: 22px; }
.cqs-attempt > aside { position: sticky; top: 16px; }
.cqs-question-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cqs-question-head > b { font-size: 16px; }
.cqs-timer { display: inline-flex; min-height: 36px; align-items: center; padding: 5px 10px; color: var(--cqs-primary); background: #edf4ff; border: 1px solid #d7e5fb; border-radius: 9px; font-variant-numeric: tabular-nums; font-weight: 900; }
.cqs-timer.is-warning { color: #b42318; background: #fff1f0; border-color: #fecdca; animation: cqsPulse 1s ease-in-out infinite; }
@keyframes cqsPulse { 50% { transform: scale(1.035); } }
.cqs-progress { height: 11px; overflow: hidden; margin: 14px 0 16px; background: #e9eef5; border-radius: 999px; }
.cqs-progress span { display: block; height: 100%; background: var(--cqs-primary); }
.cqs-attempt section > h3 { margin: 24px 0 14px; font-size: clamp(20px, 2.2vw, 26px); line-height: 1.4; }
.cqs-option { display: flex !important; min-height: 54px; align-items: center; gap: 10px; margin: 10px 0; padding: 12px 14px; background: #fff; border: 1px solid #dce4ee; border-radius: 12px; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.cqs-option:hover { background: #fbfdff; border-color: #a8c6f4; }
.cqs-option:has(input:checked) { background: #f3f7ff; border-color: var(--cqs-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cqs-primary) 9%, transparent); }
.cqs-option > input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--cqs-primary); }
.cqs-option-content { display: flex; min-width: 0; flex: 1; align-items: center; gap: 12px; }
.cqs-option-image { display: block; width: min(180px, 35vw); height: 110px; margin: 0 !important; padding: 4px; object-fit: contain; background: #f8fafc; border: 1px solid #e5eaf1; border-radius: 9px; }
.cqs-question-media { display: block; max-width: min(100%, 760px); max-height: 420px; margin: 14px 0; object-fit: contain; background: #f2f4f7; border-radius: 12px; }
.cqs-attempt audio.cqs-question-media { width: min(100%, 760px); height: auto; }
.cqs-response-text { width: 100%; }
.cqs-attempt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #edf1f5; }
.cqs-attempt-actions .cqs-review-toggle { display: flex; min-height: 44px; align-items: center; gap: 7px; margin-right: auto; }
.cqs-review-toggle input { width: 18px; height: 18px; accent-color: var(--cqs-primary); }
[data-cqs-save-status] { min-height: 24px; margin-top: 6px; color: var(--cqs-muted); font-size: 13px; }
.cqs-palette { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.cqs-palette a,
.cqs-palette span { display: grid; min-width: 38px; min-height: 38px; place-items: center; color: var(--cqs-text); background: #f0f4f9; border-radius: 9px; font-size: 12px; font-weight: 800; text-decoration: none; }
.cqs-palette a.is-answered { color: #087443; background: #dcfae6; }
.cqs-palette a.is-review { box-shadow: inset 0 0 0 2px #f79009; }
.cqs-palette a.is-current { color: #fff; background: var(--cqs-primary); }
.cqs-submit-link { display: flex; min-height: 46px; align-items: center; justify-content: center; margin-top: 16px; color: #b42318 !important; background: #fff5f5; border-radius: 10px; font-weight: 800; text-decoration: none; }
.cqs-palette-toggle,
.cqs-palette-close,
.cqs-palette-backdrop { display: none !important; }
.cqs-comprehension-passage { margin: 12px 0 16px; padding: 16px; background: #f8fafc; border: 1px solid #e4eaf2; border-left: 4px solid var(--cqs-primary); border-radius: 10px; line-height: 1.65; }
.cqs-math-expression { overflow: auto; margin: 10px 0 16px; padding: 14px; background: #fff; border: 1px dashed #cfd9e8; border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cqs-hint { margin: 12px 0; padding: 10px 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; }

.cqs-order-builder,
.cqs-match-builder { display: grid; gap: 10px; margin: 14px 0; }
.cqs-order-builder label,
.cqs-match-builder label { display: grid; grid-template-columns: minmax(90px, 180px) 1fr; align-items: center; gap: 10px; }
.cqs-order-builder select.is-duplicate { border-color: #d63638; box-shadow: 0 0 0 1px #d63638; }
.cqs-order-warning { margin-top: 8px; color: #b42318; font-size: 12px; }
.cqs-matrix-builder { overflow-x: auto; margin: 14px 0; -webkit-overflow-scrolling: touch; }
.cqs-matrix-builder table { width: 100%; min-width: 520px; border-collapse: collapse; background: #fff; }
.cqs-matrix-builder th,
.cqs-matrix-builder td { padding: 10px; border: 1px solid #e8edf4; text-align: center; }
.cqs-matrix-builder th:first-child { min-width: 150px; text-align: left; }

/* Results, leaderboard, wallet and profile */
.cqs-result-card { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: center; gap: 22px; }
.cqs-score-ring { display: grid; width: 160px; height: 160px; place-items: center; align-content: center; margin: auto; border: 16px solid #31b36b; border-radius: 50%; box-shadow: inset 0 0 0 7px #ecfdf3; }
.cqs-score-ring b { font-size: 34px; }
.cqs-result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cqs-result-grid span { display: grid; padding: 12px; background: var(--cqs-soft); border-radius: 10px; }
.cqs-result-grid small { color: var(--cqs-muted); }
.cqs-review-item { padding: 18px 0; border-top: 1px solid #edf0f5; }
.cqs-review-item.is-correct { padding-left: 12px; border-left: 4px solid #12b76a; }
.cqs-review-item.is-wrong { padding-left: 12px; border-left: 4px solid #f04438; }
.cqs-explanation { padding: 12px; background: #eef6ff; border-radius: 10px; }

.cqs-leaderboard-head { padding: 18px 20px; }
.cqs-front-podium { display: flex; align-items: flex-end; justify-content: center; gap: 14px; margin: 20px 0 26px; }
.cqs-front-podium > div { display: flex; width: 150px; min-height: 160px; flex-direction: column; align-items: center; justify-content: center; padding: 14px; background: #fff; border: 1px solid #dce5ef; border-radius: 17px; box-shadow: 0 10px 25px rgba(15, 23, 42, .07); text-align: center; }
.cqs-front-podium .p1 { min-height: 205px; border-color: #f5b942; }
.cqs-front-podium span { font-size: 30px; }
.cqs-front-podium b { font-size: 28px; }
.cqs-front-podium small { color: var(--cqs-muted); }
.cqs-public-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cqs-public-table { width: 100%; border-collapse: collapse; }
.cqs-public-table th,
.cqs-public-table td { padding: 13px 11px; border-bottom: 1px solid #e7edf3; text-align: left; vertical-align: middle; }
.cqs-public-table th { color: var(--cqs-muted); font-size: 12px; white-space: nowrap; }
.cqs-public-table tr.is-me td { background: #edf4ff; }
.cqs-mini-tank { width: 100%; min-width: 90px; height: 6px; overflow: hidden; margin-top: 5px; background: #e8edf4; border-radius: 999px; }
.cqs-mini-tank span { display: block; height: 100%; background: var(--cqs-primary); }

.cqs-wallet { max-width: 760px; margin: 6px auto 0; padding: 28px; color: #fff; background: var(--cqs-primary); box-shadow: 0 16px 34px color-mix(in srgb, var(--cqs-primary) 23%, transparent); }
.cqs-wallet > small { font-weight: 800; }
.cqs-wallet > strong { display: block; margin: 4px 0; font-size: clamp(48px, 8vw, 64px); line-height: 1; }
.cqs-tank { height: 20px; overflow: hidden; margin: 22px 0; background: rgba(255, 255, 255, .28); border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; }
.cqs-tank span { display: block; height: 100%; background: #facc15; }
.cqs-wallet .cqs-public-btn.alt { color: var(--cqs-primary); background: #fff; border-color: #fff; }
.cqs-stats-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.cqs-stats-mini span { display: grid; min-height: 82px; place-items: center; align-content: center; padding: 12px 8px; background: var(--cqs-soft); border: 1px solid #e8edf3; border-radius: 12px; text-align: center; }
.cqs-stats-mini b { font-size: 16px; }

.cqs-copy { display: flex; flex-wrap: wrap; gap: 8px; }
.cqs-copy input { min-width: 220px; flex: 1 1 300px; }
.cqs-copy button { flex: 0 0 auto; white-space: nowrap; }
.cqs-copy button:disabled { cursor: not-allowed; opacity: .45; }

/* Ads and certificate */
.cqs-sponsored { display: inline-flex; padding: 5px 9px; color: #8d5d0a; background: #fff7e8; border: 1px solid #f1ae35; border-radius: 999px; font-weight: 800; }
.cqs-sponsored-card { max-width: 760px; }
.cqs-sponsored-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cqs-sponsored-head small,
.cqs-ad-countdown { color: var(--cqs-muted); font-weight: 600; }
.cqs-ad-countdown b { display: inline-grid; min-width: 34px; place-items: center; padding: 4px 8px; color: var(--cqs-primary); background: #eef4ff; border-radius: 999px; }
.cqs-ad-box { display: grid; height: 260px; place-items: center; margin: 14px 0; overflow: hidden; color: #fff; background: #111827; border-radius: 14px; }
.cqs-ad-media { max-width: 100%; max-height: 240px; object-fit: contain; }
.cqs-ad-video { width: min(100%, 720px); max-height: 360px; background: #000; border-radius: 12px; }
.cqs-ad-link { display: inline-block; margin: 0 0 12px; }
.cqs-certificate { padding: 42px; background: #fff; border: 8px double #c9a227; text-align: center; }
.cqs-no-print { margin-top: 20px; }

@media (max-width: 1024px) {
  .cqs-student-shell { grid-template-columns: 205px minmax(0, 1fr); }
  .cqs-student-main { padding-right: 18px; padding-left: 18px; }
  .cqs-attempt { grid-template-columns: minmax(0, 1fr) 230px; }
  .cqs-page-header h2 { font-size: 30px; }
}

/* Phone/tablet app layout */
@media (max-width: 800px) {
  .cqs-public {
    width: 100vw;
    max-width: 100vw;
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
    padding: 0;
    background: #f5f8fc;
    border-radius: 0;
  }
  .cqs-student-shell { display: block; min-height: 100dvh; padding-bottom: 76px; background: #f7f9fc; border: 0; border-radius: 0; box-shadow: none; }
  .cqs-student-side { display: none; }
  .cqs-student-main { padding: 0 12px 22px; }
  .cqs-mobile-appbar { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -12px; padding: 9px 12px; background: #fff; border-bottom: 1px solid var(--cqs-border); }
  .cqs-mobile-brand { min-width: 0; font-size: 14px; font-weight: 800; }
  .cqs-mobile-brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cqs-mobile-brand .cqs-brand-mark { flex-basis: 40px; width: 40px; height: 40px; border-radius: 10px; }
  .cqs-mobile-account > span { display: grid; width: 38px; height: 38px; place-items: center; color: #fff; background: var(--cqs-primary); border-radius: 50%; font-weight: 800; }
  .cqs-mobile-account > a { display: inline-flex; min-height: 42px; align-items: center; padding: 6px 12px; border: 1px solid #d7e3f4; border-radius: 999px; font-weight: 800; text-decoration: none; }
  .cqs-page-header { min-height: auto; padding: 18px 0 14px; }
  .cqs-page-kicker,
  .cqs-student-user { display: none; }
  .cqs-page-header h2 { font-size: clamp(24px, 7.5vw, 31px); line-height: 1.17; }
  .cqs-page-body { padding-top: 14px; }
  .cqs-mobile-bottom-nav { position: fixed; z-index: 900; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); min-height: 66px; padding: 5px max(5px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(5px, env(safe-area-inset-left)); background: rgba(255, 255, 255, .97); border-top: 1px solid #dce4ee; box-shadow: 0 -8px 24px rgba(15, 23, 42, .08); }
  .cqs-mobile-bottom-nav a { display: flex; min-width: 0; min-height: 54px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px; color: #667085; border-radius: 9px; font-size: 10px; font-weight: 700; line-height: 1.1; text-decoration: none; }
  .cqs-mobile-bottom-nav a.is-active { color: var(--cqs-primary); background: #edf4ff; }
  .cqs-mobile-bottom-nav .cqs-nav-icon svg { width: 21px; height: 21px; }
  .cqs-public-grid,
  .cqs-result-card { grid-template-columns: 1fr; }
  .cqs-public-grid { gap: 12px; }
  .cqs-public-grid > article { min-height: 220px; }
  .cqs-public-grid > article,
  .cqs-public-card,
  .cqs-center-card,
  .cqs-result-card,
  .cqs-wallet,
  .cqs-attempt > section,
  .cqs-attempt > aside { padding: 16px; border-radius: 14px; box-shadow: 0 5px 15px rgba(15, 23, 42, .04); }
  .cqs-hero { margin: 0 0 14px; padding: 22px 16px; border-radius: 14px; }
  .cqs-hero h3 { font-size: 25px; }
  .cqs-hero p { margin-bottom: 16px; }
  .cqs-center-card { margin: 6px auto; }
  .cqs-public button,
  .cqs-public-btn { min-height: 48px; }
  .cqs-detail-list p { align-items: flex-start; padding: 13px 0; }
  .cqs-login-actions { align-items: stretch; flex-direction: column-reverse; }
  .cqs-login-actions button { width: 100%; }
  .cqs-result-grid,
  .cqs-stats-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cqs-front-podium { gap: 7px; margin: 14px 0 20px; }
  .cqs-front-podium > div { width: 31.5%; min-height: 140px; padding: 8px 5px; }
  .cqs-front-podium .p1 { min-height: 178px; }
  .cqs-front-podium strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cqs-front-podium span { font-size: 25px; }
  .cqs-front-podium b { font-size: 23px; }
  .cqs-public-card:has(.cqs-public-table) { overflow: hidden; padding-right: 0; padding-left: 0; }
  .cqs-public-card:has(.cqs-public-table) > h3,
  .cqs-public-card:has(.cqs-public-table) > p { padding-right: 16px; padding-left: 16px; }
  .cqs-public-table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cqs-public-table th,
  .cqs-public-table td { min-width: 110px; white-space: nowrap; }
  .cqs-public-table th:first-child,
  .cqs-public-table td:first-child { padding-left: 16px; }
  .cqs-public-table th:last-child,
  .cqs-public-table td:last-child { padding-right: 16px; }
  .cqs-wallet { margin: 0; }
  .cqs-wallet > strong { font-size: 52px; }
  .cqs-copy { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cqs-copy input { min-width: 0; grid-column: 1 / -1; }
  .cqs-copy button { width: 100%; }
  .cqs-sponsored-head { align-items: flex-start; flex-direction: column; }

  /* Mobile quiz attempt: full width, sticky action bar and palette sheet. */
  .cqs-screen-attempt .cqs-student-shell { padding-bottom: 92px; }
  .cqs-screen-attempt .cqs-page-header { padding-bottom: 10px; }
  .cqs-screen-attempt .cqs-page-header h2 { font-size: 22px; }
  .cqs-attempt { display: block; margin: 0 -12px; }
  .cqs-attempt > section { padding: 15px 12px 90px; border-right: 0; border-left: 0; border-radius: 0; box-shadow: none; }
  .cqs-question-head { position: sticky; z-index: 20; top: 0; margin: -15px -12px 0; padding: 11px 12px; background: rgba(255, 255, 255, .98); border-bottom: 1px solid #e5ebf2; }
  .cqs-attempt section > h3 { margin-top: 18px; font-size: 20px; }
  .cqs-option { min-height: 58px; padding: 13px 12px; }
  .cqs-option-content { align-items: flex-start; flex-direction: column; }
  .cqs-option-image { width: 100%; height: auto; max-height: 190px; }
  .cqs-attempt-actions { position: fixed; z-index: 850; right: 0; bottom: calc(66px + env(safe-area-inset-bottom)); left: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 8px 12px; background: rgba(255, 255, 255, .98); border-top: 1px solid #dce4ee; box-shadow: 0 -7px 20px rgba(15, 23, 42, .08); }
  .cqs-attempt-actions .cqs-review-toggle { grid-column: 1 / -1; min-height: 34px; margin: 0; font-size: 13px; }
  .cqs-attempt-actions > .cqs-public-btn { width: 100%; padding-right: 10px; padding-left: 10px; }
  [data-cqs-save-status] { position: fixed; z-index: 851; right: 12px; bottom: calc(154px + env(safe-area-inset-bottom)); min-height: 0; padding: 3px 8px; background: #fff; border-radius: 999px; box-shadow: 0 3px 9px rgba(15, 23, 42, .08); }
  .cqs-palette-toggle { display: inline-flex !important; min-height: 44px !important; margin: 10px 0 2px; color: var(--cqs-primary) !important; background: #fff !important; box-shadow: none !important; }
  .cqs-attempt > aside { position: fixed; z-index: 1002; right: 0; bottom: 0; left: 0; display: block; max-height: min(72dvh, 620px); padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; border-radius: 20px 20px 0 0; box-shadow: 0 -18px 45px rgba(15, 23, 42, .2); transform: translateY(105%); transition: transform .22s ease; }
  .cqs-attempt > aside.is-open { transform: translateY(0); }
  .cqs-palette-close { position: absolute; top: 10px; right: 12px; display: inline-grid !important; width: 44px; min-height: 44px !important; place-items: center; padding: 0 !important; color: var(--cqs-text) !important; background: #f2f5f9 !important; border-color: #e2e8f0 !important; border-radius: 50% !important; box-shadow: none !important; font-size: 23px !important; }
  .cqs-attempt > aside h3 { margin: 4px 52px 18px 0; }
  .cqs-palette { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .cqs-palette a,
  .cqs-palette span { min-height: 44px; }
  .cqs-palette-backdrop { position: fixed; z-index: 1001; inset: 0; display: block !important; min-height: 0 !important; visibility: hidden; padding: 0 !important; background: rgba(15, 23, 42, .48) !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; opacity: 0; transition: opacity .2s ease, visibility .2s ease; }
  .cqs-palette-backdrop.is-open { visibility: visible; opacity: 1; }
  body.cqs-palette-open { overflow: hidden; }
  .cqs-order-builder label,
  .cqs-match-builder label { grid-template-columns: 1fr; gap: 5px; }
}

@media (max-width: 420px) {
  .cqs-page-header h2 { font-size: 25px; }
  .cqs-public-grid > article { min-height: 0; }
  .cqs-public-grid h3,
  .cqs-public-card h3 { font-size: 22px; }
  .cqs-front-podium > div { min-height: 128px; font-size: 12px; }
  .cqs-front-podium .p1 { min-height: 160px; }
  .cqs-stats-mini { gap: 8px; }
  .cqs-stats-mini span { min-height: 76px; padding: 8px 5px; }
  .cqs-result-grid { grid-template-columns: 1fr 1fr; }
  .cqs-copy { grid-template-columns: 1fr; }
  .cqs-copy input { grid-column: auto; }
  .cqs-palette { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 340px) {
  .cqs-student-main { padding-right: 10px; padding-left: 10px; }
  .cqs-mobile-appbar { margin-right: -10px; margin-left: -10px; padding-right: 10px; padding-left: 10px; }
  .cqs-mobile-bottom-nav a { font-size: 9px; }
  .cqs-mobile-bottom-nav .cqs-nav-icon svg { width: 19px; height: 19px; }
  .cqs-attempt { margin-right: -10px; margin-left: -10px; }
  .cqs-front-podium { gap: 4px; }
  .cqs-front-podium > div { width: 32%; padding-right: 3px; padding-left: 3px; }
}

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

@media print {
  .cqs-student-side,
  .cqs-mobile-appbar,
  .cqs-mobile-bottom-nav,
  .cqs-page-header,
  .cqs-no-print { display: none !important; }
  .cqs-public,
  .cqs-student-shell,
  .cqs-student-main { display: block; width: 100%; min-height: 0; padding: 0; background: #fff; border: 0; box-shadow: none; }
}
