.qselect-hidden{display:none!important}.qselect-backdrop{position:fixed;inset:0;z-index:2147481000;background:rgba(15,23,42,.48);display:flex;align-items:center;justify-content:center;padding:18px}.qselect-modal{width:min(980px,100%);max-height:min(92vh,980px);overflow:auto;background:#fff;border-radius:24px;box-shadow:0 28px 90px rgba(15,23,42,.25);border:1px solid #e2e8f0}.qselect-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:24px 26px 18px;border-bottom:1px solid #e2e8f0;position:sticky;top:0;background:rgba(255,255,255,.96);backdrop-filter:blur(12px);z-index:2}.qselect-head span{font-size:12px;color:#64748b;font-weight:700;letter-spacing:.08em}.qselect-head h2{margin:4px 0 6px;font-size:24px}.qselect-head p{margin:0;color:#64748b}.qselect-close{border:0;background:#f1f5f9;border-radius:12px;width:40px;height:40px;font-size:25px;cursor:pointer}.qselect-body{padding:22px 26px 28px}.qselect-error{padding:12px 14px;border-radius:14px;background:#fff1f2;color:#be123c;margin-bottom:14px}.qselect-controls{display:grid;grid-template-columns:minmax(180px,260px) 1fr;gap:14px}.qselect-field{display:flex;flex-direction:column;gap:7px}.qselect-field>span,.qselect-filter-head span,.qselect-summary small{font-size:12px;color:#64748b}.qselect-field select,.qselect-field input{width:100%;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:13px;padding:11px 12px;background:#fff;font:inherit}.qselect-filter{margin-top:20px}.qselect-filter-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:10px}.qselect-filter-head b{font-size:14px}.qselect-chips{display:flex;flex-wrap:wrap;gap:8px}.qselect-chips button,.qselect-toolbar button,.qselect-pages button{border:1px solid #cbd5e1;background:#fff;border-radius:999px;padding:8px 12px;cursor:pointer;font:inherit}.qselect-chips button.active{background:#0f172a;color:#fff;border-color:#0f172a}.qselect-summary{display:grid;grid-template-columns:1fr auto;gap:16px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:16px;padding:14px 16px;margin-top:20px}.qselect-summary div{display:flex;flex-direction:column;gap:3px}.qselect-summary b{font-size:15px}.qselect-summary span{color:#64748b;font-size:13px}.qselect-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}.qselect-list{display:grid;gap:9px}.qselect-question{display:grid;grid-template-columns:24px 1fr;align-items:flex-start;gap:10px;border:1px solid #e2e8f0;border-radius:14px;padding:12px 13px;cursor:pointer;background:#fff}.qselect-question:hover{border-color:#94a3b8}.qselect-question.selected{border-color:#64748b;background:#f8fafc}.qselect-question input{position:absolute;opacity:0;pointer-events:none}.qselect-check{width:19px;height:19px;border:2px solid #cbd5e1;border-radius:6px;box-sizing:border-box;margin-top:2px}.qselect-question.selected .qselect-check{background:#0f172a;border-color:#0f172a;box-shadow:inset 0 0 0 4px #fff}.qselect-qbody{display:flex;flex-direction:column;gap:5px;min-width:0}.qselect-qbody b{font-size:14px;line-height:1.55;font-weight:600}.qselect-meta{font-size:12px;color:#64748b}.qselect-empty{padding:34px;text-align:center;color:#64748b;border:1px dashed #cbd5e1;border-radius:14px}.qselect-pages{display:flex;justify-content:center;align-items:center;gap:12px;margin:16px 0}.qselect-pages button:disabled{opacity:.4;cursor:not-allowed}.qselect-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;position:sticky;bottom:-28px;background:linear-gradient(to bottom,rgba(255,255,255,.88),#fff 30%);padding:18px 0 0}.qselect-actions button{border-radius:14px;padding:13px 16px;font-weight:700;font:inherit;cursor:pointer}.qselect-actions .secondary{border:1px solid #cbd5e1;background:#fff}.qselect-actions .primary{border:1px solid #0f172a;background:#0f172a;color:#fff}.qselect-actions button:disabled{opacity:.4;cursor:not-allowed}.ui2-task-custom-row{width:100%;margin-top:10px;border:1px dashed #94a3b8;background:#f8fafc;border-radius:14px;padding:12px 14px;display:flex;justify-content:space-between;align-items:center;gap:12px;text-align:left;cursor:pointer}.ui2-task-custom-row span{display:flex;flex-direction:column;gap:2px}.ui2-task-custom-row small{color:#64748b}.ui2-task-custom-row em{font-style:normal;color:#475569;font-weight:700}@media(max-width:720px){.qselect-backdrop{padding:0;align-items:stretch}.qselect-modal{border-radius:0;max-height:100vh;height:100vh}.qselect-head{padding:18px 16px 14px}.qselect-head h2{font-size:20px}.qselect-body{padding:16px}.qselect-controls{grid-template-columns:1fr}.qselect-filter-head{align-items:flex-start;flex-direction:column;gap:2px}.qselect-summary{grid-template-columns:1fr}.qselect-actions{grid-template-columns:1fr;bottom:-16px}.qselect-question{padding:11px}.qselect-qbody b{font-size:13px}}

.qselect-rich-stem{display:block;font-weight:600;line-height:1.7;overflow-wrap:anywhere}.qselect-rich-stem p,.qselect-rich-stem div{margin:0 0 4px}.qselect-inline-formula{display:inline-block;max-width:100%;max-height:3em;vertical-align:middle;object-fit:contain}.qselect-preview-toggle{align-self:flex-start;border:1px solid #94a3b8;background:#f8fafc;border-radius:10px;padding:8px 12px;color:#334155;font:inherit;cursor:pointer;margin-top:6px}.qselect-preview-image{max-width:100%;max-height:65vh;object-fit:contain;border:1px solid #dbe3ec;border-radius:10px;background:#fff}.qselect-preview-image:hover{cursor:zoom-in}@media(max-width:720px){.qselect-head p{display:none}.qselect-rich-stem{font-size:14px}.qselect-inline-formula{max-height:2.6em}}

.qselect-advanced{margin:16px 0;border:1px solid #cbd5e1;border-radius:14px;background:#f8fafc;padding:12px 14px}
.qselect-advanced summary{cursor:pointer;font-weight:700;display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;align-items:center}
.qselect-advanced summary span{font-size:12px;color:#64748b;font-weight:400}
.qselect-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:15px}
.qselect-settings-grid label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:#334155;font-weight:600}
.qselect-settings-grid select,.qselect-settings-grid input{min-width:0;max-width:100%;box-sizing:border-box;padding:11px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;font:inherit;color:#0f172a}
.qselect-settings-note{font-size:12px;line-height:1.6;color:#64748b;margin:12px 0 0}
@media(max-width:720px){.qselect-settings-grid{grid-template-columns:minmax(0,1fr)}}

.qselect-math-preset{background:#eff6ff;border:1px solid #bfdbfe;border-radius:12px;padding:12px;margin:12px 0}
.qselect-math-preset [data-qselect-math-preset]{width:100%;padding:10px 13px;border:1px solid #93c5fd;border-radius:10px;background:#fff;color:#1e40af;font-weight:700}
.qselect-math-preset [data-qselect-math-preset].active{background:#1d4ed8;color:#fff}
.qselect-math-preset details{font-size:13px;color:#475569;margin-top:10px}
.qselect-math-preset summary{cursor:pointer}.qselect-math-preset p{margin:6px 0;line-height:1.55}


/* v7.2 custom sampling quotas */
.qselect-quota-panel{
  margin-top:14px;
  padding:13px;
  border:1px solid #dbe3ec;
  border-radius:12px;
  background:#fff;
}
.qselect-quota-panel .qselect-filter-head{margin-bottom:9px}
.qselect-quota-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
}
.qselect-quota-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 11px;
  border:1px solid #e2e8f0;
  border-radius:10px;
  background:#f8fafc;
}
.qselect-quota-row>span{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
}
.qselect-quota-row b{
  font-size:12px;
  color:#334155;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.qselect-quota-row small{
  font-size:11px;
  color:#64748b;
}
.qselect-quota-row input{
  width:78px;
  flex:0 0 78px;
  box-sizing:border-box;
  padding:8px 9px;
  border:1px solid #cbd5e1;
  border-radius:9px;
  background:#fff;
  font:inherit;
  color:#0f172a;
  text-align:center;
}
.qselect-settings-grid input:disabled{
  background:#f1f5f9;
  color:#94a3b8;
  cursor:not-allowed;
}
@media(max-width:720px){
  .qselect-quota-grid{grid-template-columns:minmax(0,1fr)}
  .qselect-quota-row input{width:72px;flex-basis:72px}
}


/* v7.3 passage selection: whole article stays together */
.qselect-passages{margin:15px 0;border:1px solid #cbd5e1;border-radius:14px;background:#f8fafc;overflow:hidden}
.qselect-passages>summary{cursor:pointer;list-style:none;padding:16px;color:#0f172a;font-size:14px;font-weight:800;display:flex;justify-content:space-between;align-items:center;gap:10px}
.qselect-passages>summary::-webkit-details-marker{display:none}
.qselect-passages>summary span{font-size:11px;color:#64748b;font-weight:500}
.qselect-passages-inner{border-top:1px solid #e2e8f0;padding:13px}
.qselect-passage-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.qselect-passage-toolbar button,.qselect-passage-pages button{background:white;color:#334155;border:1px solid #cbd5e1;border-radius:9px;padding:7px 11px;cursor:pointer}
.qselect-passage-toolbar span{font-size:12px;color:#64748b;margin-left:auto}
.qselect-passage-list{display:grid;gap:8px}
.qselect-passage-row{display:flex;align-items:flex-start;gap:11px;border:1px solid #dbe3ed;border-radius:10px;background:#fff;padding:11px;cursor:pointer}
.qselect-passage-row.selected{border-color:#60a5fa;background:#eff6ff}
.qselect-passage-row input{width:17px;height:17px;margin:2px 0 0;flex-shrink:0;accent-color:#2563eb}
.qselect-passage-title{font-weight:700;color:#1e293b;font-size:13px;line-height:1.45;min-width:0}
.qselect-passage-title small,.qselect-passage-title em{display:block;font-size:11px;color:#64748b;margin-top:5px;font-weight:400;font-style:normal;overflow-wrap:anywhere}
.qselect-passage-pages{display:flex;align-items:center;justify-content:center;gap:12px;margin:12px 0;font-size:12px;color:#64748b}
.qselect-passage-pages button:disabled{opacity:.35;cursor:default}
.qselect-launch-passages{display:block;width:100%;border:0;border-radius:11px;color:white;background:#0f172a;padding:14px;font-size:14px;font-weight:750;cursor:pointer}
.qselect-launch-passages:disabled{opacity:.45;cursor:default}
@media(max-width:720px){.qselect-passages>summary{display:block}.qselect-passages>summary span{display:block;margin-top:5px}.qselect-passage-toolbar span{width:100%;margin-left:0}}

/* Passage mode instant-answer control */
.qselect-passage-submit-label{display:flex;flex-direction:column;gap:7px;font-size:12px;font-weight:750;color:#334155;margin:12px 0}
.qselect-passage-submit-label select{min-width:0;max-width:100%;width:100%;padding:10px 12px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;color:#0f172a;font:inherit}

/* v7.5 source scopes */
.qselect-source-filter{margin-top:12px}
.qselect-source-filter .qselect-chips{display:flex;flex-wrap:wrap;gap:8px}
.qselect-source-note{margin:10px 0 0;color:#64748b;font-size:12px;line-height:1.5}
