/* 파일: 전역 테마·레이아웃·네비·홈/시장 공통. 설명( 대부분 HTML이 이 파일을 참조. ) */
:root {
  --navy: #143226;
  --blue-dark: #1d4d38;
  --blue-mid: #2f7a57;
  --blue-bright: #3b9669;
  --blue-light: #79c89f;
  --accent: #2f8f5f;
  --accent2: #d3f1df;
  --white: #ffffff;
  --text-primary: #1f2f26;
  --gray-100: #f6faf7;
  --gray-200: #e1ede5;
  --gray-300: #9eb0a3;
  --gray-400: #5f7c6c;
  /* 보합·0.00% 등락: 본문보다 살짝만 진하게(가독성·부담 균형) */
  --quote-flat: #3a5246;
  --quote-flat-bg: rgba(58, 82, 70, 0.08);
  --quote-flat-border: rgba(58, 82, 70, 0.14);
  --up: #FF4747;
  /* 국내 관례: 상승 빨강, 하락 파랑 */
  --down: #2563eb;
  --green: #2f8f5f;
  --blue: #2f8f5f;
  --gray-500: #7a9385;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: #ffffff;
  color: var(--text-primary);
  overflow-x: hidden;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

.important-line {
  display: inline;
  background-repeat: no-repeat;
  background-size: 100% 0.82em;
  background-position: 0 92%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 2px;
}

.important-line.brush-1,
.important-line.brush-2,
.important-line.brush-3,
.important-line.brush-4 {
  background-image: linear-gradient(transparent 52%, rgba(47, 143, 95, 0.42) 52%);
}

/* NAVBAR */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(47, 143, 95, 0.2);
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--blue-bright), var(--accent));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: white;
  animation: glow 2.5s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.35);
  }
  50% {
    box-shadow: 0 0 28px rgba(0, 212, 255, 0.7);
  }
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo-text span {
  color: var(--accent);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-menu a {
  color: #355845;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-menu a:hover {
  color: #1d4d38;
  background: rgba(47, 143, 95, 0.12);
}

.nav-menu a.active {
  color: var(--accent);
}

.nav-badge {
  font-size: 10px;
  background: var(--accent2);
  color: #1d4d38;
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 700;
  margin-left: 4px;
}

.nav-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-mobile-panel {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-mobile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-hamburger {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(47, 143, 95, 0.34);
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.nav-hamburger-lines {
  position: relative;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #214c37;
  transition: background 0.2s ease;
}

.nav-hamburger-lines::before,
.nav-hamburger-lines::after {
  content: '';
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #214c37;
  transition: transform 0.2s ease, top 0.2s ease;
}

.nav-hamburger-lines::before {
  top: -6px;
}

.nav-hamburger-lines::after {
  top: 6px;
}

nav.nav-open .nav-hamburger-lines {
  background: transparent;
}

nav.nav-open .nav-hamburger-lines::before {
  top: 0;
  transform: rotate(45deg);
}

nav.nav-open .nav-hamburger-lines::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav-mobile-backdrop {
  display: none;
}

@media (max-width: 1024px) {
  nav {
    padding: 0 20px;
    z-index: 700;
    justify-content: flex-start;
    gap: 8px;
  }

  .logo-text {
    display: none;
  }

  .nav-hamburger {
    display: inline-flex;
    margin-left: auto;
    flex-shrink: 0;
  }

  .nav-mobile-panel {
    display: none;
    position: fixed;
    top: 64px;
    left: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(47, 143, 95, 0.22);
    border-radius: 14px;
    box-shadow: 0 16px 34px rgba(20, 40, 30, 0.18);
    padding: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    max-height: calc(100vh - 88px);
    overflow: auto;
    z-index: 710;
  }

  nav.nav-open .nav-mobile-panel {
    display: flex;
  }

  .nav-mobile-panel .nav-menu {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .nav-mobile-panel .nav-menu a {
    display: block;
    padding: 10px 12px;
  }

  .nav-right {
    display: flex !important;
    margin-left: 6px;
    gap: 4px;
    flex-shrink: 0;
  }

  .nav-right .nav-user-email {
    display: inline-block !important;
    max-width: 132px;
    font-size: 11px;
    line-height: 1.25;
    color: #2f5b44;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-right .btn-ghost,
  .nav-right .btn-primary {
    padding: 7px 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  .nav-mobile-backdrop {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(16, 30, 23, 0.24);
    z-index: 690;
  }

  nav.nav-open + .nav-mobile-backdrop {
    display: block;
  }
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(47, 143, 95, 0.4);
  color: var(--accent);
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  background: linear-gradient(135deg, #2f8f5f, #4faa77);
  border: none;
  color: #ffffff;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(47, 143, 95, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.login-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.login-modal.is-open {
  display: flex;
}

.login-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 47, 38, 0.35);
  backdrop-filter: blur(8px);
}

.login-modal-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 440px);
  padding: 32px;
  border-radius: 20px;
  border: 1px solid rgba(47, 143, 95, 0.22);
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(31, 47, 38, 0.12);
}

.login-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-400);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.login-modal-header {
  margin-bottom: 24px;
}

.login-eyebrow {
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.login-modal-header h2 {
  font-size: 30px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.login-modal-header p {
  color: var(--gray-400);
  font-size: 14px;
  line-height: 1.6;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-field span {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
}

.login-field input {
  width: 100%;
  border: 1px solid rgba(47, 143, 95, 0.25);
  border-radius: 10px;
  background: var(--gray-100);
  color: var(--text-primary);
  padding: 14px 16px;
  font-size: 14px;
  font-family: inherit;
}

.login-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 143, 95, 0.15);
}

.login-submit {
  margin-top: 8px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-bright), var(--accent));
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 18px;
  cursor: pointer;
}

.login-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.login-links a {
  color: var(--gray-400);
  text-decoration: none;
  font-size: 13px;
}

.login-links a:hover {
  color: var(--accent);
}

.login-google-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  line-height: 1.5;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--gray-400);
  font-size: 12px;
  font-weight: 600;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(47, 143, 95, 0.18);
}

.login-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid rgba(47, 143, 95, 0.28);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Google "G" multicolor logo (공식 브랜드 색상) */
.login-google-btn::before {
  content: '';
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%234285F4' d='M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z'/%3E%3Cpath fill='%2334A853' d='M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z'/%3E%3Cpath fill='%23FBBC05' d='M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z'/%3E%3Cpath fill='%23EA4335' d='M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z'/%3E%3C/svg%3E");
}

.login-google-btn:hover {
  background: var(--gray-100);
  border-color: rgba(47, 143, 95, 0.45);
  box-shadow: 0 4px 14px rgba(31, 47, 38, 0.08);
}

.login-google-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 143, 95, 0.2);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--gray-400);
  font-size: 12px;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(47, 143, 95, 0.18);
}

/* TICKER */
.ticker-strip {
  margin-top: 64px;
  background: #f5fbf7;
  border-bottom: 1px solid rgba(47, 143, 95, 0.15);
  overflow: hidden;
  padding: 10px 0;
}

.tutorial-guide-strip {
  background: #ffffff;
  border-bottom: 1px solid rgba(47, 143, 95, 0.16);
  padding: 12px 0;
}

.tutorial-guide-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tutorial-guide-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-primary);
}

.tutorial-guide-copy strong {
  font-size: 14px;
  color: var(--accent);
}

.tutorial-guide-copy span {
  font-size: 13px;
  color: #3e594c;
  font-weight: 600;
}

.tutorial-guide-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tutorial-btn-start,
.tutorial-btn-ghost {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.tutorial-btn-start {
  border: none;
  background: linear-gradient(135deg, #2f8f5f, #4faa77);
  color: #ffffff;
}

.tutorial-btn-ghost {
  border: 1px solid rgba(47, 143, 95, 0.28);
  background: #f7fcf9;
  color: #345644;
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: none;
  background: rgba(15, 25, 20, 0.52);
}

.tutorial-overlay.is-open {
  display: block;
}

.tutorial-step-card {
  display: none;
}

.tutorial-step-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.tutorial-step-card p {
  font-size: 14px;
  color: #415b4d;
  line-height: 1.6;
}

.tutorial-step-label {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #eef8f1;
  color: var(--accent);
}

.tutorial-step-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.mascot-coach {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 420;
  width: min(94vw, 460px);
  background: transparent;
  box-shadow: none;
  display: none;
}

.mascot-coach.is-open {
  display: block;
}

.mascot-coach-head { display: none; }

.mascot-coach-badge {
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 8px;
  display: none !important;
}

.mascot-coach-badge.info {
  color: #1f5e8a;
  background: #e9f4ff;
}

.mascot-coach-badge.success {
  color: #1f6b45;
  background: #e9f7ef;
}

.mascot-coach-badge.caution {
  color: #945f00;
  background: #fff6df;
}

.mascot-coach-badge.welcome {
  color: #5944a8;
  background: #f2efff;
}

.mascot-coach-badge.wink {
  color: #5944a8;
  background: #f2efff;
}

.mascot-coach-close {
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f3faf6;
  color: #365747;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.mascot-coach-body {
  display: grid;
  grid-template-columns: 126px 1fr;
  gap: 12px;
  padding: 0;
  align-items: end;
}

.mascot-coach-image-wrap {
  width: 126px;
  height: 156px;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
}

/* drop-shadow 필터는 알파 PNG(머리카락 등) 가장자리에 백색/밝은 테두리처럼 보이는 경우가 있어 그림자는 래퍼 box-shadow로만 처리 */
.mascot-coach-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
  /* 고대비/합성 시 색 왜곡 방지, 확대 시 가장자리 번짐 완화 */
  forced-color-adjust: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.mascot-coach-fallback {
  font-size: 28px;
}

.mascot-coach-title {
  font-size: 14px;
  font-weight: 900;
  color: #2b5a45;
  margin-bottom: 6px;
}

.mascot-coach-text {
  font-size: 14px;
  color: #2c4a3b;
  line-height: 1.6;
  min-height: 44px;
}

.mascot-coach-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* 시장 페이지 상승·하락: 홈 시장 탭과 같은 딤 색(rgba) — 본문·헤더는 딤에 가리고 퀘스트 패널·루미는 위 */
body.market-step1-spotlight:not(.market-step1-clear-phase) .market-step1-overlay {
  z-index: 400;
}

body.market-step1-spotlight:not(.market-step1-clear-phase) .market-step1-overlay.is-dim {
  background: rgba(4, 8, 6, 0.68);
  pointer-events: none;
}

/* 거래량 필터 단계: 상승·하락과 동일 딤·오버레이 스택 */
body.market-step1-spotlight-volume:not(.market-step1-clear-phase) .market-step1-overlay {
  z-index: 400;
}

body.market-step1-spotlight-volume:not(.market-step1-clear-phase) .market-step1-overlay.is-dim {
  background: rgba(4, 8, 6, 0.68);
  pointer-events: none;
}

/* 상세 시세·용어 스텝: 상승·하락과 같은 전역 딤(오버레이) */
body.market-step1-detail-spotlight:not(.market-step1-clear-phase) .market-step1-overlay {
  z-index: 400;
}

body.market-step1-detail-spotlight:not(.market-step1-clear-phase) .market-step1-overlay.is-dim {
  background: rgba(4, 8, 6, 0.68);
  pointer-events: none;
}

/* 상세 시세: 용어별 한 카드만 콜아웃일 때 나머지 카드 딤 */
body.market-step1-detail-term-mode .stock-detail-view .detail-grid .detail-card:not(.tutorial-callout-target) {
  opacity: 0.38;
  transition: opacity 0.2s ease;
}

body.market-step1-detail-term-mode .stock-detail-view .detail-grid .detail-card.tutorial-callout-target {
  position: relative;
  /* 전역 .tutorial-callout-target z-index:500과 동일 — 상세 딤 오버레이(400) 위로 올려 시가 등 강조 카드가 어둡게 보이지 않게 */
  z-index: 500;
  opacity: 1;
}

/* 용어 단계: 강조 카드 안 라벨이 gray-400이라 딤 위에서 연해 보임 → 대비 보강 */
body.market-step1-detail-term-mode .stock-detail-view .detail-grid .detail-card.tutorial-callout-target .detail-label,
body.market-step2-detail-term-mode .stock-detail-view .detail-grid .detail-card.tutorial-callout-target .detail-label {
  color: #174a36;
  font-weight: 800;
  opacity: 1;
}

body.market-step1-detail-term-mode .stock-detail-view .detail-grid .detail-card.tutorial-callout-target .detail-value,
body.market-step2-detail-term-mode .stock-detail-view .detail-grid .detail-card.tutorial-callout-target .detail-value {
  font-weight: 800;
}

body.market-step1-detail-term-mode .stock-detail-view .detail-grid .detail-card.tutorial-callout-target .detail-value.quote-flat,
body.market-step2-detail-term-mode .stock-detail-view .detail-grid .detail-card.tutorial-callout-target .detail-value.quote-flat {
  color: #0f1f16;
}

body.market-step1-detail-term-mode .stock-detail-view .detail-grid .detail-card.tutorial-callout-target .detail-value.quote-up,
body.market-step2-detail-term-mode .stock-detail-view .detail-grid .detail-card.tutorial-callout-target .detail-value.quote-up {
  color: #b91c1c;
}

body.market-step1-detail-term-mode .stock-detail-view .detail-grid .detail-card.tutorial-callout-target .detail-value.quote-down,
body.market-step2-detail-term-mode .stock-detail-view .detail-grid .detail-card.tutorial-callout-target .detail-value.quote-down {
  color: #1d4ed8;
}

/* 전체 그리드 소개: 카드별 딤 없음(그리드 전체에만 콜아웃) */
body.market-step1-detail-overview .stock-detail-view .detail-grid .detail-card {
  opacity: 1;
}

/* 5단계 시세 용어: 한 칸만 밝게 (패널 통째 opacity 금지) */
body.sim-step5-term-mode #simHoldingPanelOrder .sim-holding-quote-stat:not(.tutorial-callout-target),
body.sim-step5-term-mode #simHoldingPanelOrder .sim-holding-quote-exec:not(.tutorial-callout-target),
body.sim-step5-term-mode #simHoldingPanelOrder .sim-holding-quote-hl-item:not(.tutorial-callout-target),
body.sim-step5-term-mode #simHoldingPanelOrder .sim-holding-quote-hl:not(.tutorial-callout-target) {
  opacity: 0.38;
  transition: opacity 0.2s ease;
}

body.sim-step5-term-mode #simHoldingPanelOrder .tutorial-callout-target {
  position: relative;
  z-index: 500;
  opacity: 1;
}

/* 5단계 차트·시세 intro: 패널 내부 칸 일괄 밝게 */
body.sim-step5-overview #simHoldingPanelOrder .sim-holding-quote-stat,
body.sim-step5-overview #simHoldingPanelOrder .sim-holding-quote-exec,
body.sim-step5-overview #simHoldingPanelOrder .sim-holding-quote-hl,
body.sim-step5-overview #simHoldingPanelOrder .sim-holding-quote-hl-item {
  opacity: 1;
}

/* 5단계 강조 칸 라벨·값 대비 (1단계 detail-card와 동일 톤) */
body.simulation-step5-active .sim-holding-quote-stat.tutorial-callout-target .sim-holding-quote-stat-label,
body.simulation-step5-active .sim-holding-quote-exec.tutorial-callout-target .sim-holding-quote-exec-label {
  color: #174a36;
  font-weight: 800;
  opacity: 1;
}

body.simulation-step5-active .sim-holding-quote-stat.tutorial-callout-target .sim-holding-quote-stat-value,
body.simulation-step5-active .sim-holding-quote-hl.tutorial-callout-target .sim-holding-quote-hl-v,
body.simulation-step5-active .sim-holding-quote-hl-item.tutorial-callout-target .sim-holding-quote-hl-v {
  font-weight: 800;
  color: #0f1f16;
}

body.simulation-step5-active .sim-holding-quote-stat.tutorial-callout-target .sim-holding-quote-stat-side--up {
  color: #b91c1c;
}

body.simulation-step5-active .sim-holding-quote-stat.tutorial-callout-target .sim-holding-quote-stat-side--down {
  color: #1d4ed8;
}

body.simulation-step5-active .sim-holding-quote-exec--high.tutorial-callout-target .sim-holding-quote-exec-pct {
  color: #b91c1c;
}

body.simulation-step5-active .sim-holding-quote-exec--low.tutorial-callout-target .sim-holding-quote-exec-pct {
  color: #1d4ed8;
}

/* 겹칠 때 루미 말풍선이 강조 카드(.tutorial-callout-target z-index 500) 위에 오도록 */
body.market-step1-active .mascot-coach.is-open:not(.mascot-coach--spotlight) {
  z-index: 600;
}

body.market-step1-active .mascot-coach-dock {
  z-index: 590;
}

.mascot-coach-actions .tutorial-btn-ghost {
  min-width: 66px;
}

.mascot-coach-actions .mascot-coach-btn-exit {
  border-color: rgba(198, 72, 72, 0.45);
  background: linear-gradient(180deg, #fff5f5 0%, #ffecec 100%);
  color: #b42318;
}

.mascot-coach-actions .mascot-coach-btn-exit:hover {
  border-color: rgba(198, 72, 72, 0.62);
  background: linear-gradient(180deg, #ffe8e8 0%, #ffd6d6 100%);
  color: #912018;
}
.mascot-coach-bubble {
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(47, 143, 95, 0.26);
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(20, 40, 30, 0.15);
  padding: 12px 12px 10px;
}
.mascot-coach-bubble::before {
  content: '';
  position: absolute;
  left: -9px;
  bottom: 22px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-left: 1px solid rgba(47, 143, 95, 0.26);
  border-bottom: 1px solid rgba(47, 143, 95, 0.26);
  transform: rotate(45deg);
}

/* 가이드 등: 전체 어둡게 + 루미 가운데 확대 + 말풍선 오른쪽
   딤은 body::before(클래스 mascot-coach-spotlight-dim)에만 둬 코치 레이어와 합성을 분리 */
body.mascot-coach-spotlight-dim::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 4700;
  background: rgba(4, 8, 6, 0.68);
  pointer-events: auto;
}

.mascot-coach.mascot-coach--spotlight {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 100vh !important;
  z-index: 4800 !important;
  background: transparent !important;
  box-sizing: border-box;
}

.mascot-coach--spotlight .mascot-coach-body {
  position: relative;
  z-index: 1;
  display: grid !important;
  grid-template-columns: minmax(200px, 1fr) minmax(260px, 420px);
  gap: 24px 40px;
  align-items: center;
  justify-content: center;
  max-width: 1080px;
  margin: 0 auto;
  padding: min(8vh, 64px) 28px min(6vh, 48px);
  min-height: calc(100vh - 0px);
  box-sizing: border-box;
  pointer-events: none;
}

.mascot-coach--spotlight .mascot-coach-image-wrap {
  position: relative;
  grid-column: 1;
  justify-self: center;
  width: min(52vw, 400px) !important;
  height: min(62vh, 520px) !important;
  max-width: 100%;
  pointer-events: none;
  /* 확대+딤: PNG 불투명 회색 AA가 어두운 배경과 이웃하면 탁해 보임 → 캐릭터 뒤만 페이지톤 밝힘 */
  background: radial-gradient(
    ellipse 72% 64% at 50% 44%,
    rgba(246, 252, 248, 0.98) 0%,
    rgba(240, 248, 243, 0.35) 52%,
    transparent 74%
  );
  box-shadow: none;
}

.mascot-coach--spotlight .mascot-coach-image-wrap img {
  position: relative;
  z-index: 1;
  width: auto !important;
  height: 100% !important;
  max-width: 100%;
  object-fit: contain;
  filter: none;
  forced-color-adjust: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.mascot-coach--spotlight .mascot-coach-bubble {
  grid-column: 2;
  justify-self: stretch;
  align-self: center;
  width: 100%;
  max-width: 420px;
  pointer-events: auto;
  box-shadow: 0 22px 50px rgba(12, 28, 20, 0.28);
}

.mascot-coach--spotlight .mascot-coach-bubble::before {
  left: auto;
  right: 100%;
  bottom: 32px;
  margin-right: -8px;
  border-left: none;
  border-bottom: none;
  border-right: 1px solid rgba(47, 143, 95, 0.26);
  border-top: 1px solid rgba(47, 143, 95, 0.26);
  transform: rotate(-45deg);
}

@media (max-width: 768px) {
  .mascot-coach--spotlight .mascot-coach-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    padding: 24px 16px 32px;
    min-height: 100vh;
  }

  .mascot-coach--spotlight .mascot-coach-image-wrap {
    grid-column: 1;
    grid-row: 1;
    height: min(42vh, 320px) !important;
    width: auto !important;
  }

  .mascot-coach--spotlight .mascot-coach-bubble {
    grid-column: 1;
    grid-row: 2;
    max-width: none;
  }

  .mascot-coach--spotlight .mascot-coach-bubble::before {
    display: none;
  }
}
.mascot-coach-close-inline {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #f3faf6;
  color: #365747;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.mascot-coach-bubble-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.mascot-coach-name {
  font-size: 12px;
  font-weight: 900;
  color: #1f5e8a;
  background: #e9f4ff;
  border-radius: 999px;
  padding: 2px 8px;
}
.mascot-coach-dock {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 425;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(47, 143, 95, 0.24);
  border-radius: 999px;
  padding: 6px 8px 6px 6px;
  box-shadow: 0 8px 20px rgba(24, 45, 35, 0.18);
}
.mascot-coach-dock-image {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(47, 143, 95, 0.22);
  /* 흰 배경은 캐릭터 반투명 가장자리에 하얗게 비침 */
  background: linear-gradient(160deg, #1a2820 0%, #24362c 100%);
}
.mascot-coach-dock-btn {
  border: 1px solid rgba(47, 143, 95, 0.28);
  background: #f7fcf9;
  color: #2f5945;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

@keyframes tutorialTargetPulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 143, 95, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(47, 143, 95, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 143, 95, 0); }
}

/* 공용 튜토리얼 이펙트 레이어 (step1~5 공통 재사용) */
body.tutorial-fx-active:not(.tutorial-fx-clear) .market-step1-overlay.is-dim,
body.tutorial-fx-active:not(.tutorial-fx-clear) .market-step2-overlay.is-dim,
body.tutorial-fx-active:not(.tutorial-fx-clear) .market-step3-overlay.is-dim,
body.tutorial-fx-active:not(.tutorial-fx-clear) .market-step4-overlay.is-dim,
body.tutorial-fx-active:not(.tutorial-fx-clear) .market-step5-overlay.is-dim {
  z-index: 400;
  background: rgba(4, 8, 6, 0.68);
  pointer-events: none;
}

body.tutorial-fx-active .mascot-coach.is-open:not(.mascot-coach--spotlight) {
  z-index: 600;
}

body.tutorial-fx-active .mascot-coach-dock {
  z-index: 590;
}

body.tutorial-fx-active.tutorial-fx-clear .mascot-coach.is-open {
  z-index: 600;
}

body.tutorial-fx-active .tutorial-callout-target:not(.market-sidebar),
body.market-step4-active .tutorial-callout-target:not(.market-sidebar),
body.market-step5-active .tutorial-callout-target:not(.market-sidebar) {
  position: relative;
  z-index: 500;
  border-radius: 8px;
  background:
    radial-gradient(ellipse 92% 88% at 50% 38%, rgba(246, 252, 248, 0.99) 0%, #ffffff 58%);
  color: #12442c;
  box-shadow:
    0 0 0 2px rgba(47, 143, 95, 0.9),
    0 0 18px rgba(47, 143, 95, 0.5),
    0 0 42px rgba(246, 252, 248, 0.75);
  animation: tutorialTargetPulse 1.1s infinite;
}

body.tutorial-step1-active nav {
  z-index: 390;
}

/* 루미 가이드·시장 1·2단계: 홈 「시장 탭」 안내와 같은 조명(방사 그라데이션 + 링) — 글자 대비는 아래 후손 규칙 */
body.tutorial-step1-active .tutorial-callout-target,
body.market-step1-active .tutorial-callout-target,
body.market-step2-active .tutorial-callout-target,
body.market-step3-active .tutorial-callout-target {
  /* 1단계 홈 가이드 포함: 공용 조명 톤 유지 */
  position: relative;
  z-index: 500;
  border-radius: 8px;
  background:
    radial-gradient(ellipse 92% 88% at 50% 38%, rgba(246, 252, 248, 0.99) 0%, #ffffff 58%);
  color: #12442c;
  box-shadow:
    0 0 0 2px rgba(47, 143, 95, 0.9),
    0 0 18px rgba(47, 143, 95, 0.5),
    0 0 42px rgba(246, 252, 248, 0.75);
  animation: tutorialTargetPulse 1.1s infinite;
}

/* 시장 2단계: 차트 기간 버튼 — 선택(.active)과 겹쳐도 튜토 링이 또렷히 보이도록 */
body.market-step2-active #stockDetailView .detail-range-btn.tutorial-callout-target {
  position: relative;
  z-index: 501;
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px rgba(47, 143, 95, 1),
    0 0 0 6px rgba(255, 255, 255, 0.85),
    0 0 20px rgba(47, 143, 95, 0.5),
    0 0 40px rgba(246, 252, 248, 0.7);
  animation: tutorialTargetPulse 1.1s infinite;
}

body.market-step2-active #stockDetailView .detail-range-btn.tutorial-callout-target.active {
  background: var(--accent, #2f8f5f);
  border-color: var(--accent, #2f8f5f);
  color: #ffffff;
}

/* 시장 1·2단계: 강조 박스 안 자식이 gray-400·gray-200 등이라 글씨만 연해 보이는 경우 — 라벨·보조문 대비 보강 */
body.market-step1-active .indices-grid.tutorial-callout-target .index-sub,
body.market-step2-active .indices-grid.tutorial-callout-target .index-sub {
  color: #2d5a45;
  font-weight: 600;
}

body.market-step1-active .indices-grid.tutorial-callout-target .indices-live-badge,
body.market-step2-active .indices-grid.tutorial-callout-target .indices-live-badge {
  color: #2d5a45;
  font-weight: 600;
}

body.market-step1-active .detail-grid.tutorial-callout-target .detail-label,
body.market-step2-active .detail-grid.tutorial-callout-target .detail-label {
  color: #174a36;
  font-weight: 800;
  opacity: 1;
}

body.market-step1-active .detail-grid.tutorial-callout-target .detail-value,
body.market-step2-active .detail-grid.tutorial-callout-target .detail-value {
  font-weight: 800;
}

body.market-step1-active .detail-grid.tutorial-callout-target .detail-value.quote-flat,
body.market-step2-active .detail-grid.tutorial-callout-target .detail-value.quote-flat {
  color: #0f1f16;
}

body.market-step1-active .detail-grid.tutorial-callout-target .detail-card-hint,
body.market-step2-active .detail-grid.tutorial-callout-target .detail-card-hint {
  color: #2d5a45;
  font-weight: 600;
}

body.market-step1-active .filter-btn.tutorial-callout-target,
body.market-step2-active .filter-btn.tutorial-callout-target {
  color: #0f291c;
  font-weight: 700;
}

body.market-step1-active .filter-btn.tutorial-callout-target.active,
body.market-step2-active .filter-btn.tutorial-callout-target.active {
  color: #fff;
}

body.market-step1-active .detail-section.tutorial-callout-target .detail-section-sub,
body.market-step2-active .detail-section.tutorial-callout-target .detail-section-sub {
  color: #2d5a45;
  font-weight: 700;
}

body.market-step1-active .detail-section.tutorial-callout-target .detail-section-lead,
body.market-step2-active .detail-section.tutorial-callout-target .detail-section-lead {
  color: #1a3d2e;
  font-weight: 600;
}

body.market-step1-active .detail-section.tutorial-callout-target .detail-news-meta,
body.market-step2-active .detail-section.tutorial-callout-target .detail-news-meta {
  color: #355848;
  font-weight: 600;
}

body.market-step1-active .detail-section.tutorial-callout-target .investor-flow-label,
body.market-step2-active .detail-section.tutorial-callout-target .investor-flow-label {
  color: #0f291c;
  font-weight: 800;
}

body.market-step1-active .detail-section.tutorial-callout-target .investor-flow-value,
body.market-step2-active .detail-section.tutorial-callout-target .investor-flow-value {
  color: #12442c;
  font-weight: 700;
}

body.market-step1-active .detail-section.tutorial-callout-target .empty-state,
body.market-step2-active .detail-section.tutorial-callout-target .empty-state {
  color: #2d5a45;
  font-weight: 600;
}

/* 상세 매수/매도: 튜토리얼 강조 시 원래 버튼 색 유지(흰 배경 덮어쓰기 방지) */
body.market-step1-active .stock-detail-view .detail-buy.tutorial-callout-target,
body.market-step2-active .stock-detail-view .detail-buy.tutorial-callout-target {
  background: linear-gradient(135deg, #ff5f64, #ff8157);
  color: #fff;
  animation: tutorialDetailCtaPulseBuy 1.15s ease-in-out infinite;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.95),
    0 0 0 5px rgba(47, 143, 95, 0.82),
    0 8px 22px rgba(255, 95, 100, 0.35);
}

body.market-step1-active .stock-detail-view .detail-sell.tutorial-callout-target,
body.market-step2-active .stock-detail-view .detail-sell.tutorial-callout-target {
  background: linear-gradient(135deg, #3182f6, #5b9cf9);
  color: #fff;
  animation: tutorialDetailCtaPulseSell 1.15s ease-in-out infinite;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.95),
    0 0 0 5px rgba(47, 143, 95, 0.82),
    0 8px 22px rgba(13, 126, 224, 0.4);
}

@keyframes tutorialDetailCtaPulseBuy {
  0%,
  100% {
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.95),
      0 0 0 5px rgba(47, 143, 95, 0.82),
      0 8px 22px rgba(255, 95, 100, 0.35);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 1),
      0 0 0 5px rgba(47, 143, 95, 0.45),
      0 0 0 14px rgba(47, 143, 95, 0),
      0 10px 28px rgba(255, 95, 100, 0.45);
  }
}

@keyframes tutorialDetailCtaPulseSell {
  0%,
  100% {
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.95),
      0 0 0 5px rgba(47, 143, 95, 0.82),
      0 8px 22px rgba(13, 126, 224, 0.4);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 1),
      0 0 0 5px rgba(47, 143, 95, 0.45),
      0 0 0 14px rgba(47, 143, 95, 0),
      0 10px 28px rgba(13, 126, 224, 0.5);
  }
}

/* 시장 2단계: 본문 위 전체 딤(강조 카드 z-index 500·루미 700 아래) */
body.market-step2-active:not(.market-step2-clear-phase) .market-step2-overlay.is-dim {
  z-index: 400;
  background: rgba(4, 8, 6, 0.68);
  pointer-events: none;
}

/* 시장 2단계 튜토리얼: 상세 구간 오버레이 스택 */
body.market-step2-detail-spotlight:not(.market-step2-clear-phase) .market-step2-overlay {
  z-index: 400;
}

/* 시장 2단계 목록 강조도 공용 tutorial-fx 규칙만 사용 */

body.market-step2-detail-term-mode .stock-detail-view .detail-grid .detail-card:not(.tutorial-callout-target) {
  opacity: 0.38;
  transition: opacity 0.2s ease;
}

body.market-step2-detail-term-mode .stock-detail-view .detail-grid .detail-card.tutorial-callout-target {
  position: relative;
  z-index: 500;
  opacity: 1;
}

body.market-step2-detail-overview .stock-detail-view .detail-grid .detail-card {
  opacity: 1;
}

body.market-step2-active .mascot-coach.is-open:not(.mascot-coach--spotlight) {
  z-index: 600;
}

body.market-step2-active .mascot-coach-dock {
  z-index: 590;
}

body.market-step2-clear-phase .mascot-coach.is-open {
  z-index: 600;
}

/* 2단계 CLEAR 동안 비필수 상위 UI는 모두 딤 아래로 봉인 */
body.market-step2-clear-phase .sector-toast,
body.market-step2-clear-phase .mock-trade-modal,
body.market-step2-clear-phase .login-modal {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* clear-phase에서 오버레이/clear 텍스트를 강제로 고정(레이어 충돌/깜빡임 방지) */
body.market-step2-clear-phase #marketStep2Overlay {
  display: block !important;
  opacity: 1 !important;
  z-index: 1200 !important;
  background: rgba(2, 6, 4, 0.9) !important;
}

body.market-step2-clear-phase #marketStep2Clear {
  z-index: 1210 !important;
}

body.market-step2-clear-phase #marketStep2QuestHud,
body.market-step2-clear-phase .mascot-coach-dock {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.market-step2-active .mock-trade-modal.is-open {
  z-index: 680;
}

/* 2단계 튜토리얼 중: 모달 백드롭을 오버레이 딤과 비슷한 톤으로(모달이 튜토리얼 딤을 덮어 밝아 보이는 현상 완화) */
body.market-step2-active .mock-trade-modal.is-open .mock-trade-backdrop {
  background: rgba(4, 8, 6, 0.72);
}

/* 2단계 튜토리얼 중 로그인 모달도 같은 레이어 체계로 정렬 */
body.market-step2-active .login-modal.is-open {
  z-index: 690;
}

body.market-step2-active .login-modal.is-open .login-modal-backdrop {
  background: rgba(4, 8, 6, 0.72);
}

body.market-step2-active .mock-trade-panel .tutorial-callout-target {
  position: relative;
  z-index: 5;
}

/* 시장 2단계 핵심 클릭 유도(삼성/NAVER/뒤로가기): 행/버튼 강조를 1·3단계 체감으로 보강 */
body.market-step2-action-spotlight #stocksTableBody tr.stock-row.tutorial-callout-target td {
  position: relative;
  z-index: 501;
  background:
    radial-gradient(ellipse 88% 84% at 50% 40%, rgba(246, 252, 248, 0.99) 0%, #ffffff 58%);
  box-shadow:
    inset 0 0 0 2px rgba(47, 143, 95, 0.92),
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 0 18px rgba(47, 143, 95, 0.46),
    0 0 36px rgba(246, 252, 248, 0.62);
  animation: tutorialTargetPulse 1.05s infinite;
}

body.market-step2-action-spotlight #stockDetailView .btn-back.tutorial-callout-target {
  position: relative;
  z-index: 501;
  outline: 3px solid rgba(255, 255, 255, 0.96);
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px rgba(47, 143, 95, 0.95),
    0 0 0 6px rgba(255, 255, 255, 0.85),
    0 0 20px rgba(47, 143, 95, 0.5),
    0 0 40px rgba(246, 252, 248, 0.68);
  animation: tutorialTargetPulse 1.05s infinite;
}

/* 시장 3단계: 차트·칩 설명 중 딤 없이 밝게 (루미 대화창과 동일 체감) */
body.market-step3-chart-bright .market-step3-overlay.is-dim {
  background: transparent !important;
  pointer-events: none;
}

/* 시장 3단계: 본문 위 전체 딤(퀴즈·결론 등) */
body.market-step3-active:not(.market-step3-clear-phase):not(.market-step3-chart-bright)
  .market-step3-overlay.is-dim {
  z-index: 400;
  background: rgba(4, 8, 6, 0.68);
  pointer-events: none;
}

/* 시장 3단계 튜토리얼: 상세 구간 오버레이 스택 */
body.market-step3-detail-spotlight:not(.market-step3-clear-phase) .market-step3-overlay {
  z-index: 400;
}

body.market-step3-chart-bright #stockDetailView [data-jurin-section="fin-chart"] {
  position: relative;
  z-index: 502;
  background: #ffffff;
  border-radius: 12px;
  box-shadow:
    0 0 0 2px rgba(47, 143, 95, 0.35),
    0 4px 24px rgba(246, 252, 248, 0.95);
}

body.market-step3-chart-bright #stockDetailView #detailFinancialChart {
  background: #ffffff;
}

body.market-step3-chart-bright #stockDetailView .detail-fin-chart-seg,
body.market-step3-chart-bright #stockDetailView .detail-fin-metric-chip {
  opacity: 1;
}

body.market-step3-clear-phase .mascot-coach.is-open {
  z-index: 600;
}

body.market-step3-active .detail-grid.tutorial-callout-target .detail-label {
  color: #174a36;
  font-weight: 800;
}

body.market-step3-active .detail-grid.tutorial-callout-target .detail-value {
  font-weight: 800;
}

/* 3단계 삼성전자 유도: 화면 딤 없이 초록 강조만 지속 */
body.market-step3-pick-lock #row-005930 {
  position: relative;
  z-index: 501;
}

body.market-step3-pick-lock #row-005930 td {
  position: relative;
  z-index: 501;
  background:
    radial-gradient(ellipse 88% 84% at 50% 40%, rgba(246, 252, 248, 0.99) 0%, #ffffff 58%);
  box-shadow:
    inset 0 0 0 2px rgba(47, 143, 95, 0.92),
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 0 18px rgba(47, 143, 95, 0.46),
    0 0 36px rgba(246, 252, 248, 0.62);
  animation: tutorialTargetPulse 1.05s infinite;
}

body.market-step3-active #indicatorGrid .metric-item.tutorial-callout-target {
  position: relative;
  z-index: 501;
  box-shadow:
    inset 0 0 0 2px rgba(47, 143, 95, 0.88),
    0 0 0 2px rgba(255, 255, 255, 0.9),
    0 0 16px rgba(47, 143, 95, 0.42);
  animation: tutorialTargetPulse 1.05s infinite;
}

body.market-step3-active #indicatorGrid .metric-item.tutorial-callout-target .metric-item-label {
  color: #174a36;
  font-weight: 800;
}

body.market-step3-active #indicatorGrid .metric-item.tutorial-callout-target .metric-item-value {
  font-weight: 800;
}

/* 3단계: 칩 — active 안쪽 연한 초록 유지, 바깥 튜토리얼 링만 */
body.market-step3-active #stockDetailView .detail-fin-metric-chip.tutorial-callout-target {
  position: relative;
  z-index: 503;
  background-image: none !important;
  color: inherit !important;
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px rgba(47, 143, 95, 0.95),
    0 0 18px rgba(47, 143, 95, 0.45);
  animation: tutorialTargetPulse 1.05s infinite;
}

body.market-step3-active #stockDetailView .detail-fin-metric-chip.tutorial-callout-target:not(.active) {
  background-color: #ffffff !important;
}

body.market-step3-active #stockDetailView .detail-fin-metric-chip.tutorial-callout-target.active {
  background-color: rgba(47, 143, 95, 0.12) !important;
  border-color: var(--accent, #2f8f5f) !important;
  color: #1d4d38 !important;
}

body.market-step3-active #stockDetailView .detail-fin-chart-seg.tutorial-callout-target {
  position: relative;
  z-index: 503;
  background: transparent !important;
  color: inherit !important;
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px rgba(47, 143, 95, 0.95),
    0 0 18px rgba(47, 143, 95, 0.45);
  animation: tutorialTargetPulse 1.05s infinite;
}

/* 시장 탭(홈)만 클릭 아이콘 — 시장 페이지 상승·하락 강조에는 미표시 */
/* 시장 1단계 CLEAR: 본문·튜토리얼 패널은 어둡고 루미 대화만 앞에 보이게 */
body.market-step1-clear-phase .mascot-coach.is-open {
  z-index: 600;
}

/* 1단계 시작(시장 탭 클릭 유도) 전용 클릭 아이콘 */
body.tutorial-step1-active .tutorial-callout-target::after {
  content: '';
  position: absolute;
  left: calc(100% - 14px);
  top: 62%;
  transform: translateY(-78%) rotate(16deg);
  transform-origin: top left;
  width: 32px;
  height: 32px;
  background-image: url('../assets/ui/mouse-click.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  animation: none;
  pointer-events: none;
}

.ticker-wrap {
  display: flex;
  animation: ticker 30s linear infinite;
  white-space: nowrap;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  border-right: 1px solid rgba(79, 158, 255, 0.15);
}

.ticker-name {
  color: #476755;
  font-weight: 500;
}

.ticker-price {
  color: #1f2f26;
  font-weight: 500;
}

.ticker-change.up {
  color: var(--up);
}

.ticker-change.down {
  color: var(--down);
}

.ticker-change.flat {
  color: var(--quote-flat);
  font-weight: 600;
  letter-spacing: -0.02em;
}

@keyframes ticker {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* HERO */
.hero {
  position: relative;
  min-height: 520px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 70% 50%, rgba(80, 170, 120, 0.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 15% 80%, rgba(47, 143, 95, 0.08) 0%, transparent 60%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: linear-gradient(var(--blue-light) 1px, transparent 1px), linear-gradient(90deg, var(--blue-light) 1px, transparent 1px);
  background-size: 50px 50px;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 40px 40px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 60px;
  align-items: center;
}

.hero-left {
  animation: fadeInUp 0.7s ease both;
}

.hero-left h1 {
  font-size: 46px;
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hero-left h1 .highlight {
  background: linear-gradient(90deg, var(--accent), var(--blue-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-left p {
  font-size: 16px;
  color: #557261;
  line-height: 1.7;
  margin-bottom: 28px;
}

.hero-search {
  display: flex;
  width: 100%;
  max-width: 100%;
  gap: 16px;
  transition: border-color 0.2s;
}

.hero-search .btn-full {
  flex: 1;
  background: linear-gradient(135deg, #2f8f5f, #55b07f);
  border: none;
  color: white;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  border-radius: 12px;
  transition: opacity 0.2s;
}

.hero-search .btn-full:hover {
  opacity: 0.9;
}

.hero-guide {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--gray-400);
  font-weight: 500;
}

.hero-tags {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.hero-tag {
  font-size: 12px;
  color: var(--gray-400);
  background: rgba(47, 143, 95, 0.08);
  border: 1px solid rgba(47, 143, 95, 0.2);
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.hero-tag:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* SLIDER */
.slider-panel {
  background: #ffffff;
  border: 1px solid rgba(47, 143, 95, 0.2);
  border-radius: 16px;
  overflow: hidden;
  animation: fadeInUp 0.7s 0.15s ease both;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(47, 143, 95, 0.1);
  background: rgba(211, 241, 223, 0.6);
}

.slider-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.slider-dots {
  display: flex;
  gap: 6px;
}

.slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(79, 158, 255, 0.3);
  cursor: pointer;
  transition: all 0.2s;
}

.slider-dot.active {
  background: var(--accent);
  width: 18px;
  border-radius: 3px;
}

.slides {
  position: relative;
  height: 300px;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  padding: 20px;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.slide-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  background: var(--accent2);
  border-radius: 4px;
  padding: 3px 8px;
  margin-bottom: 10px;
  width: fit-content;
}

.slide-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  color: #1f2f26;
  margin-bottom: 10px;
}

.slide-desc {
  font-size: 13px;
  color: var(--gray-400);
  line-height: 1.6;
}

.slide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.slide-time {
  font-size: 11px;
  color: var(--gray-400);
  font-family: 'DM Mono', monospace;
}

.slide-more {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

/* SECTIONS */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 40px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.section-title span {
  color: var(--accent);
}

.section-sub {
  font-size: 14px;
  color: #5f7c6c;
  margin-top: 4px;
}

.section-more {
  font-size: 13px;
  color: #1a5c3e;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-more:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(47, 143, 95, 0.22), transparent);
  margin: 0 40px;
}

/* NEWS GRID */
.news-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.news-card {
  background: #ffffff;
  border: 1px solid rgba(47, 143, 95, 0.14);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.news-card-thumb {
  margin: -20px -20px 12px -20px;
  width: calc(100% + 40px);
  height: 132px;
  overflow: hidden;
  background: #eef2f0;
  border-radius: 11px 11px 0 0;
}

.news-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-card-thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #e5efe8 0%, #d8e8df 42%, #c9dfd2 100%);
}

.news-card-thumb-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  text-align: center;
}

.news-card-thumb-ph-icon {
  width: 44px;
  height: 34px;
  border-radius: 8px;
  border: 2px solid rgba(47, 143, 95, 0.32);
  background: rgba(255, 255, 255, 0.55);
  box-sizing: border-box;
  position: relative;
}

.news-card-thumb-ph-icon::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 10px;
  height: 6px;
  border-radius: 2px;
  background: rgba(47, 143, 95, 0.2);
}

.news-card-thumb-ph-hint {
  font-size: 11px;
  font-weight: 700;
  color: #5a7a6a;
  letter-spacing: -0.02em;
}

.news-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue-bright), var(--accent));
  opacity: 0;
  transition: opacity 0.2s;
}

.news-card:hover {
  border-color: rgba(47, 143, 95, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(31, 47, 38, 0.12);
}

.news-card:hover::before {
  opacity: 1;
}

.news-card-cat {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #185f3d;
  background: #e7f5ed;
  border: 1px solid rgba(47, 143, 95, 0.3);
  border-radius: 999px;
  padding: 2px 8px;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
  width: fit-content;
}

.news-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: #1f2f26;
  margin-bottom: 8px;
}

.news-card-desc {
  font-size: 13px;
  color: var(--gray-400);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.news-card-time {
  font-size: 11px;
  color: var(--gray-400);
  font-family: 'DM Mono', monospace;
}

.news-tag {
  font-size: 11px;
  font-weight: 700;
  background: #eef8f1;
  color: #245640;
  border: 1px solid rgba(47, 143, 95, 0.22);
  border-radius: 999px;
  padding: 2px 8px;
}

/* TERMS */
.terms-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.term-card {
  background: #ffffff;
  border: 1px solid rgba(47, 143, 95, 0.16);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

a.term-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

a.term-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.term-card:hover {
  background: #f7fcf9;
  border-color: rgba(47, 143, 95, 0.35);
  transform: translateY(-2px);
}

.term-symbol {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.term-word {
  font-size: 13px;
  font-weight: 700;
  color: #335342;
  margin-bottom: 6px;
}

.term-glossary-hint {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.term-def {
  font-size: 12px;
  color: var(--gray-400);
  line-height: 1.6;
}

/* MOCK */
.mock-section {
  background: linear-gradient(135deg, rgba(211, 241, 223, 0.55) 0%, rgba(255, 255, 255, 1) 100%);
  border: 1px solid rgba(47, 143, 95, 0.22);
  border-radius: 20px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.mock-text h2 {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.mock-text h2 span {
  color: #1a6b45;
}

.mock-text p {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.7;
  margin-bottom: 24px;
}

.mock-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.mock-feat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.mock-feat-icon {
  width: 22px;
  height: 22px;
  background: rgba(47, 143, 95, 0.2);
  border: 1px solid rgba(47, 143, 95, 0.35);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #156b43;
  flex-shrink: 0;
}

.btn-accent {
  background: linear-gradient(135deg, #2f8f5f, #4faa77);
  border: none;
  color: #ffffff;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 20px rgba(47, 143, 95, 0.2);
  transition: all 0.2s;
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 212, 255, 0.4);
}

.mock-portfolio {
  background: #ffffff;
  border: 1px solid rgba(47, 143, 95, 0.15);
  border-radius: 14px;
  padding: 20px;
}

.portfolio-header {
  margin-bottom: 16px;
}

.portfolio-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--gray-500);
  text-transform: none;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.portfolio-total {
  font-size: 22px;
  font-weight: 900;
  color: #14261c;
}

.portfolio-return {
  font-size: 14px;
  color: #1d6b45;
  font-weight: 800;
}

.portfolio-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(47, 143, 95, 0.12);
}

.portfolio-item:last-of-type {
  border-bottom: none;
}

.p-name {
  font-size: 15px;
  font-weight: 800;
  color: #14261c;
}

.p-shares {
  font-size: 13px;
  font-weight: 600;
  color: #4a6354;
  margin-top: 2px;
}

.p-price {
  font-size: 15px;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
  color: #14261c;
  text-align: right;
}

.p-change {
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.p-change.up {
  color: var(--up);
}

.p-change.down {
  color: var(--down);
}

.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 40px;
  margin-top: 16px;
}

.mini-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: rgba(42, 111, 219, 0.4);
  transition: background 0.2s;
}

.mini-bar:hover,
.mini-bar.highlight {
  background: var(--accent);
}

/* MARKET TABLE */
.market-table {
  width: 100%;
  border-collapse: collapse;
}

.market-table th {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-400);
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(79, 158, 255, 0.1);
  letter-spacing: 0.5px;
}

.market-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(79, 158, 255, 0.06);
}

.market-table tr:last-child td {
  border-bottom: none;
}

.market-table tr:hover td {
  background: rgba(79, 158, 255, 0.04);
}

.market-table tbody tr[data-stock-code] {
  cursor: pointer;
}

.market-table tbody tr[data-stock-code]:focus-visible {
  outline: 2px solid rgba(47, 143, 95, 0.55);
  outline-offset: -2px;
}

.stock-name {
  font-weight: 700;
  color: #1f2f26;
}

.stock-code {
  font-size: 11px;
  color: var(--gray-400);
  font-family: 'DM Mono', monospace;
  margin-top: 2px;
}

.stock-price {
  font-family: 'DM Mono', monospace;
  font-weight: 600;
  color: #1f2f26;
}

.badge-up {
  background: rgba(255, 71, 71, 0.12);
  color: var(--up);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
}

.badge-down {
  background: rgba(79, 158, 255, 0.12);
  color: var(--down);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
}

.badge-flat {
  background: var(--quote-flat-bg);
  color: var(--quote-flat);
  border: 1px solid var(--quote-flat-border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
}

/* 메인 홈 시장 인기 종목: 등락률은 배경·테두리 없이 퍼센트만 */
.market-table tbody td:nth-child(4) .badge-up,
.market-table tbody td:nth-child(4) .badge-down,
.market-table tbody td:nth-child(4) .badge-flat {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 700;
}

.volume {
  font-size: 12px;
  color: var(--gray-400);
  font-family: 'DM Mono', monospace;
}

.ai-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.ai-strong-buy {
  background: rgba(0, 200, 150, 0.15);
  color: var(--green);
}

.ai-buy {
  background: rgba(0, 212, 255, 0.12);
  color: var(--accent);
}

.ai-hold {
  background: #fff5db;
  color: #8a6200;
}

/* FOOTER */
footer {
  background: #f7fcf9;
  border-top: 1px solid rgba(47, 143, 95, 0.12);
  padding: 40px;
  text-align: center;
}

.footer-logo {
  font-size: 18px;
  font-weight: 700;
  color: #1f2f26;
  margin-bottom: 8px;
}

.footer-logo span {
  color: var(--accent);
}

.footer-desc {
  font-size: 12px;
  color: var(--gray-400);
}

.footer-disclaimer {
  font-size: 11px;
  color: rgba(122, 144, 184, 0.45);
  margin-top: 14px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s, transform 0.6s;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .mascot-coach {
    left: 10px;
    right: 10px;
    width: auto;
  }
  .mascot-coach-body {
    grid-template-columns: 102px 1fr;
  }
  .mascot-coach-image-wrap {
    width: 102px;
    height: 136px;
  }
  .hero-content {
    grid-template-columns: 1fr;
    padding: 46px 20px 28px;
    gap: 24px;
  }
  .slider-panel {
    display: none;
  }
  .news-grid {
    grid-template-columns: 1fr 1fr;
  }
  .terms-grid {
    grid-template-columns: 1fr 1fr;
  }
  .mock-section {
    grid-template-columns: 1fr;
    padding: 24px 18px;
    gap: 20px;
  }

  .hero-left h1 {
    font-size: clamp(30px, 8vw, 40px);
    line-height: 1.22;
    letter-spacing: -0.8px;
  }

  .hero-left p {
    font-size: 14px;
    line-height: 1.65;
  }

  .section {
    padding: 42px 20px;
  }

  .section-header {
    margin-bottom: 20px;
    gap: 10px;
    align-items: flex-start;
    flex-direction: column;
  }

  .section-title {
    font-size: 22px;
  }

  .section-sub {
    font-size: 13px;
  }

  .divider {
    margin: 0 20px;
  }

  .market-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .market-table thead,
  .market-table tbody,
  .market-table tr {
    width: 100%;
  }

  .market-table th,
  .market-table td {
    white-space: nowrap;
  }

  footer {
    padding: 30px 20px;
  }
  nav {
    padding: 0 20px;
  }

  .tutorial-guide-inner {
    padding: 0 20px;
  }

  .tutorial-step-card {
    left: 16px !important;
    right: 16px;
    width: auto;
  }

  .login-modal-panel {
    padding: 28px 20px 24px;
  }

  .login-modal-header h2 {
    font-size: 26px;
  }
}

@media (max-width: 430px) {
  .nav-right .btn-ghost,
  .nav-right .btn-primary {
    padding: 6px 7px;
    font-size: 10px;
  }

  .nav-right .nav-user-email {
    max-width: 112px;
    font-size: 10px;
  }
}

/* 종목·용어 자동완성 (stock-autocomplete.js) — 래퍼 삽입 후에도 입력란 폭·버튼 배치가 이전과 동일하도록 */
.jurin-ac-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.jurin-ac-wrap > .stock-input-field,
.jurin-ac-wrap > .input-field,
.jurin-ac-wrap > .term-input-field {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex: none;
}

.jurin-ac-dd {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  max-height: 260px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid rgba(47, 143, 95, 0.28);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(31, 47, 38, 0.12);
  padding: 6px;
}

.jurin-ac-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
}

.jurin-ac-item:hover,
.jurin-ac-item:focus {
  background: var(--gray-100);
  outline: none;
}

.jurin-ac-name {
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jurin-ac-code {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
  font-family: 'DM Mono', ui-monospace, monospace;
  flex-shrink: 0;
}

.jurin-ac-item--term .jurin-ac-name {
  font-weight: 600;
}

/* 모의투자 좁은 사이드바: 제안 줄 한 줄·글자 소폭 축소 */
.jurin-ac-dd--compact .jurin-ac-item {
  font-size: 12px;
  padding: 8px 10px;
  gap: 6px;
}

.jurin-ac-dd--compact .jurin-ac-code {
  font-size: 11px;
}

/* 루미 코치 키워드 (5단계는 plain 텍스트 — 강조색 미사용) */
.mascot-coach-text .mascot-coach-kw {
  font-weight: 700;
  color: inherit;
  background: none;
  padding: 0;
  border-radius: 0;
  text-decoration: none;
}

body.simulation-step5-active .mascot-coach-text .mascot-coach-kw {
  font-weight: inherit;
}

/* simulation 5단계: 스포트라이트 없을 때 오버레이 투명 */
body.tutorial-fx-active:not(.sim-step5-spotlight) .sim-step5-overlay.is-open,
body.simulation-step5-active:not(.sim-step5-spotlight) .sim-step5-overlay.is-open {
  position: fixed;
  inset: 0;
  z-index: 390;
  background: transparent !important;
  pointer-events: none;
}

/* 5단계 스포트라이트: 1단계와 같은 전역 딤 */
body.tutorial-fx-active.sim-step5-spotlight .sim-step5-overlay.is-open,
body.tutorial-fx-active.sim-step5-spotlight .sim-step5-overlay.is-open.is-dim,
body.simulation-step5-active.sim-step5-spotlight .sim-step5-overlay.is-open,
body.simulation-step5-active.sim-step5-spotlight .sim-step5-overlay.is-open.is-dim {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(4, 8, 6, 0.68) !important;
  pointer-events: none;
}

/* 5단계: 강조 요소를 딤(400) 위로 — callout 카드는 tutorial-fx 규칙 */
body.simulation-step5-active.sim-step5-spotlight .tutorial-callout-target {
  position: relative;
  z-index: 500;
}

body.simulation-step5-active.sim-step5-spotlight .portfolio-section > .sim-holding-detail-sheet.tutorial-callout-target {
  position: absolute;
  z-index: 500;
  isolation: auto;
}

body.simulation-step5-active.sim-step5-spotlight .orderbook-overlay.tutorial-callout-target {
  position: absolute;
  z-index: 500;
  isolation: auto;
}

body.simulation-step5-active .mascot-coach.is-open {
  z-index: 620;
}

body.simulation-step5-active .mascot-coach-dock,
body.simulation-step5-active .sim-step5-quest-hud {
  z-index: 615;
}

.sim-step5-quest-hud {
  position: fixed;
  top: 88px;
  right: 16px;
  z-index: 550;
  max-width: min(320px, calc(100vw - 32px));
  display: none;
}

.sim-step5-quest-hud.is-open {
  display: block;
}

.sim-step5-panel {
  border: 1px solid rgba(47, 143, 95, 0.28);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.sim-step5-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.sim-step5-tag {
  font-size: 11px;
  font-weight: 800;
  color: #2f8f5f;
  background: #f0faf4;
  border-radius: 999px;
  padding: 3px 8px;
}

.sim-step5-title {
  font-size: 15px;
  color: #1a3d2c;
}

.sim-step5-now {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #4b6658;
  line-height: 1.45;
}

.sim-step5-confetti {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 700;
  display: none;
  overflow: hidden;
}

.sim-step5-confetti.is-active {
  display: block;
}

.sim-step5-confetti.is-active::before,
.sim-step5-confetti.is-active::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, #ffd54f 2px, transparent 2px),
    radial-gradient(circle, #2f8f5f 2px, transparent 2px),
    radial-gradient(circle, #ff8a80 2px, transparent 2px);
  background-size: 48px 48px, 64px 64px, 56px 56px;
  background-position: 0 0, 24px 24px, 12px 36px;
  animation: simStep5ConfettiDrift 2.4s ease-out forwards;
  opacity: 0.85;
}

@keyframes simStep5ConfettiDrift {
  0% {
    transform: translateY(-20%) scale(1);
    opacity: 0;
  }
  15% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(30%) scale(1.05);
    opacity: 0;
  }
}

