/* QuizBank variant of the canonical study reader. */
body.quizbank-page { min-width: 0; background: #fff; --quizbank-accent: #d91c37; --quizbank-sheet-rule: color-mix(in srgb, var(--quizbank-accent) 35%, var(--surface)); --quizbank-accent-hover: color-mix(in srgb, var(--quizbank-accent) 85%, #000); --z-dialog: 1000; --quizbank-scroll-thumb: var(--muted); --quizbank-scroll-track: var(--surface); }
.quizbank-page, .quizbank-page * { scrollbar-color: var(--quizbank-scroll-thumb) var(--quizbank-scroll-track); scrollbar-width: thin; }
.quizbank-page ::-webkit-scrollbar { width: 8px; height: 8px; }
.quizbank-page ::-webkit-scrollbar-track { background: var(--quizbank-scroll-track); }
.quizbank-page ::-webkit-scrollbar-thumb { border-radius: 8px; background: var(--quizbank-scroll-thumb); }
.quizbank-page ::-webkit-scrollbar-thumb:hover { background: var(--purple-dark); }
.quizbank-page ::-webkit-scrollbar-thumb:active { background: var(--forest); }
@media (forced-colors: active) { .quizbank-page, .quizbank-page * { scrollbar-color: auto; } }
.quizbank-page [hidden] { display: none !important; }
.quizbank-page .study-header { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); min-height: 80px; background: #fff; box-shadow: none; border-bottom-color: var(--line); }
.quizbank-page .study-header > .study-icon-button { justify-self: start; }
.quizbank-page .study-heading { display: flex; align-items: center; justify-content: center; gap: 12px; }
.quizbank-page .study-heading small, .quizbank-page .study-heading h1 { margin: 0; font-family: Norwester, var(--font-ui); font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 400; line-height: 1.3; letter-spacing: .01em; }
.quizbank-page .study-heading small { flex-shrink: 0; color: var(--quizbank-accent); }
.quizbank-page .study-heading h1 { display: flex; align-items: center; gap: 12px; }
.quizbank-page .study-heading h1::before { content: ""; width: 4px; height: 4px; flex: 0 0 auto; border-radius: 50%; background: var(--quizbank-sheet-rule); }
.quizbank-page[data-quizbank-view="catalog"] .study-heading small,
.quizbank-page[data-quizbank-view="catalog"] .study-heading h1::before { display: none; }
.quizbank-page[data-quizbank-view="catalog"] .study-heading h1 { color: var(--quizbank-accent); letter-spacing: .16em; padding-left: .16em; font-size: 1.6rem; }
.quizbank-header-summary { justify-self: end; text-align: right; font-family: var(--font-ui); }
.quizbank-header-summary strong { display: block; font-size: .77rem; font-weight: 650; }
.quizbank-header-summary span { display: block; margin-top: 5px; font-size: .69rem; color: var(--muted); }
.quizbank-preview { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.quizbank-page .study-main { padding-top: clamp(24px, 5vw, 64px); padding-bottom: 64px; }
.quizbank-intro { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 0 0 32px; margin-bottom: 32px; border-bottom: 1px solid var(--line); }
.quizbank-intro > div:first-child { max-width: 650px; }
.quizbank-eyebrow { color: var(--muted); font-size: .67rem; font-weight: 700; letter-spacing: .12em; }
.quizbank-intro h2 { margin: 0 0 18px; color: var(--ink); font-family: var(--font-ui); font-weight: 750; font-size: clamp(1.65rem, 3vw, 2.6rem); line-height: 1.2; letter-spacing: -.035em; }
.quizbank-intro p:not([lang="bn"]), .quizbank-section-heading, .quizbank-page .study-reader-toolbar { font-family: var(--font-ui); }
.quizbank-intro p:not(.quizbank-eyebrow) { margin: 8px 0 0; font-size: .94rem; line-height: 1.75; color: var(--muted); }
.quizbank-intro p[lang="bn"] { color: var(--ink); font-size: 1rem; }
.quizbank-total { flex-shrink: 0; display: flex; align-items: center; gap: 20px; border-left: 1px solid var(--line); padding-left: 32px; }
.quizbank-total strong { font-family: Norwester, var(--font-ui); font-size: 5rem; font-weight: 400; color: var(--quizbank-accent); line-height: 1; }
.quizbank-total span { color: var(--muted); font-size: .8rem; line-height: 1.8; }
.quizbank-section-heading { display: flex; align-items: baseline; justify-content: center; margin-bottom: 22px; }
.quizbank-section-heading h3 { display: flex; align-items: center; gap: 14px; margin: 0; font-size: 1.05rem; font-weight: 650; }
.quizbank-section-heading h3 span { color: var(--quizbank-accent); font-size: .85rem; font-variant-numeric: tabular-nums; font-weight: 500; }
.quizbank-section-heading > span { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.quizbank-page .study-chapter-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.quizbank-page .study-chapter { min-height: 88px; padding: 16px; grid-template-columns: minmax(0, 1fr) 42px; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: none; }
.quizbank-page .study-chapter-copy { text-align: left; }
.quizbank-page .study-chapter::before, .quizbank-page .study-chapter::after, .quizbank-page .study-chapter-arrow { display: none; }
.quizbank-page .study-chapter-number { width: 42px; height: 46px; border: 0; border-radius: 6px; background: #f7f4f4; box-shadow: none; color: var(--quizbank-accent); font-family: Norwester, var(--font-ui); font-weight: 400; font-size: 1.45rem; }
.quizbank-page .study-chapter-copy strong { font-size: .72rem; font-weight: 400; color: var(--muted); }
.quizbank-page .study-chapter-copy small { font-size: .65rem; color: var(--ink); margin-bottom: 6px; }
.quizbank-page .study-chapter:hover { background: #fcf8f9; border-color: var(--quizbank-accent); transform: none; box-shadow: none; }
.quizbank-page :is(button, a):focus-visible { outline: 3px solid var(--quizbank-accent); outline-offset: 4px; }
.quizbank-page :is(h2, section):focus { outline: none; }
.quizbank-page .study-reader-toolbar h2 { font-family: var(--font-ui); font-weight: 750; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.25; letter-spacing: -.03em; }
.quizbank-page .study-reader-toolbar > div > span { color: var(--quizbank-accent); }
.quizbank-page .study-question-card { border-color: var(--line); border-radius: 16px; box-shadow: none; }
.quizbank-page .study-search { box-shadow: none; border-radius: 10px; }
.quizbank-page .study-search:focus-within { outline: 2px solid var(--quizbank-accent); outline-offset: 2px; box-shadow: none; }
.quizbank-page .study-search input { min-width: 0; }
.quizbank-page .study-search input::-webkit-search-cancel-button { display: none; }
#quizbank-clear-search { flex: 0 0 40px; height: 40px; border: 0; background: transparent; color: var(--ink); font-size: 1.6rem; cursor: pointer; }
.quizbank-help-note { color: var(--muted); font-size: .8rem; margin: 0 0 24px; line-height: 1.7; }
.quizbank-page .study-figure-frame { min-height: 150px; }
.quizbank-page .study-figure-frame p { font-size: .8rem; color: #9f172b; }
.quizbank-page .quizbank-figure-rotated { transform: rotate(90deg); max-height: 145px; max-width: 145px; object-fit: contain; }
.quizbank-sheet-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 16px; margin-top: 28px; }
#quizbank-previous { justify-self: start; }
#quizbank-next { justify-self: end; }
.quizbank-sheet-nav button, .quizbank-button, .quizbank-page .study-figure-frame button:not(.figure-detail-trigger) { min-height: 44px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: .82rem; text-decoration: none; cursor: pointer; }
.quizbank-sheet-nav button {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 50px; padding: 12px 20px; border-color: var(--quizbank-accent); border-radius: 14px;
  background: var(--quizbank-accent); color: var(--surface); font: 650 .84rem/1.4 var(--font-ui);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--quizbank-accent) 16%, transparent);
  transition: background-color .16s ease, box-shadow .16s ease;
}
.quizbank-sheet-nav button img { width: 24px; height: 24px; flex: 0 0 auto; object-fit: contain; filter: brightness(0) invert(1); }
.quizbank-sheet-nav button:hover:not(:disabled) { background: var(--quizbank-accent-hover); border-color: var(--quizbank-accent-hover); box-shadow: 0 6px 18px color-mix(in srgb, var(--quizbank-accent) 24%, transparent); }
.quizbank-sheet-nav button:active:not(:disabled) { box-shadow: none; }
.quizbank-sheet-nav button:disabled { background: var(--surface); color: var(--muted); border-color: var(--line); box-shadow: none; cursor: default; }
.quizbank-sheet-nav button:disabled img { filter: none; opacity: .5; }
@media (forced-colors: active) { .quizbank-sheet-nav button img { filter: none; background: white; border-radius: 4px; } }
.quizbank-page .study-error { margin: 32px auto; max-width: 680px; border-radius: 16px; box-shadow: none; }
.quizbank-page .study-error h2 { margin-top: 0; }
.quizbank-page .study-error p { line-height: 1.8; }
.quizbank-button { display: inline-flex; align-items: center; }
.quizbank-home { display: inline-block; margin-left: 18px; color: var(--ink); font-size: .82rem; }
.quizbank-skip { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 12px; background: #fff; transform: translateY(-200%); }
.quizbank-skip:focus { transform: none; }
@media (max-width: 900px) { .quizbank-page .study-chapter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .quizbank-total { display: none; } }
@media (max-width: 600px) {
  .quizbank-page .study-header { grid-template-columns: 44px minmax(0, 1fr) 44px; row-gap: 10px; }
  .quizbank-header-summary { grid-column: 1 / -1; justify-self: center; text-align: center; padding-bottom: 3px; }
  .quizbank-header-summary span { display: none; }
  .quizbank-preview { display: none; }
  .quizbank-page .study-chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .quizbank-intro { padding-bottom: 24px; margin-bottom: 24px; }
  .quizbank-page .study-chapter { min-height: 80px; padding: 10px; gap: 6px; grid-template-columns: minmax(0, 1fr) 34px; }
  .quizbank-page .study-chapter-number { width: 34px; height: 42px; font-size: 1.35rem; }
  .quizbank-page .study-reader-toolbar { grid-template-columns: 1fr; gap: 18px; }
  .quizbank-sheet-nav { gap: 8px; }
  .quizbank-sheet-nav button { width: 100%; min-width: 0; padding: 10px 8px; gap: 6px; font-size: .72rem; }
  .quizbank-sheet-nav button img { width: 18px; height: 18px; }
  .quizbank-page .study-heading, .quizbank-page .study-heading h1 { gap: 8px; }
  .quizbank-page .study-heading small, .quizbank-page .study-heading h1 { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { .quizbank-page *, .quizbank-page *::before, .quizbank-page *::after { scroll-behavior: auto !important; transition: none !important; } }

/* Study-sheet presentation. Values/recording/help remain owned by Study. */
.quizbank-start-quiz {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 18px; border: 2px solid var(--quizbank-accent);
  border-radius: 16px; background: var(--surface); color: var(--quizbank-accent);
  font: 650 .84rem/1.4 var(--font-ui); text-decoration: none; cursor: pointer;
  box-shadow: none;
}
.quizbank-start-quiz picture, .quizbank-start-quiz img { display: block; width: 38px; height: 38px; flex: 0 0 auto; object-fit: contain; }
.quizbank-start-quiz img { border-radius: 9px; }
@keyframes quizbank-practice-pulse {
  0%, 100% { background-position: 0% 50%; box-shadow: 0 6px 16px color-mix(in srgb, var(--forest) 12%, transparent); }
  50% { background-position: 100% 50%; box-shadow: 0 6px 24px color-mix(in srgb, var(--purple) 28%, transparent); }
}
.quizbank-start-quiz:hover { background: color-mix(in srgb, var(--quizbank-accent) 5%, var(--surface)); border-color: var(--quizbank-accent-hover); }
.quizbank-start-quiz:active { background: color-mix(in srgb, var(--quizbank-accent) 10%, var(--surface)); }
.quizbank-bottom-quiz {
  display: inline-flex; align-items: center; justify-content: center; min-width: 84px; min-height: 50px; padding: 12px 20px;
  border: 1px solid var(--purple-dark); border-radius: 14px; color: var(--surface);
  background: linear-gradient(115deg, var(--purple-dark) 15%, var(--purple) 50%, var(--purple-dark) 85%); background-size: 220% 100%;
  font: 750 .88rem/1.2 var(--font-ui); letter-spacing: .06em; text-decoration: none; cursor: pointer;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--forest) 12%, transparent);
}
.quizbank-bottom-quiz.is-pulsing { animation: quizbank-practice-pulse 3s ease-in-out 3; }
.quizbank-bottom-quiz:hover { border-color: var(--forest); filter: brightness(1.08); }
.quizbank-bottom-quiz:active { filter: brightness(.92); }
.quizbank-help-label { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; }
.quizbank-help-label [lang="bn"] { font-family: var(--font-bn-title); font-size: 1.1rem; font-weight: 400; line-height: 1.4; }
.quizbank-page .quizbank-sheet-search { display: flex; align-items: center; gap: 12px; width: min(100%, 620px); margin: 24px 0; padding: 6px 6px 6px 16px; border-radius: 16px; background: var(--surface); }
.quizbank-search-icon { width: 22px; height: 22px; flex: 0 0 auto; color: var(--quizbank-accent); }
.quizbank-page .quizbank-sheet-search input { flex: 1 1 0; width: 0; padding: 10px 0; font: 400 .9rem/1.5 var(--font-ui); }
.quizbank-search-submit { min-height: 44px; padding: 10px 18px; border: 1px solid var(--quizbank-accent); border-radius: 11px; background: var(--quizbank-accent); color: var(--surface); font: 650 .82rem/1.4 var(--font-ui); cursor: pointer; }
.quizbank-search-submit:hover { background: var(--quizbank-accent-hover); }
.quizbank-search-submit:active { box-shadow: inset 0 0 0 2px var(--surface); }
.quizbank-page #quizbank-clear-search { flex-basis: 32px; height: 44px; border-radius: 8px; }
.quizbank-page #quizbank-clear-search:hover { background: color-mix(in srgb, var(--quizbank-accent) 7%, var(--surface)); }
.quizbank-page #quizbank-clear-search:active { color: var(--quizbank-accent); }
@media (min-width: 601px) and (max-width: 999px) {
  .quizbank-page .study-header { grid-template-columns: 48px minmax(0, 1fr) 48px; }
  .quizbank-header-summary { grid-column: 1 / -1; justify-self: center; text-align: center; }
  .quizbank-header-summary span { display: none; }
}
.quizbank-page .study-question-list { gap: 0; border: 2px solid var(--quizbank-sheet-rule); border-radius: 22px; background: var(--surface); overflow: hidden; }
.quizbank-page .study-question-card { border: 0; border-bottom: 2px solid var(--quizbank-sheet-rule); border-radius: 0; box-shadow: none; }
.quizbank-page .study-question-card:last-child { border-bottom: 0; }
.quizbank-page .study-question-card:hover { box-shadow: none; }
.quizbank-page .study-question-main {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "meta solution" "figure figure" "text text" "actions actions" "recorder recorder";
  align-items: start; column-gap: 16px; row-gap: 14px;
}
.quizbank-page .study-question-meta { grid-area: meta; margin: 0; align-self: center; }
.quizbank-page .study-question-number {
  display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 50%;
  background: color-mix(in srgb, var(--quizbank-accent) 7%, var(--surface)); color: var(--quizbank-accent);
  font: 750 .78rem/1 var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.quizbank-page .study-question-number::before { display: none; }
.quizbank-page .study-figure-frame { grid-area: figure; min-height: 0; width: min(160px, 100%); margin: 0 auto; align-self: center; border-radius: 8px; }
.quizbank-page .study-figure { max-height: 160px; object-fit: contain; }
.quizbank-page .study-question-text { grid-area: text; min-width: 0; color: var(--ink); }
.quizbank-page .study-actions { grid-area: actions; min-width: 0; margin-top: 2px; }
.quizbank-page .quiz-audio-recorder { grid-area: recorder; min-width: 0; }
.quizbank-page .study-actions + .quiz-audio-recorder { margin-block-start: 4px; } /* 14px row gap + 4px = canonical18px */
.quizbank-solution { grid-area: solution; display: grid; grid-template-columns: repeat(2, 42px); gap: 6px 10px; justify-content: end; font-family: var(--font-ui); }
.quizbank-answer-cell { display: grid; justify-items: center; gap: 5px; color: var(--muted); }
.quizbank-answer-letter { font-size: .72rem; font-weight: 750; }
.quizbank-answer-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 1.4rem; line-height: 1; }
.quizbank-answer-cell.is-marked { color: var(--purple-dark); }
.quizbank-answer-cell.is-marked .quizbank-answer-mark { border-color: var(--purple-dark); background: color-mix(in srgb, var(--purple-dark) 7%, var(--surface)); font-size: 2rem; font-weight: 500; }
.quizbank-page .study-figure-frame.is-sheet-flipping { animation: quizbank-sheet-flip .8s cubic-bezier(.4, 0, .2, 1) 1; backface-visibility: hidden; }
@keyframes quizbank-sheet-flip { from { transform: perspective(700px) rotateY(0deg); } to { transform: perspective(700px) rotateY(360deg); } }
@media (min-width: 1000px) {
  .quizbank-page .study-main { width: min(1440px, calc(100% - 64px)); padding-top: 40px; }
  .quizbank-page .study-header { padding-inline: max(32px, calc((100% - 1440px) / 2)); }
  .quizbank-page .study-question-main {
    position: relative;
    grid-template-columns: 160px minmax(0, 1fr) 120px;
    grid-template-areas: "figure meta solution" "figure text solution" "figure actions solution" ". recorder .";
    column-gap: 28px; row-gap: 12px; padding: 26px 30px;
  }
  .quizbank-page .study-question-main::before, .quizbank-page .study-question-main::after {
    content: ""; position: absolute; top: 0; bottom: 0; width: 0;
    border-left: 2px solid var(--quizbank-sheet-rule); pointer-events: none;
  }
  .quizbank-page .study-question-main::before { left: 204px; }
  .quizbank-page .study-question-main::after { right: 164px; }
  .quizbank-solution { align-self: center; justify-content: center; }
  .quizbank-page .study-question-text { font-size: 1.06rem; line-height: 1.65; }
  .quizbank-page .study-actions + .quiz-audio-recorder { margin-block-start: 6px; }
  .quizbank-page .study-help { padding-left: 218px; padding-right: 178px; }
}
@media (max-width: 600px) {
  .quizbank-start-quiz { width: 100%; }
  .quizbank-bottom-quiz { min-width: 60px; padding: 12px 10px; font-size: .8rem; }
  .quizbank-page .quizbank-sheet-search { width: 100%; }
  .quizbank-page .study-question-list { border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  .quizbank-bottom-quiz.is-pulsing { animation: none; }
  .quizbank-page .study-figure-frame.is-sheet-flipping { animation: none; }
}
html[data-native-motion-paused] .quizbank-page .study-figure-frame.is-sheet-flipping { animation: none; }
html[data-native-motion-paused] .quizbank-bottom-quiz { animation-play-state: paused; }
