/* Question bank: pool pages, bilingual question cards, study mode and practice exam. */
.qb-content { padding: 40px 0 96px; }
.qb-credit { margin: 32px 0 0; color: var(--vk-gray-50); font-size: 13px; line-height: 1.6; }
.qb-breadcrumb { margin: 0; color: var(--vk-gray-70); font-size: 14px; }
.qb-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.qb-hero-en { margin-top: 8px; font-size: 15px; opacity: .8; }

/* Pool list and pool home */
.qb-pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.qb-pool-card { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; transition: box-shadow .15s; }
.qb-pool-card:hover { box-shadow: var(--vk-shadow-lg); }
.qb-pool-card h2, .qb-mode-card h2 { margin: 0; font-size: 22px; }
.qb-pool-card .vk-btn { align-self: flex-start; margin-top: 8px; }
.qb-pool-meta { margin: 0; color: var(--vk-gray-70); }

.qb-mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 20px 0 48px; }
.qb-mode-card { display: flex; flex-direction: column; gap: 10px; }
.qb-mode-card p { margin: 0; color: var(--vk-gray-70); line-height: 1.6; }
.qb-mode-card > .vk-btn, .qb-study-form .vk-btn { align-self: flex-start; margin-top: auto; }
.qb-study-form { display: flex; flex: 1; flex-direction: column; gap: 12px; }
.qb-order { display: flex; gap: 16px; margin: 0; border: 0; padding: 0; }
.qb-order label, .qb-section-checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.qb-section-picker summary { cursor: pointer; font-weight: 600; }
.qb-section-picker small { color: var(--vk-gray-50); font-weight: 400; }
.qb-section-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px 8px; margin-top: 10px; font-family: var(--vk-font-mono); font-size: 14px; }

.qb-section-table th[scope=row] { font-family: var(--vk-font-mono); white-space: nowrap; }
.qb-summary-en { display: block; margin-top: 2px; color: var(--vk-gray-50); font-size: 13px; }
.qb-section-actions { white-space: nowrap; }
.qb-section-actions .vk-btn + .vk-btn { margin-left: 4px; }

/* Question card */
.qb-question-list { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
.qb-question { overflow: hidden; border: 1px solid var(--vk-gray-20); border-radius: var(--vk-radius-lg); background: var(--vk-gray-0); box-shadow: var(--vk-shadow-sm); scroll-margin-top: 16px; }
.qb-question-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; border-bottom: 1px solid var(--vk-gray-10); background: var(--vk-gray-3); padding: 12px 20px; }
.qb-number { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: var(--vk-radius-pill); background: var(--vk-primary-60); padding: 0 6px; color: var(--vk-gray-0); font-size: 14px; font-weight: 700; }
.qb-id { color: var(--vk-gray-90); font-family: var(--vk-font-mono); font-weight: 700; }
.qb-fcc { color: var(--vk-gray-50); font-size: 13px; }
.qb-verdict { display: none; margin-left: auto; }
.qb-question.is-right .qb-verdict--right,
.qb-question.is-wrong .qb-verdict--wrong,
.qb-question.is-none .qb-verdict--none { display: inline-block; }

.qb-columns { display: grid; grid-template-columns: 1fr 1fr; }
.qb-col { min-width: 0; padding: 20px; }
.qb-col--ko { border-left: 1px solid var(--vk-gray-10); background: var(--vk-gray-3); }
.qb-col-label { margin: 0 0 8px; color: var(--vk-gray-50); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.qb-stem { margin: 0 0 14px; color: var(--vk-gray-90); font-size: 17px; font-weight: 600; line-height: 1.6; }
.qb-figure { display: block; max-width: 100%; max-height: 360px; margin: 0 0 14px; border: 1px solid var(--vk-gray-10); border-radius: var(--vk-radius-md); background: var(--vk-gray-0); }
/* The exam shows English only until it is graded, in a narrow centered card; grading widens it for both columns. */
.qb-question--exam:not(.is-revealed) { max-width: 500px; margin-right: auto; margin-left: auto; }
.qb-question--exam:not(.is-revealed) .qb-columns { grid-template-columns: 1fr; }
.qb-question--exam:not(.is-revealed) .qb-col--ko { display: none; }

.qb-choices { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.qb-choice { border: 1px solid var(--vk-gray-10); border-radius: var(--vk-radius-md); background: var(--vk-gray-0); line-height: 1.55; }
.qb-choice > b, .qb-choice label b { display: inline-grid; flex: none; place-items: center; width: 26px; height: 26px; border-radius: var(--vk-radius-pill); background: var(--vk-gray-10); color: var(--vk-gray-70); font-size: 13px; }
.qb-choice, .qb-choice label { display: flex; align-items: flex-start; gap: 10px; }
.qb-question--view .qb-choice { padding: 10px 12px; }
.qb-choice:has(label) { display: block; }
.qb-choice label { width: 100%; padding: 10px 12px; cursor: pointer; }
.qb-choice label span { padding-top: 1px; }
.qb-choice input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.qb-choice:has(label):is(:hover, .is-hover) { border-color: var(--vk-primary-20); background: var(--vk-primary-5); }
.qb-choice:has(input:focus-visible) { outline: 2px solid var(--vk-focus); outline-offset: 2px; }
.qb-question:not(.is-revealed) .qb-choice:has(input:checked),
.qb-question:not(.is-revealed):has(input[value="A"]:checked) .qb-choice[data-letter="A"],
.qb-question:not(.is-revealed):has(input[value="B"]:checked) .qb-choice[data-letter="B"],
.qb-question:not(.is-revealed):has(input[value="C"]:checked) .qb-choice[data-letter="C"],
.qb-question:not(.is-revealed):has(input[value="D"]:checked) .qb-choice[data-letter="D"] { border-color: var(--vk-primary-50); background: var(--vk-primary-5); }
.qb-question:not(.is-revealed):has(input[value="A"]:checked) .qb-choice[data-letter="A"] b,
.qb-question:not(.is-revealed):has(input[value="B"]:checked) .qb-choice[data-letter="B"] b,
.qb-question:not(.is-revealed):has(input[value="C"]:checked) .qb-choice[data-letter="C"] b,
.qb-question:not(.is-revealed):has(input[value="D"]:checked) .qb-choice[data-letter="D"] b { background: var(--vk-primary-60); color: var(--vk-gray-0); }
.qb-question.is-revealed .qb-choice label { cursor: default; }
.qb-question.is-revealed .qb-choice:not(.is-answer, .is-chosen-wrong):is(:hover, .is-hover) { border-color: var(--vk-gray-10); background: var(--vk-gray-0); }
.qb-question .qb-choice.is-chosen-wrong { border-color: var(--vk-danger-20); background: var(--vk-danger-5); }
.qb-question .qb-choice.is-chosen-wrong b { background: var(--vk-danger-60); color: var(--vk-gray-0); }
.qb-question .qb-choice.is-answer { border-color: var(--vk-success-20); background: var(--vk-success-5); }
.qb-question .qb-choice.is-answer b { background: var(--vk-success-60); color: var(--vk-gray-0); }

.qb-explain { display: none; border-top: 1px solid var(--vk-gray-10); background: var(--vk-secondary-5); padding: 16px 20px 18px; }
.qb-question.is-revealed .qb-explain { display: block; }
.qb-explain-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 8px; }
.qb-chosen-line { color: var(--vk-gray-70); font-size: 14px; }
.qb-question--view .qb-chosen-line { display: none; }
.qb-explain-text { margin: 0; color: var(--vk-gray-90); line-height: 1.7; }
.qb-why-not { display: grid; gap: 4px; margin: 12px 0 0; }
.qb-why-not div { display: grid; grid-template-columns: 22px 1fr; gap: 6px; color: var(--vk-gray-70); font-size: 14px; line-height: 1.6; }
.qb-why-not dt { font-weight: 700; }
.qb-why-not dd { margin: 0; }
.qb-concepts { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }

.qb-question-foot { display: flex; justify-content: flex-end; border-top: 1px solid var(--vk-gray-10); padding: 10px 20px; }
.qb-question--exam:not(.is-revealed) .qb-question-foot { display: none; }

/* Feedback dialog */
.qb-feedback-body { display: grid; gap: 10px; padding: 24px; }
.qb-feedback-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.qb-feedback-head h2 { margin: 0; font-size: 20px; }
.qb-feedback-head code { margin-left: 6px; color: var(--vk-primary-60); font-size: 16px; }
.qb-feedback-question { border-radius: var(--vk-radius-md); background: var(--vk-gray-3); padding: 12px 14px; }
.qb-feedback-question p { margin: 0; line-height: 1.6; }
.qb-feedback-question p + p { margin-top: 4px; color: var(--vk-gray-70); }
.qb-feedback-form, .qb-feedback-done { display: grid; gap: 8px; }
.qb-feedback-form .vk-label { margin-top: 6px; }
.qb-feedback-text { min-height: 120px; }
.qb-feedback-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.qb-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 32px; }

/* display rules below would otherwise override the hidden attribute JS toggles */
.qb-practice [hidden], .qb-feedback-modal [hidden] { display: none; }

/* Study mode */
.qb-study-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-bottom: 8px; border: 1px solid var(--vk-gray-20); border-radius: var(--vk-radius-lg); background: var(--vk-gray-0); padding: 10px 16px; box-shadow: var(--vk-shadow-sm); }
.qb-progress, .qb-score { margin: 0; color: var(--vk-gray-70); }
.qb-progress b { color: var(--vk-primary-60); font-size: 18px; }
.qb-study-actions { display: flex; gap: 8px; margin-left: auto; }
.qb-hint { margin: 0 0 16px; color: var(--vk-gray-50); font-size: 13px; }

/* Results panel (study and exam) */
.qb-summary { margin-bottom: 24px; scroll-margin-top: 16px; }
.qb-summary h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
.qb-summary-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0 12px; }
.qb-summary-tiles div { border-radius: var(--vk-radius-md); background: var(--vk-gray-3); padding: 14px 16px; }
.qb-summary-tiles dt { color: var(--vk-gray-70); font-size: 14px; }
.qb-summary-tiles dd { margin: 4px 0 0; color: var(--vk-gray-90); font-size: 26px; font-weight: 700; }
.qb-summary-help { margin: 0 0 16px; color: var(--vk-gray-70); }
.qb-summary-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.qb-filter { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; cursor: pointer; }

/* Practice exam */
.qb-exam-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; border: 1px solid var(--vk-gray-20); border-radius: var(--vk-radius-lg); background: var(--vk-gray-0); padding: 12px 16px; box-shadow: var(--vk-shadow-lg); }

@media (max-width: 900px) {
  .qb-mode-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .qb-content { padding: 24px 0 72px; }
  .qb-columns { grid-template-columns: 1fr; }
  .qb-col { padding: 16px; }
  .qb-col--ko { border-top: 1px solid var(--vk-gray-10); border-left: 0; }
  .qb-question-head, .qb-explain { padding-right: 16px; padding-left: 16px; }
  .qb-stem { font-size: 16px; }
  .qb-summary-tiles { grid-template-columns: repeat(2, 1fr); }
  .qb-study-actions { width: 100%; margin-left: 0; }
  .qb-study-actions .vk-btn { flex: 1; padding-right: 8px; padding-left: 8px; }
  .qb-section-table .qb-summary-en { display: none; }
}
