/**
 * Q-Bank — assets/qb.css  앱 화면 컴포넌트 (/qb/…)
 * 색은 테마 변수(--p, --bg-card, --border, --text-main, --text-muted, --hover-row, --qb-*)를 사용 → 다크모드 자동
 */
.qb-page { display: flex; flex-direction: column; gap: 20px; }
.qb-page * { box-sizing: border-box; }
.qb-muted { color: var(--text-muted); }
.qb-num { font-variant-numeric: tabular-nums; }
.qb-lab { display: inline-block; margin-right: 8px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.qb-link { color: var(--p); text-decoration: none; font-weight: 600; }
.qb-link:hover { text-decoration: underline; }
.qb-mt { margin-top: 22px; }
.qb-note { margin: 0; font-size: 13px; }

/* ── 머리 ───────────────────────────────────── */
.qb-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.qb-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.03em; color: var(--text-main); }
.qb-sub { margin: 6px 0 0; font-size: 14px; color: var(--text-muted); }
.qb-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); text-decoration: none; }
.qb-back:hover { color: var(--p); }
.qb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qb-h3 { display: flex; align-items: center; gap: 8px; margin: 8px 0 -6px; font-size: 16px; font-weight: 800; }
.qb-count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--hover-row); color: var(--text-muted); font-size: 11.5px; font-weight: 700; }

/* ── 버튼 ───────────────────────────────────── */
.qb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 11px;
  background: var(--bg-card); color: var(--text-main);
  font: 700 13.5px/1 var(--qb-font, inherit); text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: border-color .15s, background-color .15s, color .15s, filter .15s;
}
.qb-btn:hover { border-color: color-mix(in srgb, var(--p) 55%, var(--border)); color: var(--p); }
.qb-btn:disabled, .qb-btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.qb-btn-p { background: var(--p); border-color: var(--p); color: #fff !important; }
.qb-btn-p:hover { filter: brightness(1.08); color: #fff; }
.qb-btn-ghost { border-color: transparent; background: transparent; }
.qb-btn-bad:hover { border-color: var(--qb-bad); color: var(--qb-bad); }
.qb-btn-sm { height: 32px; padding: 0 11px; border-radius: 9px; font-size: 12.5px; }
.qb-btn-lg { height: 50px; padding: 0 24px; border-radius: 13px; font-size: 15px; }
.qb-btn-block { width: 100%; }
.qb-btn.is-on { background: var(--qb-soft); border-color: transparent; color: var(--p); }
.qb-ibtn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); color: var(--text-muted); cursor: pointer; text-decoration: none; transition: color .15s, border-color .15s; }
.qb-ibtn:hover { color: var(--text-main); border-color: var(--text-muted); }
.qb-ibtn:disabled { opacity: .35; cursor: not-allowed; }
.qb-ibtn-sm { width: 30px; height: 30px; border-radius: 8px; font-size: 12.5px; }

/* ── 칩 · 난이도 · 태그 ─────────────────────── */
.qb-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.qb-chip-mute { background: var(--hover-row); color: var(--text-muted); }
.qb-chip-p { background: var(--qb-soft); color: var(--p); }
.qb-chip-ok { background: color-mix(in srgb, var(--qb-ok) 12%, transparent); color: var(--qb-ok); }
.qb-chip-warn { background: color-mix(in srgb, var(--qb-warn) 14%, transparent); color: var(--qb-warn); }
.qb-chip-bad { background: color-mix(in srgb, var(--qb-bad) 12%, transparent); color: var(--qb-bad); }
.qb-diff { display: inline-flex; gap: 2px; vertical-align: middle; }
.qb-diff i { width: 10px; height: 4px; border-radius: 2px; background: var(--border); }
.qb-diff i.on { background: var(--qb-warn); }
.qb-tag { font-size: 12px; color: var(--p); }
.qb-rate { font-size: 12px; font-weight: 700; color: var(--qb-ok); }
.qb-rate.is-low { color: var(--qb-bad); }

/* ── 카드 · 표 ─────────────────────────────── */
.qb-card { padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--qb-r, 14px); background: var(--bg-card);  }
.qb-card-flush { padding: 0; overflow: hidden; }
.qb-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.qb-card-h h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15.5px; font-weight: 800; letter-spacing: -.02em; }
.qb-card-h .qb-muted { font-size: 12.5px; }
.qb-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.qb-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qb-table-wrap { overflow-x: auto; }
.qb-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.qb-table th { padding: 10px 12px; text-align: left; font-size: 12px; font-weight: 700; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.qb-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.qb-table tr:last-child td { border-bottom: 0; }
.qb-table tbody tr:hover td { background: var(--hover-row); }
.qb-table .r { text-align: right; } .qb-table .c { text-align: center; }
.qb-table tr.is-low td b { color: var(--qb-bad); }

/* ── 입력 ───────────────────────────────────── */
.qb-field { display: flex; flex-direction: column; gap: 7px; margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.qb-field > span:first-child, .qb-field > legend { font-size: 13px; font-weight: 700; color: var(--text-main); padding: 0; }
.qb-field em { color: var(--qb-bad); font-style: normal; }
.qb-field small { font-size: 12px; font-weight: 500; }
.qb-input {
  width: 100%; height: 42px; padding: 0 13px;
  border: 1px solid var(--border); border-radius: 11px;
  background: var(--bg-card); color: var(--text-main);
  font: 500 14px var(--qb-font, inherit);
  transition: border-color .15s, box-shadow .15s;
}
textarea.qb-input { height: auto; padding: 11px 13px; line-height: 1.65; resize: vertical; }
.qb-input:focus { outline: none; border-color: var(--p);  }
.qb-input-sm { height: 32px; padding: 0 10px; border-radius: 9px; font-size: 13px; }
.qb-input-lg { height: 52px; font-size: 16px; }
.qb-ta { min-height: 130px; font-size: 15px; }
.qb-input-ico { position: relative; }
.qb-input-ico i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; }
.qb-input-ico .qb-input { padding-left: 36px; }
.qb-msg { min-height: 1em; margin: 10px 0 0; font-size: 13px; font-weight: 600; color: var(--qb-bad); }
.qb-msg:empty { display: none; }

/* 세그먼트 · 체크 칩 */
.qb-seg { display: flex; gap: 3px; padding: 3px; margin-bottom: 18px; border-radius: 11px; background: var(--hover-row); }
.qb-seg button, .qb-seg label { flex: 1; }
.qb-seg button, .qb-seg label span { display: block; padding: 8px 8px; border: 0; border-radius: 8px; background: none; color: var(--text-muted); font: 700 13px/1.2 var(--qb-font, inherit); text-align: center; cursor: pointer; }
.qb-seg button[aria-selected="true"], .qb-seg input:checked + span { background: var(--bg-card); color: var(--text-main);  }
.qb-seg input { position: absolute; opacity: 0; }
.qb-seg-3 { margin: 0; }
.qb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qb-chk { position: relative; }
.qb-chk input { position: absolute; opacity: 0; }
.qb-chk span { display: inline-block; padding: 6px 11px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--qb-ink-2); cursor: pointer; transition: all .12s; }
.qb-chk input:checked + span { background: var(--p); border-color: var(--p); color: #fff; }
.qb-chk input:focus-visible + span { outline: 2px solid var(--p); outline-offset: 2px; }

/* 스위치 */
.qb-switch { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 14px; cursor: pointer; }
.qb-switch input { position: absolute; opacity: 0; }
.qb-knob { position: relative; flex-shrink: 0; width: 38px; height: 22px; margin-top: 1px; border-radius: 999px; background: #cbd0dd; transition: background .15s; }
.qb-knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;  transition: transform .15s; }
.qb-switch input:checked + .qb-knob { background: var(--p); }
.qb-switch input:checked + .qb-knob::after { transform: translateX(16px); }
.qb-switch input:focus-visible + .qb-knob { outline: 2px solid var(--p); outline-offset: 2px; }
.qb-switch b { display: block; font-size: 13.5px; } .qb-switch small { display: block; font-size: 12px; color: var(--text-muted); }

/* 알림 */
.qb-alert { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--hover-row); font-size: 13.5px; font-weight: 600; color: var(--qb-ink-2); }
.qb-alert a { margin-left: auto; color: var(--p); font-weight: 700; }
.qb-alert-warn { background: color-mix(in srgb, var(--qb-warn) 12%, var(--bg-card)); color: var(--qb-warn); }
.qb-alert-ok { background: color-mix(in srgb, var(--qb-ok) 12%, var(--bg-card)); color: var(--qb-ok); }
.qb-banner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; background: var(--p); color: #fff; text-decoration: none; font-size: 14px; }
.qb-banner i:last-child { margin-left: auto; }
.qb-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 20px; text-align: center; }
.qb-empty > i { font-size: 32px; color: var(--text-muted); opacity: .6; }
.qb-empty p { margin: 0; color: var(--text-muted); line-height: 1.7; }
.qb-empty-page { min-height: 50vh; justify-content: center; align-items: center; }
.qb-empty-s { padding: 22px 16px; text-align: center; color: var(--text-muted); font-size: 13.5px; list-style: none; line-height: 1.7; }
.qb-empty-s .qb-btn { margin-left: 8px; }

/* ── 대시보드 ────────────────────────────────── */
.qb-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.qb-hello-sub { margin: 0; font-size: 13px; color: var(--text-muted); }
.qb-hello-t { margin: 6px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -.03em; word-break: keep-all; }
.qb-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.qb-stat { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--qb-r, 14px); background: var(--bg-card);  }
.qb-stat-l { margin: 0; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.qb-stat-l i { margin-right: 4px; color: var(--p); }
.qb-stat-v { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.qb-stat-v small { font-size: 14px; color: var(--text-muted); margin-left: 2px; }
.qb-stat small { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.qb-meter { display: block; height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.qb-meter i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--p); }
.qb-meter.is-full i { background: var(--qb-bad); }

.qb-trend { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 18px; }
.qb-trend-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.qb-trend-col i { display: block; width: 100%; max-width: 26px; height: max(3px, var(--h)); border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--p) 30%, transparent); transition: background .15s; }
.qb-trend-col i.today, .qb-trend-col:hover i { background: var(--p); }
.qb-trend-col em { font-style: normal; font-size: 10.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.qb-trend-n { font-size: 10.5px; font-weight: 700; color: var(--text-muted); min-height: 13px; }
.qb-hardlist { list-style: none; margin: 0; padding: 0; counter-reset: h; }
.qb-hardlist li { counter-increment: h; }
.qb-hardlist a { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 2px 10px; padding: 10px 8px; margin: 0 -8px; border-radius: 10px; color: var(--text-main); text-decoration: none; }
.qb-hardlist a::before { content: counter(h); grid-row: span 2; font-weight: 800; color: var(--qb-bad); }
.qb-hardlist a:hover { background: var(--hover-row); }
.qb-hard-t { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-hard-r { font-size: 12px; color: var(--text-muted); }
.qb-hard-r b { color: var(--qb-bad); }

/* ── 문제은행 ────────────────────────────────── */
.qb-bank { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; align-items: start; }
.qb-filter { position: sticky; top: calc(var(--qb-top, 64px) + 16px); }
.qb-resbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.qb-resbar-r { display: flex; gap: 6px; }
.qb-chk-all { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.qb-chk-all input, .qb-q-chk input { width: 16px; height: 16px; accent-color: var(--p); }
.qb-qlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.qb-q {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px;
  padding: 16px 16px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card);
  transition: border-color .15s, box-shadow .15s;
}
.qb-qlist-pick .qb-q { grid-template-columns: minmax(0, 1fr) auto; }
.qb-q:hover { border-color: color-mix(in srgb, var(--p) 35%, var(--border));  }
.qb-q.is-open { border-color: var(--p); }
.qb-q-chk { padding-top: 2px; }
.qb-q-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qb-q-cat { font-size: 12px; color: var(--text-muted); }
.qb-q-body { display: block; width: 100%; margin: 8px 0 6px; padding: 0; border: 0; background: none; color: var(--text-main); font: 600 14.5px/1.6 var(--qb-font, inherit); text-align: left; cursor: pointer; word-break: keep-all; overflow-wrap: anywhere; }
.qb-q-body:hover { color: var(--p); }
.qb-q-foot { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.qb-q-act { display: flex; align-items: flex-start; gap: 6px; }
.qb-q-detail { grid-column: 1 / -1; margin-top: 10px; padding-top: 14px; border-top: 1px dashed var(--border); }
.qb-pager { display: flex; justify-content: center; gap: 4px; margin-top: 16px; }
.qb-pager button { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-card); color: var(--text-main); font: 600 13px var(--qb-font, inherit); cursor: pointer; }
.qb-pager button[aria-current] { background: var(--p); border-color: var(--p); color: #fff; }
.qb-pager button:disabled { opacity: .35; cursor: default; }

.qb-loading { display: flex; flex-direction: column; gap: 10px; list-style: none; }
.qb-loading span { height: 86px; border-radius: 14px; background: linear-gradient(90deg, var(--hover-row), var(--bg-card), var(--hover-row)); background-size: 200% 100%; animation: qb-sh 1.2s linear infinite; }
@keyframes qb-sh { to { background-position: -200% 0; } }

/* 바구니 */
.qb-cart {
  position: fixed; left: 50%; bottom: 22px; z-index: 950; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 14px; border-radius: 16px;
  background: #0f172a; color: #fff;
  
}
.qb-cart[hidden] { display: none; }
.qb-cart-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--p); }
.qb-cart-t { font-size: 14px; }
.qb-cart .qb-btn-ghost { color: #cbd5e1; }
.qb-cart .qb-btn-ghost:hover { color: #fff; }

/* 문항 본문 (공통) */
.qb-body { white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.75; font-size: 15px; }
.qb-body img { max-width: 100%; height: auto; border-radius: 8px; }
.qb-body code { padding: 1px 5px; border-radius: 5px; background: var(--hover-row); font-family: var(--qb-mono, monospace); font-size: .92em; }
.qb-body p { margin: 0 0 8px; }
.qb-body p:last-child { margin-bottom: 0; }
.qb-body pre { position: static; white-space: pre; overflow-x: auto; margin: 10px 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--hover-row); color: var(--text-main); line-height: 1.7; }
.qb-body pre::before { content: none !important; display: none !important; }
.qb-body pre code { display: block; padding: 0; background: none; color: inherit; font-size: 13px; white-space: pre; }
.qb-body code { white-space: normal; }
.qb-opts { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qb-opt { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); font-size: 14.5px; }
.qb-opt > b { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; background: var(--hover-row); color: var(--text-muted); font: 800 12px/1 var(--qb-mono, monospace); }
.qb-opt > span { flex: 1; white-space: pre-wrap; }
.qb-opt > em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.qb-opt.is-ans { border-color: var(--qb-ok); background: color-mix(in srgb, var(--qb-ok) 7%, var(--bg-card)); }
.qb-opt.is-ans > b { background: var(--qb-ok); color: #fff; }
.qb-opts-ro .qb-opt.is-picked:not(.is-ans) { border-color: var(--qb-bad); background: color-mix(in srgb, var(--qb-bad) 6%, var(--bg-card)); }
.qb-opts-ro .qb-opt.is-picked:not(.is-ans) > b { background: var(--qb-bad); color: #fff; }
.qb-opt-in { cursor: pointer; transition: border-color .12s, background-color .12s; }
.qb-opt-in:hover { border-color: color-mix(in srgb, var(--p) 45%, var(--border)); }
.qb-opt-in input { position: absolute; opacity: 0; }
.qb-opt-in.is-picked { border-color: var(--p); background: var(--qb-soft); }
.qb-opt-in.is-picked > b { background: var(--p); color: #fff; }
.qb-opt-in:focus-within { outline: 2px solid var(--p); outline-offset: 2px; }
.qb-expl-in { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--hover-row); }
.qb-rv-ans p, p.qb-rv-ans { margin: 10px 0 0; white-space: pre-wrap; }

/* ── 문제 편집 ───────────────────────────────── */
.qb-editor, .qb-builder { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.qb-editor-main, .qb-builder-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.qb-sticky { position: sticky; top: calc(var(--qb-top, 64px) + 16px); }
.qb-ans[hidden] { display: none; }
.qb-typepick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.qb-typepick input, .qb-diffpick input, .qb-ox input { position: absolute; opacity: 0; }
.qb-typepick span { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 6px; border: 1px solid var(--border); border-radius: 12px; font-size: 12.5px; font-weight: 700; color: var(--qb-ink-2); text-align: center; cursor: pointer; transition: all .12s; }
.qb-typepick span i { font-size: 17px; color: var(--text-muted); }
.qb-typepick input:checked + span { border-color: var(--p); background: var(--qb-soft); color: var(--p); }
.qb-typepick input:checked + span i { color: var(--p); }
.qb-typepick input:focus-visible + span, .qb-diffpick input:focus-visible + span, .qb-ox input:focus-visible + span { outline: 2px solid var(--p); outline-offset: 2px; }
.qb-choices { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qb-choice { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.qb-choice-l { width: 22px; font: 800 13px/1 var(--qb-mono, monospace); color: var(--text-muted); text-align: center; }
.qb-choice-ok { position: relative; }
.qb-choice-ok input { position: absolute; opacity: 0; }
.qb-choice-ok span { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--border); border-radius: 50%; cursor: pointer; transition: all .12s; }
.qb-choice-ok input[type=checkbox] + span { border-radius: 8px; }
.qb-choice-ok input:checked + span { border-color: var(--qb-ok); background: var(--qb-ok); }
.qb-choice-ok input:checked + span::after { content: "\f00c"; font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", sans-serif; color: #fff; font-weight: 900; font-size: 12px; }
.qb-choice-ok input:focus-visible + span { outline: 2px solid var(--p); outline-offset: 2px; }
.qb-diffpick { display: flex; gap: 6px; }
.qb-diffpick label { flex: 1; }
.qb-diffpick span { display: grid; place-items: center; height: 38px; border: 1px solid var(--border); border-radius: 10px; font-weight: 800; color: var(--text-muted); cursor: pointer; }
.qb-diffpick input:checked + span { border-color: var(--qb-warn); background: color-mix(in srgb, var(--qb-warn) 14%, var(--bg-card)); color: var(--qb-warn); }
.qb-ox { display: flex; gap: 12px; }
.qb-ox label { flex: 1; max-width: 160px; }
.qb-ox span { display: grid; place-items: center; height: 72px; border: 2px solid var(--border); border-radius: 16px; font: 900 30px/1 'Montserrat', sans-serif; color: var(--text-muted); cursor: pointer; transition: all .12s; }
.qb-ox input:checked + span { border-color: var(--p); background: var(--qb-soft); color: var(--p); }
.qb-ox-big { margin-top: 18px; justify-content: center; }
.qb-ox-big label { max-width: 200px; }
.qb-ox-big span { height: 110px; font-size: 46px; }
.qb-save { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

/* ── 시험지 목록 · 빌더 ──────────────────────── */
.qb-exams, .qb-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.qb-exam, .qb-group { display: flex; flex-direction: column; gap: 12px; }
.qb-exam-top { display: flex; align-items: center; gap: 6px; }
.qb-more { position: relative; margin-left: auto; }
.qb-more .qb-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 190px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card);  }
.qb-more .qb-menu[hidden] { display: none; }
.qb-more .qb-menu a, .qb-more .qb-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 0; border-radius: 8px; background: none; color: var(--qb-ink-2); font: 600 13px var(--qb-font, inherit); text-align: left; text-decoration: none; cursor: pointer; }
.qb-more .qb-menu a:hover, .qb-more .qb-menu button:hover { background: var(--hover-row); color: var(--text-main); }
.qb-more .qb-menu .bad { color: var(--qb-bad); }
.qb-exam-t { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.qb-exam-t a { color: var(--text-main); text-decoration: none; }
.qb-exam-t a:hover { color: var(--p); }
.qb-exam-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; }
.qb-exam-meta div { display: flex; flex-direction: column-reverse; gap: 2px; }
.qb-exam-meta dt { font-size: 12px; color: var(--text-muted); }
.qb-exam-meta dd { margin: 0; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.qb-exam-share { display: flex; gap: 6px; }
.qb-exam-share .qb-input { flex: 1; min-width: 0; font-family: var(--qb-mono, monospace); font-size: 12px; color: var(--text-muted); }
.qb-exam-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.qb-exam-date { margin-left: auto; font-size: 12px; }

.qb-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qb-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 12px 12px 10px; border: 1px solid var(--border); border-radius: 12px; }
.qb-item:hover { border-color: color-mix(in srgb, var(--p) 35%, var(--border)); }
.qb-item-no { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--qb-soft); color: var(--p); font: 800 12px/1 var(--qb-mono, monospace); }
.qb-item-t { margin: 5px 0 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-item-pt { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-muted); }
.qb-item-pt input { width: 64px; text-align: right; }
.qb-item-act { display: flex; gap: 4px; }
.qb-items-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 10px; color: var(--text-muted); }
.qb-items-empty[hidden] { display: none; }
.qb-items-empty i { font-size: 26px; opacity: .6; }
.qb-items-empty p { margin: 0; }
.qb-items-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }

/* 모달 */
.qb-modal { position: fixed; inset: 0; z-index: 99990; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.qb-modal[hidden] { display: none; }
html.qb-modal-open { overflow: hidden; }
.qb-modal-box { display: flex; flex-direction: column; width: min(520px, 100%); max-height: calc(100vh - 40px); border-radius: 18px; background: var(--bg-card);  overflow: hidden; }
.qb-modal-lg { width: min(820px, 100%); }
.qb-modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.qb-modal-h h3 { margin: 0; font-size: 16px; font-weight: 800; }
.qb-modal-b { padding: 18px; overflow-y: auto; }
.qb-modal-f { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.qb-modal-f .qb-pager { margin: 0 auto 0 0; }
.qb-pick-bar { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.qb-qlist-pick { padding: 14px 18px; overflow-y: auto; flex: 1; min-height: 200px; }

/* ── 응시 ───────────────────────────────────── */
.qb-take { max-width: 1060px; margin: 0 auto; width: 100%; }
.qb-take-intro { max-width: 620px; margin: 30px auto; padding: 36px 34px; text-align: center; }
.qb-take-by { margin: 0; font-size: 13px; color: var(--text-muted); }
.qb-take-t { margin: 8px 0 12px; font-size: 26px; font-weight: 800; letter-spacing: -.03em; word-break: keep-all; }
.qb-take-d { margin: 0 0 18px; color: var(--qb-ink-2); line-height: 1.7; text-align: left; padding: 14px 16px; border-radius: 12px; background: var(--hover-row); }
.qb-take-meta { display: flex; justify-content: center; gap: 10px; margin: 0 0 24px; flex-wrap: wrap; }
.qb-take-meta div { display: flex; flex-direction: column-reverse; gap: 3px; padding: 12px 18px; border: 1px solid var(--border); border-radius: 12px; min-width: 96px; }
.qb-take-meta dt { font-size: 12px; color: var(--text-muted); }
.qb-take-meta dd { margin: 0; font-size: 17px; font-weight: 800; }
.qb-take-start { display: flex; flex-direction: column; align-items: stretch; gap: 10px; max-width: 360px; margin: 0 auto; text-align: left; }
.qb-take-start .qb-muted { font-size: 12.5px; text-align: center; }
.qb-take-intro > .qb-alert { justify-content: center; margin-bottom: 16px; }

.qb-solve[hidden] { display: none; }
.qb-solve-h { position: sticky; top: var(--qb-top, 64px); z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 0; background: var(--bg-body); }
.qb-solve-t { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.qb-solve-t b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-solve-t .qb-muted { font-size: 12.5px; }
.qb-timer { display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 11px; background: var(--bg-card); border: 1px solid var(--border); font: 700 15px/1 var(--qb-mono, monospace); }
.qb-timer[hidden] { display: none; }
.qb-timer.is-low { border-color: var(--qb-bad); color: var(--qb-bad); animation: qb-blink 1s steps(2) infinite; }
@keyframes qb-blink { 50% { opacity: .55; } }
.qb-progress { height: 4px; margin-bottom: 18px; border-radius: 999px; background: var(--border); overflow: hidden; }
.qb-progress i { display: block; height: 100%; width: 0; background: var(--p); transition: width .3s; }
.qb-solve-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.qb-qcard { padding: 26px 28px; min-height: 320px; }
.qb-qcard-h { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.qb-qcard-pt { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.qb-qcard-body { font-size: 17px; font-weight: 600; }
.qb-hint { margin: 12px 0 0; font-size: 12.5px; }
.qb-qcard .qb-input { margin-top: 16px; }
.qb-rv-no { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 9px; background: var(--p); color: #fff; font: 800 13px/1 var(--qb-mono, monospace); }
.qb-nav { position: static; padding: 14px 16px 12px; min-width: 0; }
.qb-navgrid { position: relative; display: flex; flex-wrap: nowrap; gap: 6px; margin: 8px 0 10px; padding: 3px 3px 8px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.qb-navgrid button { flex: 0 0 auto; min-width: 38px; padding: 0 8px; height: 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); color: var(--text-muted); font: 700 12.5px/1 var(--qb-mono, monospace); cursor: pointer; position: relative; }
.qb-navgrid button.done { background: var(--qb-soft); border-color: transparent; color: var(--p); }
.qb-navgrid button.cur { outline: 2px solid var(--p); outline-offset: 1px; }
.qb-navgrid button.flag::after { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--qb-warn); }
.qb-legend { display: flex; gap: 12px; margin: 0; font-size: 11.5px; color: var(--text-muted); }
.qb-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.qb-legend i.done { background: var(--qb-soft); border: 1px solid var(--p); }
.qb-legend i.flag { background: var(--qb-warn); border-radius: 50%; }
.qb-solve-f { display: flex; justify-content: space-between; gap: 10px; }
#qb-flag.is-on { color: var(--qb-warn); }

/* ── 결과 ───────────────────────────────────── */
.qb-score { display: flex; align-items: center; gap: 28px; padding: 26px 28px; }
.qb-ring { position: relative; flex-shrink: 0; width: 140px; height: 140px; }
.qb-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.qb-ring circle { fill: none; stroke-width: 10; }
.qb-ring .t { stroke: var(--border); }
.qb-ring .b { stroke: var(--p); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p2, 0)); transition: stroke-dashoffset 1s ease; }
.qb-ring span { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-size: 14px; color: var(--text-muted); }
.qb-ring span b { font-size: 38px; font-weight: 800; color: var(--text-main); letter-spacing: -.03em; }
.qb-score-tx { min-width: 0; }
.qb-score-tx .qb-title { margin: 4px 0 8px; }
.qb-score-line { display: flex; gap: 6px; margin: 0 0 14px; }
.qb-review { display: flex; flex-direction: column; gap: 12px; }
.qb-rv-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.qb-rv-st { margin-left: auto; font-size: 13px; font-weight: 800; }
.qb-rv-ok { border-left: 4px solid var(--qb-ok); }
.qb-rv-ok .qb-rv-st { color: var(--qb-ok); }
.qb-rv-bad { border-left: 4px solid var(--qb-bad); }
.qb-rv-bad .qb-rv-st { color: var(--qb-bad); }
.qb-rv-wait { border-left: 4px solid var(--qb-warn); }
.qb-rv-wait .qb-rv-st { color: var(--qb-warn); }
.qb-rv-pt { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.qb-rv-ans { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--hover-row); }
.qb-rv-ans p { margin: 0; }
.qb-rv-ans p + p { margin-top: 8px; }
.qb-feedback { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--qb-soft); color: var(--p); font-size: 13.5px; }
.qb-expl { margin-top: 12px; }
.qb-expl summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--p); }
.qb-expl .qb-body { margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--hover-row); font-size: 14px; }
.qb-grade { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); font-size: 13px; font-weight: 700; }
.qb-grade label { display: flex; align-items: center; gap: 6px; }
.qb-grade input[type=number] { width: 80px; }
.qb-grade input[name=feedback] { flex: 1; min-width: 160px; }

/* ── 분석 ───────────────────────────────────── */
.qb-dist { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 16px; }
.qb-dist-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.qb-dist-col i { display: block; width: 100%; height: max(2px, var(--h)); border-radius: 6px 6px 2px 2px; background: var(--p); opacity: .85; }
.qb-dist-col span { font-size: 11px; font-weight: 700; color: var(--text-muted); min-height: 13px; }
.qb-dist-col em { font-style: normal; font-size: 10.5px; color: var(--text-muted); }
.qb-hbar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 44px; align-items: center; gap: 10px; margin: 10px 0; font-size: 13px; }
.qb-hbar-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--qb-ink-2); }
.qb-hbar-t { height: 9px; border-radius: 999px; background: var(--border); overflow: hidden; }
.qb-hbar-t i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--p); }
.qb-hbar-t i.bad { background: var(--qb-bad); }
.qb-hbar b { text-align: right; }

/* ── 그룹 · 요금제 ─────────────────────────── */
.qb-group-top { display: flex; align-items: center; gap: 12px; }
.qb-group-ic { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 13px; background: var(--qb-soft); color: var(--p); font-size: 18px; font-weight: 800; }
.qb-group-ic.is-joined { background: color-mix(in srgb, var(--qb-ok) 14%, var(--bg-card)); color: var(--qb-ok); }
.qb-group-ic-lg { width: 64px; height: 64px; font-size: 26px; border-radius: 18px; margin: 0 auto; }
.qb-group-tx h4 { margin: 0; font-size: 16px; font-weight: 800; }
.qb-group-tx p { margin: 2px 0 0; font-size: 12.5px; }
.qb-group-n { margin: 0; font-size: 13px; color: var(--text-muted); }
.qb-group-n b { color: var(--text-main); }
.qb-join-inline { display: flex; gap: 6px; }
.qb-join-inline .qb-input { width: 130px; }
.qb-joincard { max-width: 440px; margin: 40px auto; padding: 36px 30px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qb-joincard .qb-title { justify-content: center; }
.qb-curplan { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: center; }
.qb-curplan h3 { margin: 4px 0; font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: var(--p); }
.qb-curplan p { margin: 0; font-size: 13px; }
.qb-usage { display: flex; flex-direction: column; gap: 12px; }
.qb-usage-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 130px; align-items: center; gap: 12px; font-size: 13.5px; }
.qb-usage-row b { text-align: right; } .qb-usage-row b small { font-weight: 500; color: var(--text-muted); }
.qb-usage-row .qb-meter { height: 8px; }
.qb-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.qb-plan { position: relative; display: flex; flex-direction: column; gap: 6px; }
.qb-plan.is-hl { border: 2px solid var(--p); }
.qb-plan.is-cur { background: linear-gradient(170deg, var(--qb-soft), var(--bg-card) 60%); }
.qb-plan-tag { position: absolute; top: -11px; left: 18px; padding: 3px 10px; border-radius: 999px; background: var(--p); color: #fff; font-size: 11.5px; font-weight: 800; }
.qb-plan h4 { margin: 0; font-size: 14px; color: var(--text-muted); }
.qb-plan-price { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.qb-plan .qb-muted { margin: 0; font-size: 13px; }
.qb-plan ul { flex: 1; list-style: none; margin: 10px 0 14px; padding: 12px 0 0; border-top: 1px solid var(--border); display: grid; gap: 8px; font-size: 13.5px; }
.qb-plan li i { color: var(--p); margin-right: 8px; font-size: 11px; }

/* 토스트 */
.qb-toasts { position: fixed; left: 50%; bottom: 90px; z-index: 100000; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.qb-toast { padding: 11px 16px; border-radius: 12px; background: #0f172a; color: #fff; font-size: 13.5px; font-weight: 600;  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.qb-toast.show { opacity: 1; transform: none; }
.qb-toast.is-bad { background: var(--qb-bad); }

/* ── 반응형 ─────────────────────────────────── */
@media (max-width: 1180px) {
  .qb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qb-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .qb-bank, .qb-editor, .qb-builder, .qb-solve-body { grid-template-columns: minmax(0, 1fr); }
  .qb-filter, .qb-sticky, .qb-nav { position: static; }
  .qb-curplan { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 640px) {
  .qb-title { font-size: 20px; }
  .qb-stats { gap: 10px; }
  .qb-stat { padding: 14px 16px; }
  .qb-stat-v { font-size: 22px; }
  .qb-card { padding: 16px; }
  .qb-typepick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qb-q { grid-template-columns: auto minmax(0, 1fr); }
  .qb-q-act { grid-column: 2; }
  .qb-item { grid-template-columns: 28px minmax(0, 1fr); }
  .qb-item-pt, .qb-item-act { grid-column: 2; }
  .qb-score { flex-direction: column; text-align: center; }
  .qb-score-line, .qb-exam-meta { justify-content: center; }
  .qb-qcard { padding: 20px 18px; }
  .qb-pick-bar { grid-template-columns: 1fr; }
  .qb-usage-row { grid-template-columns: 80px minmax(0, 1fr); }
  .qb-usage-row b { grid-column: 2; text-align: left; }
  .qb-cart { left: 10px; right: 10px; transform: none; }
  .qb-take-intro { padding: 26px 20px; margin: 10px auto; }
  .qb-grid2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .qb-loading span, .qb-timer.is-low { animation: none; } }

/* v1.1 — 문제는 시험지 안에서만: 문제은행 목록의 소속 시험지 링크 · 시험지 문항 제목 링크 */
.qb-q-exam { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--p); text-decoration: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qb-q-exam:hover { text-decoration: underline; }
a.qb-item-t { color: inherit; text-decoration: none; }
a.qb-item-t:hover { text-decoration: underline; }
.qb-items-add { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }


/* 그림자 없음 · 포커스는 윤곽선 */
.qb-page *, .qb-page *::before, .qb-page *::after, .qb-modal *, .qb-toast { box-shadow: none !important; text-shadow: none !important; }
.qb-input:focus, .qb-input:focus-visible { outline: 2px solid color-mix(in srgb, var(--p) 35%, transparent); outline-offset: 0; }

/* 기본 테마의 `header { background !important }` 규칙이 화면 머리글에 흰 띠를 만들지 않도록 */
.qb-page header, .qb-modal header { background: transparent !important; backdrop-filter: none !important; }
.qb-page .qb-solve-h { background: var(--bg-body) !important; }
.qb-item-main { min-width: 0; }
.qb-item-t { display: block; }
