/* ============================================================
   QUIZ — "Selection Quiz" (v2, 19 Aug 2026)
   Light, clean, educational. Matches site theme (theme.css):
   blue #0b5cd6 primary, green #16a34a success, Inter, soft surfaces.
   Screens: hub -> category -> topic (language + set pick) -> player -> result
   ============================================================ */

:root {
  --qz-blue: #0b5cd6;  --qz-blue-d: #0846a8;  --qz-blue-s: #eaf1fd;
  --qz-green: #16a34a; --qz-green-d: #15803d; --qz-green-s: #ecfdf3;
  --qz-amber: #d97706; --qz-amber-s: #fff7e6;
  --qz-red: #dc2626;   --qz-red-s: #fef2f2;
  --qz-ink: #1e293b;   --qz-muted: #64748b;  --qz-line: #e6edf6;
  --qz-bg: #f7fafd;    --qz-card: #ffffff;
  --qz-r: 16px;        --qz-r-sm: 10px;
  --qz-sh: 0 1px 2px rgba(15,23,42,.04), 0 4px 14px rgba(15,23,42,.05);
  --qz-sh-md: 0 10px 28px rgba(15,23,42,.08);
  --qz-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.qz-page { background: var(--qz-bg); padding-bottom: 64px; font-family: var(--qz-font); color: var(--qz-ink); }
.qz-page * { font-family: var(--qz-font); }
.qz-wrap { max-width: 1140px; margin: 0 auto; padding: 0 18px; }
.qz-narrow { max-width: 860px; }

/* ---------- Hero (light, soft gradient) ---------- */
.qz-hero {
  background: linear-gradient(135deg, #eef4ff 0%, #eafaf1 100%);
  border-bottom: 1px solid var(--qz-line);
  padding: 36px 0 30px;
}
.qz-crumbs { font-size: .82rem; color: var(--qz-muted); margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qz-crumbs a { color: var(--qz-blue); text-decoration: none; font-weight: 500; }
.qz-crumbs a:hover { text-decoration: underline; }
.qz-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--qz-line); color: var(--qz-blue);
  border-radius: 999px; padding: 5px 12px; font-size: .76rem; font-weight: 700;
  letter-spacing: .3px; text-transform: uppercase; margin-bottom: 14px; box-shadow: var(--qz-sh);
}
.qz-hero h1 { font-size: clamp(1.55rem, 3.6vw, 2.3rem); line-height: 1.2; margin: 0 0 10px; font-weight: 800; letter-spacing: -.02em; color: var(--qz-ink); }
.qz-hero .qz-sub { font-size: 1rem; color: #475569; max-width: 700px; margin: 0; line-height: 1.6; }
.qz-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.qz-stat { background: #fff; border: 1px solid var(--qz-line); border-radius: 12px; padding: 10px 16px; min-width: 110px; box-shadow: var(--qz-sh); }
.qz-stat b { display: block; font-size: 1.25rem; font-weight: 800; color: var(--qz-blue); line-height: 1.1; }
.qz-stat span { font-size: .72rem; color: var(--qz-muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }

/* ---------- Sections ---------- */
.qz-sec { padding-top: 30px; }
.qz-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.qz-sec-head h2 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; color: var(--qz-ink); }
.qz-sec-head p  { margin: 3px 0 0; color: var(--qz-muted); font-size: .9rem; }
.qz-more { font-size: .86rem; font-weight: 700; color: var(--qz-blue); text-decoration: none; white-space: nowrap; }
.qz-more:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.qz-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--qz-r-sm); padding: 10px 16px;
  font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; text-decoration: none;
  white-space: nowrap; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; line-height: 1.2;
}
.qz-btn-p { background: var(--qz-blue); color: #fff; box-shadow: 0 6px 16px rgba(11,92,214,.22); }
.qz-btn-p:hover { background: var(--qz-blue-d); color: #fff; transform: translateY(-1px); }
.qz-btn-s { background: var(--qz-green); color: #fff; box-shadow: 0 6px 16px rgba(22,163,74,.22); }
.qz-btn-s:hover { background: var(--qz-green-d); color: #fff; transform: translateY(-1px); }
.qz-btn-g { background: #fff; color: var(--qz-ink); border-color: var(--qz-line); }
.qz-btn-g:hover { background: #f8fafc; border-color: #cbd5e1; }
.qz-btn-lg { padding: 14px 24px; font-size: 1rem; border-radius: 12px; }
.qz-btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ---------- Cards ---------- */
.qz-card { background: var(--qz-card); border: 1px solid var(--qz-line); border-radius: var(--qz-r); box-shadow: var(--qz-sh); }

/* ---------- Category grid (hub) ---------- */
.qz-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.qz-cat {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: var(--qz-card); border: 1px solid var(--qz-line); border-radius: var(--qz-r);
  text-decoration: none; color: var(--qz-ink); box-shadow: var(--qz-sh);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.qz-cat:hover { transform: translateY(-3px); box-shadow: var(--qz-sh-md); border-color: color-mix(in srgb, var(--cat-accent, var(--qz-blue)) 45%, #fff); }
.qz-cat-ico { width: 48px; height: 48px; border-radius: 14px; flex: 0 0 48px; display: grid; place-items: center; font-size: 1.45rem; background: color-mix(in srgb, var(--cat-accent, var(--qz-blue)) 12%, #fff); }
.qz-cat-body { min-width: 0; }
.qz-cat-body b { display: block; font-size: .98rem; font-weight: 700; line-height: 1.25; }
.qz-cat-body small { display: block; color: var(--qz-muted); font-size: .78rem; margin-top: 3px; line-height: 1.3; }
.qz-cat-meta { margin-top: 6px; font-size: .74rem; font-weight: 700; color: var(--cat-accent, var(--qz-blue)); }

/* ---------- Latest strip (hub) ---------- */
.qz-latest { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.qz-lcard { background: var(--qz-card); border: 1px solid var(--qz-line); border-radius: var(--qz-r); padding: 18px; box-shadow: var(--qz-sh); display: flex; flex-direction: column; gap: 10px; transition: transform .15s, box-shadow .15s; }
.qz-lcard:hover { transform: translateY(-3px); box-shadow: var(--qz-sh-md); }
.qz-chip { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; padding: 4px 10px; border-radius: 999px; color: var(--cat-accent, var(--qz-blue)); background: color-mix(in srgb, var(--cat-accent, var(--qz-blue)) 12%, #fff); }
.qz-lcard h3 { margin: 0; font-size: 1.02rem; line-height: 1.35; font-weight: 700; }
.qz-lcard h3 a { color: var(--qz-ink); text-decoration: none; }
.qz-lcard h3 a:hover { color: var(--qz-blue); }
.qz-meta { font-size: .8rem; color: var(--qz-muted); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.qz-meta span::before { content: '\00B7'; margin-right: 6px; color: #cbd5e1; }
.qz-meta span:first-child::before { content: none; margin: 0; }
.qz-lcard .qz-btn { margin-top: auto; align-self: flex-start; }
.qz-lang-tag { display: inline-block; font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--qz-blue-s); color: var(--qz-blue); letter-spacing: .3px; }
.qz-lang-tag::before { content: none !important; }
.qz-tag-new { background: var(--qz-green-s); color: var(--qz-green); font-weight: 800; padding: 2px 8px; border-radius: 999px; font-size: .68rem; }
.qz-tag-new::before { content: none !important; }

/* ---------- How it works strip ---------- */
.qz-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.qz-steps li { background: var(--qz-card); border: 1px solid var(--qz-line); border-radius: var(--qz-r); padding: 16px; box-shadow: var(--qz-sh); display: flex; gap: 12px; align-items: flex-start; }
.qz-steps .n { width: 30px; height: 30px; border-radius: 9px; background: var(--qz-blue-s); color: var(--qz-blue); font-weight: 800; display: grid; place-items: center; flex: 0 0 30px; font-size: .9rem; }
.qz-steps b { display: block; font-size: .92rem; font-weight: 700; margin-bottom: 2px; }
.qz-steps span { font-size: .82rem; color: var(--qz-muted); line-height: 1.45; }

/* ---------- Category page: toolbar + topic list ---------- */
.qz-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--qz-card); border: 1px solid var(--qz-line); border-radius: var(--qz-r); padding: 12px 14px; margin-top: 22px; box-shadow: var(--qz-sh); }
.qz-search { flex: 1 1 260px; display: flex; gap: 8px; }
.qz-search input { flex: 1; min-width: 0; border: 1px solid var(--qz-line); border-radius: var(--qz-r-sm); padding: 11px 14px; font: inherit; font-size: .95rem; background: #fafbfe; }
.qz-search input:focus { outline: 3px solid rgba(11,92,214,.25); border-color: var(--qz-blue); background: #fff; }
.qz-search button { border: 0; border-radius: var(--qz-r-sm); padding: 0 18px; font: inherit; font-weight: 700; cursor: pointer; background: var(--qz-blue); color: #fff; }
.qz-search button:hover { background: var(--qz-blue-d); }
.qz-count { color: var(--qz-muted); font-size: .86rem; white-space: nowrap; }

.qz-topics { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.qz-topic { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--qz-card); border: 1px solid var(--qz-line); border-radius: var(--qz-r); padding: 14px 16px; box-shadow: var(--qz-sh); transition: border-color .15s, box-shadow .15s, transform .15s; }
.qz-topic:hover { border-color: #cbd5e1; box-shadow: var(--qz-sh-md); transform: translateY(-1px); }
.qz-topic-no { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: .9rem; color: var(--qz-blue); background: var(--qz-blue-s); }
.qz-topic-body { min-width: 0; }
.qz-topic-body h3 { margin: 0 0 5px; font-size: 1rem; font-weight: 700; line-height: 1.35; }
.qz-topic-body h3 a { color: var(--qz-ink); text-decoration: none; }
.qz-topic-body h3 a:hover { color: var(--qz-blue); }

.qz-empty { text-align: center; padding: 48px 20px; color: var(--qz-muted); background: var(--qz-card); border: 1px dashed #cbd5e1; border-radius: var(--qz-r); margin-top: 16px; }
.qz-empty b { display: block; color: var(--qz-ink); font-size: 1.05rem; margin-bottom: 6px; }
.qz-empty a { color: var(--qz-blue); font-weight: 600; }

/* ---------- Ads ---------- */
.qz-ad { margin: 22px 0; text-align: center; }
.qz-ad .ad-live-wrap { margin: 0 !important; }

/* ---------- Topic hero extras ---------- */
.qz-hero-topic { padding-bottom: 26px; }
.qz-hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: .86rem; color: var(--qz-muted); align-items: center; }
.qz-hero-meta b { color: var(--qz-ink); font-weight: 800; }
.qz-preview-note { background: var(--qz-amber-s); border: 1px solid #fcd34d; border-radius: 10px; padding: 10px 14px; margin-top: 14px; font-weight: 600; text-align: center; font-size: .9rem; }

/* ---------- 2-column grid: test (left) + navigator/ad (right) ---------- */
.qz-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; margin-top: 22px; }
.qz-main { min-width: 0; }
.qz-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 16px; }
.qz-ad-side { margin: 0; }
.qz-h2 { margin: 22px 0 0; font-size: 1.2rem; font-weight: 800; }
.qz-h4-sm { margin: 14px 0 8px; font-size: .74rem; text-transform: uppercase; letter-spacing: .5px; color: var(--qz-muted); font-weight: 800; }

/* Sidebar state: navigator only while playing; About card otherwise */
#qz-palette { display: none; }
.qz-playing #qz-palette { display: block; }
.qz-playing #qz-about { display: none; }
.qz-done #qz-palette { display: none; }
.qz-done #qz-about { display: block; }

/* ---------- Setup card ---------- */
.qz-setup { padding: 24px; }
.qz-setup h2 { margin: 0 0 4px; font-size: 1.15rem; font-weight: 800; }
.qz-hint { color: var(--qz-muted); font-size: .88rem; margin: 0 0 16px; line-height: 1.55; }
.qz-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 0 0 20px; padding: 0; list-style: none; }
.qz-facts li { background: #f8fafc; border: 1px solid var(--qz-line); border-radius: 12px; padding: 12px; font-size: .78rem; color: var(--qz-muted); }
.qz-facts li b { display: block; color: var(--qz-ink); font-size: 1.05rem; font-weight: 800; margin-bottom: 2px; }
.qz-lbl { display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--qz-muted); margin: 0 0 8px; }
.qz-langs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; max-width: 440px; }
.qz-lang { border: 2px solid var(--qz-line); border-radius: 12px; background: #fff; padding: 12px 14px; cursor: pointer; text-align: left; font: inherit; color: var(--qz-ink); display: flex; gap: 10px; align-items: center; transition: border-color .12s, background .12s; }
.qz-lang:hover { border-color: #cbd5e1; }
.qz-lang.on { border-color: var(--qz-blue); background: var(--qz-blue-s); }
.qz-lang .r { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #cbd5e1; flex: 0 0 18px; position: relative; }
.qz-lang.on .r { border-color: var(--qz-blue); }
.qz-lang.on .r::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--qz-blue); }
.qz-lang b { display: block; font-size: .95rem; font-weight: 800; }
.qz-lang small { display: block; font-size: .76rem; color: var(--qz-muted); }
.qz-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.qz-set { border: 2px solid var(--qz-line); border-radius: 12px; background: #fff; padding: 12px 14px; cursor: pointer; text-align: left; font: inherit; color: var(--qz-ink); transition: border-color .12s, background .12s; }
.qz-set:hover { border-color: #cbd5e1; }
.qz-set.on { border-color: var(--qz-green); background: var(--qz-green-s); }
.qz-set b { display: block; font-size: .95rem; font-weight: 800; }
.qz-set small { color: var(--qz-muted); font-size: .76rem; }
.qz-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.qz-setup-note { margin: 16px 0 0; font-size: .83rem; color: var(--qz-muted); line-height: 1.6; }
kbd { display: inline-block; font-family: inherit; font-size: .74rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; border: 1px solid #cbd5e1; background: #fff; color: #475569; box-shadow: 0 1px 0 #cbd5e1; line-height: 1.4; }

/* ---------- SEO question index ---------- */
.qz-qindex { padding: 22px 24px; margin-top: 18px; }
.qz-qindex h2 { margin: 0 0 4px; font-size: 1.1rem; font-weight: 800; }
.qz-qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.qz-qlist li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; font-size: .93rem; line-height: 1.55; color: #334155; padding: 8px 0; border-bottom: 1px dashed var(--qz-line); }
.qz-qlist li:last-child { border-bottom: 0; }
.qz-qlist-n { width: 26px; height: 26px; border-radius: 8px; background: var(--qz-blue-s); color: var(--qz-blue); font-weight: 800; font-size: .76rem; display: grid; place-items: center; }
.qz-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.qz-tags span { font-size: .74rem; font-weight: 600; color: #475569; background: #f1f5f9; border-radius: 999px; padding: 3px 10px; }

/* Exam tag — red, in brackets, after question text (book style) */
.qz-asked { color: var(--qz-red); font-weight: 700; font-size: .84em; white-space: normal; }

/* ---------- About card (sidebar) ---------- */
.qz-about { padding: 18px; }
.qz-about h4, .qz-palette h4 { margin: 0 0 10px; font-size: .74rem; text-transform: uppercase; letter-spacing: .5px; color: var(--qz-muted); font-weight: 800; }
.qz-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: .88rem; }
.qz-dl dt { color: var(--qz-muted); font-weight: 600; }
.qz-dl dd { margin: 0; color: var(--qz-ink); font-weight: 600; }
.qz-dl dd a { color: var(--qz-blue); text-decoration: none; }
.qz-exam-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qz-exam-chips span { font-size: .74rem; font-weight: 700; color: var(--qz-red); background: var(--qz-red-s); border: 1px solid #fecaca; border-radius: 999px; padding: 3px 10px; }

/* ---------- PLAYER ---------- */
.qz-player { display: none; }
.qz-player.on { display: block; }
.qz-playing .qz-setup-wrap { display: none; }
.qz-qcard-wrap { overflow: visible; }
.qz-nav { border-radius: 0 0 var(--qz-r) var(--qz-r); }
.qz-pbar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--qz-line); background: #fbfcfe; border-radius: var(--qz-r) var(--qz-r) 0 0; }
.qz-pno { font-weight: 800; font-size: .92rem; white-space: nowrap; }
.qz-pno small { color: var(--qz-muted); font-weight: 600; }
.qz-progress { flex: 1; height: 8px; background: #e9eef6; border-radius: 999px; overflow: hidden; }
.qz-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--qz-blue), var(--qz-green)); transition: width .3s ease; border-radius: 999px; }
.qz-timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: .92rem; background: #eef2f7; border-radius: 10px; padding: 6px 12px; white-space: nowrap; min-width: 76px; text-align: center; }
.qz-timer.warn { background: var(--qz-amber-s); color: var(--qz-amber); }
.qz-timer.danger { background: var(--qz-red-s); color: var(--qz-red); animation: qzPulse 1s infinite; }
@keyframes qzPulse { 50% { transform: scale(1.05); } }

.qz-qcard { padding: 24px 26px 8px; min-height: 260px; }
.qz-qtext { font-size: 1.15rem; line-height: 1.65; font-weight: 600; margin: 0 0 20px; color: var(--qz-ink); }
.qz-qtext .qz-qn { color: var(--qz-blue); font-weight: 800; margin-right: 8px; }
.qz-opts { display: grid; gap: 10px; }
.qz-opt { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: center; border: 1.5px solid var(--qz-line); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: #fff; text-align: left; font: inherit; font-size: 1rem; color: var(--qz-ink); line-height: 1.5; transition: border-color .12s, background .12s, transform .08s, box-shadow .12s; }
.qz-opt:hover { border-color: #94a3b8; background: #fafbfe; }
.qz-opt:active { transform: scale(.995); }
.qz-opt .qz-ok { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; background: #f1f5f9; color: #475569; font-size: .88rem; transition: background .12s, color .12s; }
.qz-opt.sel { border-color: var(--qz-blue); background: var(--qz-blue-s); box-shadow: 0 0 0 3px rgba(11,92,214,.12); }
.qz-opt.sel .qz-ok { background: var(--qz-blue); color: #fff; }
.qz-nav { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 14px 18px 18px; flex-wrap: wrap; }
.qz-nav .qz-right { display: flex; gap: 10px; margin-left: auto; }

/* Navigator (sidebar) */
.qz-palette { padding: 16px 18px; }
.qz-pal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.qz-pal-count { font-size: .78rem; color: var(--qz-muted); font-weight: 600; white-space: nowrap; }
.qz-pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; }
.qz-pal { height: 40px; border-radius: 10px; border: 1.5px solid var(--qz-line); background: #fff; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; color: var(--qz-ink); transition: all .12s; }
.qz-pal:hover { border-color: #94a3b8; }
.qz-pal.cur { border-color: var(--qz-blue); box-shadow: 0 0 0 3px rgba(11,92,214,.22); }
.qz-pal.done { background: var(--qz-blue); color: #fff; border-color: var(--qz-blue); }
.qz-pal.skip { background: var(--qz-amber-s); border-color: #fcd34d; color: var(--qz-amber); }
.qz-pal-legend { display: flex; gap: 10px 14px; margin: 12px 0 14px; font-size: .74rem; color: var(--qz-muted); flex-wrap: wrap; }
.qz-pal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 5px; border: 1px solid var(--qz-line); }
.qz-pal-legend .l-done i { background: var(--qz-blue); border-color: var(--qz-blue); }
.qz-pal-legend .l-skip i { background: var(--qz-amber-s); border-color: #fcd34d; }
.qz-pal-legend .l-cur i { box-shadow: 0 0 0 2px rgba(11,92,214,.3); border-color: var(--qz-blue); }
.qz-btn-block { width: 100%; }

/* ---------- RESULT ---------- */
.qz-result { display: none; }
.qz-result.on { display: block; }
.qz-rcard { padding: 30px 24px; text-align: center; }
.qz-ring { width: 156px; height: 156px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: conic-gradient(var(--qz-green) calc(var(--pct) * 1%), #e5e9f0 0); }
.qz-ring > div { width: 122px; height: 122px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.qz-ring b { font-size: 2rem; font-weight: 800; line-height: 1; }
.qz-ring small { display: block; color: var(--qz-muted); font-size: .78rem; margin-top: 4px; font-weight: 600; }
.qz-rcard h2 { margin: 4px 0 6px; font-size: 1.4rem; font-weight: 800; }
.qz-rmsg { color: var(--qz-muted); margin: 0 0 18px; }
.qz-rstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 20px; }
.qz-rstat { background: #f8fafc; border: 1px solid var(--qz-line); border-radius: 12px; padding: 12px; }
.qz-rstat b { display: block; font-size: 1.3rem; font-weight: 800; }
.qz-rstat.ok b { color: var(--qz-green); } .qz-rstat.bad b { color: var(--qz-red); } .qz-rstat.skip b { color: var(--qz-amber); }
.qz-rstat span { font-size: .72rem; color: var(--qz-muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.qz-ractions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.qz-review { margin-top: 14px; display: grid; gap: 12px; }
.qz-rv { background: var(--qz-card); border: 1px solid var(--qz-line); border-radius: var(--qz-r); padding: 18px 20px; border-left: 5px solid #cbd5e1; box-shadow: var(--qz-sh); }
.qz-rv.ok { border-left-color: var(--qz-green); } .qz-rv.bad { border-left-color: var(--qz-red); } .qz-rv.skip { border-left-color: #fcd34d; }
.qz-rv-head { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.qz-rv-tag { font-size: .72rem; font-weight: 700; color: var(--qz-blue); background: var(--qz-blue-s); padding: 3px 10px; border-radius: 999px; }
.qz-rv-q { font-weight: 600; line-height: 1.6; margin: 0 0 10px; }
.qz-rv-q .qz-qn { color: var(--qz-blue); font-weight: 800; margin-right: 6px; }
.qz-rv-opts { display: grid; gap: 6px; font-size: .93rem; }
.qz-rv-opts div { padding: 8px 10px; border-radius: 8px; background: #f8fafc; display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; }
.qz-rv-opts div b { min-width: 20px; color: #475569; }
.qz-rv-opts div.right { background: var(--qz-green-s); color: #14532d; }
.qz-rv-opts div.wrong { background: var(--qz-red-s); color: #7f1d1d; }
.qz-rv-exp { margin-top: 10px; font-size: .9rem; color: #334155; background: var(--qz-amber-s); border: 1px solid #fde68a; border-radius: 8px; padding: 10px 12px; line-height: 1.55; }
.qz-rv-exp b { color: #92400e; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .qz-grid { grid-template-columns: minmax(0, 1fr); }
  .qz-side { position: static; }
  .qz-playing .qz-grid { display: flex; flex-direction: column; }
  .qz-playing .qz-side { order: -1; width: 100%; align-self: stretch; }
  .qz-playing .qz-main { width: 100%; }
  .qz-playing .qz-palette { padding: 12px 14px; }
  .qz-playing .qz-pal-grid { grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 6px; }
  .qz-playing .qz-pal { height: 34px; font-size: .82rem; border-radius: 8px; }
  .qz-playing .qz-pal-legend { display: none; }
  .qz-playing .qz-ad-side { display: none; }
}
@media (max-width: 640px) {
  .qz-hero { padding: 26px 0 22px; }
  .qz-topic { grid-template-columns: minmax(0, 1fr); }
  .qz-topic-no { display: none; }
  .qz-topic .qz-btn { width: 100%; }
  .qz-setup { padding: 18px 16px; }
  .qz-qcard { padding: 18px 16px 6px; }
  .qz-qtext { font-size: 1.05rem; }
  .qz-pbar { padding: 10px 12px; gap: 8px; }
  .qz-pno small { display: none; }
  .qz-nav { padding: 12px 14px 14px; }
  .qz-nav .qz-btn { flex: 1; }
  .qz-nav .qz-right { width: 100%; margin-left: 0; }
  .qz-ring { width: 132px; height: 132px; } .qz-ring > div { width: 102px; height: 102px; } .qz-ring b { font-size: 1.7rem; }
  .qz-actions .qz-btn-lg { width: 100%; }
  .qz-qindex { padding: 18px 16px; }
}

/* ---------- Hub hero: small circular avatar (admin: Quiz -> Hero photo) ---------- */
.qz-hero-hub { padding: 36px 0 30px; }
.qz-hub-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: center; }
.qz-hub-grid.no-photo { grid-template-columns: minmax(0, 1fr); }
.qz-hub-photo { display: flex; flex-direction: column; align-items: center; gap: 12px; justify-self: end; }
.qz-avatar { position: relative; width: 200px; height: 200px; }
.qz-avatar-halo {
  position: absolute; inset: -22px; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(99,102,241,.20), rgba(11,92,214,.12) 45%, rgba(22,163,74,.08) 62%, transparent 72%);
  filter: blur(6px); pointer-events: none;
}
.qz-avatar-ring {
  position: relative; z-index: 1; display: block; width: 100%; height: 100%; border-radius: 50%; padding: 5px;
  background: linear-gradient(135deg, #c7d6ff 0%, #ffffff 45%, #d4f5e2 100%);
  box-shadow: 0 10px 30px rgba(15,23,42,.12), 0 0 0 1px rgba(255,255,255,.8) inset;
}
.qz-avatar-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 20%; display: block; background: #eef2f7; }
.qz-avatar-dot {
  position: absolute; z-index: 2; right: 14px; bottom: 12px; width: 22px; height: 22px; border-radius: 50%;
  background: #22c55e; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(15,23,42,.18);
}
.qz-avatar-dot::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid rgba(34,197,94,.45); animation: qzPing 2s ease-out infinite; }
@keyframes qzPing { 0% { transform: scale(.8); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.qz-avatar-name { text-align: center; line-height: 1.25; }
.qz-avatar-name b { display: block; font-size: .95rem; font-weight: 800; color: var(--qz-ink); }
.qz-avatar-name span { font-size: .74rem; color: var(--qz-muted); font-weight: 600; }
@media (max-width: 960px) {
  .qz-hub-grid { grid-template-columns: minmax(0, 1fr) 200px; gap: 18px; }
  .qz-avatar { width: 160px; height: 160px; }
  .qz-avatar-dot { width: 18px; height: 18px; right: 10px; bottom: 9px; }
}
@media (max-width: 640px) {
  .qz-hero-hub { padding: 22px 0 20px; }
  /* Avatar sits top-right next to the kicker/heading; text flows on the left */
  .qz-hub-grid { grid-template-columns: minmax(0, 1fr) 96px; gap: 14px; align-items: start; }
  .qz-hub-photo { gap: 6px; }
  .qz-avatar { width: 88px; height: 88px; }
  .qz-avatar-halo { inset: -10px; filter: blur(4px); }
  .qz-avatar-ring { padding: 3px; }
  .qz-avatar-dot { width: 14px; height: 14px; right: 4px; bottom: 4px; border-width: 2px; }
  .qz-avatar-name b { font-size: .74rem; } .qz-avatar-name span { display: none; }
  .qz-hub-text .qz-stats { grid-column: 1 / -1; }
}
/* ============================================================
   MOBILE POLISH PASS (<= 640px) — 19 Aug 2026
   Compact spacing, 2x2 stat tiles, full-width actions, tidy meta.
   Scrolling behaviour unchanged (nothing new is sticky/fixed).
   ============================================================ */
@media (max-width: 640px) {
  .qz-wrap { padding: 0 14px; }
  /* Hero */
  .qz-hero h1 { font-size: 1.45rem; line-height: 1.25; }
  .qz-hero .qz-sub { font-size: .92rem; }
  .qz-kicker { font-size: .7rem; padding: 4px 10px; margin-bottom: 10px; }
  .qz-crumbs { font-size: .76rem; margin-bottom: 8px; }
  .qz-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
  .qz-stat { min-width: 0; padding: 9px 12px; }
  .qz-stat b { font-size: 1.1rem; }
  .qz-hero-meta { gap: 6px 12px; font-size: .8rem; }
  /* Sections */
  .qz-sec { padding-top: 22px; }
  .qz-sec-head h2 { font-size: 1.1rem; }
  .qz-sec-head p { font-size: .84rem; }
  /* Subject cards: compact 2-col grid */
  .qz-cats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .qz-cat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; }
  .qz-cat-ico { width: 38px; height: 38px; flex-basis: 38px; font-size: 1.15rem; border-radius: 11px; }
  .qz-cat-body b { font-size: .88rem; }
  .qz-cat-body small { font-size: .72rem; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .qz-cat-meta { font-size: .7rem; margin-top: 4px; }
  /* Latest cards + steps */
  .qz-latest { grid-template-columns: 1fr; }
  .qz-lcard { padding: 14px; }
  .qz-lcard .qz-btn { align-self: stretch; }
  .qz-steps { grid-template-columns: 1fr; gap: 8px; }
  .qz-steps li { padding: 12px 14px; }
  /* Category page */
  .qz-toolbar { margin-top: 16px; padding: 10px; }
  .qz-search { flex-basis: 100%; }
  .qz-search input { padding: 10px 12px; font-size: .92rem; }
  .qz-count { width: 100%; font-size: .8rem; }
  .qz-topic { padding: 12px 14px; gap: 10px; }
  .qz-topic-body h3 { font-size: .95rem; }
  .qz-meta { font-size: .76rem; gap: 4px 10px; }
  /* Setup card */
  .qz-setup h2 { font-size: 1.05rem; }
  .qz-facts { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
  .qz-facts li { padding: 10px; font-size: .74rem; }
  .qz-facts li b { font-size: .98rem; }
  .qz-langs { grid-template-columns: 1fr 1fr; max-width: none; gap: 8px; }
  .qz-lang { padding: 10px 12px; }
  .qz-lang b { font-size: .88rem; } .qz-lang small { font-size: .7rem; }
  .qz-sets { grid-template-columns: 1fr 1fr; gap: 8px; }
  .qz-actions { flex-direction: column; align-items: stretch; }
  .qz-actions .qz-btn { width: 100%; }
  .qz-setup-note { font-size: .8rem; }
  /* Question index */
  .qz-qindex h2 { font-size: 1rem; }
  .qz-qlist li { font-size: .88rem; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; }
  /* Player */
  .qz-pbar { border-radius: var(--qz-r) var(--qz-r) 0 0; }
  .qz-pno { font-size: .86rem; }
  .qz-timer { font-size: .86rem; min-width: 68px; padding: 5px 10px; }
  .qz-qcard { min-height: 0; }
  .qz-qtext { font-size: 1.02rem; line-height: 1.6; margin-bottom: 16px; }
  .qz-asked { font-size: .8em; }
  .qz-opt { padding: 11px 12px; font-size: .95rem; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
  .qz-opt .qz-ok { width: 28px; height: 28px; font-size: .8rem; }
  .qz-nav { gap: 8px; }
  .qz-nav .qz-btn { padding: 11px 12px; font-size: .88rem; }
  /* Navigator strip (above question while playing) */
  .qz-playing .qz-palette { padding: 10px 12px; }
  .qz-playing .qz-pal-head h4 { margin-bottom: 8px; }
  .qz-playing .qz-pal-grid { grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); gap: 6px; }
  .qz-playing .qz-pal { height: 32px; font-size: .8rem; }
  .qz-playing #qz-submit { margin-top: 10px; padding: 10px; font-size: .88rem; }
  /* About card + result */
  .qz-about { padding: 14px; }
  .qz-dl { font-size: .84rem; }
  .qz-rcard { padding: 22px 16px; }
  .qz-rcard h2 { font-size: 1.2rem; }
  .qz-rstats { grid-template-columns: 1fr 1fr; }
  .qz-ractions { flex-direction: column; }
  .qz-ractions .qz-btn { width: 100%; }
  .qz-rv { padding: 14px; }
  .qz-rv-q { font-size: .95rem; }
  .qz-rv-opts { font-size: .88rem; }
  .qz-rv-exp { font-size: .85rem; }
  .qz-h2 { font-size: 1.08rem; }
}
@media (max-width: 340px) {
  .qz-cats { grid-template-columns: 1fr; }
  .qz-langs, .qz-sets { grid-template-columns: 1fr; }
}

/* ============================================================
   v6 — admin font scale, hero chips, share button,
   stable nav bar, navigator below question on mobile, review ads
   ============================================================ */
.qz-page { --qz-scale: .95; }
.qz-qtext { font-size: calc(1.15rem * var(--qz-scale)); }
.qz-opt { font-size: calc(1rem * var(--qz-scale)); }
.qz-rv-q { font-size: calc(1rem * var(--qz-scale)); }
.qz-rv-opts { font-size: calc(.93rem * var(--qz-scale)); }
.qz-qlist li { font-size: calc(.93rem * var(--qz-scale)); }

/* Hero chips under avatar (admin: Hero photo -> Highlights) */
.qz-hub-chips { grid-column: 2; justify-self: end; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 260px; margin-top: -6px; }
.qz-hchip { font-size: .72rem; font-weight: 600; color: #334155; background: #fff; border: 1px solid var(--qz-line); border-radius: 999px; padding: 4px 10px; box-shadow: var(--qz-sh); white-space: nowrap; }
.qz-hchip b { color: var(--qz-blue); font-weight: 800; }

/* Share button (hero meta + result) */
.qz-share { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; border: 1px solid var(--qz-line); background: #fff; color: var(--qz-blue); font: inherit; font-size: .82rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; box-shadow: var(--qz-sh); transition: background .12s, border-color .12s; }
.qz-share:hover { background: var(--qz-blue-s); border-color: #bfd3f7; }
.qz-share.copied { background: var(--qz-green-s); color: var(--qz-green); border-color: #bbf7d0; }
.qz-hero-meta { align-items: center; }

/* Stable question card: min-height so Skip / Save & Next do not jump between questions */
.qz-qcard { min-height: 400px; display: flex; flex-direction: column; }
.qz-qcard .qz-opts { margin-top: auto; }
.qz-nav { border-top: 1px solid var(--qz-line); background: #fff; }

/* Review ads */
.qz-rv-ad { margin: 4px 0; text-align: center; }
.qz-rv-ad .adsbygoogle { min-height: 100px; }

@media (max-width: 960px) {
  /* Navigator goes BELOW the question (thumb zone); 5-per-row grid -> 10 Q = 2 rows */
  .qz-playing .qz-side { order: 1; }
  .qz-playing .qz-pal-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .qz-playing .qz-pal { height: 40px; font-size: .9rem; border-radius: 10px; }
  .qz-playing .qz-pal-legend { display: flex; }
  .qz-playing .qz-palette { padding: 14px; }
  .qz-playing #qz-submit { margin-top: 12px; }
}
@media (max-width: 640px) {
  .qz-hub-chips { grid-column: 1 / -1; justify-self: start; justify-content: flex-start; max-width: none; margin-top: -4px; }
  .qz-hchip { font-size: .7rem; padding: 3px 9px; }
  .qz-share span { display: none; }
  .qz-share { padding: 7px 9px; }
  /* Nav bar: normal flow (NOT sticky) - owner's call, 19 Aug. Navigator below stays as is. */
  .qz-qcard { min-height: 300px; }
  .qz-nav { position: static; padding: 12px 14px 14px; box-shadow: none; }
  .qz-nav .qz-btn { flex: 1; padding: 11px 12px; font-size: .88rem; }
  .qz-nav .qz-right { width: 100%; margin-left: 0; }
  .qz-playing .qz-pal-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .qz-playing .qz-pal { height: 42px; font-size: .92rem; }
}
/* Share fallback popover */
.qz-share-pop { display: inline-flex; gap: 6px; margin-left: 8px; background: #fff; border: 1px solid var(--qz-line); border-radius: 999px; padding: 4px; box-shadow: var(--qz-sh-md); vertical-align: middle; }
.qz-share-pop a, .qz-share-pop button { font: inherit; font-size: .76rem; font-weight: 700; color: var(--qz-ink); background: #f8fafc; border: 0; border-radius: 999px; padding: 5px 10px; cursor: pointer; text-decoration: none; }
.qz-share-pop a:hover, .qz-share-pop button:hover { background: var(--qz-blue-s); color: var(--qz-blue); }
