/* question-bank.html: the list of every question in the bank */

.qb-levels { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.qb-levels .tool[aria-pressed="true"] .qb-n { color: var(--ink-muted); }
.qb-n { font-weight: 400; color: var(--muted); margin-left: 4px; }

.qb-page { margin: 0 22px; padding: 16px 0; border-top: 2px solid var(--border); }
.qb-page:last-child { padding-bottom: 22px; }
.qb-page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.qb-page h3 { margin: 0; font-size: 1.15rem; }
.qb-page-try { font-weight: 700; color: var(--accent); }
.qb-spec { margin: 4px 0 8px; color: var(--muted); font-size: 0.9rem; }

.qb-questions { margin: 0; padding: 0 0 0 1.6em; }
.qb-questions li { margin: 0; }
.qb-q {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  align-items: start;
  min-height: var(--tap);
  padding: 8px 4px;
  cursor: pointer;
}
.qb-q input { width: 22px; height: 22px; margin: 2px 0 0; grid-row: span 2; accent-color: var(--accent); }
.qb-prompt { line-height: 1.4; }
.qb-meta { color: var(--muted); font-size: 0.85rem; }
.qb-meta a { color: inherit; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* The bar that follows the list: how many are ticked, Clear, Try them */
.qb-bar {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 0;
  padding: 10px 12px 10px 18px;
  background: var(--surface);
  border: var(--edge-w) solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--pop);
  font-weight: 700;
}
.qb-bar [data-qb-count], .qb-bar [data-qb-topic-count] { margin-right: auto; }
.qb-try { text-decoration: none; background: var(--accent); color: var(--accent-text); }
.qb-try[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

.qb-missing { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.qb-q.is-page-only { cursor: default; opacity: 0.6; }
.qb-all { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); margin: 0 0 2px 4px; font-weight: 700; cursor: pointer; }
.qb-all input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.qb-bar .tool:disabled { opacity: 0.45; cursor: default; }

/* The QR code box (share-link.js): big enough to put on the board */
.share {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 20px 22px;
  border: var(--edge-w) solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--pop);
  color: var(--text);
}
.share::backdrop { background: rgba(29, 20, 66, 0.55); }
.share-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.share-head h2 { margin: 0; font-size: 1.4rem; }
.share-qr { margin: 14px auto 4px; width: min(100%, calc(100vh - 400px)); min-width: 220px; }
.share-qr svg { display: block; width: 100%; height: auto; }
.share-count { margin: 0 0 10px; text-align: center; font-weight: 700; color: var(--muted); }
.share-where { margin: 0 0 12px; padding: 0; border: 0; }
.share-where legend { padding: 0; margin-bottom: 4px; font-weight: 700; }
.share-where label { display: flex; align-items: center; gap: 10px; min-height: var(--tap); cursor: pointer; }
.share-where input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.share-link { display: flex; gap: 10px; }
.share-link input {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  padding: 0 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--muted);
}
.share-note { margin: 10px 0 0; font-size: 0.9rem; color: var(--muted); }

/* starter.html hides the spec line and LI for a mix of starters; their own display rules would show them */
[data-bank-starter] [hidden] { display: none; }

/* By topic / By question, and the topic list */
.qb-modes { display: flex; flex-wrap: wrap; gap: 10px; margin: -6px 0 8px; }
.qb-modes .tool[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.qb-topics { list-style: none; margin: 0; padding: 0 22px 16px; }
.qb-topics li { border-top: 2px solid var(--border); }
.qb-topic {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 14px;
  align-items: start;
  min-height: var(--tap);
  padding: 12px 4px;
  cursor: pointer;
}
.qb-topic input { width: 24px; height: 24px; margin: 1px 0 0; grid-row: span 2; accent-color: var(--accent); }
.qb-topic-name { font-weight: 700; font-size: 1.1rem; line-height: 1.3; }

/* The picked questions, shown before opening them */
.qb-picked {
  margin: 8px 0 0;
  padding: 18px 22px;
  border: var(--edge-w) solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--pop);
}
.qb-picked-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.qb-picked-head h2 { margin: 0; font-size: 1.3rem; }
.qb-picked-list { margin: 0; padding: 0 0 0 1.6em; }
.qb-picked-list li { padding: 8px 0; border-top: 2px solid var(--border); }
.qb-picked-list li:first-child { border-top: 0; }
.qb-picked-list .qb-prompt, .qb-picked-list .qb-meta { display: block; }
.qb-how-many { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.qb-how-many select {
  min-height: var(--tap);
  padding: 0 10px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
@media (max-width: 600px) {
  .qb-bar { flex-wrap: wrap; }
  .qb-bar > span { flex-basis: 100%; }
}
[data-qb-by-topic] .units { padding-bottom: 8px; }
