/* --- 퀴즈 상세: 문제+선지 한 카드, 보기 세로형, 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;
}

.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;
  }
}

/* ChatGPT-like redesign baseline */
:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --s1: #212121;
  --s2: #2a2a2a;
  --bd: #303030;
  --navy: #ececec;
  --navy-l: #262626;
  --navy-b: #3a3a3a;
  --amber: #c9c9c9;
  --amber-l: #262626;
  --amber-b: #3a3a3a;
  --t1: #ececec;
  --t2: #b5b5b5;
  --t3: #838383;
}

html,
body {
  background: var(--bg);
  color: var(--t1);
}

.nav,
.topbar {
  background: #161616;
  border-bottom: 1px solid var(--bd);
}

.card,
.info-card,
.question-card,
.panel,
.auth-card {
  background: var(--surface);
  border-color: var(--bd);
  box-shadow: none;
}

.nav-link.active,
.btn.btn-out:hover,
.btn.ghost:hover {
  background: #2a2a2a;
  border-color: #3c3c3c;
  color: #fff;
}

.btn.primary,
.btn.btn-navy {
  background: #fff;
  color: #111;
}

.btn.primary:hover,
.btn.btn-navy:hover {
  background: #e8e8e8;
}

.field input,
.explain-textarea,
.token-textarea,
.bank-select {
  background: #111;
  border-color: #353535;
  color: #eee;
}

/* AI explain page: chatgpt-style two-pane layout */
.gpt-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.gpt-sidebar {
  border-right: 1px solid var(--bd);
  background: #171717;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gpt-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.gpt-new-chat {
  width: 100%;
  text-align: center;
}

.gpt-side-nav {
  display: grid;
  gap: 6px;
}

.gpt-side-nav .nav-link {
  display: block;
  border: 1px solid transparent;
}

.gpt-user-box {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.gpt-main {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100vh;
}

.gpt-thread {
  overflow-y: auto;
  padding: 28px 24px 16px;
}

.gpt-message {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.gpt-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #2d2d2d;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.gpt-bubble {
  flex: 1;
  background: #181818;
  border: 1px solid #2f2f2f;
  border-radius: 14px;
  padding: 16px;
}

.gpt-bubble h1 {
  font-size: 22px;
  line-height: 1.35;
  margin-bottom: 8px;
}

.gpt-bubble p {
  color: #b8b8b8;
}

.gpt-composer {
  margin: 0 16px 16px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #353535;
  background: #161616;
}

@media (max-width: 900px) {
  .gpt-page {
    grid-template-columns: 1fr;
  }
  .gpt-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--bd);
  }
}

/* Notion-like refinement over GPT shell */
.chatgpt-ui {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --s1: #f2f1ef;
  --s2: #ebe9e6;
  --bd: #e3e1dd;
  --navy: #37352f;
  --navy-l: #f1f0ed;
  --navy-b: #dddad4;
  --amber: #7f6f54;
  --amber-l: #faf6ed;
  --amber-b: #e8ddcb;
  --t1: #37352f;
  --t2: #6f6a61;
  --t3: #9e9a92;
}

body.chatgpt-ui {
  background: #f7f7f5;
  color: #37352f;
}

.chatgpt-ui .gpt-main {
  background: #fcfcfb;
}

.chatgpt-ui .gpt-sidebar {
  background: #fbfbfa;
  border-right: 1px solid #ecebe8;
}

.chatgpt-ui .gpt-logo {
  color: #2f2d28;
}

.chatgpt-ui .gpt-side-nav .nav-link {
  border-radius: 8px;
  padding: 8px 10px;
}

.chatgpt-ui .gpt-avatar {
  background: #ecebe8;
  color: #4b4842;
}

.chatgpt-ui .gpt-bubble {
  background: #fff;
  border: 1px solid #e7e5e1;
  box-shadow: 0 1px 2px rgba(15, 15, 15, 0.04);
}

.chatgpt-ui .gpt-bubble p {
  color: #6e685f;
}

.chatgpt-ui .gpt-composer {
  background: #fff;
  border: 1px solid #e5e3de;
}

.chatgpt-ui .card,
.chatgpt-ui .panel,
.chatgpt-ui .info-card,
.chatgpt-ui .auth-card,
.chatgpt-ui .question-card {
  box-shadow: 0 1px 2px rgba(15, 15, 15, 0.04);
  border-color: #e5e3df;
}

.chatgpt-ui .btn.btn-navy,
.chatgpt-ui .btn.primary {
  background: #2f2f2f;
  color: #fff;
}

.chatgpt-ui .btn.btn-navy:hover,
.chatgpt-ui .btn.primary:hover {
  background: #1f1f1f;
}

.chatgpt-ui .btn.btn-out,
.chatgpt-ui .btn.ghost {
  background: #fff;
  border-color: #dddad4;
  color: #4c4943;
}

.chatgpt-ui .btn.btn-out:hover,
.chatgpt-ui .btn.ghost:hover,
.chatgpt-ui .nav-link.active {
  background: #f3f2ef;
  border-color: #d9d6d0;
  color: #2f2d28;
}

/* Forge v2 full redesign */
body.chatgpt-ui {
  background:
    radial-gradient(900px 420px at -10% -15%, rgba(76, 132, 255, 0.18), transparent 60%),
    radial-gradient(820px 460px at 110% -10%, rgba(94, 234, 212, 0.12), transparent 62%),
    linear-gradient(180deg, #f8fafc 0%, #f3f6fb 100%);
  color: #172033;
}

.chatgpt-ui .gpt-page {
  grid-template-columns: 290px 1fr;
}

.chatgpt-ui .gpt-sidebar {
  background: rgba(255, 255, 255, 0.78);
  border-right: 1px solid #e4ebf5;
  backdrop-filter: blur(10px);
  padding: 20px 14px;
}

.chatgpt-ui .gpt-logo {
  font-size: 15px;
  font-weight: 800;
  color: #15223a;
}

.chatgpt-ui .logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #2e6bff, #244fd6);
  box-shadow: 0 10px 18px rgba(44, 87, 213, 0.28);
  position: relative;
}

.chatgpt-ui .logo-mark svg {
  display: none;
}

.chatgpt-ui .logo-mark::after {
  content: "F";
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
}

.chatgpt-ui .gpt-side-nav {
  gap: 6px;
}

.chatgpt-ui .gpt-side-nav .nav-link {
  border-radius: 10px;
  padding: 9px 11px;
  color: #51607d;
  font-size: 13px;
  font-weight: 600;
}

.chatgpt-ui .gpt-side-nav .nav-link:hover {
  background: #eef4ff;
  color: #1f3358;
}

.chatgpt-ui .gpt-side-nav .nav-link.active {
  background: linear-gradient(180deg, #edf3ff 0%, #e4eeff 100%);
  color: #1f3a69;
  border: 1px solid #d7e5ff;
}

.chatgpt-ui .gpt-main {
  background: transparent;
}

.chatgpt-ui .gpt-thread {
  padding: 34px 34px 18px;
}

.chatgpt-ui .gpt-message {
  max-width: 980px;
}

.chatgpt-ui .gpt-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eaf0fb;
  color: #30456f;
  font-weight: 700;
}

.chatgpt-ui .gpt-bubble {
  border-radius: 16px;
  border: 1px solid #e0e9f5;
  box-shadow: 0 14px 34px rgba(18, 40, 78, 0.08);
  padding: 22px;
}

.chatgpt-ui .gpt-bubble h1 {
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.23;
  letter-spacing: -0.02em;
  color: #12213b;
}

.chatgpt-ui .gpt-bubble p {
  color: #5d6d89;
  font-size: 15px;
  line-height: 1.7;
}

.chatgpt-ui .gpt-composer {
  margin: 0 22px 22px;
  border-radius: 16px;
  border: 1px solid #dce7f6;
  box-shadow: 0 16px 36px rgba(18, 40, 78, 0.11);
  padding: 16px;
}

.chatgpt-ui .card,
.chatgpt-ui .panel,
.chatgpt-ui .info-card,
.chatgpt-ui .auth-card,
.chatgpt-ui .question-card,
.chatgpt-ui .history-group-col {
  border-radius: 16px !important;
  border: 1px solid #dde6f3 !important;
  box-shadow: 0 10px 28px rgba(15, 37, 74, 0.08) !important;
  background: #fff !important;
}

.chatgpt-ui .dash-headline h2 {
  color: #12213b;
  letter-spacing: -0.02em;
}

.chatgpt-ui .dash-headline .sub {
  color: #5b6982;
}

.chatgpt-ui .dash-pill {
  background: #eaf1ff;
  border-color: #d6e4ff;
  color: #2a4c86;
}

.chatgpt-ui .btn.btn-navy,
.chatgpt-ui .btn.primary {
  background: linear-gradient(130deg, #2f67f4, #2857d3 74%);
  color: #fff;
  border: 1px solid #2953c6;
}

.chatgpt-ui .btn.btn-navy:hover,
.chatgpt-ui .btn.primary:hover {
  background: linear-gradient(130deg, #2559dd, #204ab8 74%);
}

.chatgpt-ui .btn.btn-out,
.chatgpt-ui .btn.ghost {
  background: #fff;
  border: 1px solid #d8e2f0;
  color: #2f446f;
}

.chatgpt-ui .btn.btn-out:hover,
.chatgpt-ui .btn.ghost:hover {
  background: #f1f6ff;
  border-color: #cfe0fb;
  color: #1f3763;
}

.chatgpt-ui .field input,
.chatgpt-ui .explain-textarea,
.chatgpt-ui .token-textarea,
.chatgpt-ui .bank-select,
.chatgpt-ui .inp {
  border: 1px solid #d8e2f2;
  background: #fdfefe;
  color: #17243d;
}

.chatgpt-ui .field input:focus,
.chatgpt-ui .explain-textarea:focus,
.chatgpt-ui .token-textarea:focus,
.chatgpt-ui .bank-select:focus,
.chatgpt-ui .inp:focus {
  border-color: #7fa9ff;
  box-shadow: 0 0 0 4px rgba(53, 112, 241, 0.14);
}

.chatgpt-ui .nav-user {
  border-radius: 999px;
  border: 1px solid #d8e2f2;
  background: #f2f7ff;
  color: #39568a;
}

@media (max-width: 980px) {
  .chatgpt-ui .gpt-page {
    grid-template-columns: 1fr;
  }
  .chatgpt-ui .gpt-sidebar {
    border-right: 0;
    border-bottom: 1px solid #e4ebf5;
  }
  .chatgpt-ui .gpt-thread {
    padding: 20px 14px 10px;
  }
  .chatgpt-ui .gpt-composer {
    margin: 0 10px 12px;
  }
}

/* Forge v3 signature aesthetic (non-template look) */
body.chatgpt-ui {
  background:
    radial-gradient(1200px 540px at -20% -20%, rgba(255, 94, 171, 0.16), transparent 60%),
    radial-gradient(900px 480px at 120% 0%, rgba(87, 124, 255, 0.19), transparent 58%),
    radial-gradient(800px 400px at 50% 120%, rgba(0, 210, 190, 0.11), transparent 60%),
    linear-gradient(180deg, #f8f6ff 0%, #f2f7ff 45%, #effaf8 100%);
  color: #1c1e2b;
}

.chatgpt-ui .gpt-sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(247, 249, 255, 0.78));
  border-right: 1px solid rgba(165, 177, 214, 0.3);
  backdrop-filter: blur(16px) saturate(130%);
}

.chatgpt-ui .gpt-logo {
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #161a2f;
}

.chatgpt-ui .logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #714bff 0%, #4f7cff 52%, #36c9bd 100%);
  box-shadow: 0 14px 26px rgba(81, 105, 210, 0.35);
  overflow: hidden;
}

.chatgpt-ui .logo-mark::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 100%;
  left: 9px;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  clip-path: polygon(0 0, 80% 0, 45% 100%, 0 100%);
}

.chatgpt-ui .logo-mark::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  right: 7px;
  top: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 0 rgba(255, 255, 255, 0.5);
}

.chatgpt-ui .gpt-side-nav .nav-link {
  border-radius: 12px;
  transition: transform 0.16s ease, background-color 0.2s ease;
}

.chatgpt-ui .gpt-side-nav .nav-link:hover {
  transform: translateX(2px);
  background: rgba(112, 124, 255, 0.1);
  color: #303f7d;
}

.chatgpt-ui .gpt-side-nav .nav-link.active {
  background: linear-gradient(135deg, rgba(115, 112, 255, 0.14), rgba(54, 201, 189, 0.12));
  border: 1px solid rgba(112, 132, 231, 0.26);
  color: #29397a;
}

.chatgpt-ui .gpt-bubble {
  border: 1px solid rgba(157, 172, 216, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(251, 252, 255, 0.88));
  box-shadow:
    0 20px 40px rgba(69, 96, 173, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.chatgpt-ui .gpt-bubble h1 {
  background: linear-gradient(120deg, #2f2f82 0%, #2876d0 45%, #169b93 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.chatgpt-ui .gpt-composer {
  border: 1px solid rgba(152, 172, 226, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 252, 255, 0.92));
}

.chatgpt-ui .btn.btn-navy,
.chatgpt-ui .btn.primary {
  background: linear-gradient(130deg, #6a4dff 0%, #3e78f0 58%, #29b8ab 100%);
  border: 0;
  box-shadow: 0 10px 20px rgba(73, 98, 197, 0.28);
}

.chatgpt-ui .btn.btn-navy:hover,
.chatgpt-ui .btn.primary:hover {
  filter: saturate(1.08) brightness(1.03);
  transform: translateY(-1px);
}

.chatgpt-ui .btn.btn-out,
.chatgpt-ui .btn.ghost {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(163, 178, 216, 0.42);
  color: #33447d;
}

.chatgpt-ui .btn.btn-out:hover,
.chatgpt-ui .btn.ghost:hover {
  background: rgba(245, 248, 255, 0.98);
  border-color: rgba(126, 144, 206, 0.46);
}

.chatgpt-ui .card,
.chatgpt-ui .panel,
.chatgpt-ui .info-card,
.chatgpt-ui .auth-card,
.chatgpt-ui .question-card,
.chatgpt-ui .history-group-col {
  border: 1px solid rgba(165, 178, 216, 0.34) !important;
  box-shadow: 0 14px 30px rgba(63, 89, 163, 0.1) !important;
}

/* Forge v4 high-end branded polish */
body.chatgpt-ui {
  background:
    radial-gradient(1400px 700px at -10% -25%, rgba(255, 122, 198, 0.19), transparent 58%),
    radial-gradient(1200px 640px at 120% -5%, rgba(101, 130, 255, 0.22), transparent 56%),
    radial-gradient(900px 460px at 55% 120%, rgba(44, 206, 184, 0.14), transparent 60%),
    linear-gradient(180deg, #f7f6ff 0%, #eef4ff 55%, #ecf9f5 100%);
}

.chatgpt-ui .gpt-sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 249, 255, 0.74));
  border-right: 1px solid rgba(145, 163, 214, 0.36);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.65);
}

.chatgpt-ui .gpt-logo {
  font-size: 16px;
  letter-spacing: -0.015em;
}

.chatgpt-ui .logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  box-shadow:
    0 16px 32px rgba(72, 90, 188, 0.38),
    inset 0 1px 1px rgba(255, 255, 255, 0.42);
}

.chatgpt-ui .gpt-bubble {
  border-radius: 18px;
  box-shadow:
    0 26px 48px rgba(53, 79, 160, 0.14),
    0 2px 0 rgba(255, 255, 255, 0.62) inset;
}

.chatgpt-ui .gpt-bubble h1 {
  font-weight: 900;
}

.chatgpt-ui .gpt-composer {
  border-radius: 18px;
  box-shadow:
    0 20px 42px rgba(54, 80, 156, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.82) inset;
}

.chatgpt-ui .btn.btn-navy,
.chatgpt-ui .btn.primary {
  border-radius: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow:
    0 12px 24px rgba(69, 89, 178, 0.34),
    0 1px 0 rgba(255, 255, 255, 0.22) inset;
}

.chatgpt-ui .btn.btn-out,
.chatgpt-ui .btn.ghost {
  border-radius: 11px;
  backdrop-filter: blur(6px);
}

.chatgpt-ui .card,
.chatgpt-ui .panel,
.chatgpt-ui .info-card,
.chatgpt-ui .auth-card,
.chatgpt-ui .question-card,
.chatgpt-ui .history-group-col {
  border-radius: 18px !important;
  box-shadow:
    0 18px 36px rgba(45, 72, 146, 0.14),
    0 1px 0 rgba(255, 255, 255, 0.62) inset !important;
}

/* Forge v5 dark premium theme */
body.chatgpt-ui {
  --bg: #0b1020;
  --surface: #11182d;
  --s1: #151f39;
  --s2: #1a2544;
  --bd: #27345c;
  --t1: #e9eeff;
  --t2: #aebbe0;
  --t3: #7f8db2;
  background:
    radial-gradient(1200px 640px at -15% -20%, rgba(147, 51, 234, 0.23), transparent 58%),
    radial-gradient(1000px 520px at 115% -10%, rgba(37, 99, 235, 0.26), transparent 55%),
    radial-gradient(880px 420px at 55% 120%, rgba(20, 184, 166, 0.2), transparent 62%),
    linear-gradient(180deg, #0b1020 0%, #0c1428 45%, #0d1831 100%);
  color: var(--t1);
}

.chatgpt-ui .gpt-main {
  background: transparent;
}

.chatgpt-ui .gpt-sidebar {
  background: linear-gradient(180deg, rgba(10, 16, 34, 0.9), rgba(12, 20, 40, 0.84));
  border-right: 1px solid rgba(68, 88, 140, 0.48);
  box-shadow: inset -1px 0 0 rgba(180, 198, 255, 0.05);
}

.chatgpt-ui .gpt-logo {
  color: #f1f4ff;
}

.chatgpt-ui .gpt-side-nav .nav-link {
  color: #9db0df;
}

.chatgpt-ui .gpt-side-nav .nav-link:hover {
  background: rgba(78, 104, 195, 0.26);
  color: #e7edff;
}

.chatgpt-ui .gpt-side-nav .nav-link.active {
  background: linear-gradient(135deg, rgba(115, 112, 255, 0.28), rgba(54, 201, 189, 0.2));
  border-color: rgba(124, 147, 228, 0.55);
  color: #f2f6ff;
}

.chatgpt-ui .gpt-avatar {
  background: #24345f;
  color: #eef3ff;
}

.chatgpt-ui .gpt-bubble {
  border: 1px solid rgba(70, 93, 156, 0.56);
  background: linear-gradient(180deg, rgba(17, 25, 47, 0.95), rgba(14, 21, 41, 0.9));
  box-shadow:
    0 24px 48px rgba(2, 6, 19, 0.52),
    0 1px 0 rgba(169, 188, 255, 0.12) inset;
}

.chatgpt-ui .gpt-bubble p {
  color: #b4c2e9;
}

.chatgpt-ui .gpt-composer {
  background: linear-gradient(180deg, rgba(16, 24, 46, 0.96), rgba(14, 21, 40, 0.92));
  border: 1px solid rgba(74, 96, 160, 0.58);
  box-shadow:
    0 20px 42px rgba(2, 6, 19, 0.48),
    0 1px 0 rgba(179, 197, 255, 0.1) inset;
}

.chatgpt-ui .card,
.chatgpt-ui .panel,
.chatgpt-ui .info-card,
.chatgpt-ui .auth-card,
.chatgpt-ui .question-card,
.chatgpt-ui .history-group-col {
  background: linear-gradient(180deg, rgba(18, 27, 51, 0.95), rgba(15, 23, 45, 0.93)) !important;
  border: 1px solid rgba(65, 87, 146, 0.52) !important;
  box-shadow:
    0 18px 36px rgba(1, 5, 16, 0.55),
    0 1px 0 rgba(178, 197, 255, 0.08) inset !important;
}

.chatgpt-ui .dash-headline h2 {
  color: #f0f4ff;
}

.chatgpt-ui .dash-headline .sub,
.chatgpt-ui .muted,
.chatgpt-ui .bank-q,
.chatgpt-ui .history-question-preview {
  color: #aebce1 !important;
}

.chatgpt-ui .dash-pill {
  background: rgba(82, 108, 193, 0.24);
  border-color: rgba(118, 145, 228, 0.5);
  color: #dbe6ff;
}

.chatgpt-ui .btn.btn-navy,
.chatgpt-ui .btn.primary {
  background: linear-gradient(130deg, #8354ff 0%, #3b82f6 56%, #14b8a6 100%);
  box-shadow: 0 12px 24px rgba(26, 46, 112, 0.52);
}

.chatgpt-ui .btn.btn-out,
.chatgpt-ui .btn.ghost {
  background: rgba(24, 35, 64, 0.9);
  border-color: rgba(92, 114, 174, 0.55);
  color: #d7e3ff;
}

.chatgpt-ui .btn.btn-out:hover,
.chatgpt-ui .btn.ghost:hover {
  background: rgba(37, 52, 90, 0.95);
  color: #f3f7ff;
}

.chatgpt-ui .field input,
.chatgpt-ui .explain-textarea,
.chatgpt-ui .token-textarea,
.chatgpt-ui .bank-select,
.chatgpt-ui .inp {
  background: rgba(12, 19, 37, 0.88);
  border-color: rgba(78, 102, 166, 0.62);
  color: #ecf2ff;
}

.chatgpt-ui .field input:focus,
.chatgpt-ui .explain-textarea:focus,
.chatgpt-ui .token-textarea:focus,
.chatgpt-ui .bank-select:focus,
.chatgpt-ui .inp:focus {
  border-color: #7ea3ff;
  box-shadow: 0 0 0 4px rgba(56, 110, 247, 0.24);
}

.chatgpt-ui .nav-user {
  background: rgba(36, 53, 95, 0.95);
  border-color: rgba(91, 113, 177, 0.65);
  color: #dce7ff;
}

/* Forge v6 enterprise-grade dark polish */
body.chatgpt-ui {
  --bg: #0d111a;
  --surface: #121826;
  --s1: #182033;
  --s2: #1f2940;
  --bd: #2c3854;
  --t1: #e7edf8;
  --t2: #a8b5cd;
  --t3: #7c8baa;
  background:
    radial-gradient(1100px 500px at -20% -30%, rgba(73, 96, 186, 0.22), transparent 55%),
    radial-gradient(900px 420px at 120% -15%, rgba(22, 163, 148, 0.16), transparent 58%),
    linear-gradient(180deg, #0d111a 0%, #0f1522 50%, #101a2c 100%);
  color: var(--t1);
}

.chatgpt-ui .gpt-sidebar {
  background: linear-gradient(180deg, rgba(15, 21, 35, 0.95), rgba(14, 20, 33, 0.9));
  border-right: 1px solid #25314c;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.chatgpt-ui .logo-mark {
  background: linear-gradient(145deg, #5b7cfa, #4b57d6);
  box-shadow: 0 10px 22px rgba(58, 87, 194, 0.4);
}

.chatgpt-ui .gpt-logo {
  color: #f3f6ff;
}

.chatgpt-ui .gpt-side-nav .nav-link {
  color: #9dadcf;
  font-weight: 600;
}

.chatgpt-ui .gpt-side-nav .nav-link:hover {
  background: #1c2740;
  color: #dde7ff;
  transform: none;
}

.chatgpt-ui .gpt-side-nav .nav-link.active {
  background: linear-gradient(180deg, #243457 0%, #1e2b48 100%);
  border: 1px solid #32466e;
  color: #eff4ff;
}

.chatgpt-ui .gpt-bubble {
  background: linear-gradient(180deg, #151d2e 0%, #131b2b 100%);
  border: 1px solid #2d3a57;
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(1, 5, 15, 0.45);
}

.chatgpt-ui .gpt-bubble h1 {
  background: none;
  color: #f0f4ff;
  font-weight: 800;
}

.chatgpt-ui .gpt-bubble p {
  color: #acb9d3;
}

.chatgpt-ui .gpt-composer {
  background: linear-gradient(180deg, #131c2e 0%, #10192a 100%);
  border: 1px solid #2c3956;
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(1, 5, 15, 0.42);
}

.chatgpt-ui .card,
.chatgpt-ui .panel,
.chatgpt-ui .info-card,
.chatgpt-ui .auth-card,
.chatgpt-ui .question-card,
.chatgpt-ui .history-group-col {
  background: linear-gradient(180deg, #151d2f 0%, #121a2b 100%) !important;
  border: 1px solid #2b3854 !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 22px rgba(1, 5, 15, 0.36) !important;
}

.chatgpt-ui .btn.btn-navy,
.chatgpt-ui .btn.primary {
  background: linear-gradient(135deg, #4d73f8 0%, #4560da 100%);
  box-shadow: 0 8px 16px rgba(46, 77, 188, 0.35);
}

.chatgpt-ui .btn.btn-out,
.chatgpt-ui .btn.ghost {
  background: #182238;
  border-color: #31415f;
  color: #d9e3f8;
}

.chatgpt-ui .btn.btn-out:hover,
.chatgpt-ui .btn.ghost:hover {
  background: #202c46;
}

.chatgpt-ui .field input,
.chatgpt-ui .explain-textarea,
.chatgpt-ui .token-textarea,
.chatgpt-ui .bank-select,
.chatgpt-ui .inp {
  background: #0f1625;
  border-color: #324463;
  color: #edf2ff;
}

.chatgpt-ui .field input:focus,
.chatgpt-ui .explain-textarea:focus,
.chatgpt-ui .token-textarea:focus,
.chatgpt-ui .bank-select:focus,
.chatgpt-ui .inp:focus {
  border-color: #5e83ff;
  box-shadow: 0 0 0 3px rgba(79, 113, 230, 0.2);
}
