/* Sir Quiz — private custom quizzes (scoped cq-*) */
.cq-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.cq{max-width:1100px;margin:10px auto 70px;padding:0 32px;animation:cqIn .4s ease both}
.cq.play{max-width:780px}
.cq-header{max-width:1100px}
.cq-meta{font-size:12px;color:var(--muted)}
.cq-fine{font-size:13px;line-height:1.6;color:var(--muted);margin:6px 0 14px}
.cq-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.cq-alert{font-size:14px;line-height:1.6;color:#8a4a1c;background:#fff0df;border:1px solid #f1d2ad;border-radius:14px;padding:13px 17px;margin:0 0 18px}
.cq-alert p{margin:0 0 10px}.cq-alert p:only-child{margin:0}
.cq-alert-error{color:#9a3426;background:#ffeeea;border-color:#f3c4b9}
.cq-conflict{background:#fff8da;border-color:#ecdfaa;color:#5b3d10}
.cq-chip{display:inline-flex;align-items:center;border-radius:20px;padding:5px 10px;font-size:11px;font-weight:800;letter-spacing:.4px;text-transform:uppercase;background:#eee4ff;color:#5633b8}
.cq-easy{background:#e2f3e9;color:#256b46}.cq-medium{background:#fff0d5;color:#875211}.cq-hard{background:#ffe9e6;color:#a13a2e}
.cq-ai{background:#fff8da;color:#79511b;border:1px solid #ecdfaa}

/* Compact homepage access and library empty state */
.cq-create-shortcut{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:50px;white-space:nowrap}
.cq-create-shortcut svg{width:19px;height:19px;flex-shrink:0}
.cq-empty-mark{flex-shrink:0;width:58px;height:58px;border-radius:17px;background:#5633b8;color:#ffdc68;display:grid;place-items:center;transform:rotate(-6deg)}
.cq-empty-mark svg{width:32px;height:32px}
@media(max-width:600px){.cq-create-shortcut{min-height:45px}}

/* library */
.cq-hero{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin:10px 0 28px}
.cq-hero h1{font-size:clamp(30px,4vw,46px);outline:0}.cq-hero p:not(.eyebrow){color:var(--muted);max-width:560px;line-height:1.65;margin:0;font-size:15px}
.cq-hero-side{display:flex;flex-direction:column;align-items:flex-end;gap:8px;flex-shrink:0}
.cq-create{background:#ffdc68;color:#3f285d;border-color:#3e226e;box-shadow:0 3px 0 #372258;padding:14px 26px}.cq-create:hover{background:#ffe68e}
.cq-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px}
.cq-card{background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:0 3px 0 #eee6f7;padding:22px;display:flex;flex-direction:column;transition:transform .15s}
.cq-card:nth-child(3n+2){transform:rotate(.4deg)}.cq-card:nth-child(3n){transform:rotate(-.4deg)}.cq-card:hover{transform:translateY(-2px)}
.cq-card.is-draft{border-style:dashed;border-color:#c9b8e0}
.cq-card-top{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.cq-card h3{font-size:22px;overflow-wrap:anywhere}.cq-topic{color:var(--muted);font-size:14px;line-height:1.5;margin:6px 0 10px;overflow-wrap:anywhere}
.cq-status-line{font-size:13px;color:#5633b8;margin:0 0 18px}
.cq-card-actions{margin-top:auto;display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.cq-card-actions .primary,.cq-card-actions .secondary{padding:10px 15px;font-size:13px}
.cq-link-danger{margin-left:auto;border:0;background:none;color:#a13a2e;font-size:13px;font-weight:700;text-decoration:underline;text-underline-offset:4px;padding:8px 4px}
.cq-empty{text-align:center;background:#fff;border:2px dashed #c9b8e0;border-radius:23px;padding:44px 24px}
.cq-empty .cq-empty-mark{margin:0 auto 18px}.cq-empty h1,.cq-empty h2{font-size:26px;margin-bottom:10px}.cq-empty p{color:var(--muted);max-width:430px;margin:0 auto 22px;line-height:1.7}

/* editor */
.cq-edit-top{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin:6px 0 10px}
.cq-edit-top h1{font-size:clamp(28px,3.4vw,40px);outline:0;overflow-wrap:anywhere;margin:0}
.cq-edit-play{display:flex;flex-direction:column;align-items:flex-end;gap:6px;flex-shrink:0}
.cq-status{min-height:30px;margin-bottom:14px}
.cq-saved{display:inline-flex;align-items:center;gap:8px;margin:0;font-size:13px;color:#256b46;font-weight:700}
.cq-saved.is-saving{color:#875211}.cq-dot{width:8px;height:8px;border-radius:50%;background:currentColor}
.cq-saved.is-saving .cq-dot{animation:cqPulse 1s ease-in-out infinite}
.cq-cols{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:20px;align-items:start}
.cq-col-main,.cq-col-side{display:flex;flex-direction:column;gap:20px;min-width:0}
.cq-col-side{position:sticky;top:16px}
.cq-panel{background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:0 3px 0 #eee6f7;padding:22px}
.cq-panel-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.cq-panel h2{font-size:20px}.cq-panel h3{font-size:17px}
.cq-label{display:block;font-size:13px;font-weight:800;color:var(--ink);margin:14px 0 7px}.cq-label:first-child,.cq-panel-head+.cq-label{margin-top:0}
.cq-label span{font-weight:600;color:var(--muted);margin-left:6px}
.cq-inline{margin:0}
.cq input[type=text],.cq textarea,.cq select{width:100%;font:inherit;font-size:15px;color:var(--ink);background:#fdfbff;border:1px solid #d9cfe8;border-radius:12px;padding:11px 13px;min-height:46px}
.cq textarea{resize:vertical;line-height:1.5}
.cq input:focus-visible,.cq textarea:focus-visible,.cq select:focus-visible{outline:2px solid #7750d5;outline-offset:2px;background:#fff}
.cq-title-input{font-family:'Fredoka',sans-serif!important;font-size:22px!important}
.cq-meta-row{display:grid;grid-template-columns:1fr 160px;gap:14px}
.cq-choices{border:0;padding:0;margin:0}.cq-choices legend{padding:0}
.cq-choice{display:flex;align-items:center;gap:10px;margin-bottom:9px}
.cq-correct{position:relative;flex-shrink:0;cursor:pointer}
.cq-correct input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.cq-letter{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;border:2px solid #d9cfe8;background:#fff;color:#7a6c8c;font-weight:800;font-size:14px;transition:transform .15s}
.cq-correct input:checked+.cq-sr+.cq-letter{background:#399b77;border-color:#256b46;color:#fff;transform:scale(1.06)}
.cq-correct input:focus-visible+.cq-sr+.cq-letter{outline:3px solid #7750d5;outline-offset:2px}
.cq-choice.is-correct input[type=text]{border-color:#83bea4;background:#f2faf6}
.cq-form-actions{margin-top:18px}
.cq-ai-panel{background:#fbf7ff;border-color:#d8c8ef}
.cq-ai-controls select{width:auto;min-width:110px}
.cq-suggestions{outline:0;margin-top:14px;display:flex;flex-direction:column;gap:14px}
.cq-suggestions:focus-visible{outline:2px solid #7750d5;outline-offset:4px;border-radius:12px}
.cq-suggestion{background:#fff;border:1px dashed #b89ee0;border-radius:17px;padding:18px}
.cq-suggestion .cq-row{margin-top:14px}
.cq-loading{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.cq-loading p{margin:4px 0;font-size:14px;color:#5633b8;font-weight:700}
.cq-skel{width:100%;height:16px;border-radius:8px;background:linear-gradient(90deg,#eee4ff,#f8f3ff,#eee4ff);background-size:200% 100%;animation:cqShimmer 1.3s linear infinite}.cq-skel.short{width:60%}
.cq-qlist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.cq-qlist li{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;padding:12px;border:1px solid var(--line);border-radius:14px;background:#fdfbff}
.cq-qlist li.is-editing{border-color:#7750d5;box-shadow:0 0 0 1px #7750d5}
.cq-num{font-family:'Fredoka',sans-serif;font-weight:600;color:#9b76e1;font-size:15px}
.cq-q-body{min-width:0}.cq-q-text{margin:0 0 4px;font-size:14px;font-weight:700;line-height:1.45;overflow-wrap:anywhere}.cq-q-body .cq-meta{margin:0;overflow-wrap:anywhere}
.cq-q-tools{grid-column:1/-1;display:flex;gap:6px;flex-wrap:wrap}
.cq-icon-btn,.cq-mini{min-height:34px;min-width:34px;border:1px solid #d8c8ef;background:#fff;border-radius:9px;color:#5633b8;font-weight:800;font-size:13px;padding:4px 10px}
.cq-icon-btn:disabled{opacity:.4}.cq-icon-btn:not(:disabled):hover,.cq-mini:hover{background:#f5eeff}
.cq-danger{color:#a13a2e;border-color:#f0c7bf;margin-left:auto}
.cq-empty-inline{padding:18px;border:1px dashed #c9b8e0;border-radius:14px;text-align:center}.cq-empty-inline p{margin:0;font-size:14px;color:var(--muted)}
.cq-preview-card{background:#faf8ff;border-radius:16px;padding:16px}
.cq-preview-card .question-number{margin-bottom:8px}
.cq-preview-q{font-family:'Fredoka',sans-serif;font-size:18px;margin:0 0 12px;line-height:1.4;overflow-wrap:anywhere}
.cq-preview-card ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px}
.cq-preview-card li{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #e5dff0;border-radius:10px;padding:8px 10px;font-size:14px;overflow-wrap:anywhere}
.cq-preview-card li.is-correct{border-color:#83bea4;background:#edf8f2;color:#176749}
.cq-preview-card .answer-letter{width:24px;height:24px}
.cq-play h1,.cq-results h1{outline:0}
#custom-question-title{outline:0;overflow-wrap:anywhere}
#custom-review{outline:0}

@keyframes cqIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cqPulse{50%{opacity:.3}}
@keyframes cqShimmer{to{background-position:-200% 0}}
@media(max-width:900px){.cq-cols{grid-template-columns:1fr}.cq-col-side{position:static}}
@media(max-width:600px){
  .cq{padding:0 18px}
  .cq-hero,.cq-edit-top{flex-direction:column;align-items:stretch}
  .cq-hero-side,.cq-edit-play{align-items:flex-start}
  .cq-meta-row{grid-template-columns:1fr}
  .cq-grid{grid-template-columns:1fr}
  .cq-card{transform:none!important}
  .cq-panel{padding:18px}
}
@media(prefers-reduced-motion:reduce){.cq,.cq-skel,.cq-saved .cq-dot{animation:none!important}.cq-card,.cq-letter{transition:none!important;transform:none!important}}
