:root {
  --s1: #2563eb;
  --s2: #059669;
  --s3: #d97706;
  --s4: #dc2626;
  --exam-comp: #1d4ed8;
  --exam-info: #be185d;
}

.timeline-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: white;
  padding: 22px 24px 16px;
  text-align: center;
}
.timeline-header h1 { margin: 0; font-size: 1.45rem; }
.timeline-header .sub { margin: 4px 0 14px; opacity: 0.85; font-size: 0.85rem; }
.timeline-header .top-nav { max-width: 1100px; margin: 0 auto; }
.timeline-header .top-nav a {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
}

.timeline-main {
  max-width: 100%;
  margin: 16px auto;
  padding: 0 20px;
  position: relative;
}

.timeline-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}
.timeline-controls .filter-group { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 0.9rem; }
.timeline-controls .filter-group select,
.timeline-controls .filter-group input {
  padding: 5px 9px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  font-size: 0.88rem;
  font-family: inherit;
}
.timeline-controls .filter-group input { width: 180px; }
.timeline-controls .muted { color: #9ca3af; font-size: 0.83rem; }

.legend { display: flex; gap: 14px; font-size: 0.8rem; color: #374151; }
.legend i.dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 4px;
}
.legend i.s1 { background: var(--s1); }
.legend i.s2 { background: var(--s2); }
.legend i.s3 { background: var(--s3); }
.legend i.s4 { background: var(--s4); }
.legend i.exam-comp { background: var(--exam-comp); }
.legend i.exam-info { background: var(--exam-info); }
.legend .muted { color: #9ca3af; font-size: 0.78rem; }

#chart {
  background: #fff;
  border-radius: 10px;
  padding: 18px 14px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  overflow-x: auto;
  overflow-y: hidden;
}
#chart svg { display: block; }

.exam-band-comp { fill: rgba(29, 78, 216, 0.04); }
.exam-band-info { fill: rgba(190, 24, 93, 0.04); }
.exam-label { font-weight: 600; font-size: 11px; }
.exam-label-comp { fill: var(--exam-comp); }
.exam-label-info { fill: var(--exam-info); }
.axis-year text, .axis-round text { font-size: 11px; fill: #6b7280; }
.axis-round line { stroke: #e5e7eb; }
.axis-year text { font-weight: 600; fill: #374151; }

circle.problem-dot { cursor: pointer; transition: r 0.15s, opacity 0.15s; }
circle.problem-dot:hover { stroke: #111; stroke-width: 1.5; }
circle.problem-dot.dim { opacity: 0.12; }

rect.kw-box { transition: fill 0.15s, opacity 0.18s; }

/* 본문/키워드 부분 갱신 직후 잠깐 강조 */
text.kw-label { transition: fill 0.3s; }
text.kw-label.just-edited { fill: #b45309; font-weight: 800; }

/* 호버 시 유사 키워드만 강조 (무관 키워드는 그대로 정상 표시) */
g.kw-group {
  transition: filter 0.18s;
}
/* dim-other는 더 이상 사용 안 함 */
g.kw-group.dim-other { opacity: 1; filter: none; }

/* 유사 키워드 강한 강조: 색상·테두리·그림자·글자 모두 진하게 */
g.kw-group.focus-cluster rect.kw-box {
  stroke: #0f172a;
  stroke-width: 2.2;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.45));
  /* 채도 + 명도 강화 */
  fill: #fef3c7 !important;  /* 진한 노란 강조 (눈에 띄게) */
}
g.kw-group.focus-cluster text {
  font-weight: 800;
  fill: #7c2d12 !important;  /* 진한 갈색-주황 (명확한 대비) */
  font-size: 14px !important;
}

/* SVG 체크박스 */
rect.kw-check {
  fill: white;
  stroke: #94a3b8;
  stroke-width: 1;
  cursor: pointer;
  transition: fill 0.1s;
}
rect.kw-check:hover { stroke: #4338ca; stroke-width: 1.5; }
rect.kw-check.checked { fill: #4338ca; stroke: #4338ca; }
path.kw-check-mark { stroke: white; stroke-width: 1.6; fill: none; pointer-events: none; }

.selection-info {
  background: #ede9fe;
  color: #4338ca;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.selection-info kbd {
  background: white;
  border: 1px solid #c4b5fd;
  border-radius: 3px;
  padding: 1px 5px;
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  color: #4338ca;
}
.btn-mini {
  padding: 5px 11px;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
}
.btn-mini.primary { background: #4338ca; color: white; border-color: #4338ca; }
.btn-mini.primary:hover { background: #3730a3; }
.btn-mini.ghost { color: #6b7280; }
.btn-mini:disabled { opacity: 0.5; cursor: not-allowed; }

/* 진행률 모달 */
.progress-area {
  padding: 18px 22px;
  background: #1e293b;
  color: #e2e8f0;
  flex: 1;
  overflow-y: auto;
}
.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  margin-bottom: 10px;
}
.progress-stats b { color: #f1f5f9; }
.progress-bar {
  background: #334155;
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-fill {
  background: linear-gradient(90deg, #10b981 0%, #4338ca 100%);
  height: 100%;
  width: 0%;
  transition: width 0.2s ease;
}
.progress-status {
  font-size: 0.86rem;
  color: #cbd5e1;
  margin-bottom: 10px;
}
.progress-log {
  max-height: 280px;
  overflow-y: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.74rem;
  background: #0f172a;
  border-radius: 5px;
  padding: 8px 10px;
  line-height: 1.5;
}
.progress-log .ok { color: #6ee7b7; }
.progress-log .err { color: #fca5a5; }
.progress-log .info { color: #94a3b8; }

.year-band {
  fill: rgba(0,0,0,0.02);
}

.tooltip {
  position: fixed;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.96);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.45;
  max-width: 380px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 200;
}
.tooltip .t-head { font-weight: 600; margin-bottom: 4px; }
.tooltip .t-meta { color: #94a3b8; font-size: 0.75rem; margin-bottom: 6px; }
.tooltip .t-body { color: #e2e8f0; }
.tooltip .t-kw { background: rgba(59,130,246,0.25); padding: 1px 6px; border-radius: 4px; }

/* 상세 패널 (오른쪽 슬라이드 인) — 풀 답안 표시를 위해 30% 확대 */
.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 546px;  /* 420 × 1.3 */
  max-width: 92vw;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  padding: 24px;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.25s;
}
.detail-panel.hidden { transform: translateX(110%); }
.detail-panel .close-btn {
  position: absolute;
  top: 12px; right: 14px;
  background: none;
  border: 0;
  font-size: 1.3rem;
  cursor: pointer;
  color: #6b7280;
}
.detail-panel h3 { margin: 0 0 8px; padding-right: 30px; }
.detail-panel .muted { color: #6b7280; font-size: 0.85rem; }
.detail-panel .detail-body {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 0.93rem;
}

.detail-edit-actions {
  margin-top: 10px;
  display: flex;
  gap: 6px;
}
.body-edit-form {
  margin-top: 12px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 10px 12px;
}
.body-edit-form label {
  display: block;
  font-size: 0.78rem;
  color: #475569;
  margin: 6px 0 3px;
  font-weight: 600;
}
.body-edit-form input,
.body-edit-form textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.88rem;
  box-sizing: border-box;
}
.body-edit-form .action-row {
  margin-top: 8px;
  gap: 6px;
}
.edited-badge {
  display: inline-block;
  background: #fef3c7;
  color: #854d0e;
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 8px;
  margin-left: 6px;
  font-weight: 600;
}

.detail-extra { margin-top: 18px; }
.detail-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid #e5e7eb; }
.detail-section h4 {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: #4338ca;
}

.detail-def {
  background: #fefce8;
  border-left: 3px solid #ca8a04;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 0.86rem;
  line-height: 1.55;
}
.detail-def .def-keyword {
  font-weight: 700;
  color: #4338ca;
  margin-right: 6px;
}
.detail-def .def-status {
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 8px;
  font-weight: 600;
  margin-right: 6px;
  background: #e0e7ff;
  color: #4338ca;
}
.detail-def .def-cat {
  font-size: 0.7rem;
  color: #6b7280;
  margin-right: 6px;
}
.detail-def .def-score {
  float: right;
  font-size: 0.72rem;
  color: #ca8a04;
  font-weight: 700;
}
.detail-def .def-text {
  margin-top: 6px;
  color: #1f2937;
}

.detail-similar {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 7px;
  cursor: pointer;
  transition: all 0.15s;
}
.detail-similar:hover { background: #fdf2f8; border-color: #be185d; }
.detail-similar-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #6b7280;
  margin-bottom: 4px;
}
.detail-similar-head .ref { font-weight: 700; color: #111827; }
.detail-similar-head .score {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.72rem;
}
.detail-similar.target-comp .detail-similar-head .ref { color: #1d4ed8; }
.detail-similar.target-info .detail-similar-head .ref { color: #be185d; }
.detail-similar.target-comp .detail-similar-head .score { background: #dbeafe; color: #1d4ed8; }
.detail-similar.target-info .detail-similar-head .score { background: #fce7f3; color: #be185d; }
.detail-similar-body {
  font-size: 0.84rem;
  color: #374151;
  line-height: 1.5;
}

.detail-hint {
  margin-top: 14px;
  padding: 8px 12px;
  background: #f0f9ff;
  border-radius: 6px;
  color: #0c4a6e;
  font-size: 0.78rem;
}
.detail-hint b { color: #075985; }

.loading-row {
  text-align: center;
  color: #9ca3af;
  padding: 12px;
  font-size: 0.85rem;
  font-style: italic;
}

/* 🎯 답안 생성 영역 */
.answer-actions .action-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  background: white;
  color: var(--text);
  font-family: inherit;
  transition: all 0.15s;
}
.btn:hover { background: #f3f4f6; }
.btn.primary { background: #4338ca; color: white; border-color: #4338ca; }
.btn.primary:hover { background: #3730a3; }
.btn.warn { background: #f59e0b; color: white; border-color: #f59e0b; }
.btn.warn:hover { background: #d97706; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.muted.small { font-size: 0.7rem; color: var(--muted); font-weight: 400; margin-left: 8px; }

.answer-result {
  font-size: 0.88rem;
  line-height: 1.6;
}
.answer-result h2 { font-size: 1.05rem; margin: 8px 0; color: #1e3a8a; }
.answer-result .ans-overview {
  padding: 10px 12px;
  background: #f0f9ff;
  border-left: 3px solid #0284c7;
  border-radius: 4px;
  margin-bottom: 14px;
  white-space: pre-wrap;
}
.answer-result .ans-section {
  margin-bottom: 14px;
}
.answer-result .ans-section h3 {
  font-size: 0.95rem;
  margin: 8px 0 6px;
  color: #1e3a8a;
}
.answer-result table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.83rem;
  margin: 4px 0 8px;
}
.answer-result th, .answer-result td {
  border: 1px solid #d1d5db;
  padding: 6px 9px;
  text-align: left;
  vertical-align: top;
}
.answer-result th {
  background: #f1f5f9;
  font-weight: 600;
}
.answer-result ul.ans-list {
  margin: 4px 0 8px 18px;
  padding: 0;
}
.answer-result ul.ans-list li { margin-bottom: 3px; }

.ans-derived {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}
.ans-derived h3 { font-size: 0.95rem; margin: 4px 0 10px; color: #4338ca; }
.derived-item {
  padding: 10px 12px;
  background: #fefce8;
  border-radius: 6px;
  margin-bottom: 8px;
  border-left: 3px solid #ca8a04;
}
.derived-item .dq-q { font-weight: 600; color: #111827; margin-bottom: 5px; }
.derived-item .dq-a { color: #374151; margin-bottom: 5px; white-space: pre-wrap; }
.derived-item .dq-kw {
  margin-top: 5px;
  font-size: 0.78rem;
  color: #6b7280;
}
.derived-item .dq-kw span {
  display: inline-block;
  background: #e0e7ff;
  color: #4338ca;
  padding: 1px 7px;
  border-radius: 8px;
  margin-right: 4px;
}

/* 파생 문제 안의 풀 답안 (제목/개요/표) */
.derived-item .dq-answer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #d4d4d8;
}
.derived-item .dq-answer .dq-ans-title {
  font-weight: 700;
  color: #1e3a8a;
  font-size: 0.88rem;
  margin-bottom: 5px;
}
.derived-item .dq-answer .dq-ans-overview {
  background: #f0f9ff;
  border-left: 2px solid #0284c7;
  padding: 6px 10px;
  border-radius: 3px;
  margin-bottom: 8px;
  font-size: 0.83rem;
  color: #1f2937;
  white-space: pre-wrap;
}
.derived-item .dq-answer .dq-ans-section {
  margin-bottom: 8px;
}
.derived-item .dq-answer .dq-ans-section h5 {
  margin: 6px 0 4px;
  font-size: 0.83rem;
  color: #4338ca;
}
.derived-item .dq-answer table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.78rem;
}
.derived-item .dq-answer th,
.derived-item .dq-answer td {
  border: 1px solid #cbd5e1;
  padding: 4px 7px;
  text-align: left;
  vertical-align: top;
}
.derived-item .dq-answer th {
  background: #e0e7ff;
  font-weight: 600;
  color: #1e3a8a;
}
.derived-item .dq-answer ul {
  margin: 4px 0 6px 16px;
  font-size: 0.83rem;
}

.cached-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  background: #d1fae5;
  color: #065f46;
  border-radius: 8px;
  margin-left: 6px;
}

/* 편집 모드 */
.answer-result.editing textarea {
  width: 100%;
  min-height: 90px;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
  margin-bottom: 8px;
}
.answer-result.editing .edit-table-row td {
  padding: 0;
}
.answer-result.editing .edit-table-row td input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  font-size: 0.82rem;
  font-family: inherit;
}

/* 📋 프롬프트 미리보기 모달 */
.prompt-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 24px;
}
.prompt-modal-content {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 12px;
  width: min(960px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.prompt-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #0f172a;
  border-bottom: 1px solid #334155;
}
.prompt-modal-head h3 { margin: 0; color: #f1f5f9; font-size: 1.05rem; }
.prompt-modal-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.prompt-modal-actions .btn {
  background: #334155;
  color: #e2e8f0;
  border-color: #475569;
}
.prompt-modal-actions .btn:hover { background: #475569; }
.prompt-modal-actions .btn.primary { background: #4338ca; border-color: #4338ca; }
.prompt-modal-actions .btn.primary:hover { background: #6366f1; }

.prompt-modal-meta {
  padding: 8px 20px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  font-size: 0.78rem;
  color: #94a3b8;
}
#promptFullText {
  flex: 1;
  margin: 0;
  padding: 18px 20px;
  background: #1e293b;
  color: #f1f5f9;
  border: 0;
  resize: none;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  outline: none;
  white-space: pre;
  word-wrap: normal;
  overflow-x: auto;
}

/* 📐 키워드 유사도 분석 결과 */
.sim-result {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 0.86rem;
}
.sim-root {
  padding: 10px 18px;
  background: #4338ca;
  color: white;
  font-weight: 700;
  border-bottom: 1px solid #334155;
}
.sim-row {
  padding: 10px 18px;
  border-bottom: 1px solid #334155;
}
.sim-row .sim-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sim-row .sim-kw {
  flex: 0 0 180px;
  font-weight: 700;
  color: #f1f5f9;
}
.sim-row .sim-bar-wrap {
  flex: 1;
  background: #334155;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  min-width: 100px;
}
.sim-row .sim-bar {
  height: 100%;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 40%, #34d399 80%, #4338ca 100%);
}
/* 비유사도 모드: 빨간 톤 (무관할수록 진함) */
.sim-row .sim-bar.dis {
  background: linear-gradient(90deg, #fde68a 0%, #fb923c 50%, #dc2626 100%);
}
.sim-row .sim-pct {
  flex: 0 0 80px;
  text-align: right;
  font-family: ui-monospace, monospace;
  color: #fde68a;
  font-weight: 700;
}
.sim-row .sim-cos {
  flex: 0 0 90px;
  text-align: right;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  color: #94a3b8;
}
.sim-match {
  margin-top: 6px;
  font-size: 0.75rem;
  color: #cbd5e1;
  padding-left: 28px;
  line-height: 1.55;
}
.sim-match .label {
  display: inline-block;
  background: #475569;
  color: white;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 6px;
  font-weight: 600;
  font-size: 0.7rem;
}
.sim-match .label.prob { background: #1d4ed8; }
.sim-match .label.def { background: #ca8a04; color: #1f2937; }
.modal-meta {
  color: #cbd5e1;
  font-size: 0.78rem;
  margin: 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* SVG 다이어그램 (timeline 답안 영역) - 컨텐츠 크기에 맞춰서 그림 */
svg.diagram {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 6px 0 10px;
  background: white;
}
/* 가로 스크롤 허용 (긴 flow가 패널보다 클 때) */
.ans-section, .dq-ans-section {
  overflow-x: auto;
}

.copy-feedback {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #16a34a;
  color: white;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.92rem;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.2s;
}
.copy-feedback.show { opacity: 1; }

/* 📥 MD import 모달 textarea (어두운 모달 컨텐츠) */
#simInput, #importMdModal textarea {
  flex: 1;
  margin: 0;
  padding: 14px 18px;
  background: #1e293b;
  color: #f1f5f9;
  border: 0;
  resize: none;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  outline: none;
  min-height: 320px;
}
.import-mode-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.import-controls {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}
.bulk-hint {
  padding: 10px 18px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.78rem;
  border-bottom: 1px solid #334155;
  line-height: 1.5;
}
.bulk-hint code {
  background: #0f172a;
  color: #fde68a;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
}
.bulk-file-list {
  flex: 1;
  overflow-y: auto;
  background: #1e293b;
  padding: 8px 18px;
  min-height: 200px;
}
.bulk-file-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid #334155;
  font-size: 0.78rem;
  color: #e2e8f0;
  font-family: ui-monospace, monospace;
}
.bulk-file-row .pid { color: #94a3b8; }
.bulk-file-row.ok { color: #6ee7b7; }
.bulk-file-row.fail { color: #fca5a5; }
.bulk-file-row .status { font-weight: 600; }
.bulk-result {
  padding: 10px 18px;
  background: #0f172a;
  color: #f1f5f9;
  font-size: 0.82rem;
  border-top: 1px solid #334155;
}

/* MD 답안 렌더링 (사이드 패널 내) */
.imported-md-answer {
  background: #fefce8;
  border-left: 4px solid #ca8a04;
  padding: 16px 18px;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.65;
}
.imported-md-answer h1,
.imported-md-answer h2,
.imported-md-answer h3,
.imported-md-answer h4 {
  margin: 14px 0 8px;
  color: #1e3a8a;
}
.imported-md-answer h1 { font-size: 1.05rem; }
.imported-md-answer h2 { font-size: 1.0rem; }
.imported-md-answer h3 { font-size: 0.95rem; }
.imported-md-answer h4 { font-size: 0.9rem; }
.imported-md-answer p { margin: 6px 0; }
.imported-md-answer ul,
.imported-md-answer ol { margin: 6px 0 8px 22px; }
.imported-md-answer code {
  background: #e0e7ff;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.83rem;
  font-family: ui-monospace, monospace;
}
.imported-md-answer pre {
  background: #1e293b;
  color: #f1f5f9;
  padding: 10px 12px;
  border-radius: 5px;
  overflow-x: auto;
  font-size: 0.8rem;
}
.imported-md-answer table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.83rem;
  margin: 6px 0;
}
.imported-md-answer th,
.imported-md-answer td {
  border: 1px solid #cbd5e1;
  padding: 5px 9px;
  text-align: left;
  vertical-align: top;
}
.imported-md-answer th {
  background: #fde68a;
  color: #78350f;
  font-weight: 700;
}
.imported-md-answer blockquote {
  border-left: 3px solid #cbd5e1;
  padding-left: 10px;
  color: #475569;
  margin: 8px 0;
}

.imported-badge {
  display: inline-block;
  background: #fde68a;
  color: #78350f;
  padding: 2px 9px;
  border-radius: 8px;
  font-size: 0.7rem;
  margin-left: 6px;
  font-weight: 600;
}

/* 펀치 가이드 (화면에서는 숨김; 인쇄는 preview 새 탭에서 paged.js 처리) */
.punch-mark { display: none; }

/* 타임라인 자체 인쇄는 더 이상 사용 안 함 — 답안 인쇄는 새 탭 preview로 통일 */

.hidden { display: none; }

/* === Job 큐: 우측 상단 배지 + 토스트 + 키워드 박스 마크 === */
.job-badge {
  position: fixed;
  top: 12px;
  right: 16px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  color: #78350f;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 9000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: none;
}
.job-badge b { font-weight: 800; }

.toast {
  position: fixed;
  bottom: 10px;
  right: 20px;
  background: #1f2937;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 9100;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.25s, transform 0.25s;
  font-size: 0.85rem;
  max-width: 360px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #065f46; }
.toast-error { background: #991b1b; }

/* 진행 중 키워드 박스 펄스 */
@keyframes pulse-job {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.kw-group.job-running .job-mark {
  animation: pulse-job 1.4s ease-in-out infinite;
}
.kw-group.job-done .job-mark {
  filter: drop-shadow(0 0 3px gold);
}

/* === 등록 답안 연결 배지 === */
.registered-answers {
  margin: 6px 0 8px;
  padding: 8px 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.7;
}
.registered-answers .ra-label { color: #166534; font-weight: 700; margin-right: 4px; }
.registered-answers .ra-link {
  display: inline-block;
  margin: 1px 4px 1px 0;
  padding: 1px 8px;
  background: #dcfce7;
  color: #15803d;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}
.registered-answers .ra-link:hover { background: #86efac; color: #14532d; }
