/* --- 퀴즈 상세: 문제+선지 한 카드, 보기 세로형, rag-detail과 통일 --- */
.quiz-q-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(37,51,80,0.10);
  border: 1.5px solid var(--navy-b);
  padding: 22px 18px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 22px;
}
.quiz-q-label {
  font-size: 13px;
  color: var(--navy);
  font-weight: 900;
  letter-spacing: 0.07em;
  margin-bottom: 7px;
  text-transform: uppercase;
}
.quiz-q-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 0;
  line-height: 1.5;
  word-break: keep-all;
}
.quiz-q-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 0;
}
.quiz-q-option {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  background: var(--s1);
  border-radius: 9px;
  border: 1.2px solid var(--bd);
  padding: 10px 13px 8px 13px;
  margin-bottom: 0;
  box-shadow: 0 1px 4px rgba(37,51,80,0.05);
  transition: border 0.15s, background 0.15s, color 0.15s;
  cursor: default;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.quiz-q-option.correct {
  background: var(--grn-l);
  border: 1.5px solid var(--grn-b);
  color: var(--grn);
}
.quiz-q-option.wrong {
  background: var(--red-l);
  border: 1.5px solid var(--red-b);
  color: var(--red);
}
.quiz-q-option .q-tag {
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 10px;
  margin-left: 8px;
  background: var(--grn-l);
  color: var(--grn);
  border: 1px solid var(--grn-b);
}
.quiz-q-option .q-tag.wrong {
  background: var(--red-l);
  color: var(--red);
  border-color: var(--red-b);
}
.quiz-q-explain {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quiz-q-official {
  font-size: 13px;
  color: var(--t2);
  background: var(--amber-l);
  border-radius: 10px;
  padding: 10px 14px;
  border: 1px solid var(--bd);
}
.quiz-q-explain-cta {
  margin-top: 4px;
}
/* 퀴즈 상세 — AI 해설을 히스토리 RAG 상세와 비슷한 섹션 카드로 */
.quiz-ai-rag {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quiz-ai-sec {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--bd);
  box-shadow: 0 2px 10px rgba(37, 51, 80, 0.07);
  overflow: hidden;
}
.quiz-ai-sec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--bd);
  background: linear-gradient(180deg, #f8f9fc 0%, #fff 100%);
}
.quiz-ai-sec-bar {
  width: 4px;
  height: 1.1em;
  border-radius: 3px;
  flex-shrink: 0;
}
.quiz-ai-sec--muted .quiz-ai-sec-bar {
  background: #b8c0d0;
}
.quiz-ai-sec--warm .quiz-ai-sec-bar {
  background: #d97736;
}
.quiz-ai-sec--green .quiz-ai-sec-bar {
  background: #2d9c5e;
}
.quiz-ai-sec--blue .quiz-ai-sec-bar {
  background: #2f5f9e;
}
.quiz-ai-sec--dark .quiz-ai-sec-bar {
  background: #5a6678;
}
.quiz-ai-sec-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--navy);
  text-transform: uppercase;
}
.quiz-ai-sec-body {
  padding: 14px 16px 16px;
  font-size: 14px;
  line-height: 1.58;
  color: var(--t1);
}
.quiz-ai-sec-body--stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-ai-copy {
  margin: 0;
  word-break: keep-all;
}
.quiz-ai-copy--warm {
  color: #b45309;
}
.quiz-ai-copy--green {
  color: #1d6f45;
}
.quiz-ai-copy--tip {
  color: #2f5f9e;
  font-weight: 700;
  font-size: 15px;
}
.quiz-ai-opt {
  border: 1px solid #e2e6ef;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fcfdff;
}
.quiz-ai-opt-k {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--navy);
}
.quiz-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.quiz-ai-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--s1);
  border: 1px solid var(--bd);
  color: var(--t2);
}
.quiz-ai-ev {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid #e2e6ef;
  border-radius: 10px;
  margin-bottom: 10px;
  background: #fafbfc;
}
.quiz-ai-ev:last-child {
  margin-bottom: 0;
}
.quiz-ai-sec--green .quiz-ai-sec-body {
  background: #e8f5ed;
}
.quiz-ai-sec--blue .quiz-ai-sec-body {
  background: #e9f1fb;
}
.quiz-ai-sec--dark {
  background: #eef1f5;
}
.quiz-ai-sec--dark .quiz-ai-sec-head {
  background: linear-gradient(180deg, #e6eaef 0%, #f4f6f9 100%);
}
.quiz-detail-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0 28px;
  padding: 14px 16px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, var(--s1) 0%, var(--surface) 100%);
  border: 1px solid var(--bd);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(37, 51, 80, 0.06);
}
.quiz-detail-pager-count {
  font-size: 15px;
  font-weight: 800;
  color: var(--navy);
  flex: 1;
  text-align: center;
  min-width: 8rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.quiz-detail-pager-btn {
  min-width: 112px;
  justify-content: center;
  border-radius: 10px;
  font-weight: 600;
  background: var(--surface);
  color: var(--navy);
  border: 1.5px solid var(--navy-b);
  box-shadow: 0 1px 3px rgba(37, 51, 80, 0.06);
}
.quiz-detail-pager-btn:hover:not(:disabled) {
  background: var(--navy-l);
  border-color: var(--navy);
}
.quiz-detail-pager-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.quiz-detail-pager-btn--next {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.quiz-detail-pager-btn--next:hover:not(:disabled) {
  filter: brightness(1.08);
  background: var(--navy);
}
@media (max-width: 520px) {
  .quiz-detail-pager {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
  }
  .quiz-detail-pager-count {
    order: -1;
    min-width: 0;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--bd);
    margin-bottom: 6px;
  }
  .quiz-detail-pager-btn {
    min-width: 0;
    width: 100%;
  }
}
.quiz-q-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-q-card--slide {
  margin-bottom: 0;
}
.quiz-ai-ev-id {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #5a6678;
  border-radius: 6px;
  padding: 4px 8px;
  min-width: 2rem;
  text-align: center;
  line-height: 1.3;
}
@media (max-width: 700px) {
  .quiz-q-card { padding: 8px 3px 5px 5px; border-radius: 8px; gap: 7px; margin-bottom: 10px; }
  .quiz-q-label { font-size: 11px; margin-bottom: 3px; }
  .quiz-q-text { font-size: 12px; }
  .quiz-q-options { gap: 4px; }
  .quiz-q-option { font-size: 10px; padding: 5px 6px 4px 6px; border-radius: 5px; }
  .quiz-q-official { font-size: 11px; padding: 8px 10px; }
  .quiz-ai-sec-body { font-size: 13px; padding: 12px; }
  .quiz-ai-sec-title { font-size: 11px; }
}
/* rag-detail 상단 문제/선지 강조 블록 */

/* --- 상단 문제/선지 영역 현대적 UI 리디자인 --- */

/* --- 문제/선지: 카드+세로형 보기 리스트, 통일감 있는 현대적 UI --- */
/* --- 문제+선지 한 카드 안에 위아래로, 보기 세로형, 심플/통일감 --- */
.rag-qblock {
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.rag-q-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(37,51,80,0.10);
  border: 1.5px solid var(--navy-b);
  padding: 26px 20px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.rag-q-label {
  font-size: 13px;
  color: var(--navy);
  font-weight: 900;
  letter-spacing: 0.07em;
  margin-bottom: 7px;
  text-transform: uppercase;
}
.rag-q-text {
  font-size: 19px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 0;
  line-height: 1.5;
  word-break: keep-all;
}
.rag-q-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 0;
}
.rag-q-option {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  background: var(--s1);
  border-radius: 9px;
  border: 1.2px solid var(--bd);
  padding: 11px 15px 9px 15px;
  margin-bottom: 0;
  box-shadow: 0 1px 4px rgba(37,51,80,0.05);
  transition: border 0.15s, background 0.15s, color 0.15s;
  cursor: default;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.rag-q-option.correct {
  background: var(--grn-l);
  border: 1.5px solid var(--grn-b);
  color: var(--grn);
}
.rag-q-option.wrong {
  background: var(--red-l);
  border: 1.5px solid var(--red-b);
  color: var(--red);
}
.rag-q-option .q-tag {
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 10px;
  margin-left: 8px;
  background: var(--grn-l);
  color: var(--grn);
  border: 1px solid var(--grn-b);
}
.rag-q-option .q-tag.wrong {
  background: var(--red-l);
  color: var(--red);
  border-color: var(--red-b);
}
.rag-q-tags { display: none; }
@media (max-width: 700px) {
  .rag-qblock { margin-bottom: 18px; }
  .rag-q-card { padding: 10px 4px 7px 7px; border-radius: 8px; gap: 8px; }
  .rag-q-label { font-size: 11px; margin-bottom: 3px; }
  .rag-q-text { font-size: 13px; }
  .rag-q-options { gap: 5px; }
  .rag-q-option { font-size: 11px; padding: 6px 7px 5px 7px; border-radius: 5px; }
}
@media (max-width: 700px) {
  .rag-qblock { margin-bottom: 18px; }
  .rag-q-main { padding: 10px 4px 7px 7px; border-radius: 8px; }
  .rag-q-label { font-size: 11px; margin-bottom: 4px; }
  .rag-q-text { font-size: 14px; }
  .rag-q-options { gap: 6px; padding: 8px 0 0 0; }
  .rag-q-option { font-size: 12px; padding: 7px 7px 6px 7px; border-radius: 6px; }
}
.rag-evidence-card {
  background: var(--s1);
  border: 1.5px solid var(--navy-b);
}
.rag-evidence-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.rag-evidence-item {
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--bd);
  padding: 10px 14px 8px 14px;
  font-size: 14px;
  box-shadow: 0 1px 4px rgba(37,51,80,0.04);
  position: relative;
}
.rag-evidence-id {
  font-size: 11px;
  color: var(--navy);
  font-weight: 600;
  margin-right: 8px;
}
.rag-evidence-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}
.dash-chip {
  display: inline-block;
  font-size: 11px;
  color: var(--navy);
  background: var(--navy-l);
  border: 1px solid var(--navy-b);
  border-radius: 999px;
  padding: 2px 10px;
  margin-right: 4px;
}
.rag-evidence-empty {
  color: var(--t3);
  font-size: 13px;
  margin: 8px 0 0 0;
}
/* 상세 페이지 카드/문제/선지/해설 UI 개선 */
.quiz-detail-layout, .rag-detail-layout {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 32px;
}
.quiz-detail-card, .rag-detail-card {
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--rl);
  box-shadow: var(--sh);
  padding: 28px 24px 24px 24px;
  margin-bottom: 28px;
}
.quiz-detail-head h2 {
  font-size: 22px;
  margin-bottom: 2px;
}
.quiz-detail-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.quiz-detail-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.quiz-detail-item {
  background: var(--s1);
  border-radius: 10px;
  padding: 18px 16px 14px 16px;
  box-shadow: 0 2px 8px rgba(37,51,80,0.04);
  border: 1px solid var(--bd);
}
.quiz-detail-q {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}
.quiz-detail-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.quiz-detail-option {
  padding: 7px 12px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid #ece8e0;
  font-size: 15px;
  transition: background 0.15s, border 0.15s;
}
.quiz-detail-option.selected {
  background: var(--navy-l);
  border: 1.5px solid var(--navy-b);
  color: var(--navy);
  font-weight: 600;
}
.quiz-detail-option.correct {
  background: var(--grn-l);
  border: 1.5px solid var(--grn-b);
  color: var(--grn);
  font-weight: 600;
}
.quiz-detail-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}
.quiz-detail-explain {
  font-size: 13px;
  color: var(--t2);
  background: var(--amber-l);
  border-radius: 7px;
  padding: 8px 12px;
  margin-top: 4px;
}
.quiz-detail-item.ok { border-left: 4px solid var(--grn); }
.quiz-detail-item.ng { border-left: 4px solid var(--red); }
/* rag-detail 카드 개선 */
/* rag-detail 카드/내부 여백 최소화, 정보 밀집, 글자 강조 */
.rag-detail-card {
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(37,51,80,0.04);
  border-radius: 10px;
  border: 1.2px solid var(--bd);
  padding: 14px 12px 10px 14px;
  transition: box-shadow 0.18s, border 0.18s;
}
.rag-detail-card:not(:last-child) {
  margin-bottom: 14px;
}
.rag-detail-label {
  font-size: 14px;
  color: var(--navy);
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-left: 3px solid var(--navy);
  padding-left: 7px;
  background: none;
}
.rag-detail-question {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 7px;
  color: var(--navy);
}
.rag-option-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 6px;
}
.rag-option-item {
  padding: 5px 8px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #ece8e0;
  font-size: 15px;
  font-weight: 700;
  transition: border 0.15s, background 0.15s;
}
.rag-option-item.selected {
  background: var(--navy-l);
  border: 1.2px solid var(--navy-b);
  color: var(--navy);
}
.rag-analysis-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rag-analysis-item strong {
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
}
.rag-copy-block {
  font-size: 15px;
  color: var(--t1);
  background: var(--amber-l);
  border-radius: 6px;
  padding: 7px 10px;
  margin-bottom: 2px;
  border-left: 3px solid var(--amber);
  font-weight: 700;
}
.rag-detail-card.rag-evidence-card {
  background: var(--s2);
  border: 1.2px solid var(--navy-b);
  box-shadow: 0 1px 6px rgba(37,51,80,0.06);
}
.rag-evidence-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.rag-evidence-item {
  background: #fff;
  border-radius: 7px;
  border: 1px solid var(--bd);
  padding: 6px 8px 5px 10px;
  font-size: 14px;
  box-shadow: none;
  position: relative;
  font-weight: 700;
}
.rag-evidence-id {
  font-size: 11px;
  color: var(--navy);
  font-weight: 800;
  margin-right: 7px;
}
.rag-evidence-meta {
  display: flex;
  gap: 7px;
  margin-bottom: 2px;
}
.dash-chip {
  display: inline-block;
  font-size: 11px;
  color: var(--navy);
  background: var(--navy-l);
  border: 1px solid var(--navy-b);
  border-radius: 999px;
  padding: 2px 7px;
  margin-right: 3px;
  font-weight: 700;
}
.rag-evidence-empty {
  color: var(--t3);
  font-size: 13px;
  margin: 4px 0 0 0;
}
/* insight, tip 강조 */
.rag-detail-card .rag-copy-block.insight {
  background: var(--grn-l);
  border-left: 3px solid var(--grn);
  color: var(--grn);
}
.rag-detail-card .rag-copy-block.tip {
  background: var(--navy-l);
  border-left: 3px solid var(--navy);
  color: var(--navy);
}
/* 태그 스타일 개선 */
.tags {
  display: flex;
  gap: 5px;
  margin-bottom: 3px;
  margin-top: 1px;
}
.tag {
  font-size: 13px;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 800;
  background: var(--s1);
  color: var(--t2);
  border: 1px solid var(--bd);
}
.tag.ok {
  background: var(--grn-l);
  color: var(--grn);
  border-color: var(--grn-b);
}
.tag.ng {
  background: var(--red-l);
  color: var(--red);
  border-color: var(--red-b);
}
@media (max-width: 700px) {
  .rag-detail-card, .rag-detail-card.rag-evidence-card {
    padding: 7px 2px 5px 4px;
    border-radius: 6px;
  }
  .rag-detail-label { font-size: 12px; padding-left: 4px; }
  .rag-detail-question { font-size: 13px; }
  .rag-option-item { font-size: 12px; padding: 4px 5px; }
  .rag-evidence-item { font-size: 11px; padding: 4px 4px 3px 5px; }
  .rag-copy-block { font-size: 12px; padding: 4px 5px; }
}
@media (max-width: 700px) {
  .quiz-detail-layout, .rag-detail-layout { padding: 8px; }
  .quiz-detail-card, .rag-detail-card { padding: 16px 6px 14px 6px; }
}
/* 히스토리 2단 레이아웃 */
.history-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 18px;
}
.history-group-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (max-width: 900px) {
  .history-2col {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
:root {
  --bg: #f7f4ef;
  --surface: #ffffff;
  --s1: #f0ede7;
  --s2: #e6e1d9;
  --bd: #ddd8cf;
  --navy: #253350;
  --navy-l: #ebf0f9;
  --navy-b: #c8d7f0;
  --amber: #96600f;
  --amber-l: #fdf5e8;
  --amber-b: #f5d8a8;
  --t1: #17130e;
  --t2: #6b5e52;
  --t3: #b0a08f;
  --grn: #1e6641;
  --grn-l: #edfaf2;
  --grn-b: #a7e8c5;
  --red: #b83232;
  --red-l: #fef2f2;
  --red-b: #f5c0c0;
  --r: 10px;
  --rl: 14px;
  --sh: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --sh-h: 0 8px 24px rgba(0, 0, 0, 0.09), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: "Outfit", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--t1);
  line-height: 1.6;
}

.page {
  min-height: 100vh;
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(37, 51, 80, 0.08);
  background: linear-gradient(180deg, rgba(247, 244, 239, 0.96), rgba(247, 244, 239, 0.88));
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0 2.4rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.nav-link {
  text-decoration: none;
  color: var(--t2);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.16s;
}

.nav-link:hover {
  background: var(--s1);
  color: var(--t1);
}

.nav-link.active {
  color: var(--navy);
  background: var(--navy-l);
  border-color: var(--navy-b);
  font-weight: 600;
}

.nav-link.disabled {
  pointer-events: none;
  cursor: default;
  opacity: 0.6;
}

.nav-brand-name {
  font-family: "Lora", Georgia, serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--navy);
  box-shadow: 0 6px 12px rgba(37, 51, 80, 0.15);
}

.logo-mark svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
}

.logo-mark img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.nav-r { display: flex; align-items: center; gap: 8px; }

.nav-user {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  border: 1px solid var(--navy-b);
  background: var(--navy-l);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .nav { padding: 0 1rem; height: 58px; }
  .logo-mark { width: 28px; height: 28px; border-radius: 8px; }
  .logo-mark svg { width: 15px; height: 15px; }
  .nav-brand-name { font-size: 18px; }
  .nav-r { gap: 6px; }
  .nav-menu {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    gap: 4px;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }
  .nav-link {
    flex: 0 0 auto;
    font-size: 12px;
    padding: 5px 8px;
  }
}

.btn {
  border: none;
  border-radius: var(--r);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s;
  font-family: inherit;
}

.btn.sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: #1c2840; transform: translateY(-1px); }
.btn.ghost { background: var(--surface); border: 1px solid var(--bd); color: var(--t1); }
.btn.ghost:hover { background: var(--s1); }
.btn.block { width: 100%; }
.btn:disabled { background: var(--s2); color: var(--t3); cursor: not-allowed; transform: none; }

/* Index-style button aliases for cross-page navbar consistency. */
.btn.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn.btn-navy { background: var(--navy); color: #fff; }
.btn.btn-navy:hover { background: #1c2840; transform: translateY(-1px); }
.btn.btn-out { background: var(--surface); border: 1px solid var(--bd); color: var(--t1); }
.btn.btn-out:hover { background: var(--s1); }

.hero {
  padding: 60px 0 42px;
  display: grid;
  gap: 34px;
  grid-template-columns: 1.08fr 1fr;
  align-items: center;
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
}

.hero-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: var(--navy);
  background: var(--navy-l);
  border: 1px solid var(--navy-b);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 14px;
}

.hero h1 {
  font-family: "Lora", Georgia, serif;
  font-size: clamp(32px, 4.6vw, 50px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.hero h1 em { font-style: normal; color: var(--navy); }
.hero p { color: var(--t2); font-size: 15px; margin-bottom: 18px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--rl);
  box-shadow: var(--sh);
}

.preview-head {
  background: var(--navy);
  color: #fff;
  border-radius: 14px 14px 0 0;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.preview-body { padding: 16px; }
.muted { color: var(--t3); }

.stats {
  border-top: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd);
  background: var(--surface);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 760px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat {
  text-align: center;
  padding: 20px 10px;
  border-right: 1px solid var(--bd);
}

.stat:last-child { border-right: none; }

@media (max-width: 760px) {
  .stat:nth-child(2n) { border-right: none; }
}

.stat-num {
  font-family: "Lora", Georgia, serif;
  font-size: 28px;
  line-height: 1;
}

.stat-label { color: var(--t3); font-size: 13px; margin-top: 4px; }

.section { padding: 38px 0; }
.section h2 {
  font-family: "Lora", Georgia, serif;
  font-size: clamp(22px, 3vw, 30px);
  margin-bottom: 8px;
}
.section p.sub { color: var(--t2); margin-bottom: 14px; }

.sec-tag {
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}

.cert-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 920px) {
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .cert-grid { grid-template-columns: 1fr; }
}

.cert-card {
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--rl);
  padding: 14px;
  position: relative;
  transition: all 0.18s;
}

.cert-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-h);
  border-color: var(--navy-b);
}

.cert-emoji { font-size: 24px; margin-bottom: 8px; display: block; }
.cert-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; color: var(--t1); }
.cert-desc { font-size: 11px; color: var(--t3); }

.cert-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 7px;
  border: 1px solid var(--amber-b);
  color: var(--amber);
  background: var(--amber-l);
}

.info-card {
  padding: 18px;
  border-radius: var(--rl);
  border: 1px solid var(--bd);
  background: var(--surface);
}

.quiz-layout { max-width: 760px; margin: 0 auto; padding: 26px 18px; }

.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.badge {
  font-size: 12px;
  color: var(--t2);
  background: var(--s1);
  border: 1px solid var(--bd);
  border-radius: 999px;
  padding: 4px 12px;
}

.progress {
  height: 4px;
  background: var(--s2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress > div {
  height: 100%;
  background: var(--navy);
  width: 0;
  transition: width 0.35s ease;
}

.question-card { padding: 20px; }
.question-no {
  font-size: 11px;
  color: var(--t3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.question-text { font-size: 17px; line-height: 1.7; margin-bottom: 14px; }

.options { display: grid; gap: 8px; }
.opt {
  display: flex;
  gap: 10px;
  border: 1px solid var(--bd);
  background: var(--bg);
  border-radius: var(--r);
  padding: 11px 12px;
  text-align: left;
  width: 100%;
}
.opt:hover { background: var(--s1); }
.opt.on { background: var(--navy-l); border-color: var(--navy-b); }
.opt-tag {
  min-width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--bd);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--t3);
  background: var(--s1);
}

.panel { padding: 20px; }
.score {
  font-family: "Lora", Georgia, serif;
  font-size: 62px;
  line-height: 1;
  color: var(--navy);
}

.tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.tag { font-size: 12px; border-radius: 999px; padding: 4px 10px; border: 1px solid; }
.tag.ok { background: var(--grn-l); color: var(--grn); border-color: var(--grn-b); }
.tag.ng { background: var(--red-l); color: var(--red); border-color: var(--red-b); }

.answer-item {
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.answer-item.ok { border-left: 3px solid var(--grn); }
.answer-item.ng { border-left: 3px solid var(--red); }

@keyframes passio-spin {
  to { transform: rotate(360deg); }
}

.spin {
  width: 36px;
  height: 36px;
  border: 3px solid var(--bd);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: passio-spin 0.85s linear infinite;
  margin: 0 auto;
}

.spin.spin-sm {
  width: 22px;
  height: 22px;
  border-width: 2px;
  margin: 0;
  flex-shrink: 0;
}

.answer-explain-row {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--bd);
}

.answer-explain-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.answer-explain-panel {
  margin-top: 10px;
  min-height: 0;
}

.answer-explain-loading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.answer-explain-loading-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
  line-height: 1.45;
}

.batch-explain-banner {
  border-left: 3px solid var(--navy);
}

.batch-explain-banner.is-active {
  animation: batch-banner-soft 2.2s ease-in-out infinite;
}

@keyframes batch-banner-soft {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(26, 58, 110, 0.08);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(26, 58, 110, 0.04);
  }
}

.batch-explain-banner-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 1문제 모드(문제은행 등): 다문항 전용 안내·카드마다 해설 UI 숨김 */
.quiz-taking--single .quiz-top > div:first-child {
  display: none;
}
.quiz-taking--single .progress {
  display: none;
}

.quiz-result--single .result-section-head,
.quiz-result--single .result-explain-toolbar,
.quiz-result--single .result-footer-primary {
  display: none !important;
}

.quiz-detail-batch-wrap {
  border-left: 3px solid var(--navy);
  margin-top: 16px;
  margin-bottom: 28px;
}
.quiz-detail-batch-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}
.quiz-detail-batch-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.quiz-detail-batch-item input {
  margin: 0;
}

.answer-subject { font-size: 11px; color: var(--t3); font-weight: 600; margin-bottom: 5px; }
.answer-q { font-size: 14px; margin-bottom: 2px; line-height: 1.6; }

.result-options {
  display: grid;
  gap: 8px;
}

.result-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--bd);
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
}

.result-option-tag {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 7px;
  border: 1px solid var(--bd);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--t3);
}

.result-option-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.5;
}

.result-option-state {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.result-option.correct {
  border-color: var(--grn-b);
  background: var(--grn-l);
}

.result-option.correct .result-option-tag {
  border-color: var(--grn-b);
  color: var(--grn);
  background: #fff;
}

.result-option.correct .result-option-state {
  color: var(--grn);
}

.result-option.selected {
  box-shadow: inset 0 0 0 1px rgba(37, 51, 80, 0.08);
}

.result-option.wrong {
  border-color: var(--red-b);
  background: var(--red-l);
}

.result-option.wrong .result-option-tag {
  border-color: var(--red-b);
  color: var(--red);
  background: #fff;
}

.result-option.wrong .result-option-state {
  color: var(--red);
}

.result-summary-card {
  text-align: center;
  margin-bottom: 14px;
  padding: 28px 24px;
}

.result-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 10px;
}

.result-section-head h3 {
  font-family: "Lora", Georgia, serif;
  font-size: 26px;
  line-height: 1.1;
}

.result-section-head p {
  font-size: 13px;
  max-width: 420px;
  text-align: right;
}

.result-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.result-footer-primary,
.result-footer-secondary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.result-footer-secondary {
  justify-content: flex-end;
  margin-left: auto;
}

/* 퀴즈 결과: AI해설 보기 + 다시 풀기 + 홈으로 한 줄 */
.result-footer--quiz-result .result-footer-secondary {
  flex-wrap: nowrap;
  gap: 10px;
}

.result-footer--quiz-result .result-single-explain-wrap {
  align-items: center;
}

@media (max-width: 700px) {
  .result-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-section-head p {
    text-align: left;
  }

  .result-footer-primary .btn,
  .result-footer-secondary .btn {
    width: 100%;
  }

  .result-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .result-footer-secondary {
    margin-left: 0;
  }

  .result-footer--quiz-result .result-footer-secondary .btn {
    width: auto;
    flex: 1 1 0;
    min-width: 0;
  }

  .result-footer--quiz-result .result-footer-secondary {
    flex-wrap: nowrap;
    width: 100%;
    justify-content: stretch;
  }
}

.auth-wrap {
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 24px;
}

.auth-card h1 {
  font-family: "Lora", Georgia, serif;
  font-size: 30px;
  margin-bottom: 6px;
}

.field { margin-bottom: 12px; }
.field label { display: block; margin-bottom: 6px; color: var(--t2); font-size: 13px; }
.field input {
  width: 100%;
  border: 1px solid var(--bd);
  background: var(--bg);
  border-radius: var(--r);
  padding: 10px 12px;
  font-size: 14px;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 700px) {
  .grid-two { grid-template-columns: 1fr; }
}

.msg { min-height: 18px; font-size: 12px; margin-top: 8px; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--grn); }

.linkline {
  margin-top: 10px;
  color: var(--t2);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--bd);
  border-radius: 6px;
  font-size: 11px;
  color: var(--t2);
  background: var(--surface);
}

.preview-question {
  font-size: 14px;
  line-height: 1.65;
  color: var(--t1);
  margin: 10px 0;
  font-weight: 500;
}

.preview-option {
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--t2);
  background: var(--bg);
  margin-bottom: 6px;
}

.preview-option.on {
  border-color: var(--navy-b);
  background: var(--navy-l);
  color: var(--navy);
  font-weight: 500;
}

.explain-box {
  background: var(--amber-l);
  border: 1px solid var(--amber-b);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
}

.explain-box strong {
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
  color: var(--amber);
  letter-spacing: 0.04em;
}

.explain-box p {
  font-size: 12px;
  line-height: 1.65;
  color: var(--t2);
}

.steps-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 800px) {
  .steps-grid { grid-template-columns: 1fr; }
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--rl);
  padding: 16px;
}

.step-no {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

.step-card h4 {
  font-size: 15px;
  margin-bottom: 4px;
}

.step-card p {
  font-size: 13px;
  color: var(--t2);
}

.cta-wrap {
  margin-top: 14px;
  background: var(--navy);
  border-radius: var(--rl);
  padding: 24px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cta-wrap p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

.footer {
  border-top: 1px solid var(--bd);
  background: var(--surface);
  padding: 16px 20px;
  color: var(--t3);
  font-size: 12px;
  text-align: center;
}

.question-bank-layout {
  max-width: 1080px;
}

.bank-mini-stats .mini-stat {
  min-width: 148px;
}

.bank-mini-stats .mini-stat strong {
  font-size: 18px;
}

.bank-filter-panel {
  margin-top: 20px;
  margin-bottom: 18px;
  border: 1px solid rgba(37, 51, 80, 0.1);
  background:
    radial-gradient(circle at 90% 6%, rgba(37, 51, 80, 0.08), rgba(37, 51, 80, 0) 40%),
    linear-gradient(180deg, #ffffff, #fcfbf9);
  box-shadow: 0 10px 28px rgba(20, 16, 11, 0.06);
}

.bank-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  align-items: end;
}

.bank-field {
  margin-bottom: 0;
  min-width: 0;
}

.bank-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--t2);
  letter-spacing: 0.03em;
}

.bank-select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(37, 51, 80, 0.18);
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--r);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.16s, box-shadow 0.16s, background-color 0.16s;
}

.bank-select:focus {
  border-color: var(--navy-b);
  box-shadow: 0 0 0 4px rgba(37, 51, 80, 0.1);
  outline: none;
}

.bank-meta {
  font-size: 13px;
  color: var(--t2);
  grid-column: 1 / -1;
  justify-self: start;
  text-align: left;
  background: #fff;
  border: 1px solid var(--bd);
  border-radius: 999px;
  padding: 8px 12px;
}

.bank-list {
  display: grid;
  gap: 12px;
}

.bank-item {
  position: relative;
  padding: 14px;
  border: 1px solid rgba(37, 51, 80, 0.1);
  background: linear-gradient(180deg, #fff, #fdfcf9);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.bank-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(37, 51, 80, 0.08), rgba(37, 51, 80, 0));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.bank-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-h);
  border-color: rgba(37, 51, 80, 0.2);
}

.bank-item:hover::after {
  opacity: 1;
}

.bank-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.bank-item-head strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  border: 1px solid rgba(37, 51, 80, 0.18);
  border-radius: 999px;
  padding: 3px 10px;
  background: rgba(235, 240, 249, 0.55);
}

.bank-item .dash-chip {
  padding: 3px 10px;
  font-size: 11px;
  color: #6e500e;
  border-color: #efd3a3;
}

.bank-q {
  font-size: 14px;
  line-height: 1.58;
  margin-bottom: 12px;
  min-height: 44px;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #31281f;
}

.bank-item-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 320px);
  margin-left: auto;
}

.bank-item-actions .btn,
.bank-item-actions a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  width: 100%;
  white-space: nowrap;
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.bank-item > .msg[data-role="explain-msg"]:empty {
  display: none;
  margin: 0;
  min-height: 0;
}

.bank-item-actions .bank-explain-btn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  text-decoration: none !important;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.bank-opts {
  display: grid;
  gap: 6px;
}

.bank-opt {
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--bg);
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  color: var(--t2);
  font-size: 13px;
}

.bank-opt.answer {
  border-color: var(--grn-b);
  background: var(--grn-l);
  color: var(--grn);
  font-weight: 600;
}

.bank-pagination {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--bd);
  background: rgba(255, 255, 255, 0.84);
  border-radius: 999px;
}

.bank-page-indicator {
  font-size: 13px;
  color: var(--navy);
  font-weight: 600;
  min-width: 72px;
  text-align: center;
}

@media (max-width: 640px) {
  .bank-filter-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .bank-mini-stats {
    gap: 8px;
  }

  .bank-mini-stats .mini-stat {
    min-width: calc(50% - 4px);
    flex: 1;
  }

  .bank-meta {
    width: 100%;
  }

  .bank-item {
    padding: 12px;
  }

  .bank-q {
    line-clamp: 3;
    -webkit-line-clamp: 3;
  }

  .bank-item-actions {
    width: 100%;
    margin-left: 0;
  }

  .bank-pagination {
    width: 100%;
    justify-content: space-between;
    border-radius: 12px;
  }
}

.token-layout {
  max-width: 860px;
}

.token-panel {
  display: grid;
  gap: 10px;
}

.token-password-field {
  max-width: 420px;
}

.token-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.token-value-field {
  margin-bottom: 0;
}

.token-textarea {
  width: 100%;
  border: 1px solid var(--bd);
  background: var(--bg);
  border-radius: var(--r);
  padding: 10px 12px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  resize: vertical;
  min-height: 86px;
}

.token-meta {
  color: var(--t2);
  font-size: 13px;
}

.doc-layout {
  max-width: 980px;
  display: grid;
  gap: 14px;
}

.doc-title {
  font-family: "Lora", Georgia, serif;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.25;
}

.doc-section {
  display: grid;
  gap: 10px;
}

.doc-section h2 {
  font-size: 18px;
  margin: 0;
}

.doc-list {
  margin: 0;
  padding-left: 18px;
  color: var(--t2);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--bd);
  border-radius: 10px;
  overflow: hidden;
  font-size: 13px;
}

.doc-table th,
.doc-table td {
  border-bottom: 1px solid var(--bd);
  border-right: 1px solid var(--bd);
  padding: 9px 10px;
  vertical-align: top;
  text-align: left;
}

.doc-table th {
  background: var(--s1);
  color: var(--t1);
  font-weight: 600;
  white-space: nowrap;
}

.doc-table tr:last-child td,
.doc-table tr:last-child th {
  border-bottom: none;
}

.doc-table td:last-child,
.doc-table th:last-child {
  border-right: none;
}

.doc-code {
  margin: 0;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #cfd8eb;
  background: #f3f7ff;
  color: #1f2e4a;
  padding: 11px 12px;
  font-size: 12px;
  line-height: 1.65;
}

/* Refinement layer: keeps existing structure while improving visual rhythm. */
:root {
  --bg-2: #efe7db;
  --ink: #111827;
  --focus: rgba(37, 51, 80, 0.22);
  --focus-strong: rgba(37, 51, 80, 0.34);
  --sh-soft: 0 10px 30px rgba(19, 28, 43, 0.08), 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

html,
body {
  color: var(--ink);
  background:
    radial-gradient(1000px 420px at -8% -10%, rgba(150, 96, 15, 0.12), transparent 60%),
    radial-gradient(920px 460px at 112% 8%, rgba(37, 51, 80, 0.12), transparent 62%),
    linear-gradient(180deg, #f9f6f1 0%, var(--bg) 42%, var(--bg-2) 100%);
}

.page {
  position: relative;
  isolation: isolate;
}

.container {
  max-width: 1120px;
  padding: 0 26px;
}

.topbar {
  box-shadow: 0 10px 30px rgba(16, 22, 35, 0.05);
  border-bottom-color: rgba(37, 51, 80, 0.11);
}

.brand {
  gap: 13px;
}

.brand > span:last-child {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo-mark {
  background: linear-gradient(145deg, #314467, #1e2a44 70%);
}

.btn {
  letter-spacing: -0.01em;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn.primary {
  background: linear-gradient(130deg, #2a3e63, #1f2e4a 74%);
  box-shadow: 0 7px 18px rgba(37, 51, 80, 0.24);
}

.btn.primary:hover {
  box-shadow: 0 10px 24px rgba(37, 51, 80, 0.29);
}

.btn.ghost {
  backdrop-filter: blur(4px);
}

.btn:focus-visible,
.field input:focus-visible,
.opt:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus), 0 0 0 1px var(--focus-strong);
}

.hero {
  padding: 64px 0 48px;
  gap: 38px;
}

.hero h1 {
  margin-bottom: 12px;
}

.hero p {
  max-width: 52ch;
  line-height: 1.75;
}

.hero > * {
  animation: riseIn 0.55s ease both;
}

.hero > *:last-child {
  animation-delay: 0.12s;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.info-card,
.question-card,
.panel,
.auth-card {
  box-shadow: var(--sh-soft);
  border-color: rgba(48, 61, 88, 0.12);
}

.info-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 247, 241, 0.96));
}

.section {
  padding: 46px 0;
}

.section p.sub {
  max-width: 60ch;
  line-height: 1.72;
}

.cert-card {
  overflow: hidden;
}

.cert-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(150, 96, 15, 0.35), rgba(37, 51, 80, 0.4));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.cert-card:hover::before {
  opacity: 1;
}

.quiz-layout {
  max-width: 800px;
  padding: 30px 18px 42px;
}

.question-text {
  line-height: 1.78;
}

.opt {
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.opt:hover {
  transform: translateY(-1px);
}

.auth-wrap {
  background:
    radial-gradient(540px 240px at 10% 8%, rgba(150, 96, 15, 0.12), transparent 70%),
    radial-gradient(560px 260px at 90% 12%, rgba(37, 51, 80, 0.11), transparent 72%);
}

.auth-card {
  max-width: 470px;
  padding: 28px;
}

.auth-card h1 {
  letter-spacing: -0.02em;
  margin-bottom: 7px;
}

.field {
  margin-bottom: 13px;
}

.field input {
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.field input:hover {
  border-color: #c8c0b4;
}

.field input:focus {
  border-color: var(--navy);
  background: #fff;
}

.msg {
  margin-top: 10px;
  font-weight: 500;
}

.linkline {
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px dashed rgba(107, 94, 82, 0.22);
}

.linkline a {
  color: var(--navy);
  text-decoration: none;
}

.linkline a:hover {
  text-decoration: underline;
}

.kbd {
  background: linear-gradient(180deg, #fff, #f5f2ed);
  color: #5c5145;
  font-weight: 600;
}

@media (max-width: 760px) {
  .container {
    padding: 0 16px;
  }

  .section {
    padding: 38px 0;
  }

  .auth-card {
    padding: 22px;
    border-radius: 12px;
  }

  .quiz-layout {
    padding: 22px 6px 30px;
  }
}

#screen-dash .section {
  padding-top: 46px;
}

.dash-shell {
  display: grid;
  gap: 18px;
}

.dash-headline {
  padding: 4px 2px 0;
}

.dash-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-l);
  border: 1px solid var(--amber-b);
  margin-bottom: 10px;
}

.dash-headline h2 {
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.2;
  margin-bottom: 8px;
}

.dash-headline .sub {
  max-width: 66ch;
  line-height: 1.7;
  margin-bottom: 14px;
}

.dash-mini-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mini-stat {
  min-width: 120px;
  border: 1px solid rgba(48, 61, 88, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(4px);
  padding: 9px 10px;
}

.mini-stat strong {
  display: block;
  line-height: 1;
  font-size: 16px;
}

.mini-stat span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--t2);
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}

.subject-card {
  border: 1px solid rgba(48, 61, 88, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--sh-soft);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.subject-card.active {
  border-color: rgba(37, 51, 80, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 250, 255, 0.92));
}

.subject-status {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--grn);
  border: 1px solid var(--grn-b);
  background: var(--grn-l);
  border-radius: 999px;
  padding: 2px 8px;
}

.subject-status.soon {
  color: var(--amber);
  border-color: var(--amber-b);
  background: var(--amber-l);
}

.subject-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.subject-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--navy-l), #f2f5fb);
  border: 1px solid var(--navy-b);
  font-size: 24px;
}

.subject-title {
  display: block;
  font-size: 18px;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.subject-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-chip {
  font-size: 12px;
  font-weight: 600;
  color: #5c5145;
  background: #f5f2ed;
  border: 1px solid #dfd7cb;
  border-radius: 999px;
  padding: 4px 10px;
}

.subject-btn {
  margin-top: auto;
  width: 100%;
  justify-content: center;
  font-size: 15px;
  padding: 12px 16px;
}

.subject-btn[disabled] {
  opacity: 0.92;
}

.history-layout {
  display: grid;
  gap: 14px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.history-card {
  padding: 14px;
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.history-head-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.history-type-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.history-type-badge.quiz {
  color: var(--navy);
  background: rgba(37, 51, 80, 0.1);
  border: 1px solid rgba(37, 51, 80, 0.2);
}

.history-type-badge.rag {
  color: #6d4c9f;
  background: rgba(109, 76, 159, 0.1);
  border: 1px solid rgba(109, 76, 159, 0.25);
}

.history-title {
  font-size: 15px;
}

.history-result-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.history-result-chip {
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.history-result-chip.ok {
  color: var(--grn);
  background: var(--grn-l);
  border: 1px solid var(--grn-b);
}

.history-result-chip.ng {
  color: var(--red);
  background: var(--red-l);
  border: 1px solid var(--red-b);
}

.history-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.history-detail {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--bd);
}

.answer-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.answer-badge {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 9px;
  flex-shrink: 0;
}

.answer-badge.ok {
  color: var(--grn);
  background: var(--grn-l);
  border: 1px solid var(--grn-b);
}

.answer-badge.ng {
  color: var(--red);
  background: var(--red-l);
  border: 1px solid var(--red-b);
}

.status-pill {
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}

.status-pill.ok {
  color: var(--grn);
  background: var(--grn-l);
  border: 1px solid var(--grn-b);
}

.status-pill.ng {
  color: var(--red);
  background: var(--red-l);
  border: 1px solid var(--red-b);
}

.status-pill.pending {
  color: var(--amber);
  background: var(--amber-l);
  border: 1px solid var(--amber-b);
}

.history-question-preview {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 10px;
}

.rag-detail-grid {
  display: grid;
  gap: 10px;
}

.rag-detail-card {
  padding: 14px;
}

.rag-detail-label {
  font-size: 11px;
  color: var(--t3);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.rag-detail-question {
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 10px;
}

.rag-option-list {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.rag-option-item {
  border: 1px solid var(--bd);
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.rag-copy-block {
  font-size: 14px;
  line-height: 1.8;
  color: var(--t2);
  white-space: pre-wrap;
}

.rag-analysis-list {
  display: grid;
  gap: 8px;
}

.rag-analysis-item {
  border: 1px solid var(--bd);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  padding: 10px;
}

.rag-analysis-item strong {
  display: block;
  margin-bottom: 4px;
}

.rag-analysis-item p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--t2);
}

.rag-evidence-card {
  grid-column: 1 / -1;
}

.rag-evidence-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.rag-evidence-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rag-evidence-empty {
  padding: 2px 0 4px;
}

.rag-evidence-item {
  border: 1px solid var(--bd);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.rag-evidence-id {
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  background: rgba(var(--navy-rgb, 30, 58, 138), 0.08);
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
  margin-top: 2px;
}

.rag-evidence-item p {
  font-size: 13px;
  line-height: 1.75;
  color: var(--t2);
  margin: 0;
}

.explain-layout {
  max-width: 940px;
}

.explain-panel {
  display: grid;
  gap: 12px;
}

.explain-textarea {
  width: 100%;
  border: 1px solid var(--bd);
  background: var(--bg);
  border-radius: var(--r);
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
}

.explain-option-grid,
.explain-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.explain-hint-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.explain-loading-layout {
  max-width: 760px;
}

.explain-loading-card {
  text-align: center;
  display: grid;
  gap: 10px;
  padding: 28px;
}

.explain-loading-actions {
  justify-content: center;
}

@media (max-width: 1120px) {
  .subject-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 920px) {
  .subject-grid {
    grid-template-columns: 1fr;
  }

  .explain-option-grid,
  .explain-meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .history-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-score {
    font-size: 24px;
  }

  .history-group-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .explain-loading-actions {
    flex-direction: column;
  }

  .explain-loading-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========== 반응형 공통 보강 (모든 Passio 페이지) ========== */
html {
  -webkit-text-size-adjust: 100%;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

.page {
  overflow-x: clip;
  max-width: 100%;
}

@media (max-width: 900px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .nav {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 10px 16px 12px;
    align-items: flex-start;
  }

  .nav-left {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
    gap: 10px;
    row-gap: 6px;
  }

  .nav-menu {
    flex: 1 1 100%;
    order: 3;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
    gap: 4px;
  }

  .nav-link {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 12px;
  }

  .nav-r {
    flex: 0 0 auto;
    margin-left: auto;
    align-self: flex-start;
  }

  .section {
    padding-left: 0;
    padding-right: 0;
  }

  .history-layout {
    padding-left: 0;
    padding-right: 0;
  }

  .explain-layout {
    max-width: 100%;
  }

  .bank-filter-row {
    grid-template-columns: 1fr;
  }

  .score {
    font-size: clamp(36px, 14vw, 62px);
  }

  .question-text {
    font-size: clamp(15px, 4.2vw, 17px);
  }

  .panel {
    padding: 16px 14px;
  }

  .question-card {
    padding: 16px 14px;
  }
}

@media (max-width: 520px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .nav {
    padding: 8px 12px 10px;
  }

  .nav-brand-name {
    font-size: 17px;
  }

  .nav-user {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .quiz-layout {
    padding: 16px 10px 24px;
  }

  .history-card {
    padding: 12px;
  }

  .history-title {
    font-size: 14px;
  }

  .dash-headline h2 {
    font-size: clamp(22px, 7vw, 34px);
  }

  .result-footer--quiz-result .result-footer-secondary .btn {
    font-size: 13px;
    padding: 9px 12px;
  }
}

/* === Cortie main-layout alignment (Passio accent) === */
:root {
  --passio-accent: #253350;
  --passio-accent-soft: #eef2fb;
  --passio-bg: #f8f9f5;
}
body {
  background: radial-gradient(circle at 100% 0%, rgba(99, 102, 241, 0.06), transparent 34%),
    radial-gradient(circle at 0% 100%, rgba(37, 51, 80, 0.08), transparent 38%),
    var(--passio-bg);
  color: #1a1a1a;
}
.page {
  min-height: 100vh;
  padding-top: 68px;
}
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 99;
  height: 68px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(39, 40, 41, 0.1);
  backdrop-filter: blur(18px);
  background: rgba(248, 249, 245, 0.9);
}
.nav-left { gap: 22px; }
.nav-logo {
  gap: 8px;
}
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, #314467, #1e2a44 72%);
}
.logo-mark img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.nav-brand-name {
  font-family: "Outfit", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.nav-menu { gap: 2px; }
.nav-link {
  border-radius: 9px;
  font-size: 13px;
  color: #50545c;
  padding: 7px 12px;
}
.nav-link:hover {
  background: #f0f1ec;
  color: #272829;
}
.nav-link.active {
  background: var(--passio-accent-soft);
  color: var(--passio-accent);
  border: 1px solid #d6deef;
}
.btn.btn-navy {
  background: var(--passio-accent);
  border-color: var(--passio-accent);
  color: #fff;
}
.btn.btn-navy:hover {
  background: #1f2b44;
}
.btn.btn-out {
  background: #fff;
  border: 1px solid #d9ddd3;
  color: #35393f;
}
.btn.btn-out:hover {
  background: #f0f1ec;
}
.container.section {
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
  padding-top: 26px;
  padding-bottom: 44px;
}
.card,
.panel,
.subject-card,
.history-card,
.result-shell,
.quiz-card,
.admin-table-wrap {
  border-radius: 18px !important;
  border: 1px solid #e0e3dc !important;
  background: linear-gradient(180deg, #ffffff, #fbfcfa) !important;
  box-shadow: 0 12px 28px rgba(16, 21, 29, 0.08) !important;
}
.dash-pill,
.dash-chip,
.status-chip {
  border-radius: 999px;
  border: 1px solid #d8dfef;
  background: var(--passio-accent-soft);
  color: var(--passio-accent);
}
.footer,
footer {
  border-top: 1px solid #dde2d8;
  background: #fff;
}
.f-copy {
  color: #6e7278;
}
@media (max-width: 900px) {
  .page {
    padding-top: 64px;
  }
  .nav {
    height: 64px;
    padding: 0 14px;
  }
  .container.section {
    width: min(1120px, 100% - 20px);
  }
}
