/* ── ecbt 확정 토큰 접속(디자인 2026-10-11 통일 차수) ───────────────────
 * 이 파일을 단독으로 링크하는 페이지도 확정판 팔레트(tokens.css)를 탄다.
 * <html data-palette="1"> 이 반드시 있어야 주조·보조가 채워진다. */
@import url("tokens.css");
/* 글꼴(@font-face)은 fonts.css(조각판·swap) 한 곳 — layers.css→components.css 와 cert-menu.css 가 부른다(2026-10-15) */

/* sets.css — 세트 페이지 전용 꾸밈 파일 (layers.css 위에 얹는다)
 *
 * 모양 기준: ref/set-01-live.html 의 렌더 결과 및 ref/template-old.html Tailwind 클래스 값.
 * 인라인 style 금지 · 유틸리티 클래스 금지 — 뜻 있는 훅 클래스만.
 * 빌더가 site-next/styles/sets.css 로 복사한다.
 */

/* ── 전역 박스 모델 ────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* ── 브라우저 기본 여백 초기화 (Tailwind preflight 가 하던 일) ─────────────
 * :where() 는 우선순위 0 이라 아래 훅 클래스 규칙(과 layers.css)이 그대로 이긴다.
 * 이게 없으면 해설 문단마다 기본 여백 1em 이 붙어 간격이 벌어진다. */
:where(.page--set) :where(h1, h2, h3, h4, p, ol, ul, figure, blockquote) {
  margin: 0;
}

/* ── 바탕 (page--set) ──────────────────────────────────────────────── */
body.page--set {
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--background);
  color: var(--foreground);
  margin: 0;
  /* 모바일에서 가로 스크롤 0 */
  overflow-x: hidden;
  max-width: 100%;
}

/* ── 사이트 헤더 (guides.css 패턴 동일) ────────────────────────────── */
.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: color-mix(in srgb, var(--card) 90%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: 65px;
  max-width: 100%;
  margin: 0;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 640px) {
  .site-head {
    padding-left: max(1.5rem, calc((100% - 72rem) / 2 + 1.5rem));
    padding-right: max(1.5rem, calc((100% - 72rem) / 2 + 1.5rem));
  }
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  flex-shrink: 0;
}

.site-logo-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.site-logo-icon svg { display: block; }

.site-logo-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--foreground);
}

.site-logo-sub {
  display: none;
  font-size: 11px;
  color: var(--muted-foreground-2);
  font-weight: 500;
  border-left: 1px solid var(--border);
  padding-left: 0.625rem;
}

@media (min-width: 640px) {
  .site-logo-sub { display: inline; }
}

.site-nav { display: none; }

@media (min-width: 768px) {
  .site-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
}

.site-nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.site-nav-item { list-style: none; margin: 0; padding: 0; }

.site-nav-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--muted-foreground);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav-link:hover {
  background-color: var(--muted);
  color: var(--foreground);
}

.site-nav-link--active {
  background-color: var(--muted);
  color: var(--foreground);
}

/* 헤더 세트 선택 드롭다운 */
.head-set-select {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.head-set-label {
  display: none;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

@media (min-width: 640px) {
  .head-set-label { display: block; }
}

.head-set-picker {
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background-color: var(--card);
  padding: 0.5rem 0.75rem;
  color: var(--foreground);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.head-set-picker:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ── 본문 틀 ───────────────────────────────────────────────────────── */
.page-main--set {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding-top: 2rem;
  padding-bottom: 1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .page-main--set {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* ── 브레드크럼 ────────────────────────────────────────────────────── */
.crumbs {
  font-size: 0.75rem;
  color: var(--muted-foreground-2);
  margin-bottom: 1rem;
}

.crumbs-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.crumbs-item { display: inline-flex; align-items: center; }
.crumbs-item[aria-current="page"] { color: var(--muted-foreground); }
.crumbs-sep { color: var(--muted-foreground-2); user-select: none; }
.crumbs-link { color: inherit; text-decoration: none; }
.crumbs-link:hover { color: var(--muted-foreground); }

/* ── 회차 요약 섹션 ────────────────────────────────────────────────── */
.set-summary {
  border-radius: 1rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .set-summary { padding: 2rem; }
}

.set-summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.set-summary-title-wrap { flex: 1 1 auto; }

.page-title {
  font-size: 1.25rem;
  line-height: 1.375;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--foreground);
  margin: 0 0 0.25rem;
}

@media (min-width: 768px) {
  .page-title { font-size: 1.5rem; }
}

.page-lead {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin: 0;
}

.set-pass-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-strong);
  background-color: var(--primary-soft);
  border: 1px solid var(--primary-soft);
  border-radius: 9999px;
  padding: 0.375rem 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.set-brief {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.75rem;
  color: var(--muted-foreground);
}

.set-brief-para { margin: 0 0 0.5rem; }
.set-brief-para:last-child { margin-bottom: 0; }

.set-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.set-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background-color: var(--muted);
  border-radius: 9999px;
  padding: 0.375rem 0.75rem;
}

/* ── 본문 2컬럼 레이아웃 ───────────────────────────────────────────── */
.set-body-layout {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .set-body-layout {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
}

.set-question-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

/* ── 사이드바 ──────────────────────────────────────────────────────── */
.set-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .set-sidebar {
    position: sticky;
    top: 5rem;
    align-self: start;
  }
}

/* ── 문항 카드 ─────────────────────────────────────────────────────── */
.cbt-question-box {
  background-color: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  /* 스크롤 여백 (헤더 65px + 여유) */
  scroll-margin-top: 6rem;
}

@media (min-width: 768px) {
  .cbt-question-box { padding: 2rem; }
}

/* 카드 머리 */
.q-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.q-chips {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.q-num-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-strong);
  background-color: var(--primary-soft);
  border-radius: 9999px;
  padding: 0.25rem 0.625rem;
}

.q-subject-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background-color: var(--muted);
  border-radius: 9999px;
  padding: 0.25rem 0.625rem;
}

.q-calc-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-strong);
  background-color: var(--primary-soft);
  border: 1px solid var(--primary-soft);
  border-radius: 9999px;
  padding: 0.25rem 0.625rem;
}

/* 문제 본문 */
.q-stem {
  font-size: 0.96875rem;
  line-height: 2rem;
  color: var(--foreground);
  margin: 0 0 0.75rem;
  white-space: normal;
}

/* 보기 목록 — CSS counter 로 번호 (본문에 숫자를 박지 않는다, §3-4).
 * counter-reset 은 <ol class="q-options"> 에 한 번만 둔다 — 보기마다 세어 ①②③④.
 * (agy 초안은 <ol> 안에 <legend> 가 끼어 nth-child 가 밀려 ②부터 시작했다.) */
@counter-style circled-option {
  system: fixed;
  symbols: "①" "②" "③" "④";
  suffix: " ";
  fallback: decimal;
}

.q-options {
  list-style: none;
  counter-reset: opt;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.opt-item {
  counter-increment: opt;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background-color: var(--card);
  cursor: pointer;
  line-height: 1.65;
  font-size: 0.9375rem;
  color: var(--foreground);
  transition: border-color 0.15s ease, background-color 0.15s ease;
  user-select: none;
}

.opt-item::before {
  content: counter(opt, circled-option);
  font-weight: 700;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

/* 보기 글 — 글·수식이 섞여도 한 줄 흐름을 유지한다(flex 항목이 쪼개지지 않게 한 칸으로 묶는다) */
.opt-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.opt-item:hover {
  border-color: var(--border);
  background-color: var(--background);
}

/* 선택 상태 */
.opt-item.is-selected {
  border-color: var(--primary);
  background-color: var(--primary-soft);
}

/* 채점 후 정답·오답 상태 */
.opt-item.is-correct {
  border-color: var(--correct);
  background-color: var(--correct-soft);
  box-shadow: inset 0 0 0 1px var(--correct);
}

.opt-item.is-wrong {
  border-color: var(--wrong);
  background-color: var(--card)1f2;
  box-shadow: inset 0 0 0 1px var(--wrong);
}

/* 채점 완료 후 커서 */
.cbt-question-box.is-graded .opt-item {
  cursor: default;
  pointer-events: none;
}

/* 즉시 피드백 */
.q-feedback {
  display: none;
  margin-top: 0.875rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.6;
}

.q-feedback.show { display: block; }
.q-feedback.ok { background-color: var(--correct-soft); color: var(--correct-strong); }
.q-feedback.no { background-color: var(--card)1f2; color: var(--wrong-strong); }

/* 해설 아코디언 */
.cbt-explanation {
  margin-top: 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background-color: color-mix(in srgb, var(--background) 70%, transparent);
}

.exp-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-strong);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

/* WebKit details marker 제거 */
.exp-toggle::-webkit-details-marker { display: none; }
details > summary { list-style: none; }

.exp-toggle-text { flex: 1; }

.chev {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

details[open] > .exp-toggle .chev {
  transform: rotate(180deg);
}

.exp-body {
  padding: 0.25rem 1.25rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.75rem;
  color: var(--foreground);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.exp-answer { margin: 0; }

.exp-answer-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background-color: var(--correct-soft);
  color: var(--correct-strong);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--correct-soft);
}

.exp-summary { margin: 0; }

.exp-evidence {
  margin: 0;
  color: var(--muted-foreground);
}

.exp-evidence-label {
  font-weight: 600;
  color: var(--muted-foreground);
}

/* ── 이전/다음 네비게이션 ──────────────────────────────────────────── */
.q-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.q-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background-color: var(--card);
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.q-nav-btn:hover:not(:disabled) {
  border-color: var(--border);
  background-color: var(--muted);
}

.q-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.q-nav-btn--next {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
}

.q-nav-btn--next:hover:not(:disabled) {
  background-color: var(--primary-strong);
  border-color: var(--primary-strong);
}

.q-nav-pos {
  font-size: 0.75rem;
  color: var(--muted-foreground-2);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ── 타이머 ────────────────────────────────────────────────────────── */
.exam-timer {
  border-radius: 1rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

.exam-timer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.exam-timer-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}

.exam-timer-total {
  font-size: 0.6875rem;
  color: var(--muted-foreground-2);
}

.exam-timer-display {
  margin: 0.75rem 0 0;
  font-size: 1.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
  color: var(--foreground);
}

.exam-timer-display.is-urgent { color: var(--destructive); }

.exam-timer-track {
  margin-top: 0.75rem;
  height: 6px;
  border-radius: 9999px;
  background-color: var(--muted);
  overflow: hidden;
}

.exam-timer-bar {
  height: 100%;
  border-radius: 9999px;
  background-color: var(--primary);
  width: 100%;
  transition: width 1s linear, background-color 0.5s ease;
}

.exam-timer-bar.is-urgent { background-color: var(--destructive); }

.exam-timer-hint {
  margin: 0.625rem 0 0;
  font-size: 0.75rem;
  color: var(--muted-foreground-2);
}

/* ── OMR 바로가기 ──────────────────────────────────────────────────── */
.omr-nav {
  border-radius: 1rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

.omr-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.omr-nav-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}

.omr-nav-count {
  font-size: 0.6875rem;
  color: var(--muted-foreground-2);
  font-variant-numeric: tabular-nums;
}

/* OMR 격자 — 6열 */
.omr-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 1rem;
}

.omr-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  background-color: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  padding: 0;
}

.omr-cell:hover {
  border-color: var(--primary);
  background-color: var(--primary-soft);
}

.omr-cell.is-current {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  color: var(--primary-strong);
  font-weight: 700;
}

.omr-cell.is-correct {
  background-color: var(--correct);
  border-color: var(--correct);
  color: var(--correct-foreground);
}

.omr-cell.is-wrong {
  background-color: var(--wrong);
  border-color: var(--wrong);
  color: var(--wrong-foreground);
}

/* OMR 범례 */
.omr-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}

.omr-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.omr-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.omr-legend-dot--current {
  background-color: var(--card);
  border: 1px solid var(--primary);
}

.omr-legend-dot--correct {
  background-color: var(--correct);
}

.omr-legend-dot--wrong {
  background-color: var(--wrong);
}

.omr-legend-dot--rest {
  background-color: var(--card);
  border: 1px solid var(--border);
}

/* ── 광고 슬롯 ─────────────────────────────────────────────────────── */
/* AD_SLOT_A (300×250) — --enable-ads 없으면 요소 자체가 없다 */
.ad-slot-a {
  width: 300px;
  min-height: 250px;
  background-color: color-mix(in srgb, var(--muted) 60%, transparent);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  align-self: start;
}

.ad-slot-a .adsbygoogle { display: block; }

/* AD_SLOT_C (728×90 leaderboard) */
.ad-slot-c {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  margin: 1.5rem auto;
  background-color: color-mix(in srgb, var(--muted) 60%, transparent);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.ad-slot-c .adsbygoogle { display: block; }

/* AD_SLOT_B (문항 사이 728×90) */
.ad-slot-b {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  margin: 1.5rem auto;
  background-color: color-mix(in srgb, var(--muted) 60%, transparent);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.ad-slot-b .adsbygoogle { display: block; }

/* ── 다음 학습 섹션 (set-nav) ──────────────────────────────────────── */
.set-nav {
  margin-top: 2.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background-color: color-mix(in srgb, var(--background) 70%, transparent);
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .set-nav { padding: 2rem; }
}

.set-nav-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
}

.set-nav-desc {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.75rem;
  color: var(--muted-foreground);
}

.set-nav-links {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.set-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background-color: var(--card);
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.set-nav-btn:hover { border-color: var(--primary); }

.set-nav-btn--next {
  border-color: var(--primary-soft);
  background-color: var(--primary-soft);
  font-weight: 600;
  color: var(--primary-strong);
}

.set-nav-btn--next:hover { border-color: var(--primary); }

.set-nav-guides-title {
  margin: 1.75rem 0 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--foreground);
}

.set-nav-guides {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .set-nav-guides { grid-template-columns: repeat(3, 1fr); }
}

.set-nav-guide-card {
  display: block;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background-color: var(--card);
  padding: 1rem;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.set-nav-guide-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.set-nav-guide-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
}

.set-nav-guide-desc {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1.5rem;
  color: var(--muted-foreground);
}

/* ── 사이트 푸터 (guides.css 패턴 동일) ────────────────────────────── */
.site-foot {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  background-color: var(--card);
  padding: 2.5rem 1rem;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .site-foot {
    padding-left: max(1.5rem, calc((100% - 72rem) / 2 + 1.5rem));
    padding-right: max(1.5rem, calc((100% - 72rem) / 2 + 1.5rem));
  }
}

@media (min-width: 768px) {
  .site-foot {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .site-foot .foot-brand { grid-column: 1; grid-row: 1; }
  .site-foot .foot-nav   { grid-column: 2; grid-row: 1; justify-self: end; }
  .site-foot .foot-copy  { grid-column: 1 / span 2; grid-row: 2; }
  .site-foot .ai-notice  { grid-column: 1 / span 2; grid-row: 3; }
}

.foot-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.brand-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-icon svg { display: block; }

.brand-name { font-size: 0.875rem; font-weight: 700; color: var(--foreground); }
.brand-desc  { font-size: 0.75rem; color: var(--muted-foreground-2); }

.foot-nav { margin: 0; padding: 0; }

.foot-nav-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.foot-nav-item { display: inline-flex; align-items: center; }
.foot-nav-sep  { color: var(--muted-foreground-2); user-select: none; }

.foot-nav-link {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.15s ease;
}

.foot-nav-link:hover { color: var(--foreground); }

.foot-copy {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5rem;
  color: var(--muted-foreground-2);
}

.ai-notice {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted-foreground-2);
  opacity: 0.35;
}

/* ── 수식(MathML) ──────────────────────────────────────────────────
 * 긴 식이 좁은 화면에서 잘리거나 페이지를 밀지 않게, 식 상자 안에서 가로로 밀어 볼 수 있게 한다.
 * 짧은 식은 max-width 에 걸리지 않아 글 흐름 그대로다. */
.q-stem .katex,
.opt-text .katex,
.exp-body .katex {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: middle;
}

/* ── 스크린 리더 전용 ───────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── 모바일 360px 가로 스크롤 0 보장 ────────────────────────────────── */
@media (max-width: 479px) {
  .page-main--set {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .cbt-question-box {
    padding: 1rem;
  }

  .set-summary {
    padding: 1rem;
  }

  .omr-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
  }

  .omr-cell {
    height: 30px;
    font-size: 0.6875rem;
  }
}

/* ── 나의 풀이 기록(2026-10-11) — sets.js 가 사이드바 상단에 삽입 ────────── */
.record-card {
  border-radius: 1rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px 0 rgb(16 24 40 / 0.05);
  padding: 1.25rem;
}
.record-head { display: flex; justify-content: space-between; align-items: center; }
.record-title { font-size: .875rem; font-weight: 700; color: var(--foreground); margin: 0; }
.record-note { font-size: .6875rem; color: var(--muted-foreground-2); margin: .25rem 0 0; line-height: 1.5; }
.record-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-top: .75rem; }
.record-stat { background: var(--muted); border-radius: .5rem; padding: .5rem .625rem; min-width: 0; }
.record-stat-value { font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--foreground); display: block; }
.record-stat-label { font-size: .6875rem; color: var(--muted-foreground); }
.record-stat--correct .record-stat-value { color: var(--correct-strong); }
.record-stat--wrong .record-stat-value { color: var(--wrong-strong); }
.record-actions { display: flex; gap: .5rem; margin-top: .75rem; }
.record-btn {
  flex: 1 1 auto; font: inherit; font-size: .8125rem; font-weight: 600;
  padding: .5rem .625rem; min-height: 44px; border-radius: .5rem;
  border: 1px solid var(--border); background: var(--card); color: var(--foreground); cursor: pointer;
}
.record-btn:hover { background: var(--muted); }
.record-btn:disabled { opacity: .45; cursor: default; background: var(--card); }
.record-btn--clear { color: var(--destructive); }
/* 오답만 보기 — 몸통 클래스로 맞은 문항 카드를 숨긴다(미응답·오답은 그대로) */
body.record-filter-on .cbt-question-box.record-ok { display: none; }
