/* chart-lab.html — 차트연구소 3단 레이아웃 */

body.chart-lab-page {
  margin: 0;
  background: #f4f9f6;
  color: #10231b;
  min-width: 1280px;
  overflow-x: auto;
}

.chart-lab-shell {
  box-sizing: border-box;
  width: 100%;
  max-width: min(1440px, 100%);
  margin: 0 auto;
}

.chart-lab-layout {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr) minmax(0, 300px);
  gap: 28px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 28px 48px;
  box-sizing: border-box;
  align-items: start;
}

.chart-lab-panel[hidden],
.chart-lab-panel.is-hidden {
  display: none !important;
}

/* ── 좌측 사이드바 ── */
.chart-lab-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.chart-lab-sidebar-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e2eee8;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(16, 35, 27, 0.05);
}

.chart-lab-sidebar-title {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

.chart-lab-sidebar-sub {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #5a7268;
  line-height: 1.75;
}

.chart-lab-lumi-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  background: #fff;
  border: 1px solid #e2eee8;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(16, 35, 27, 0.05);
}

.chart-lab-lumi-img {
  flex-shrink: 0;
  width: 56px;
  height: auto;
  object-fit: contain;
}

.chart-lab-lumi-body strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #1e693b;
  margin-bottom: 4px;
}

.chart-lab-lumi-body p {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #5a7268;
  line-height: 1.5;
}

.chart-lab-sidebar .inquiry-menu-card {
  box-shadow: 0 4px 14px rgba(16, 35, 27, 0.05);
}

/* ── 중앙 메인 ── */
.chart-lab-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-lab-intro-card {
  background: #fff;
  border: 1px solid #e2eee8;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 4px 14px rgba(16, 35, 27, 0.05);
}

.chart-lab-intro-head {
  margin-bottom: 14px;
}

.chart-lab-lumi-bubble {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.chart-lab-lumi-bubble-img {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.chart-lab-lumi-bubble-text {
  position: relative;
  flex: 1;
  min-width: 0;
  background: #f0faf5;
  border: 1px solid #d4eadc;
  border-radius: 14px;
  padding: 12px 14px;
}

.chart-lab-lumi-bubble-text::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 16px;
  width: 12px;
  height: 12px;
  background: #f0faf5;
  border-left: 1px solid #d4eadc;
  border-bottom: 1px solid #d4eadc;
  transform: rotate(45deg);
}

.chart-lab-lumi-bubble-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #1e693b;
  margin-bottom: 4px;
}

.chart-lab-lumi-bubble-text p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #4d6b5d;
  line-height: 1.55;
}

.chart-lab-content-card {
  background: #fff;
  border: 1px solid #e2eee8;
  border-radius: 16px;
  padding: 20px;
  min-height: 320px;
  box-shadow: 0 4px 14px rgba(16, 35, 27, 0.05);
  box-sizing: border-box;
}

.chart-lab-main-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.chart-lab-main-sub {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #5a7268;
  line-height: 1.5;
}

/* 패턴 그리드 */
.chart-lab-pattern-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.chart-lab-pattern-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2eee8;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(16, 35, 27, 0.04);
}

.chart-lab-pattern-card--interactive {
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.chart-lab-pattern-card--interactive:hover,
.chart-lab-pattern-card--interactive:focus-visible {
  border-color: #2DB473;
  background: #f4fbf7;
  box-shadow: 0 0 0 2px rgba(45, 180, 115, 0.18), 0 4px 14px rgba(30, 105, 59, 0.1);
  outline: none;
}

.chart-lab-pattern-card--interactive:active {
  background: #ecf8f1;
  border-color: #1e7a45;
}

.chart-lab-pattern-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  min-width: 0;
}

.chart-lab-pattern-index {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #e8f7ee;
  color: #1e7a45;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.chart-lab-pattern-name {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #10231b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-lab-pattern-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  line-height: 1.2;
  white-space: nowrap;
}

.chart-lab-pattern-chart {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  margin-bottom: 10px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #eef3f0;
  padding: 6px 4px;
}

.chart-lab-pattern-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-lab-pattern-summary {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #5a7268;
  line-height: 1.45;
  flex: 1;
}

/* 지지·저항 / 이평선 — 패턴 도감과 동일 카드 형식 */
.chart-lab-topic-card .chart-lab-pattern-summary {
  margin-bottom: 0;
}

/* 퀴즈 */
.chart-lab-quiz-intro,
.chart-lab-quiz-complete {
  padding: 12px 8px 8px;
  text-align: center;
}

.chart-lab-quiz-intro img,
.chart-lab-quiz-complete img {
  width: 72px;
  height: auto;
  margin-bottom: 14px;
}

.chart-lab-quiz-intro h3,
.chart-lab-quiz-complete h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 900;
}

.chart-lab-quiz-intro p,
.chart-lab-quiz-complete p {
  margin: 0 0 18px;
  font-size: 14px;
  font-weight: 600;
  color: #5a7268;
  line-height: 1.5;
}

.chart-lab-quiz-start-btn {
  padding: 12px 28px;
  border: none;
  border-radius: 12px;
  background: #1e693b;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.chart-lab-quiz-start-btn:hover {
  background: #165a31;
}

.chart-lab-quiz-intro[hidden],
.chart-lab-quiz-play[hidden],
.chart-lab-quiz-complete[hidden] {
  display: none !important;
}

.chart-lab-quiz-play {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.chart-lab-quiz-play.is-feedback-visible {
  align-items: stretch;
}

.chart-lab-quiz-question {
  flex: 1;
  min-width: 0;
}

.chart-lab-quiz-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.chart-lab-quiz-prompt {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #10231b;
  line-height: 1.5;
}

.chart-lab-quiz-progress {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
  color: #5a7268;
  white-space: nowrap;
}

.chart-lab-quiz-chart {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  margin-bottom: 16px;
  padding: 12px;
  background: #fafcfb;
  border: 1px solid #eef3f0;
  border-radius: 12px;
}

.chart-lab-quiz-chart svg {
  width: 100%;
  max-width: 280px;
  height: auto;
}

.chart-lab-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-lab-quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e2eee8;
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.chart-lab-quiz-option:hover:not(:disabled) {
  border-color: #2DB473;
  background: #f4fbf7;
}

.chart-lab-quiz-option:disabled {
  cursor: default;
}

.chart-lab-quiz-option-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f0f2f1;
  color: #5f6f66;
  font-size: 12px;
  font-weight: 800;
}

.chart-lab-quiz-option-text {
  font-size: 14px;
  font-weight: 700;
  color: #10231b;
  line-height: 1.4;
}

.chart-lab-quiz-option.is-selected {
  border-color: #2DB473;
  background: #f4fbf7;
}

.chart-lab-quiz-option.is-correct {
  border-color: #2DB473;
  background: #ecf8f1;
}

.chart-lab-quiz-option.is-correct .chart-lab-quiz-option-num {
  background: #2DB473;
  color: #fff;
}

.chart-lab-quiz-option.is-wrong {
  border-color: #E15241;
  background: #fef5f4;
}

.chart-lab-quiz-option.is-wrong .chart-lab-quiz-option-num {
  background: #E15241;
  color: #fff;
}

.chart-lab-quiz-feedback {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 16px;
  border-radius: 14px;
  background: #f4fbf7;
  border: 1px solid rgba(45, 180, 115, 0.2);
}

.chart-lab-quiz-feedback[hidden] {
  display: none !important;
}

.chart-lab-quiz-feedback.is-wrong {
  background: #fff8f7;
  border-color: rgba(225, 82, 65, 0.2);
}

.chart-lab-quiz-result-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 900;
  color: #1e693b;
}

.chart-lab-quiz-feedback.is-wrong .chart-lab-quiz-result-title {
  color: #c62828;
}

.chart-lab-quiz-lumi {
  width: 80px;
  height: auto;
  margin-bottom: 12px;
}

.chart-lab-quiz-result-text {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: #4d6b5d;
  line-height: 1.55;
  text-align: left;
  width: 100%;
}

.chart-lab-quiz-answer-line {
  margin-bottom: 8px;
  font-weight: 800;
  color: #1e693b;
}

.chart-lab-quiz-feedback.is-wrong .chart-lab-quiz-answer-line {
  color: #c62828;
}

.chart-lab-quiz-explain-line {
  font-weight: 600;
  color: #4d6b5d;
  line-height: 1.55;
}

.chart-lab-quiz-next-btn {
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 10px;
  background: #1e693b;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.chart-lab-quiz-next-btn:hover {
  background: #165a31;
}

/* ── 우측 레일 ── */
.chart-lab-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.chart-lab-widget {
  background: #fff;
  border: 1px solid #e2eee8;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(16, 35, 27, 0.05);
}

.chart-lab-widget h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 900;
}

.chart-lab-quiz-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.chart-lab-quiz-cta img {
  width: 64px;
  height: auto;
}

.chart-lab-quiz-cta p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #4d6b5d;
  line-height: 1.5;
}

.chart-lab-quiz-cta-btn {
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 10px;
  background: #1e693b;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.chart-lab-quiz-cta-btn:hover {
  background: #165a31;
}

.chart-lab-quote-text {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #2a4035;
  line-height: 1.65;
  font-style: normal;
}

.chart-lab-quote-author {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #5a7268;
  font-style: normal;
  text-align: right;
}

.chart-lab-history-widget h3 {
  margin-bottom: 10px;
}

.chart-lab-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-lab-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fafcfb;
  border: 1px solid #e8f0eb;
  border-radius: 10px;
}

.chart-lab-history-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 48px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2eee8;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-lab-history-thumb svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-lab-history-body {
  flex: 1;
  min-width: 0;
}

.chart-lab-history-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #2a4035;
  line-height: 1.45;
  margin-bottom: 4px;
}

.chart-lab-history-date {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #8a9e94;
}

.chart-lab-history-empty {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #8a9e94;
  line-height: 1.55;
}

/* ── 패턴 상세 모달 ── */
.chart-lab-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(31, 47, 38, 0.45);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.chart-lab-modal.is-open {
  display: flex;
}

.chart-lab-modal-panel {
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(47, 143, 95, 0.22);
  border-radius: 20px;
  padding: 28px 28px 24px;
  position: relative;
  box-shadow: 0 20px 40px rgba(31, 47, 38, 0.14);
}

.chart-lab-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.chart-lab-modal-close:hover {
  background: rgba(47, 143, 95, 0.08);
  color: #1d4d38;
}

.chart-lab-modal-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  margin-bottom: 8px;
}

.chart-lab-modal-title {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 900;
}

.chart-lab-modal-chart {
  display: flex;
  justify-content: center;
  padding: 16px;
  margin-bottom: 16px;
  background: #fafcfb;
  border-radius: 14px;
  border: 1px solid #eef3f0;
}

.chart-lab-modal-chart svg {
  width: 100%;
  max-width: 280px;
}

.chart-lab-modal-desc {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #4d6b5d;
  line-height: 1.6;
}

.chart-lab-modal-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px 14px;
  background: #f0faf5;
  border-radius: 10px;
  border: 1px solid rgba(45, 180, 115, 0.14);
}

.chart-lab-modal-tip[hidden] {
  display: none;
}

.chart-lab-modal-tip-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(45, 180, 115, 0.18);
  color: #1e693b;
  font-size: 11px;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
}

.chart-lab-modal-tip-text {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #1e693b;
  line-height: 1.5;
}

.chart-lab-modal-confirm {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #1e693b;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.chart-lab-modal-confirm:hover {
  background: #165a31;
}

/* ── 반응형 ── */
@media (max-width: 1100px) {
  .chart-lab-pattern-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  body.chart-lab-page {
    min-width: 0;
  }

  .chart-lab-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }

  .chart-lab-rail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .chart-lab-pattern-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .chart-lab-rail {
    grid-template-columns: 1fr;
  }

  .chart-lab-quiz-play {
    flex-direction: column;
  }

  .chart-lab-quiz-feedback {
    flex: 1 1 auto;
    width: 100%;
  }
}
