/* Question-bank item styles. Every rule is scoped to .q-* so the renderer drops into any page. */
:root {
  --q-ink: #17181c;
  --q-ink-2: #4a4d55;
  --q-ink-3: #767a84;
  --q-line: #e3e5ea;
  --q-surface: #ffffff;
  --q-hover: #f5f6f8;
  --q-accent: #2f5bd3;
  --q-ok: #1f7a4d;
  --q-ok-bg: #e9f6ef;
  --q-bad: #b42318;
  --q-bad-bg: #fdeeec;
  --q-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.q-item {
  font-family: var(--q-font);
  color: var(--q-ink);
  background: var(--q-surface);
  font-size: 17px;
  line-height: 1.65;
  max-width: 720px;
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}

.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 20px; }
.q-tag {
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: var(--q-ink-2); background: var(--q-hover);
  border: 1px solid var(--q-line); border-radius: 999px; padding: 2px 10px;
}
.q-num { margin-left: auto; font-size: 13px; color: var(--q-ink-3); }

.q-stem > * + *, .q-prompt > * + * { margin-top: 14px; }
.q-p { margin: 0; text-wrap: pretty; hyphens: auto; }
.q-heading { margin: 0; font-size: 17px; font-weight: 700; text-align: center; }
.q-source {
  margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--q-ink-3); text-align: right;
}
.q-prompt { margin-top: 22px; font-weight: 500; }

.q-figure { margin: 18px 0; text-align: center; }
.q-figure img { max-width: 100%; height: auto; display: inline-block; }
.q-figure figcaption { margin-top: 6px; font-size: 13px; color: var(--q-ink-3); }

.q-display { margin: 14px 0; overflow-x: auto; text-align: center; }
.q-math .katex { font-size: 1.05em; }
.q-item sub, .q-item sup { font-size: .72em; line-height: 0; }
.q-list { margin: 0; padding-left: 1.4em; }
.q-list li + li { margin-top: 4px; }
.q-verse { margin: 0; padding-left: 1.5em; }
.q-verse { line-height: 1.5; }
.q-line { min-height: 1.5em; }
.q-line:empty { min-height: 0; height: .75em; }

.q-table-wrap { overflow-x: auto; margin: 18px 0; }
.q-table { border-collapse: collapse; margin: 0 auto; font-size: 15px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.q-table th, .q-table td { border: 1px solid var(--q-line); padding: 8px 14px; }
.q-table th { background: var(--q-hover); font-weight: 600; }

.q-options { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.q-options-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.q-option {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  padding: 10px 14px; border: 1px solid var(--q-line); border-radius: 10px;
  transition: border-color .12s, background .12s;
}
.q-options-grid .q-option { flex-direction: column; align-items: stretch; height: 100%; }
.q-option:hover { background: var(--q-hover); }
.q-option:focus-visible { outline: 2px solid var(--q-accent); outline-offset: 2px; }
.q-letter {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; margin-top: 1px;
  font-size: 13px; font-weight: 700; color: var(--q-ink-2); border: 1.5px solid var(--q-ink-3);
}
.q-option-body { flex: 1; min-width: 0; }
.q-option-body .q-figure { margin: 4px 0; }


.q-selected { border-color: var(--q-accent); background: #eef2fd; }
.q-selected .q-letter { background: var(--q-accent); border-color: var(--q-accent); color: #fff; }
.q-answered .q-option { cursor: default; }
.q-answered .q-option:hover { background: none; }
.q-correct, .q-answered .q-correct:hover { border-color: var(--q-ok); background: var(--q-ok-bg); }
.q-correct .q-letter { background: var(--q-ok); border-color: var(--q-ok); color: #fff; }
.q-wrong, .q-answered .q-wrong:hover { border-color: var(--q-bad); background: var(--q-bad-bg); }
.q-wrong .q-letter { background: var(--q-bad); border-color: var(--q-bad); color: #fff; }

.q-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.q-submit {
  all: unset; cursor: pointer; font-size: 14px; font-weight: 600;
  background: var(--q-ink); color: #fff; padding: 9px 18px; border-radius: 8px;
}
.q-submit:disabled { opacity: .35; cursor: default; }
.q-verdict { font-size: 14px; font-weight: 600; }
.q-verdict.ok { color: var(--q-ok); }
.q-verdict.bad { color: var(--q-bad); }

.q-error { color: var(--q-bad); background: var(--q-bad-bg); font-family: ui-monospace, monospace; font-size: 13px; }
