/* Give graph questions enough horizontal space for readable axes and labels. */
.qb-v3-visual-preview-card:has(.qb-graph-wrap){grid-column:1/-1}
.qb-v3-visual-preview-card:has(.qb-graph-wrap) .qb-graph-wrap{width:100%;max-width:640px;margin:12px auto}
.qb-v3-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.qb-v3-card.has-graph{grid-column:1/-1}
.qb-v3-card.has-graph .qb-graph-wrap{width:100%;max-width:640px;align-self:center;justify-self:center}
.qb-v3-card.has-graph .qb-graph{display:block;width:100%;height:auto;max-height:420px;min-height:0}
.qb-v3-card.has-graph h3::before{content:"그래프 포함";display:block;width:max-content;margin:0 0 8px;padding:4px 8px;border-radius:999px;background:#e9f2ff;color:#246bfe;font-size:11px;font-weight:800;letter-spacing:.02em}
.qb-graph-legend{display:flex;gap:8px 16px;flex-wrap:wrap;align-items:center;margin:8px 4px 0;color:#51657f;font-size:12px;font-weight:700}
.qb-graph-legend span{display:inline-flex;align-items:center;gap:6px}
.qb-graph-legend-swatch{display:inline-block;width:34px;height:10px;flex:0 0 34px;overflow:visible}
.qb-graph-area{fill-opacity:.28;stroke:none}.qb-graph-area-swatch{display:inline-block;width:14px;height:10px;border:1px solid #c99836;border-radius:3px;opacity:.75;flex:0 0 14px}
.qb-graph.qb-graph-fit{max-height:320px!important;min-height:0!important}.qb-graph-area{fill-opacity:.3}
@media(max-width:760px){.qb-graph.qb-graph-fit{max-height:220px!important}}
.qb-graph-curve{stroke-width:3.8;vector-effect:non-scaling-stroke;paint-order:stroke}
.qb-graph-overlay-curve{stroke-width:3.4;vector-effect:non-scaling-stroke}
.qb-v3-visual-filters{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px 14px;background:#fff;border:1px solid #dce6f2;border-radius:14px}
.qb-v3-visual-filters>span{margin-right:4px;color:#51657f;font-size:13px;font-weight:800}
.qb-v3-visual-filters>small{margin-left:auto;color:#8696ab;font-size:12px}
.qb-v3-visual-filters button{border:1px solid #d4e0ed;border-radius:999px;background:#f5f8fc;color:#415a78;padding:8px 13px;font:inherit;font-size:13px;font-weight:800;cursor:pointer}
.qb-v3-visual-filters button.active{border-color:#2f7cf6;background:#eaf2ff;color:#1769e8}
.qb-v3-visual-filters button.qb-v3-visual-combined{border-color:#2f7cf6;background:#2f7cf6;color:#fff;box-shadow:0 5px 14px rgba(47,124,246,.16)}
.qb-v3-visual-filters button.qb-v3-visual-combined.active{background:#145ac0;color:#fff}
.qb-v3-visual-filters button b{margin-left:4px}
.qb-v3-review-focus{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:14px 16px;border:1px solid #b9d5fb;border-radius:14px;background:#edf5ff;color:#294665}.qb-v3-review-focus span{flex:1 1 320px;color:#627a96;font-size:13px;line-height:1.5}.qb-v3-review-focus button{flex:0 0 auto}
.qb-v3-review-notice{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:12px 0;padding:16px 18px;border:1px solid #f0d49b;border-radius:14px;background:#fffaf0;color:#634b1b}
.qb-v3-review-notice b{display:block;font-size:15px;color:#46340e}
.qb-v3-review-notice p{margin:5px 0 0;color:#806b41;font-size:13px;line-height:1.55}
.qb-v3-review-notice .primary{flex:0 0 auto}
.qb-v3-review-notice-actions{display:flex;flex:0 0 auto;gap:8px}
.qb-v3-visual-filters button.qb-v3-jump-results{border-color:#173f78;background:#173f78;color:#fff}
.qb-v3-card,.qb-v3-visual-preview-card{scroll-margin-top:220px}.qb-v3-card h3,.qb-graph-wrap{scroll-margin-top:220px}
.qb-v3-badges .visual-badge{background:#e8f2ff;color:#1769e8;font-weight:800}
.qb-v3-badges .visual-badge.math{background:#f1eaff;color:#7046b7}
.qb-v3-card .qb-frac{display:inline-flex;vertical-align:middle;flex-direction:column;text-align:center;line-height:1.1;margin:0 .12em;font-size:.92em}
.qb-v3-card .qb-frac>span:first-child{padding:0 .15em .08em;border-bottom:1px solid currentColor}
.qb-v3-card .qb-frac>span:last-child{padding:.08em .15em 0}
.qb-v3-card .qb-formula{font-size:clamp(20px,2.1vw,27px);line-height:1.8;overflow-wrap:anywhere}
.qb-v3-card ol{font-size:16px;line-height:1.85}
.qb-v3-card ol .qb-frac{font-size:1.12em}
.qb-v3-card .qb-root{display:inline-flex;align-items:flex-start;white-space:nowrap}
.qb-v3-card .qb-root>span{border-top:1px solid currentColor;padding:0 .12em}
.qb-v3-card sup,.qb-v3-card sub{line-height:0;font-size:.72em}
.qb-v3-card sup{vertical-align:super}.qb-v3-card sub{vertical-align:sub}
.qb-v3-card .qb-math-text{font-style:normal}
@media(min-width:761px) and (max-width:1400px){body:has(.qb-v3-shell) .topbar{gap:12px;padding:0 14px}body:has(.qb-v3-shell) .brand{min-width:140px}body:has(.qb-v3-shell) .mainnav{gap:10px}body:has(.qb-v3-shell) .mainnav button,body:has(.qb-v3-shell) .more button{font-size:13px}body:has(.qb-v3-shell) .tools{gap:9px}}
@media(max-width:1050px){.qb-v3-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.qb-v3-card.has-graph{grid-column:1/-1}}
@media(max-width:680px){.qb-v3-grid{grid-template-columns:minmax(0,1fr)}.qb-v3-card.has-graph{grid-column:1}.qb-v3-card.has-graph .qb-graph-wrap{max-width:100%}.qb-v3-card.has-graph .qb-graph{min-height:0}.qb-v3-card-top{flex-wrap:wrap}.qb-v3-badges{min-width:0}.qb-v3-card-actions{margin-left:auto}}
.qb-graph-reference{stroke:#e28a2c;stroke-width:1.8;stroke-dasharray:6 4;opacity:.9}.qb-graph-reference-label{fill:#b96514;font-size:10px;font-weight:700;paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round}
.qb-v3-visual-filters{position:sticky;top:72px;z-index:5;box-shadow:0 4px 14px rgba(31,66,112,.08)}
.qb-v3-visual-filters button.qb-v3-visual-combined{border-color:#d4e0ed;background:#f5f8fc;color:#415a78;box-shadow:none}
.qb-v3-visual-filters button.qb-v3-visual-combined.active{border-color:#2f7cf6;background:#eaf2ff;color:#1769e8;box-shadow:none}
@media(max-width:680px){.qb-v3-visual-filters{top:62px;padding:10px;gap:6px}.qb-v3-visual-filters>span{flex:1 0 100%;font-size:12px}.qb-v3-visual-filters>small{flex:1 0 100%;margin:0}.qb-v3-summary{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px}.qb-v3-summary article{min-width:0;padding:10px;border-radius:12px}.qb-v3-summary article span,.qb-v3-summary article small{font-size:10px}.qb-v3-summary article b{font-size:20px}.qb-v3-review-notice{align-items:stretch;flex-direction:column;padding:13px}.qb-v3-review-notice-actions{flex-direction:column}.qb-v3-review-notice-actions button{width:100%}}
.qb-v3-preview-jumps{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin:12px 0}
.qb-v3-preview-jumps button{border:1px solid #cbdcf2;border-radius:10px;background:#fff;color:#245fba;padding:9px 13px;font:inherit;font-size:13px;font-weight:800;cursor:pointer}
.qb-v3-preview-jumps button:disabled{border-color:#e2e8f0;background:#f5f7fa;color:#99a7b8;cursor:not-allowed}
.qb-v3-preview-filters{position:sticky;top:72px;z-index:4;display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 12px;border:1px solid #dce6f2;border-radius:12px;background:#fff;box-shadow:0 4px 14px rgba(31,66,112,.08)}
.qb-v3-preview-filters button{border:1px solid #d4e0ed;border-radius:999px;background:#f5f8fc;color:#415a78;padding:8px 13px;font:inherit;font-size:13px;font-weight:800;cursor:pointer}
.qb-v3-preview-filters button.active{border-color:#2f7cf6;background:#eaf2ff;color:#1769e8}
.qb-v3-preview-filters button b{margin-left:4px}
.qb-v3-preview-filters span{margin-left:auto;color:#657b98;font-size:12px;font-weight:700}
.qb-v3-visual-preview-card:has(.qb-graph-wrap){display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,.9fr);grid-template-areas:"head head" "question graph" "formula graph" "options graph" "details details" "footer footer";column-gap:20px;align-items:start}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>header{grid-area:head}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>h3{grid-area:question;margin-top:10px}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-formula{grid-area:formula}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap{grid-area:graph;align-self:center;width:100%;max-width:520px;margin:0 auto}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap .qb-graph{display:block;width:100%;height:auto;max-width:520px;max-height:360px;min-height:0}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-v3-preview-options{grid-area:options;align-self:start;margin:4px 0!important}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>details{grid-area:details}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>footer{grid-area:footer}
.qb-v3-visual-preview-card .qb-graph-wrap{scroll-margin-top:220px}
@media(max-width:760px){.qb-v3-visual-preview-card:has(.qb-graph-wrap){grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "question" "formula" "graph" "options" "details" "footer";row-gap:4px}.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap{max-width:100%;margin:8px auto}.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap .qb-graph{max-width:100%;max-height:360px}}
/* Keep a graph and its problem statement in the same first-screen card in the main bank. */
.qb-v3-card.has-graph{display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,.9fr);grid-template-areas:"head head" "question graph" "formula graph" "options graph" "status status" "details details" "footer footer";column-gap:20px;align-items:start}
.qb-v3-card.has-graph>.qb-v3-card-top{grid-area:head;min-width:0}
.qb-v3-card.has-graph>h3{grid-area:question;margin-top:8px}
.qb-v3-card.has-graph>.qb-formula{grid-area:formula;width:100%;box-sizing:border-box}
.qb-v3-card.has-graph>.qb-graph-wrap{grid-area:graph;width:100%;max-width:560px;justify-self:center;align-self:center;margin:0}
.qb-v3-card.has-graph>.qb-graph-wrap>.qb-graph{width:100%;height:auto;min-height:0;max-height:300px}
.qb-v3-card.has-graph>ol{grid-area:options;align-self:start}
.qb-v3-card.has-graph>.qb-v3-status{grid-area:status}
.qb-v3-card.has-graph>.qb-v3-meta{grid-area:details}
.qb-v3-card.has-graph>.qb-v3-review-actions{grid-area:footer}
@media(max-width:760px){.qb-v3-card.has-graph{grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "question" "formula" "graph" "options" "status" "details" "footer";row-gap:10px}.qb-v3-card.has-graph>.qb-graph-wrap{max-width:100%;margin:0 auto}.qb-v3-card.has-graph>.qb-graph-wrap>.qb-graph{max-width:100%;max-height:300px}}
@media(max-width:680px){.qb-v3-preview-filters{top:62px;gap:6px;padding:8px}.qb-v3-preview-filters button{flex:1 1 calc(50% - 6px);padding:8px;font-size:12px}.qb-v3-preview-filters span{flex:1 0 100%;margin:0}.qb-v3-preview-jumps{justify-content:stretch}.qb-v3-preview-jumps button{flex:1 1 100%}}
/* Compact charts so the complete plot, formula and answer choices are visible together. */
.qb-v3-card.has-graph>.qb-graph-wrap>.qb-graph{max-height:220px;object-fit:contain}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap .qb-graph{max-height:260px;object-fit:contain}
@media(max-width:760px){.qb-v3-card.has-graph>.qb-graph-wrap>.qb-graph,.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap .qb-graph{max-height:220px}}
/* On narrow screens, keep the visual-question controls compact so the first
   actual equation/graph is not pushed below several rows of navigation. */
@media(max-width:680px){
  .qb-v3-shell{gap:10px}
  .qb-v3-tabs{flex-wrap:nowrap;overflow-x:auto;gap:3px;padding-bottom:6px;scrollbar-width:thin}
  .qb-v3-tabs button{flex:0 0 auto;padding:8px 10px;font-size:12px;white-space:nowrap}
  .qb-v3-visual-preview-intro{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:10px 12px}
  .qb-v3-visual-preview-intro .kicker{display:none}
  .qb-v3-visual-preview-intro h2{font-size:15px;line-height:1.35;margin:0 0 4px}
  .qb-v3-visual-preview-intro p{font-size:11px;line-height:1.4}
  .qb-v3-visual-preview-intro label{display:flex;flex-direction:column;align-items:flex-start;gap:3px;font-size:11px}
  .qb-v3-visual-preview-intro select{min-width:76px;width:82px;padding:7px;font-size:12px}
  .qb-v3-preview-filters{top:56px;flex-wrap:nowrap;padding:6px;gap:4px}
  .qb-v3-preview-filters button{flex:1 1 0;min-width:0;padding:7px 4px;font-size:10px;white-space:nowrap}
  .qb-v3-preview-filters button b{margin-left:2px}
  .qb-v3-preview-filters span{display:none}
  .qb-v3-preview-jumps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:6px 0}
  .qb-v3-preview-jumps button{min-width:0;padding:7px 4px;font-size:10px;line-height:1.25}
  .qb-v3-visual-preview-card{padding:10px;border-radius:12px}
  .qb-v3-visual-preview-card>header{font-size:10px;gap:5px;flex-wrap:wrap}
  .qb-v3-visual-preview-card h3{font-size:15px;line-height:1.45;margin:7px 0}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap){row-gap:2px}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap{margin:2px auto}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap .qb-graph{max-height:185px;min-height:0}
.qb-v3-visual-preview-card .qb-formula{min-height:38px;padding:8px;font-size:17px;line-height:1.45}
  .qb-v3-preview-options{gap:4px;margin:6px 0!important;padding:8px!important;font-size:12px}
}

/* Textbook diagram layer: one authoritative layout and print-friendly graph
   primitives, replacing the earlier competing size/layout overrides. */
.qb-graph-segment{stroke:#263b53;stroke-width:2;stroke-linecap:round;vector-effect:non-scaling-stroke}
.qb-graph-point-label{font-size:13px;font-weight:750;paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round}
.qb-graph-axis-label{font-size:13px;font-weight:800}
.qb-graph-label{font-size:11px}
.qb-graph-grid{stroke:#e6ebf1;stroke-width:.9}
.qb-v3-visual-preview-card:has(.qb-graph-wrap){
  grid-template-columns:minmax(0,1.08fr) minmax(440px,.92fr);
  grid-template-areas:"head head" "question graph" "formula graph" "options graph" "details details" "footer footer";
  column-gap:26px;row-gap:14px;padding:24px;align-items:center
}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>h3{font-size:19px;line-height:1.7}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap{width:100%;max-width:680px;margin:0 auto;padding:14px;box-sizing:border-box}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap>.qb-graph{width:100%;max-width:100%;max-height:420px;min-height:300px;object-fit:contain}
.qb-v3-card.has-graph{grid-template-columns:minmax(0,1.08fr) minmax(440px,.92fr);align-items:center;column-gap:26px;row-gap:14px}
.qb-v3-card.has-graph>.qb-graph-wrap{width:100%;max-width:680px;margin:0 auto;padding:14px;box-sizing:border-box}
.qb-v3-card.has-graph>.qb-graph-wrap>.qb-graph{width:100%;max-width:100%;max-height:420px;min-height:300px;object-fit:contain}
.qb-v3-visual-preview-card .qb-formula,.qb-v3-card .qb-formula{font-family:"STIX Two Math","Cambria Math","Noto Serif KR",serif;font-variant-numeric:lining-nums;font-feature-settings:"ssty" 1}
@media(max-width:1080px){
  .qb-v3-visual-preview-card:has(.qb-graph-wrap),.qb-v3-card.has-graph{grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "question" "formula" "graph" "options" "status" "details" "footer";align-items:start}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap,.qb-v3-card.has-graph>.qb-graph-wrap{max-width:760px}
}
@media(max-width:760px){
  .qb-v3-visual-preview-card:has(.qb-graph-wrap),.qb-v3-card.has-graph{padding:14px;row-gap:10px}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap,.qb-v3-card.has-graph>.qb-graph-wrap{padding:8px}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap>.qb-graph,.qb-v3-card.has-graph>.qb-graph-wrap>.qb-graph{max-height:340px;min-height:250px}
}
@media print{
  .qb-graph-grid{stroke:#d9d9d9}
  .qb-graph-axis,.qb-graph-segment{stroke:#111}
  .qb-graph-curve{stroke:#111!important}
  .qb-graph-point-label,.qb-graph-reference-label{fill:#111!important}
}

/* Final, single source of truth for the teacher's visual-question preview.
   Keep the prompt and choices together, and give the mathematical figure its
   own stable column instead of letting earlier overrides fight each other. */
.qb-v3-visual-preview-intro{padding:16px 20px;gap:20px}
.qb-v3-visual-preview-intro h2{font-size:20px;line-height:1.4}
.qb-v3-visual-preview-intro p{font-size:14px;line-height:1.55}
.qb-v3-visual-preview-card:has(.qb-graph-wrap){
  display:grid;
  grid-template-columns:minmax(0,1.08fr) minmax(400px,.92fr);
  grid-template-areas:"head head" "question graph" "formula graph" "options graph" "details details" "footer footer";
  align-items:start;
  column-gap:24px;
  row-gap:12px;
  padding:22px;
}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>header{grid-area:head;min-width:0;font-size:13px}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>h3{grid-area:question;margin:2px 0 0;font-size:19px;line-height:1.65}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-formula{grid-area:formula;box-sizing:border-box;width:100%;min-height:56px;padding:13px 16px;font-size:clamp(20px,1.7vw,27px);line-height:1.55}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap{grid-area:graph;align-self:center;justify-self:stretch;width:100%;max-width:620px;margin:0 auto;padding:12px;border:1px solid #dce6f2;border-radius:14px;background:#fff;box-sizing:border-box}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap>.qb-graph{display:block;width:100%;height:auto;max-width:100%;max-height:340px;min-height:280px;object-fit:contain}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-v3-preview-options{grid-area:options;grid-template-columns:minmax(0,1fr);gap:7px;margin:0!important;padding:12px 16px!important;font-size:15px;line-height:1.55}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>details{grid-area:details;margin:4px 0 0}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>footer{grid-area:footer;margin-top:2px;font-size:13px}
.qb-v3-visual-preview-card:has(.qb-graph-wrap) .qb-graph-wrap figcaption{font-size:12px;line-height:1.5}
.qb-v3-visual-preview-card:has(.qb-graph-wrap) .qb-graph-label{font-size:12px}
.qb-v3-visual-preview-card:has(.qb-graph-wrap) .qb-graph-axis-label{font-size:14px}
.qb-v3-visual-preview-card:has(.qb-graph-wrap) .qb-graph-point-label{font-size:12px}
.qb-v3-visual-preview-card:has(.qb-graph-wrap) .qb-graph-wrap>small{font-size:12px;line-height:1.5}
@media(max-width:980px){
  .qb-v3-visual-preview-card:has(.qb-graph-wrap){grid-template-columns:minmax(0,1fr) minmax(300px,.9fr);column-gap:18px;padding:18px}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap>.qb-graph{min-height:250px;max-height:310px}
}
@media(max-width:760px){
  .qb-v3-visual-preview-intro{padding:14px;gap:12px}
  .qb-v3-visual-preview-intro h2{font-size:17px}
  .qb-v3-visual-preview-intro p{font-size:13px}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap){grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "question" "formula" "graph" "options" "details" "footer";row-gap:10px;padding:15px}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>h3{font-size:16px;line-height:1.55}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-formula{min-height:48px;font-size:20px}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap{max-width:100%;padding:8px}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap>.qb-graph{min-height:0;max-height:280px}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-v3-preview-options{font-size:14px;padding:10px 12px!important}
}

/* Assessment-style layout: no floating controls over the question, a balanced
   graph/equation split, and answer choices kept in a readable vertical list. */
.qb-v3-preview-filters,.qb-v3-visual-filters{position:static;top:auto;z-index:auto}
.qb-v3-visual-preview-card:has(.qb-graph-wrap){
  grid-template-columns:minmax(0,1.08fr) minmax(420px,.92fr);
  column-gap:24px;
  row-gap:12px;
}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap{max-width:620px}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap .qb-graph{max-width:620px;max-height:340px;min-height:0}
.qb-v3-visual-preview-card .qb-formula{
  min-height:44px;
  padding:12px 16px;
  font-size:clamp(18px,1.4vw,24px);
  line-height:1.55;
}
.qb-v3-preview-options{grid-template-columns:minmax(0,1fr);gap:5px;margin:8px 0!important;padding:12px 16px!important}
.qb-v3-preview-options li{min-width:0;line-height:1.55}
@media(max-width:900px){
  .qb-v3-visual-preview-card:has(.qb-graph-wrap){grid-template-columns:minmax(0,1fr) minmax(300px,.9fr);column-gap:16px}
}
@media(max-width:760px){
  .qb-v3-visual-preview-card:has(.qb-graph-wrap){grid-template-columns:minmax(0,1fr);row-gap:8px}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap{max-width:100%;margin:4px auto}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap .qb-graph{max-width:100%;max-height:280px}
  .qb-v3-visual-preview-card .qb-formula{font-size:19px;line-height:1.5}
  .qb-v3-preview-options{grid-template-columns:minmax(0,1fr);padding:10px 12px!important}
}

/* Keep one real graph and one formula question visible on the bank landing. */
.qb-v3-visual-peek{display:flex;flex-direction:column;gap:12px;padding:14px;background:#f8fbff;border:1px solid #dce6f2;border-radius:16px}
.qb-v3-visual-peek-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.qb-v3-visual-peek-heading>div{display:flex;flex-direction:column;gap:4px}
.qb-v3-visual-peek-heading b{color:#203858;font-size:15px}
.qb-v3-visual-peek-heading span{color:#71859f;font-size:12px}
.qb-v3-visual-peek-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.qb-v3-visual-peek-card{min-width:0;padding:14px;background:#fff;border:1px solid #dce6f2;border-radius:13px;overflow:hidden}
.qb-v3-visual-peek-card>header{display:flex;justify-content:space-between;gap:8px;align-items:center;color:#7588a0;font-size:11px}
.qb-v3-visual-peek-card>header b{color:#236bd0;font-size:12px}
.qb-v3-visual-peek-card h3{margin:10px 0;color:#172d4b;font-size:14px;line-height:1.5}
.qb-v3-visual-peek-card>.qb-formula{min-height:64px;margin:12px 0;padding:14px;font-size:clamp(21px,2vw,28px)}
.qb-v3-visual-peek-card>.qb-graph-wrap{width:100%!important;max-width:420px!important;margin:8px auto!important}
.qb-v3-visual-peek-card>.qb-graph-wrap>.qb-graph{max-height:260px!important}
.qb-v3-visual-peek-card details{margin-top:8px;padding-top:8px;border-top:1px solid #edf1f6;color:#58708e;font-size:12px}
.qb-v3-visual-peek-card details summary{cursor:pointer;color:#236bd0;font-weight:800}
.qb-v3-visual-peek-card details ol{margin:6px 0;padding-left:24px;line-height:1.65}
.qb-v3-visual-peek-card details p{margin:6px 0;line-height:1.6}
@media(max-width:680px){.qb-v3-visual-peek{padding:10px;gap:8px}.qb-v3-visual-peek-heading{align-items:flex-start}.qb-v3-visual-peek-heading b{font-size:13px}.qb-v3-visual-peek-heading span{font-size:10px;line-height:1.4}.qb-v3-visual-peek-heading>.outline{padding:7px 8px;font-size:11px;white-space:nowrap}.qb-v3-visual-peek-grid{grid-template-columns:minmax(0,1fr);gap:8px}.qb-v3-visual-peek-card{padding:10px}.qb-v3-visual-peek-card h3{font-size:13px}.qb-v3-visual-peek-card>.qb-graph-wrap>.qb-graph{max-height:210px!important}}

/* Review cards: preserve a clear question-first hierarchy, with enough plot
   area for axis labels but no giant chart that dominates the text. */
@media(min-width:761px){
  .qb-v3-card.has-graph>.qb-graph-wrap>.qb-graph{max-height:320px;min-height:280px;object-fit:contain}
  .qb-v3-card.has-graph>.qb-formula{font-size:clamp(18px,1.15vw,22px);line-height:1.5}
  .qb-v3-card.has-graph>h3{font-size:clamp(16px,1.1vw,20px);line-height:1.6}
}
.qb-v3-card .qb-formula,.qb-v3-visual-preview-card .qb-formula{min-height:52px;display:flex;align-items:center;justify-content:center;padding:15px 18px;border-color:#c8d9ef;background:linear-gradient(135deg,#f7faff,#edf4ff);color:#102b50;font-size:clamp(22px,2.1vw,29px);font-weight:650;line-height:1.85;overflow-wrap:anywhere}
.qb-v3-visual-preview-card .qb-formula{font-size:clamp(24px,2.4vw,32px)}
@media(max-width:760px){.qb-v3-card .qb-formula,.qb-v3-visual-preview-card .qb-formula{min-height:44px;padding:12px;font-size:20px}}
.qb-binomial{display:inline-flex;align-items:center;vertical-align:middle;gap:.08em;line-height:1}
.qb-binomial-paren{font-size:1.55em;font-weight:350;line-height:.9}
.qb-binomial-stack{display:inline-grid;grid-template-rows:1fr 1fr;text-align:center;font-size:.72em;line-height:1.08;padding:.08em 0}
.qb-binomial-stack>span{white-space:nowrap}
.qb-overline{display:inline-block;text-decoration:overline;text-decoration-thickness:1.5px;text-decoration-skip-ink:none;padding-top:.08em}
.qb-underline{display:inline-block;text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:.12em}
.qb-vector{display:inline-block;position:relative;padding-top:.2em}
.qb-vector::before{content:"→";position:absolute;left:0;right:0;top:-.48em;text-align:center;font-size:.72em;font-weight:500}
/* Mobile visual preview: compact the controls so equation/graph content appears near the top. */
@media(max-width:680px){
  .qb-v3-shell{gap:10px}
  .qb-v3-tabs{flex-wrap:nowrap;overflow-x:auto;gap:3px;padding-bottom:6px;scrollbar-width:thin}
  .qb-v3-tabs button{flex:0 0 auto;padding:8px 10px;font-size:12px;white-space:nowrap}
  .qb-v3-visual-preview-intro{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:10px 12px}
  .qb-v3-visual-preview-intro .kicker{display:none}
  .qb-v3-visual-preview-intro h2{font-size:15px;line-height:1.35;margin:0 0 4px}
  .qb-v3-visual-preview-intro p{font-size:11px;line-height:1.4}
  .qb-v3-visual-preview-intro label{display:flex;flex-direction:column;align-items:flex-start;gap:3px;font-size:11px}
  .qb-v3-visual-preview-intro select{min-width:76px;width:82px;padding:7px;font-size:12px}
  .qb-v3-preview-filters{top:56px;flex-wrap:nowrap;padding:6px;gap:4px}
  .qb-v3-preview-filters button{flex:1 1 0;min-width:0;padding:7px 4px;font-size:10px;white-space:nowrap}
  .qb-v3-preview-filters button b{margin-left:2px}
  .qb-v3-preview-filters span{display:none}
  .qb-v3-preview-jumps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:6px 0}
  .qb-v3-preview-jumps button{min-width:0;padding:7px 4px;font-size:10px;line-height:1.25}
  .qb-v3-visual-preview-card{padding:10px;border-radius:12px}
  .qb-v3-visual-preview-card>header{font-size:10px;gap:5px;flex-wrap:wrap}
  .qb-v3-visual-preview-card h3{font-size:15px;line-height:1.45;margin:7px 0}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap){row-gap:2px}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap{margin:2px auto}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap .qb-graph{max-height:185px;min-height:0}
  .qb-v3-visual-preview-card .qb-formula{min-height:38px;padding:8px;font-size:17px;line-height:1.45}
  .qb-v3-preview-options{gap:4px;margin:6px 0!important;padding:8px!important;font-size:12px}
}

/* Final graph baseline: textbook-like ink, quiet grid, and a consistent
   reading frame. This is deliberately last so older responsive overrides
   cannot make the same diagram look different in preview and grading. */
.qb-graph-wrap{padding:10px 12px 8px;border:1px solid #d9e2ec;border-radius:12px;background:#fff;box-sizing:border-box}
.qb-graph{shape-rendering:geometricPrecision;text-rendering:geometricPrecision}
.qb-graph-bg{fill:#fff;stroke:#d8e2ec;stroke-width:1}
.qb-graph-grid{stroke:#e7edf3;stroke-width:.85}
.qb-graph-axis{stroke:#637a93;stroke-width:1.45;vector-effect:non-scaling-stroke}
.qb-graph-axis-label{fill:#536b84;font-size:13px;font-weight:700}
.qb-graph-label{fill:#8a9bad;font-size:10.5px}
.qb-graph-guide{stroke:#9aabba;stroke-width:1;stroke-dasharray:3 3;opacity:.82;vector-effect:non-scaling-stroke}
.qb-graph-curve{stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.qb-graph-overlay-curve{stroke-width:2.8;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.qb-graph[data-graph-style="textbook"] .qb-graph-curve{stroke:#263b53;stroke-width:2.6}
.qb-graph[data-graph-style="textbook"] .qb-graph-segment{stroke:#263b53;stroke-width:2.1}
.qb-graph-point{stroke-width:2.2;vector-effect:non-scaling-stroke}
.qb-graph-point.open{stroke-width:2.2}
.qb-graph-point-bg{fill:#fff;stroke:#dce5ee;stroke-width:1}
.qb-graph-point-label{font-size:11.5px;font-weight:700;paint-order:stroke;stroke:#fff;stroke-width:3.5px;stroke-linejoin:round}
.qb-graph-reference{stroke:#a56b1a;stroke-width:1.45;stroke-dasharray:5 4;opacity:.86;vector-effect:non-scaling-stroke}
.qb-graph-reference-label{fill:#8b5e16;font-size:10px;font-weight:700;paint-order:stroke;stroke:#fff;stroke-width:3px}
.qb-graph-legend{display:flex;justify-content:center;gap:7px 16px;flex-wrap:wrap;margin:7px 3px 0;color:#526983;font-size:11.5px;font-weight:700}
.qb-graph-wrap>small{margin-top:5px;color:#7f91a6;font-size:11px;line-height:1.4}
.qb-graph-wrap:has(.qb-graph[data-graph-style="textbook"]){padding:4px 0 0;border:0;border-radius:0;background:#fff}
.qb-graph[data-graph-style="textbook"] .qb-graph-bg{stroke:none}
.qb-graph[data-graph-style="textbook"] .qb-graph-grid{display:none}
.qb-graph[data-graph-style="textbook"] .qb-graph-axis{stroke:#171717;stroke-width:1.25}
.qb-graph[data-graph-style="textbook"] marker path{fill:#171717}
.qb-graph[data-graph-style="textbook"] .qb-graph-axis-label,.qb-graph[data-graph-style="textbook"] .qb-graph-label{fill:#171717}
.qb-graph[data-graph-style="textbook"] .qb-graph-guide{stroke:#171717;stroke-dasharray:2 2;opacity:.9}
.qb-graph[data-graph-style="textbook"] .qb-graph-curve,.qb-graph[data-graph-style="textbook"] .qb-graph-overlay-curve,.qb-graph[data-graph-style="textbook"] .qb-graph-segment{stroke:#171717!important}
.qb-graph[data-graph-style="textbook"] .qb-graph-point{stroke:#171717!important;fill:#171717!important}
.qb-graph[data-graph-style="textbook"] .qb-graph-point.open{fill:#fff!important}
.qb-graph[data-graph-style="textbook"] .qb-graph-point-bg{stroke:none;fill:#fff}
.qb-graph[data-graph-style="textbook"] .qb-graph-point-label,.qb-graph[data-graph-style="textbook"] .qb-graph-reference-label{fill:#171717!important}
.qb-graph[data-graph-style="textbook"] .qb-graph-reference{stroke:#171717;opacity:1}
.qb-graph[data-graph-style="textbook"]~.qb-graph-legend{color:#171717}
.qb-graph[data-graph-style="textbook"]~.qb-graph-legend .qb-graph-legend-swatch line{stroke:#171717!important}
.qb-graph[data-graph-style="textbook"]~small{color:#171717}
@media(max-width:760px){
  .qb-graph-wrap{padding:8px 8px 6px;border-radius:10px}
  .qb-graph-point-label{font-size:10.5px}
  .qb-graph-label{font-size:9.5px}
  .qb-graph-axis-label{font-size:11px}
  .qb-graph-legend{font-size:10px;gap:5px 10px}
}
/* Keep every textbook graph a compact landscape figure. */
.qb-v3-card.has-graph>.qb-graph-wrap,.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap{width:min(100%,520px);max-width:520px}
.qb-v3-card.has-graph>.qb-graph-wrap>.qb-graph,.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap>.qb-graph{max-height:300px;min-height:0}
@media(max-width:760px){
  .qb-v3-card.has-graph>.qb-graph-wrap,.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap{width:min(100%,330px);max-width:330px}
  .qb-v3-card.has-graph>.qb-graph-wrap>.qb-graph,.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap>.qb-graph{max-height:230px}
}

/* Stable problem-bank preview sizing.
   graphSvg() also writes an inline max-width/max-height for the SVG.  Those
   values are useful for standalone rendering, but they must not make one
   preview card suddenly grow larger than the surrounding question list. */
.qb-v3-visual-preview-list{
  grid-template-columns:minmax(0,1fr);
  max-width:1440px;
  margin-inline:auto;
  gap:16px;
}
.qb-v3-visual-preview-card:has(.qb-graph-wrap),
.qb-v3-card.has-graph{
  min-width:0;
  overflow:hidden;
}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap,
.qb-v3-card.has-graph>.qb-graph-wrap{
  width:min(100%,440px)!important;
  max-width:440px!important;
  min-width:0;
  min-height:0;
  margin-inline:auto;
}
.qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap>.qb-graph,
.qb-v3-card.has-graph>.qb-graph-wrap>.qb-graph{
  width:100%!important;
  max-width:440px!important;
  height:auto!important;
  max-height:280px!important;
  min-height:0!important;
}
@media(max-width:1080px){
  .qb-v3-visual-preview-card:has(.qb-graph-wrap),
  .qb-v3-card.has-graph{
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"head" "question" "formula" "graph" "options" "status" "details" "footer";
    align-items:start;
  }
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap,
  .qb-v3-card.has-graph>.qb-graph-wrap{
    width:min(100%,520px)!important;
    max-width:520px!important;
  }
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap>.qb-graph,
  .qb-v3-card.has-graph>.qb-graph-wrap>.qb-graph{
    max-width:520px!important;
    max-height:300px!important;
  }
}
@media(max-width:760px){
  .qb-v3-visual-preview-list{gap:12px}
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap,
  .qb-v3-card.has-graph>.qb-graph-wrap{
    width:min(100%,360px)!important;
    max-width:360px!important;
  }
  .qb-v3-visual-preview-card:has(.qb-graph-wrap)>.qb-graph-wrap>.qb-graph,
  .qb-v3-card.has-graph>.qb-graph-wrap>.qb-graph{
    max-width:360px!important;
    max-height:240px!important;
  }
}
