@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;600;700;800&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600&display=swap');

/* ==========================================================================
   Cosmic Divination Web App - Deep Space Glassmorphism Design System
   모듈명: 세상 만물 만사의 상징체계 (Cosmic Divination Web App Module)
   디자인 토큰, 글래스모피즘, 6효 진행배지, 다국어 토글, 애니메이션 정의
   ========================================================================== */

/* 1. 디자인 시스템 토큰 (CSS Root Variables) */
:root {
  /* 배경 테마: 딥 스페이스 다크 블루 & 반투명 유리 */
  --bg-dark: #05060b;
  --bg-card: rgba(15, 20, 35, 0.55);
  --bg-card-hover: rgba(25, 32, 55, 0.75);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glass-glow: rgba(168, 85, 247, 0.4);

  /* front/formenu 디자인 시스템 토큰 완벽 호환 (#1 styles.css 기준) */
  --gold-primary: #f3e5ab;
  --gold-light: #fff5d6;
  --cyan-ethereal: #70e4ef;
  --border-gold: rgba(212, 175, 55, 0.25);
  --font-display: 'Cinzel Decorative', serif;
  --font-title: 'Cinzel', serif;
  --font-serif: 'Cormorant Garamond', serif;
  --font-sans: 'Plus Jakarta Sans', sans-serif;

  /* 타이포그래피 컬러 */
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-gold: #f3e5ab;

  /* 음양(陰陽) 포인트 컬러 */
  --accent-yang: #ff3b5c;         /* 양효(陽爻): 붉은빛 글로우 */
  --accent-yang-glow: rgba(255, 59, 92, 0.6);
  --accent-yin: #3b82f6;          /* 음효(陰爻): 푸른빛 글로우 */
  --accent-yin-glow: rgba(59, 130, 246, 0.6);
  --accent-purple: #9333ea;
  --accent-cyan: #06b6d4;

  /* 모서리 곡률 (Border Radius) */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
}

/* 2. 글로벌 리셋 & 뷰포트 레이아웃 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  width: 100vw;
  min-height: 100vh;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 3. 배경 캔버스 (Canvas Layer) */
#cosmosCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* 4. 상단 네비게이션 헤더 (Top Bar) */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(5, 6, 11, 0.4);
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand .symbol {
  font-size: 1.6rem;
  color: var(--gold-primary);
  filter: drop-shadow(0 0 8px rgba(254, 240, 138, 0.5));
  animation: pulseRotate 12s infinite linear;
}

.brand .title {
  font-family: var(--font-title) !important;
  font-weight: 700 !important;
  letter-spacing: 0.2em;
  font-size: 1.3rem;
  color: var(--gold-primary, #f3e5ab) !important;
  background: none !important;
  -webkit-text-fill-color: var(--gold-primary, #f3e5ab) !important;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 5. 6효 진행도 배지 (Placed below spinning orb / hero header) */
.hexagram-orb-tower {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(14, 18, 38, 0.75);
  border: 1px solid var(--border-glass-glow);
  padding: 8px 22px;
  border-radius: 40px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.4s ease;
  margin-top: 2px;
  margin-bottom: 2px;
}

.hexagram-orb-tower:hover {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.3);
}

.mini-step-label {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  color: var(--text-gold);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.mini-lines-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-line-slot {
  width: 16px;
  height: 18px;
  display: flex;
  align-items: center;
}

.mini-line {
  width: 100%;
  height: 10px;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.mini-line.empty {
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(255, 255, 255, 0.25);
}

.mini-line.line-yang {
  background: var(--accent-yang);
  box-shadow: 0 0 8px var(--accent-yang-glow);
}

.mini-line.line-yin {
  background: var(--accent-yin);
  box-shadow: 0 0 8px var(--accent-yin-glow);
}

/* 6. 다국어 토글 버튼 (KO / EN) 및 아이콘 버튼 */
.controls-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-selector {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 3px;
  backdrop-filter: blur(10px);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-btn:hover {
  color: var(--text-main);
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--accent-purple), #ec4899);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(147, 51, 234, 0.3);
}

/* 7. 메인 컨테이너 영역 */
.main-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 680px;
  margin-top: 100px;
  margin-bottom: 60px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* 히어로 헤더 */
.hero-header {
  text-align: center;
  animation: fadeInDown 1s ease;
  transition: opacity 0.5s ease;
}

.main-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #ffffff 0%, #d8b4fe 70%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
  margin-bottom: 8px;
}

.subtitle {
  font-family: var(--font-sans);
  font-size: 1.02rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.3px;
}

/* 8. Glassmorphism Card Component */
.glass-card {
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 9. 모드 선택 탭 (Mode Tabs) */
.mode-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.45) 0%, rgba(59, 130, 246, 0.35) 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(147, 51, 234, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tab-icon {
  font-size: 1.1rem;
}

/* Extraction Mode: Hide mode tabs & input form during progressive line drawing */
.input-card.in-extraction-mode .mode-tabs,
.input-card.in-extraction-mode .input-group {
  display: none !important;
}

.extraction-recap-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(14, 18, 38, 0.6);
  border: 1px solid var(--border-glass-glow);
  padding: 14px 22px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  text-align: center;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
}

.extraction-recap-box .recap-label {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--text-gold);
  letter-spacing: 0.5px;
}

.extraction-recap-box .recap-val {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: #ffffff;
  font-weight: 600;
}

/* 10. 질문 입력 폼 & 경건한 기도의 안내문 */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.input-label {
  font-family: var(--font-sans);
  font-size: 1.04rem;
  color: #e2e8f0;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.2px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  word-break: keep-all;
  white-space: pre-line;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

.input-wrapper input {
  width: 100%;
  padding: 16px 44px 16px 20px;
  background: #FFFFFF !important;
  border: 2px solid #E5C158 !important;
  border-radius: var(--radius-md);
  color: #0F172A !important;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  outline: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 16px rgba(229, 193, 88, 0.25);
  transition: all 0.25s ease;
}

.input-wrapper input::placeholder {
  color: #64748B !important;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 400;
}

.input-info-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.char-counter {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: #CBD5E1;
  font-weight: 600;
  transition: color 0.3s ease;
}

.char-counter.limit {
  color: #EF4444;
  font-weight: 700;
}

.input-wrapper input:focus {
  border-color: #D97706 !important;
  box-shadow: 0 0 0 4px rgba(229, 193, 88, 0.3), 0 6px 24px rgba(0, 0, 0, 0.35) !important;
  background: #FFFFFF !important;
}

.clear-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748B;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.clear-btn:hover {
  color: #0F172A;
}

/* 11. 액션 버튼 (Glowing Button) */
.action-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}

.glowing-btn {
  position: relative;
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #3b82f6 100%);
  border: none;
  border-radius: 40px;
  padding: 16px 48px;
  color: #ffffff;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.glowing-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 40px rgba(168, 85, 247, 0.6);
}

.glowing-btn .btn-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.glowing-btn:hover .btn-glow {
  opacity: 1;
}

/* 12. 연출 진행 상태 토스트 (Divination Status) */
.divination-status {
  display: none !important;
  align-items: center;
  gap: 12px;
  background: rgba(14, 18, 38, 0.8);
  border: 1px solid var(--border-glass-glow);
  padding: 14px 28px;
  border-radius: 30px;
  color: var(--text-gold);
  font-family: var(--font-serif);
  font-size: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.4s ease;
}

/* 유리구슬 전면 배치 & 컨텐츠 박스 백그라운드 블러 레이어링 (Glass Marble Front Layering) */
body.divination-animating #cosmosCanvas {
  z-index: 30; /* 유리구슬 캔버스를 전면으로 끌어올림! */
  pointer-events: none;
}

body.divination-animating .input-card {
  opacity: 0.15;
  transform: scale(0.92);
  filter: blur(12px);
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s ease, filter 0.6s ease;
}

body.divination-animating .hero-header {
  opacity: 0.2;
  filter: blur(8px);
  transition: opacity 0.6s ease, filter 0.6s ease;
}

body.divination-animating .divination-status {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: rgba(4, 6, 18, 0.88);
  border: 1px solid var(--border-glass-glow);
  box-shadow: 0 0 35px rgba(168, 85, 247, 0.5);
  backdrop-filter: blur(16px);
  padding: 14px 32px;
}

body.divination-animating .top-bar,
body.divination-animating .hexagram-orb-tower {
  z-index: 100;
  position: relative;
}

.spinner-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-purple);
  box-shadow: 0 0 12px var(--accent-purple);
  animation: pulseDot 1s infinite alternate;
}

/* 13. 6효 시각화 라인 Representation */
.line-yang {
  height: 16px;
  width: 100%;
  background: linear-gradient(90deg, #ff3b5c, #ff758c);
  border-radius: 4px;
  box-shadow: 0 0 12px var(--accent-yang-glow);
}

.line-yin {
  height: 16px;
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.line-yin::before,
.line-yin::after {
  content: '';
  width: 47%;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 4px;
  box-shadow: 0 0 12px var(--accent-yin-glow);
}

/* 14. 8괘 상괘 / 하괘 정보 박스 */
.trigram-info-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  margin-bottom: 20px;
  font-family: var(--font-serif);
}

.trigram-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.trigram-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.trigram-value {
  font-size: 0.98rem;
  color: var(--text-gold);
  font-weight: 600;
}

.trigram-divider {
  color: rgba(254, 240, 138, 0.4);
  font-size: 0.9rem;
}

/* 15. 결과 카드 및 2차 해석 카드 (Result Card & Interpretation Card) */
.result-card {
  animation: zoomIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-header {
  text-align: center;
  margin-bottom: 20px;
}

.result-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 6px;
}

.result-hanja {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text-gold);
}

.result-line-display {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
  min-height: 40px;
  width: 100%;
}

/* 14-B. 본괘 ➔ 동효 ➔ 지괘 전환 배지 & 동효 라인 시각화 */
.hexagram-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px auto 16px auto;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(254, 240, 138, 0.25);
  border-radius: 24px;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  max-width: 90%;
}
.flow-node {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-weight: 600;
}
.flow-node.primary {
  color: #fef08a;
}
.flow-node.transformed {
  color: #93c5fd;
}
.flow-arrow {
  color: var(--text-gold);
  font-weight: 800;
  font-size: 1.1rem;
}
.flow-moving-tag {
  background: rgba(234, 179, 8, 0.2);
  border: 1px solid rgba(234, 179, 8, 0.5);
  color: #fde047;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  animation: pulseGold 2s infinite ease-in-out;
}
.line-row {
  display: block;
  width: 100%;
  position: relative;
}
.line-row .line-content {
  width: 100%;
}
.result-line-display .line-yang,
.result-line-display .line-yin {
  height: 20px;
}
.line-moving-badge {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  font-size: 0.72rem;
  line-height: 1.1;
  font-weight: 700;
  color: #fef08a;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(250, 204, 21, 0.75);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 0.3px;
  pointer-events: none;
  animation: pulseGold 2s infinite ease-in-out;
}
@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 4px rgba(255, 215, 0, 0.3); }
  50% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.65); }
}
.line-row.is-moving .line-yang {
  box-shadow: inset 0 0 0 1.5px rgba(250, 204, 21, 0.85), 0 0 10px rgba(255, 215, 0, 0.45);
}
.line-row.is-moving .line-yin::before,
.line-row.is-moving .line-yin::after {
  box-shadow: inset 0 0 0 1.5px rgba(250, 204, 21, 0.85), 0 0 10px rgba(255, 215, 0, 0.45);
}

.question-recap {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  border-left: 3px solid var(--accent-purple);
}

.divider {
  text-align: center;
  color: var(--text-gold);
  letter-spacing: 6px;
  margin: 20px 0;
  opacity: 0.6;
}

.section-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.section-box h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: #f3f4f6;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-box .text-content {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.8;
  color: #e5e7eb;
}

/* 16. 전통 금기 및 복채 안내문 (Completion Notice) */
.completion-notice {
  margin-top: 24px;
  padding: 16px 22px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-gold);
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.75;
  letter-spacing: 0.4px;
  white-space: pre-line;
  word-break: keep-all;
}

/* 17. 도움말 모달 (Modal Popup) */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 18, 0.75);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  position: relative;
  max-width: 520px;
  padding: 36px;
}

.close-modal-btn {
  position: absolute;
  top: 18px;
  right: 22px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
}

.modal-box h2 {
  font-family: var(--font-serif);
  color: var(--text-gold);
  margin-bottom: 16px;
  font-size: 1.5rem;
}

.modal-content {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #e5e7eb;
}

.steps-list {
  padding-left: 20px;
}

.steps-list li {
  margin-bottom: 8px;
}

/* 18. 알림 토스트 (Toast) */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid var(--accent-purple);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.9rem;
  z-index: 300;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 0.3s ease;
}

/* 19. 유틸리티 클래스 */
.hidden {
  display: none !important;
}

/* 20. 키프레임 애니메이션 (Keyframes) */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulseRotate {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg); }
}

@keyframes starSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulseDot {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 1; }
}

/* 21. Eon 포인트 배지 & 3TREE 연동 요소 스타일 (CASTALIEN Platform Integration) */
.eon-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(192, 132, 252, 0.4);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 700;
  color: #f3e8ff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
  transition: all 0.3s ease;
}

.eon-badge:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: rgba(192, 132, 252, 0.7);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.4);
}

.eon-icon {
  font-size: 0.95rem;
  animation: pulseRotate 10s infinite linear;
}

.eon-unit {
  font-size: 0.75rem;
  color: var(--accent-purple);
  margin-left: 2px;
}

.ai-reading-box {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(192, 132, 252, 0.3);
}

.ai-text {
  line-height: 1.75;
  color: #f3e8ff;
  white-space: pre-line;
}

.tree-reward-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #86efac;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 14px;
  text-align: center;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
}

/* Step 4 Live AI Consultation & Timer Styles */
.step4-timer-badge-compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 16px;
  border-radius: 20px;
  color: #e2e8f0;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.step4-timer-badge-compact strong {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--accent-gold);
}

.step4-timer-badge-compact .rate-info {
  font-size: 0.78rem;
  color: #94a3b8;
  opacity: 0.85;
}

.step4-timer-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.5);
  padding: 8px 16px;
  border-radius: 20px;
  color: #fef08a;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  margin-top: 10px;
  box-shadow: 0 0 15px rgba(234, 179, 8, 0.2);
}

.step4-timer-badge strong {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: #ffffff;
}

.step4-timer-badge .rate-info {
  font-size: 0.78rem;
  color: #fde047;
  opacity: 0.85;
}

.step4-chat-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
  padding: 12px;
  background: rgba(14, 18, 38, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-line;
}

.chat-bubble.ai {
  align-self: flex-start;
  background: rgba(147, 51, 234, 0.2);
  border: 1px solid rgba(192, 132, 252, 0.35);
  color: #f3e8ff;
  border-top-left-radius: 4px;
}

.chat-bubble.user {
  align-self: flex-end;
  background: rgba(234, 179, 8, 0.2);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #fffbeb;
  border-top-right-radius: 4px;
}

.step4-input-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.step4-input-row input {
  flex: 1;
  background: #FFFFFF !important;
  border: 2px solid #E5C158 !important;
  border-radius: 20px;
  padding: 12px 20px;
  color: #0F172A !important;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25), 0 0 10px rgba(229, 193, 88, 0.2);
  transition: all 0.25s ease;
}

.step4-input-row input::placeholder {
  color: #64748B !important;
  font-size: 0.88rem;
  font-weight: 400;
}

.step4-input-row input:focus {
  border-color: #D97706 !important;
  box-shadow: 0 0 0 3px rgba(229, 193, 88, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25) !important;
  background: #FFFFFF !important;
}

.chat-send-btn {
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  border: none;
  border-radius: 20px;
  padding: 0 20px;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.glowing-btn.secondary-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}
.glowing-btn.secondary-btn:hover {
  background: rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.glowing-btn.print-btn {
  background: rgba(229, 193, 88, 0.15);
  border: 1px solid rgba(229, 193, 88, 0.5);
  color: #f3e5ab;
  cursor: pointer;
  transition: all 0.25s ease;
}
.glowing-btn.print-btn:hover {
  background: rgba(229, 193, 88, 0.3);
  border-color: rgba(229, 193, 88, 0.85);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(229, 193, 88, 0.45);
  transform: translateY(-1px);
}


/* 22. 반응형 미디어 쿼리 (Responsive Mobile Adjustments) */
@media (max-width: 640px) {
  .top-bar {
    padding: 12px 16px;
  }
  .mini-step-label {
    display: none;
  }
  .main-content {
    padding: 0 16px;
    margin-top: 80px;
  }
  .main-title {
    font-size: 1.9rem;
  }
  .glass-card {
    padding: 24px 18px;
  }
}

/* 23. Printable Report Layout (@media print) */
.printable-report-area {
  display: none;
}

@media print {
  body {
    background: #ffffff !important;
    color: #111111 !important;
  }

  #cosmosCanvas, .top-bar, .hero-header, #hexagramTower, .input-card, 
  #divinationStatus, #resultCard, #interpretationCard, #step3AiCard, 
  .modal-backdrop, .toast, .print-action-row,
  #mobile-bottom-nav, .mobile-bottom-nav, .nav-dropdown, #network-dropdown-menu,
  .ai-report-bottom-tools, .card-outer-footer-left, .auth-modal-overlay,
  footer, .footer, .site-footer, #castalien-global-footer, #castalien-legal-modal-overlay, .print-footer {
    display: none !important;
    visibility: hidden !important;
  }

  .printable-report-area {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 800px;
    margin: 0 auto;
    padding: 12px 16px;
    color: #1a1a1a !important;
    background: #ffffff !important;
    font-family: 'Noto Serif KR', serif;
    line-height: 1.58;
  }

  .print-header {
    text-align: center;
    border-bottom: 1.5px solid #334155;
    padding-bottom: 9px;
    margin-bottom: 12px;
  }

  .print-brand {
    font-family: 'Cinzel', 'Cormorant Garamond', 'Times New Roman', Georgia, serif !important;
    font-size: 1.38rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
    color: #0f172a !important;
    line-height: 1.25;
  }

  .print-title-sub {
    font-size: 0.88rem;
    color: #475569;
    margin-top: 3px;
  }

  .print-date {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 3px;
  }

  .print-section {
    margin-bottom: 11px;
    page-break-inside: auto;
  }

  .print-sec-title {
    font-size: 0.98rem;
    font-weight: 700;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 4px;
    margin-bottom: 6px;
    color: #0f172a;
  }

  .print-question {
    font-size: 0.95rem;
    font-style: italic;
    font-weight: 600;
    color: #1e3a8a;
    background: #f8fafc;
    padding: 7px 12px;
    border-left: 4px solid #3b82f6;
    border-radius: 4px;
    margin: 0;
  }

  .print-hex-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 9px 14px;
    border-radius: 6px;
  }

  .print-hex-box h2 {
    margin: 0 0 2px 0;
    font-size: 1.12rem;
    color: #0f172a;
  }

  .print-text {
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.54;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
  }

  /* 2페이지 시작: 4종 입체괘상 심층 도해 */
  #printAiSection {
    break-before: page !important;
    page-break-before: always !important;
    padding-top: 4px !important;
    margin-top: 0 !important;
  }

  .screen-only-yao-box {
    display: none !important;
  }

  /* 인쇄 시 챕터 구분용 수평선 및 챕터 1 이전 불필요 서문 단락 숨김 */
  .report-divider-hr,
  .ai-report-print hr,
  .ai-report-print .report-pre-chapter-p {
    display: none !important;
  }

  /* 챕터별 줄바꿈 (기본: 페이지 넘김 없이 약 2줄 여백만 적용) */
  .report-chapter-h2,
  [id^="iching-chapter-"],
  [id^="saju-chap-"] {
    break-before: auto !important;
    page-break-before: auto !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
    color: #1e3a8a !important;
    border-left: 4px solid #1e3a8a !important;
    padding-left: 12px !important;
    margin-top: 2.2em !important;
    padding-top: 4px !important;
    margin-bottom: 12px !important;
    font-size: 1.22rem !important;
  }

  /* 3페이지 시작: Chapter 1은 반드시 3페이지 최상단에서 시작 */
  #iching-chapter-1,
  .report-chapter-first {
    break-before: page !important;
    page-break-before: always !important;
    margin-top: 0 !important;
    padding-top: 8px !important;
  }

  /* AI 심층 리포트 인쇄 서식 보존 (단락 줄바꿈, 헤딩, 리스트, 인용구) */
  .ai-report-print {
    white-space: normal !important;
    color: #1e293b !important;
    font-family: 'Noto Serif KR', -apple-system, BlinkMacSystemFont, serif !important;
  }

  .ai-report-print p {
    color: #1e293b !important;
    margin-bottom: 14px !important;
    line-height: 1.85 !important;
    font-size: 0.96rem !important;
    word-break: keep-all !important;
  }

  .ai-report-print h3 {
    color: #0f172a !important;
    font-family: 'Noto Serif KR', 'Cinzel', serif !important;
    margin-top: 20px !important;
    margin-bottom: 10px !important;
    font-size: 1.06rem !important;
    font-weight: 700 !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  .ai-report-print h3.report-dashboard-title {
    margin-top: 8px !important;
    margin-bottom: 6px !important;
    font-size: 0.96rem !important;
  }

  .ai-report-print h4 {
    color: #0284c7 !important;
    margin-top: 16px !important;
    margin-bottom: 8px !important;
    font-size: 1.02rem !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  .ai-report-print blockquote {
    background: #f8fafc !important;
    border-left: 4px solid #0284c7 !important;
    color: #334155 !important;
    padding: 12px 16px !important;
    margin: 16px 0 !important;
    border-radius: 0 6px 6px 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    font-style: italic !important;
  }

  .ai-report-print ul, .ai-report-print ol {
    color: #334155 !important;
    padding-left: 22px !important;
    margin: 12px 0 16px 0 !important;
  }

  .ai-report-print li {
    margin-bottom: 6px !important;
    line-height: 1.75 !important;
  }

  .ai-report-print .report-table-wrap {
    margin: 10px 0 14px 0 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .ai-report-print .report-table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  .ai-report-print .report-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-bottom: 1.5px solid #cbd5e1 !important;
    padding: 9px 10px !important;
    font-size: 0.83rem !important;
    line-height: 1.4 !important;
  }

  .ai-report-print .report-table td {
    color: #1e293b !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 9px 10px !important;
    font-size: 0.81rem !important;
    line-height: 1.48 !important;
  }

  .ai-report-print .report-dashboard-table th:nth-child(1),
  .ai-report-print .report-dashboard-table td:nth-child(1) {
    width: 13% !important;
    white-space: nowrap !important;
  }

  .ai-report-print .report-dashboard-table th:nth-child(2),
  .ai-report-print .report-dashboard-table td:nth-child(2) {
    width: 22% !important;
  }

  .ai-report-print .report-dashboard-table th:nth-child(3),
  .ai-report-print .report-dashboard-table td:nth-child(3) {
    width: 23% !important;
  }

  .ai-report-print .report-dashboard-table th:nth-child(4),
  .ai-report-print .report-dashboard-table td:nth-child(4) {
    width: 42% !important;
  }

  /* 목차(TOC) 완전 제거 */
  .report-toc-box {
    display: none !important;
  }

  .print-guide-grid p {
    margin: 5px 0;
    font-size: 0.92rem;
    color: #334155;
  }

  .print-footer {
    display: none !important;
  }
}



/* 🔮 버튼 클릭 후 백엔드 API/애니메이션 대기 중 깜박임 (Pulse Blink) 효과 */
@keyframes buttonPulseBlink {
  0% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.7), 0 0 40px rgba(99, 102, 241, 0.5);
    filter: brightness(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.97);
    box-shadow: 0 0 45px rgba(236, 72, 153, 0.95), 0 0 75px rgba(168, 85, 247, 0.85);
    filter: brightness(1.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.7), 0 0 40px rgba(99, 102, 241, 0.5);
    filter: brightness(1);
  }
}

.glowing-btn.btn-blinking {
  animation: buttonPulseBlink 0.75s infinite ease-in-out !important;
  pointer-events: none !important;
  cursor: wait !important;
}

/* Auth & EON Recharge Header Controls */
.recharge-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
  transition: all 0.25s ease;
  margin-left: 4px;
}

.recharge-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.7);
}

.auth-header-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-info-label {
  font-size: 0.82rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.auth-btn {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #e9d5ff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.auth-btn:hover {
  background: rgba(168, 85, 247, 0.4);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}

/* --- Language Selector & Navigation Dropdown (front/formenu Standard) --- */
.lang-select {
  height: 36px !important;
  box-sizing: border-box !important;
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(229, 193, 88, 0.4) !important;
  color: #f3e5ab !important;
  padding: 0 1.9rem 0 0.8rem !important;
  border-radius: 20px !important;
  font-family: var(--font-title, 'Cinzel', sans-serif) !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em !important;
  cursor: pointer !important;
  outline: none !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.3s ease !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f3e5ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.6rem center !important;
}

.lang-select:hover, .lang-select:focus {
  background-color: rgba(229, 193, 88, 0.15) !important;
  box-shadow: 0 0 15px rgba(229, 193, 88, 0.35) !important;
  border-color: #e5c158 !important;
  color: #ffffff !important;
}

.lang-select option {
  background: #0b0f19 !important;
  color: #f3e5ab !important;
  padding: 0.5rem !important;
  font-family: sans-serif !important;
}

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 36px !important;
  box-sizing: border-box !important;
  gap: 0.45rem !important;
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(229, 193, 88, 0.4) !important;
  color: #f3e5ab !important;
  padding: 0 0.95rem !important;
  border-radius: 20px !important;
  font-family: var(--font-title, 'Cinzel', sans-serif) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em !important;
  cursor: pointer !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2) !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  white-space: nowrap !important;
}

.nav-dropdown-btn:hover,
.nav-dropdown.active .nav-dropdown-btn {
  background: rgba(229, 193, 88, 0.15) !important;
  border-color: #e5c158 !important;
  color: #ffffff !important;
  box-shadow: 0 0 15px rgba(229, 193, 88, 0.35) !important;
}

.nav-dropdown-btn .dropdown-arrow {
  transition: transform 0.3s ease;
  color: #70e4ef !important;
  flex-shrink: 0;
}

.nav-dropdown.active .nav-dropdown-btn .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none !important;
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: 260px;
  max-width: 88vw;
  background: rgba(8, 11, 22, 0.98) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(229, 193, 88, 0.4) !important;
  border-radius: 12px !important;
  padding: 0.5rem 0 !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.85), 0 0 20px rgba(112, 228, 239, 0.2) !important;
  flex-direction: column;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}

.nav-dropdown.active .nav-dropdown-menu {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

.dropdown-item {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 1.1rem;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: rgba(112, 228, 239, 0.08);
  border-left-color: #70e4ef;
  padding-left: 1.3rem;
}

.dropdown-item.dropdown-sub-item:hover {
  padding-left: 1.8rem !important;
}

.dropdown-item .item-title,
.dropdown-section-header,
.dropdown-section-header .item-title {
  color: #ffffff;
  font-family: var(--font-title, 'Cinzel', serif) !important;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.dropdown-item:hover .item-title {
  color: #70e4ef !important;
}

.dropdown-item .item-url {
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--font-serif, serif);
  font-size: 0.73rem;
  margin-top: 0.15rem;
}

/* --- User Auth Dropdown & Mobile Responsiveness (front/formenu Standard) --- */
.user-auth-btn {
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(229, 193, 88, 0.4) !important;
  color: #f3e5ab !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.05rem !important;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2) !important;
  box-sizing: border-box !important;
}

.user-auth-btn:hover,
.nav-dropdown.active .user-auth-btn {
  background: rgba(229, 193, 88, 0.18) !important;
  border-color: #e5c158 !important;
  color: #ffffff !important;
  box-shadow: 0 0 15px rgba(229, 193, 88, 0.35) !important;
}

.user-avatar-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.user-auth-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f3e5ab;
}

.user-auth-label:empty {
  display: none;
}

/* Responsive Media Queries (Mobile & Tablet Optimization - Unified with #1 styles.css) */
@media (max-width: 992px) {
  .top-bar {
    padding: 0.9rem 1.2rem !important;
  }
  .brand .title {
    font-size: 1rem !important;
    letter-spacing: 0.08em !important;
  }
  .top-bar-right {
    gap: 0.45rem !important;
  }
}

@media (max-width: 768px) {
  .top-bar {
    padding: 0.75rem 0.85rem !important;
  }
  .top-bar-right {
    gap: 0.38rem !important;
  }
  .brand .title {
    font-size: 0.88rem !important;
    letter-spacing: 0.05em !important;
  }
  .lang-select {
    height: 34px !important;
    padding: 0 1.5rem 0 0.6rem !important;
    font-size: 0.76rem !important;
    background-position: right 0.45rem center !important;
  }
  .user-auth-btn {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.98rem !important;
  }
  #network-dropdown-btn {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    justify-content: center !important;
    gap: 0 !important;
  }
  .nav-btn-text,
  .nav-dropdown-btn .dropdown-arrow {
    display: none !important;
  }
  .eon-badge {
    padding: 3px 8px !important;
    font-size: 0.75rem !important;
  }
  .recharge-btn {
    padding: 2px 6px !important;
    font-size: 0.7rem !important;
  }
}

@media (max-width: 480px) {
  .top-bar {
    padding: 0.65rem 0.55rem !important;
  }
  .top-bar-right {
    gap: 0.28rem !important;
  }
  .brand {
    gap: 0.28rem !important;
  }
  .brand a {
    gap: 0.28rem !important;
  }
  .brand .symbol {
    font-size: 1.15rem !important;
  }
  .brand .title {
    display: inline-block !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.02em !important;
  }
  .icon-btn {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.75rem !important;
  }
  .lang-select {
    height: 32px !important;
    padding: 0 1.25rem 0 0.45rem !important;
    font-size: 0.72rem !important;
    background-position: right 0.35rem center !important;
  }
  .user-auth-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.92rem !important;
  }
  #network-dropdown-btn {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    justify-content: center !important;
    gap: 0 !important;
  }
  .nav-dropdown-btn .nav-btn-icon {
    width: 16px !important;
    height: 16px !important;
  }
  .nav-dropdown-btn .dropdown-arrow,
  .nav-btn-text {
    display: none !important;
  }
  .nav-dropdown-menu {
    width: 245px !important;
    right: 0 !important;
  }
}

/* 22. 팔괘숫자배열비교 모달 및 하단 전문가용 서브 버튼 스타일 */
.glass-card.result-card {
  position: relative;
  margin-bottom: 32px;
}

.card-outer-footer-left {
  position: relative;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}

.discreet-sub-btn {
  background: rgba(15, 23, 42, 0.4) !important;
  border: 1px solid rgba(255, 215, 0, 0.22) !important;
  outline: none !important;
  color: #cbd5e1 !important;
  font-family: var(--font-serif);
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  cursor: pointer;
  padding: 6px 12px !important;
  border-radius: 4px !important;
  letter-spacing: 0.3px;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

.discreet-sub-btn:hover {
  background: rgba(30, 41, 59, 0.75) !important;
  border-color: rgba(255, 215, 0, 0.5) !important;
  color: var(--text-gold) !important;
  box-shadow: none !important;
  transform: none;
  text-decoration: none !important;
}

@media (max-width: 640px) {
  .card-outer-footer-left {
    margin-top: 24px;
    padding-top: 12px;
    gap: 8px;
    justify-content: center;
  }
  .discreet-sub-btn {
    font-size: 0.82rem !important;
    padding: 5px 10px !important;
  }
}

.trigram-modal-box {
  max-width: 760px !important;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 22px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.trigram-comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.trigram-comparison-table th,
.trigram-comparison-table td {
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 10px 12px;
  vertical-align: middle;
}

.trigram-comparison-table th {
  background: rgba(30, 41, 59, 0.95);
  color: var(--text-gold);
  font-weight: 600;
  white-space: nowrap;
}

.trigram-comparison-table th small {
  font-size: 0.78rem;
  color: #cbd5e1;
  font-weight: normal;
}

.trigram-comparison-table td {
  color: #f1f5f9;
}

.trigram-comparison-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.04);
}

.trigram-comparison-table tbody tr:hover {
  background: rgba(168, 85, 247, 0.15);
}

/* 5번, 10번 핵심 수리 시각적 하이라이트 행 */
.trigram-comparison-table tbody tr.highlight-row {
  background: rgba(255, 215, 0, 0.12) !important;
}
.trigram-comparison-table tbody tr.highlight-row td {
  font-weight: 600;
  color: #fffde7;
}

/* 오행(金·土·水·火·木) 추천 HEX 컬러 코드 적용 태그 */
.element-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.tag-metal { color: #f8fafc; text-shadow: 0 0 6px rgba(255, 255, 255, 0.4); } /* 金 */
.tag-earth { color: #fbbf24; } /* 土 */
.tag-water { color: #60a5fa; } /* 水 */
.tag-fire  { color: #f87171; } /* 火 */
.tag-wood  { color: #4ade80; } /* 木 */

/* 각주 수식어 및 해설 섹션 스타일링 */
.fn-ref {
  color: var(--text-gold);
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 2px;
}

.trigram-footnotes {
  margin-top: 20px;
  padding: 16px 18px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: var(--radius-sm);
  text-align: left;
}

.footnotes-title {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--text-gold);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footnote-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.83rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 8px;
}
.footnote-item:last-child {
  margin-bottom: 0;
}

.fn-badge {
  background: rgba(255, 215, 0, 0.2);
  color: var(--text-gold);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}

.trigram-color-guide {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.color-palette-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.color-palette-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.5);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 23. 팔괘 모양 비교 연구 모달 스타일 */
.bagua-shape-modal-box {
  max-width: 900px !important;
  width: 95%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 28px 24px;
  background: rgba(11, 15, 25, 0.96) !important;
  border: 1px solid rgba(255, 215, 0, 0.35) !important;
  backdrop-filter: blur(20px);
}

.bagua-modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.bagua-modal-header h2 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--text-gold);
  margin-bottom: 6px;
}

.bagua-tab-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  padding: 6px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 24px;
}

.bagua-tab-btn {
  flex: 1;
  max-width: 140px;
  padding: 10px 16px;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.bagua-tab-btn:hover {
  color: #f1f5f9;
}

.bagua-tab-btn.active {
  background: rgba(30, 41, 59, 0.95);
  color: var(--text-gold);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

/* 단일 팔괘도 시각화 레이아웃 (2열 분할) */
.bagua-single-view {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: center;
}

@media (max-width: 768px) {
  .bagua-single-view {
    grid-template-columns: 1fr;
  }
}

/* 원형 방위 컴퍼스 섹션 */
.bagua-compass-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bagua-compass-wrapper {
  position: relative;
  width: 320px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
}

.compass-outer-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(148, 163, 184, 0.35);
}

.compass-inner-ring {
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* 방위 라벨 (정남, 정북, 정동, 정서) */
.compass-dir-label {
  position: absolute;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  font-family: var(--font-serif);
  z-index: 5;
}
.compass-dir-label.dir-top { top: -4px; color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }
.compass-dir-label.dir-bottom { bottom: -4px; color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.3); }
.compass-dir-label.dir-left { left: -4px; color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.3); }
.compass-dir-label.dir-right { right: -4px; color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }

/* 중앙 태극 노드 */
.bagua-center-node {
  position: relative;
  z-index: 10;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid rgba(255, 215, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.25);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.bagua-center-node:hover {
  transform: scale(1.08);
}

.taegeuk-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.center-label-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-gold);
  margin-top: 4px;
  font-family: var(--font-serif);
}

.bagua-nodes-container {
  position: absolute;
  inset: 0;
}

/* 8괘 노드 카드 */
.bagua-node-card {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  z-index: 8;
}

.bagua-node-card:hover, .bagua-node-card.selected {
  transform: scale(1.18);
  border-color: rgba(255, 215, 0, 0.8);
  box-shadow: 0 8px 22px rgba(255, 215, 0, 0.35);
  background: rgba(30, 41, 59, 0.98);
}

.node-num {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-gold);
}

.node-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #f1f5f9;
  font-family: var(--font-serif);
}

.bagua-diagram-title {
  margin-top: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-gold);
  background: rgba(15, 23, 42, 0.8);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 215, 0, 0.25);
  font-family: var(--font-serif);
}

/* 우측 상세 인스펙터 카드 */
.bagua-inspector-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
  text-align: left;
}

.bagua-info-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 14px;
}

.bagua-info-num-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--text-gold);
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bagua-info-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
}

.bagua-info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bagua-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
}

.info-label {
  color: #94a3b8;
}

.info-val-symbol {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-gold);
}

.info-val-number {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-gold);
}

.info-val-text {
  font-weight: 600;
  color: #f1f5f9;
}

.bagua-info-desc-box {
  margin-top: 6px;
}

.desc-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 6px;
}

.desc-text {
  font-size: 0.82rem;
  line-height: 1.6;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.6);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Header overflow guard: brand shrinks first, right-side controls never get pushed off-screen */
.brand { min-width: 0; flex: 0 1 auto; }
.brand .title { white-space: nowrap; }
.top-bar-right { flex-shrink: 0; }

/* ==========================================================================
   Member navigation menu (.nm-*), built by navbar.js (NAVIMENU_PLAN.txt)
   ========================================================================== */
#network-dropdown-menu.nm-menu { padding: 0.5rem 0; }
.nm-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 1.15rem;
  color: #E5E7EB;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-left: 2px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.nm-item:hover { background: rgba(16, 185, 129, 0.1); color: #6EE7B7; border-left-color: #10B981; }
.nm-item.is-current { color: #34D399; background: rgba(16, 185, 129, 0.08); border-left-color: #10B981; }
.nm-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); }
.nm-item.is-current .nm-dot { background: #10B981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.85); }
.nm-group { margin: 0.3rem 0; padding: 0.4rem 0; border-top: 1px solid rgba(255, 255, 255, 0.08); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.nm-group-label { display: block; padding: 0.25rem 1.15rem 0.15rem; font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: #D9B36A; font-weight: 700; }
.nm-sub { padding-left: 1.9rem; font-weight: 500; font-size: 0.88rem; }
/* third level: link + arrow toggle, collapsible children */
.nm-branch-row { display: flex; align-items: stretch; }
.nm-branch-link { flex: 1; min-width: 0; }
.nm-toggle { flex: none; width: 44px; display: flex; align-items: center; justify-content: center; background: transparent; border: 0; border-left: 1px solid rgba(255, 255, 255, 0.06); color: #9CA3AF; cursor: pointer; transition: background 0.2s ease, color 0.2s ease; }
.nm-toggle:hover, .nm-toggle:focus-visible { background: rgba(16, 185, 129, 0.12); color: #6EE7B7; outline: none; }
.nm-arrow { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.2s ease; }
.nm-branch.is-open .nm-arrow { transform: rotate(45deg); }
.nm-children { display: none; background: rgba(0, 0, 0, 0.14); }
.nm-branch.is-open .nm-children { display: block; }
.nm-sub2 { padding-left: 2.9rem; font-weight: 500; font-size: 0.84rem; }
.nm-branch.has-current .nm-branch-link .nm-dot { background: rgba(16, 185, 129, 0.55); }

/* Wide screens: align top-bar content with the 1240px content standard used by other modules */
@media (min-width: 1300px) {
  .top-bar {
    padding-left: calc((100% - 1240px) / 2 + 28px);
    padding-right: calc((100% - 1240px) / 2 + 28px);
  }
}


/* ==========================================================================
   23. CASTALIEN KICHING V2.0 Masterpiece Styles
   - Focus Theme Pills & Preset Chips
   - 4-Fold Hexagram Mirror Matrix Grid
   - 6-Line Position Progress Stepper
   - Sticky Chapter TOC & Report Tables
   - Report Copy Button & Print Enhancements
   ========================================================================== */

/* Theme Selector Group & Step-by-Step Guided Flow */
.theme-selector-group {
  margin-bottom: 18px;
}
.theme-step-box {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(229, 193, 88, 0.25);
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 4px;
  margin-bottom: 4px;
  transition: all 0.3s ease;
}
.theme-question-prompt {
  font-family: var(--font-sans);
  font-size: 1.0rem;
  font-weight: 700;
  color: #FDE68A;
  margin: 0 0 10px 0;
  letter-spacing: 0.2px;
}
.step2-input-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  animation: fadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.step2-guide-label {
  margin-bottom: 2px;
  text-align: center;
}
.yao-step-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
}
.yao-step-box .theme-question-prompt {
  margin: 0;
}
.yao-mode-tabs {
  margin-bottom: 0;
  min-width: 190px;
}
.yao-mode-tabs .tab-btn {
  font-size: 1.05rem;
  font-weight: 700;
  padding: 8px 18px;
}
.theme-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #F59E0B;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.theme-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.theme-pill {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(229, 193, 88, 0.3);
  color: #cbd5e1;
  padding: 6px 11px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-pill:hover {
  background: rgba(229, 193, 88, 0.15);
  border-color: #E5C158;
  color: #fff;
  transform: translateY(-1px);
}
.theme-pill.active {
  background: linear-gradient(135deg, rgba(229, 193, 88, 0.35), rgba(245, 158, 11, 0.25));
  border-color: #F59E0B;
  color: #FEF3C7;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

/* Preset Chips Section */
.preset-chips-section {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(229, 193, 88, 0.25);
  border-radius: 12px;
}
.preset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.preset-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #FDE68A;
}
.preset-hint {
  font-size: 0.76rem;
  color: #94A3B8;
}
.preset-chips-container {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.preset-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  color: #E2E8F0;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.preset-chip:hover {
  background: rgba(229, 193, 88, 0.12);
  border-color: rgba(229, 193, 88, 0.4);
  transform: translateX(3px);
  color: #fff;
}
.preset-chip.active {
  background: rgba(229, 193, 88, 0.2);
  border-color: #E5C158;
  color: #FEF3C7;
}
.chip-badge {
  flex-shrink: 0;
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #FCD34D;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
}

/* Sub Concern Input */
.sub-concern-row {
  margin-top: 10px;
}
.sub-concern-input {
  width: 100%;
  background: #F8FAFC !important;
  border: 1.5px solid rgba(229, 193, 88, 0.4) !important;
  border-radius: 8px;
  padding: 11px 16px;
  color: #1E293B !important;
  font-size: 0.9rem;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}
.sub-concern-input::placeholder {
  color: #64748B !important;
  font-size: 0.86rem;
}
.sub-concern-input:focus {
  outline: none;
  border-color: #D97706 !important;
  background: #FFFFFF !important;
  box-shadow: 0 0 0 3px rgba(229, 193, 88, 0.25), 0 3px 12px rgba(0, 0, 0, 0.2) !important;
}

/* 4-Fold Hexagram Matrix Dashboard */
.hex-matrix-container {
  margin: 24px 0 16px 0;
  padding: 18px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(229, 193, 88, 0.28);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.matrix-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(229, 193, 88, 0.18);
  color: #FDE68A;
  font-size: 1.05rem;
  font-weight: 700;
}
.matrix-subtitle {
  font-size: 0.78rem;
  color: #94A3B8;
  font-weight: 400;
}
.hex-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.hex-matrix-card {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: all 0.25s ease;
}
.hex-matrix-card:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(229, 193, 88, 0.4);
  transform: translateY(-2px);
}
.hex-matrix-card.primary {
  border-left: 3px solid #E5C158;
}
.hex-matrix-card.nuclear {
  border-left: 3px solid #38BDF8;
}
.hex-matrix-card.transformed {
  border-left: 3px solid #10B981;
}
.hex-matrix-card.mirror {
  border-left: 3px solid #EC4899;
}
.matrix-role-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.hex-matrix-card.primary .matrix-role-badge { background: rgba(229, 193, 88, 0.2); color: #FCD34D; }
.hex-matrix-card.nuclear .matrix-role-badge { background: rgba(56, 189, 248, 0.2); color: #7DD3FC; }
.hex-matrix-card.transformed .matrix-role-badge { background: rgba(16, 185, 129, 0.2); color: #6EE7B7; }
.hex-matrix-card.mirror .matrix-role-badge { background: rgba(236, 72, 153, 0.2); color: #F472B6; }
.matrix-card-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.matrix-symbol {
  font-size: 1.4rem;
  line-height: 1;
}
.matrix-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
}
.matrix-hanja {
  font-size: 0.86rem;
  color: #94A3B8;
}
.matrix-nature {
  font-size: 0.78rem;
  color: #cbd5e1;
}
.matrix-desc {
  font-size: 0.8rem;
  color: #94A3B8;
  line-height: 1.5;
  margin-top: 4px;
}

/* 6-Line Position Progress Stepper */
.line-position-timeline-box {
  margin: 16px 0 20px 0;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
.line-position-stepper {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 10px;
}
@media (max-width: 640px) {
  .line-position-stepper {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}
.stepper-step {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
  transition: all 0.2s ease;
}
.stepper-step.is-moving {
  background: rgba(245, 158, 11, 0.15);
  border-color: #F59E0B;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}
.stepper-step.is-central {
  border-top: 2px solid #E5C158;
}
.step-pos {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94A3B8;
  display: block;
}
.stepper-step.is-moving .step-pos {
  color: #FCD34D;
}
.step-archetype {
  font-size: 0.75rem;
  color: #e2e8f0;
  margin-top: 2px;
  display: block;
}
.step-status {
  font-size: 0.68rem;
  color: #64748B;
  margin-top: 4px;
  display: block;
}
.stepper-step.is-moving .step-status {
  color: #38BDF8;
  font-weight: 700;
}

/* Sticky Chapter TOC */
.report-toc-box {
  margin: 18px 0 24px 0;
  padding: 16px 18px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
}
.report-toc-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FDE68A;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}
.toc-link {
  display: block;
  padding: 6px 10px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
}
.toc-link:hover {
  background: rgba(229, 193, 88, 0.15);
  border-color: #E5C158;
  color: #FEF3C7;
  transform: translateX(2px);
}

/* Report Tables Styling */
.report-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 18px 0;
  border-radius: 10px;
  border: 1px solid rgba(229, 193, 88, 0.25);
  background: rgba(15, 23, 42, 0.5);
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}
.report-table th {
  background: rgba(229, 193, 88, 0.15);
  color: #FDE68A;
  padding: 10px 14px;
  font-weight: 700;
  border-bottom: 1px solid rgba(229, 193, 88, 0.3);
  white-space: nowrap;
}
.report-table td {
  padding: 10px 14px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  line-height: 1.6;
}
.report-table tr:last-child td {
  border-bottom: none;
}
.report-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Copy Report Button */
.copy-report-btn {
  background: rgba(56, 189, 248, 0.18) !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  color: #7DD3FC !important;
  padding: 7px 14px !important;
  font-size: 0.86rem !important;
  border-radius: 8px !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.copy-report-btn:hover {
  background: rgba(56, 189, 248, 0.3) !important;
  border-color: #38BDF8 !important;
  color: #fff !important;
  transform: translateY(-1px);
}

/* Publication Print Enhancements */
@media print {
  body {
    background: #fff !important;
    color: #1e293b !important;
  }
  .hex-matrix-container, .line-position-timeline-box {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    page-break-inside: avoid;
  }
  .hex-matrix-card {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
  }
  .matrix-name {
    color: #0f172a !important;
  }
  .report-table-wrap {
    border: 1px solid #cbd5e1 !important;
    background: #fff !important;
  }
  .report-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-bottom: 1px solid #cbd5e1 !important;
  }
  .report-table td {
    color: #334155 !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }
}


/* Collapsible Groups for Theme & Presets: 차분한 기본 톤 -> 마우스 오버 시 밝고 기품 있게 전환 */
.collapsible-group {
  margin-bottom: 10px;
  background: rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.collapsible-group:hover {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(229, 193, 88, 0.45);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}
.collapse-toggle-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  background: transparent;
  border: none;
  color: #8E9CAE;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: color 0.25s ease, background 0.25s ease;
}
.collapsible-group:hover .collapse-toggle-btn {
  color: #FDE68A;
}
.collapse-toggle-btn:hover {
  background: rgba(229, 193, 88, 0.06);
}
.toggle-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.selected-theme-badge {
  font-size: 0.72rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94A3B8;
  padding: 2px 7px;
  border-radius: 4px;
  transition: all 0.25s ease;
}
.collapsible-group:hover .selected-theme-badge {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.45);
  color: #FCD34D;
  font-weight: 600;
}
.preset-hint-badge {
  font-size: 0.72rem;
  font-weight: 400;
  color: #64748B;
  transition: color 0.25s ease;
}
.collapsible-group:hover .preset-hint-badge {
  color: #94A3B8;
}
.toggle-icon {
  font-size: 0.86rem;
  color: #64748B;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.25s ease;
}
.collapsible-group:hover .toggle-icon {
  color: #E5C158;
  background: rgba(229, 193, 88, 0.12);
  border-color: rgba(229, 193, 88, 0.35);
}
.collapse-content {
  padding: 12px 14px 14px 14px;
  border-top: 1px dashed rgba(229, 193, 88, 0.18);
  display: block;
}
.collapse-content.collapsed {
  display: none !important;
}

/* Step 3 AI Report Card & Clean Compact Layout (이중 삼중 박스 테두리 및 과도한 여백 제거) */
#step3AiCard {
  padding: 24px 28px;
}
#step3AiCard .result-header {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(229, 193, 88, 0.25);
}
#step3AiCard .result-title {
  text-align: center;
  font-size: 1.48rem;
  letter-spacing: 0.04em;
  color: #FDE68A;
  margin: 0;
  width: 100%;
}
#step3AiCard #aiInitialReportBox,
#step3AiCard .ai-report-container,
#step3AiCard .section-box.ai-reading-box {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}
#step3AiCard #aiInitialReportContent {
  padding: 0;
  margin: 0;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}
#step3AiCard .report-toc-box {
  margin: 14px 0 22px 0;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(229, 193, 88, 0.22);
}
#step3AiCard .report-toc-title {
  font-size: 1.05rem;
  color: #FDE68A;
  font-weight: 700;
  margin-bottom: 10px;
}
#step3AiCard .hex-matrix-container {
  margin: 18px 0 18px 0;
  padding: 16px 18px;
}

/* Mobile Optimization for Oracle Containers & Report Body (Eliminate excessive side margins & nested padding) */
@media (max-width: 768px) {
  .main-content {
    padding: 0 10px !important;
    margin-top: 76px;
    margin-bottom: 44px;
    gap: 20px;
  }
  .glass-card,
  #inputCard,
  #resultCard,
  #interpretationCard,
  #step3AiCard {
    padding: 18px 14px !important;
    border-radius: 14px !important;
    overflow-x: hidden;
  }
  .result-header,
  #step3AiCard .result-header {
    margin-bottom: 12px !important;
    padding-bottom: 10px !important;
  }
  .result-title,
  #step3AiCard .result-title {
    font-size: 1.24rem !important;
    line-height: 1.38 !important;
  }
  .result-hanja {
    font-size: 1.02rem !important;
  }
  .hexagram-flow {
    max-width: 100% !important;
    padding: 6px 10px !important;
    font-size: 0.85rem !important;
    gap: 6px !important;
  }
  .trigram-info-box {
    padding: 10px 12px !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
  }
  .section-box {
    padding: 14px 12px !important;
    margin-bottom: 12px !important;
    border-radius: 12px !important;
  }
  .question-recap {
    padding: 10px 12px !important;
    margin-bottom: 14px !important;
    font-size: 0.9rem !important;
  }
  .hex-matrix-container,
  #step3AiCard .hex-matrix-container {
    padding: 12px 10px !important;
    margin: 14px 0 12px 0 !important;
    border-radius: 12px !important;
  }
  .hex-matrix-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .hex-matrix-card {
    padding: 12px 12px !important;
  }
  .line-position-timeline-box {
    padding: 12px 10px !important;
    margin: 12px 0 14px 0 !important;
    border-radius: 12px !important;
  }
  .report-toc-box,
  #step3AiCard .report-toc-box {
    padding: 12px 12px !important;
    margin: 10px 0 16px 0 !important;
    border-radius: 10px !important;
  }
  .report-toc-title,
  #step3AiCard .report-toc-title {
    font-size: 0.9rem !important;
    margin-bottom: 8px !important;
  }
  .report-toc-grid {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  .toc-link {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    font-size: 0.84rem !important;
    padding: 6px 10px !important;
    line-height: 1.42 !important;
    word-break: keep-all;
    overflow-wrap: break-word;
  }
  #step3AiCard #aiInitialReportContent {
    font-size: 0.95rem !important;
    line-height: 1.76 !important;
    word-break: keep-all;
    overflow-wrap: break-word;
  }
  #step3AiCard #aiInitialReportContent h2.report-chapter-h2 {
    font-size: 1.14rem !important;
    margin: 22px 0 10px 0 !important;
    padding-left: 9px !important;
    border-left-width: 3px !important;
    line-height: 1.4 !important;
  }
  #step3AiCard #aiInitialReportContent h3 {
    font-size: 1.02rem !important;
    margin: 16px 0 8px 0 !important;
    line-height: 1.42 !important;
  }
  #step3AiCard #aiInitialReportContent h4 {
    font-size: 0.95rem !important;
    margin: 12px 0 6px 0 !important;
  }
  #step3AiCard #aiInitialReportContent p {
    font-size: 0.95rem !important;
    line-height: 1.76 !important;
    margin-bottom: 11px !important;
  }
  #step3AiCard #aiInitialReportContent ul,
  #step3AiCard #aiInitialReportContent ol {
    margin: 8px 0 12px 1.1rem !important;
    padding-left: 0 !important;
    line-height: 1.72 !important;
  }
  #step3AiCard #aiInitialReportContent blockquote {
    padding: 10px 12px !important;
    margin: 12px 0 !important;
    font-size: 0.92rem !important;
    line-height: 1.65 !important;
  }
  .report-table-wrap {
    margin: 12px 0 16px 0 !important;
    -webkit-overflow-scrolling: touch;
  }
  .report-table {
    font-size: 0.82rem !important;
  }
  .report-table th,
  .report-table td {
    padding: 8px 8px !important;
    word-break: keep-all;
  }
  .ai-report-bottom-tools {
    margin-top: 22px !important;
    padding-top: 16px !important;
    gap: 10px !important;
  }
  .step4-chat-history {
    padding: 10px 8px !important;
  }
  .chat-bubble {
    max-width: 92% !important;
    padding: 10px 12px !important;
    font-size: 0.9rem !important;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 0 6px !important;
    margin-top: 68px;
  }
  .glass-card,
  #inputCard,
  #resultCard,
  #interpretationCard,
  #step3AiCard {
    padding: 15px 10px !important;
    border-radius: 12px !important;
  }
  .section-box {
    padding: 12px 10px !important;
  }
  .hex-matrix-container,
  #step3AiCard .hex-matrix-container,
  .line-position-timeline-box {
    padding: 10px 8px !important;
  }
  .report-toc-box,
  #step3AiCard .report-toc-box {
    padding: 10px 10px !important;
  }
  #step3AiCard #aiInitialReportContent ul,
  #step3AiCard #aiInitialReportContent ol {
    margin-left: 0.95rem !important;
  }
}

/* ==========================================================================
   64괘 전용 테마 음악 플레이어 바 (24s Clip & 90s Full Version)
   ========================================================================== */
.hex-audio-player-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 10px 0 16px 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 27, 75, 0.72));
  border: 1px solid rgba(229, 193, 88, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.hex-audio-player-bar.full-mode {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.9), rgba(49, 46, 129, 0.75));
  border-color: rgba(167, 139, 250, 0.45);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hex-audio-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(229, 193, 88, 0.4);
  background: rgba(255, 255, 255, 0.07);
  color: #fde68a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0;
}

.hex-audio-btn:hover {
  background: rgba(229, 193, 88, 0.2);
  transform: scale(1.06);
}

.hex-audio-btn.loop-btn {
  opacity: 0.55;
}

.hex-audio-btn.loop-btn.active {
  opacity: 1;
  border-color: rgba(52, 211, 153, 0.65);
  background: rgba(16, 185, 129, 0.18);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.28);
}

.hex-audio-equalizer {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 18px;
  width: 18px;
  flex-shrink: 0;
}

.hex-audio-equalizer span {
  display: block;
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  transition: height 0.2s ease;
}

.hex-audio-player-bar.full-mode .hex-audio-equalizer span {
  background: linear-gradient(180deg, #c4b5fd, #f59e0b);
}

.hex-audio-equalizer.playing span:nth-child(1) { animation: hexEqBounce 0.7s ease-in-out infinite 0.0s; }
.hex-audio-equalizer.playing span:nth-child(2) { animation: hexEqBounce 0.7s ease-in-out infinite 0.18s; }
.hex-audio-equalizer.playing span:nth-child(3) { animation: hexEqBounce 0.7s ease-in-out infinite 0.35s; }
.hex-audio-equalizer.playing span:nth-child(4) { animation: hexEqBounce 0.7s ease-in-out infinite 0.12s; }

@keyframes hexEqBounce {
  0%, 100% { height: 4px; }
  50% { height: 17px; }
}

.hex-audio-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hex-audio-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.hex-audio-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  white-space: nowrap;
  flex-shrink: 0;
}

.hex-audio-badge.full {
  background: rgba(139, 92, 246, 0.22);
  border-color: rgba(167, 139, 250, 0.55);
  color: #ddd6fe;
}

.hex-audio-track-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hex-audio-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hex-audio-slider {
  flex: 1;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.hex-audio-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fde68a;
  box-shadow: 0 0 6px rgba(253, 230, 138, 0.85);
  cursor: pointer;
}

.hex-audio-time {
  font-size: 0.73rem;
  font-family: monospace;
  color: #cbd5e1;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .hex-audio-player-bar {
    padding: 8px 10px;
    gap: 7px;
  }
  .hex-audio-btn {
    width: 30px;
    height: 30px;
    font-size: 0.82rem;
  }
  .hex-audio-track-name {
    font-size: 0.78rem;
  }
}

/* Print Cleanups: 불필요한 모바일 네비게이션 및 도구 버튼 인쇄 완전 차단 */
@media print {
  #mobile-bottom-nav,
  .mobile-bottom-nav,
  .nav-dropdown,
  #network-dropdown-menu,
  .ai-report-bottom-tools,
  .hex-audio-player-bar,
  .card-outer-footer-left,
  .auth-modal-overlay,
  .auth-modal-content,
  .top-bar,
  .hero-header {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
  }
}

/* ==========================================================================
   역점 해설서 4종 입체괘상 심층 도해 (목차 제거 후 2페이지 풀 레이아웃 확장)
   ========================================================================== */
.report-toc-box {
  display: none !important;
}

.report-quad-showcase {
  margin: 12px 0 24px 0;
  padding: 20px 22px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(229, 193, 88, 0.35);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.report-quad-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(229, 193, 88, 0.25);
}

.report-quad-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: 0.02em;
}

.report-quad-sub {
  font-size: 0.82rem;
  color: #94a3b8;
}

.report-quad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .report-quad-showcase {
    padding: 14px 12px;
    margin: 10px 0 18px 0;
  }
  .report-quad-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.report-quad-card {
  background: rgba(30, 41, 59, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-quad-card.primary     { border-left: 4px solid #E5C158; }
.report-quad-card.nuclear     { border-left: 4px solid #38BDF8; }
.report-quad-card.transformed { border-left: 4px solid #10B981; }
.report-quad-card.mirror      { border-left: 4px solid #EC4899; }

.quad-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.quad-role-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
}

.report-quad-card.primary     .quad-role-badge { background: rgba(229, 193, 88, 0.22); color: #FCD34D; }
.report-quad-card.nuclear     .quad-role-badge { background: rgba(56, 189, 248, 0.22); color: #7DD3FC; }
.report-quad-card.transformed .quad-role-badge { background: rgba(16, 185, 129, 0.22); color: #6EE7B7; }
.report-quad-card.mirror      .quad-role-badge { background: rgba(236, 72, 153, 0.22); color: #F472B6; }

.quad-trigram-meta {
  font-size: 0.76rem;
  color: #cbd5e1;
  font-weight: 500;
}

.quad-card-main {
  display: flex;
  align-items: stretch;
  gap: 14px;
}

.quad-hex-lines {
  width: 98px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(229, 193, 88, 0.2);
  border-radius: 8px;
}

.quad-line-row {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 12px;
}

.quad-line-pos {
  font-size: 0.65rem;
  color: #94a3b8;
  width: 24px;
  flex-shrink: 0;
  text-align: right;
}

.quad-line-row.is-moving .quad-line-pos {
  color: #fcd34d;
  font-weight: 700;
}

.quad-line-bar {
  flex: 1;
  height: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.quad-line-bar.yang span {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.45);
}

.quad-line-bar.yin span {
  display: block;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #38bdf8, #60a5fa);
  box-shadow: 0 0 5px rgba(56, 189, 248, 0.35);
}

.quad-line-bar.moving span {
  background: linear-gradient(90deg, #ef4444, #f97316) !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.75) !important;
}

.quad-line-mark {
  width: 12px;
  font-size: 0.68rem;
  text-align: center;
  color: #fcd34d;
  flex-shrink: 0;
}

.quad-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.quad-title-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.quad-symbol {
  font-size: 1.45rem;
  color: #fde68a;
  line-height: 1;
}

.quad-name {
  font-size: 1.02rem;
  font-weight: 800;
  color: #f8fafc;
}

.quad-hanja {
  font-size: 0.84rem;
  color: #94a3b8;
}

.quad-judgment {
  font-size: 0.81rem;
  line-height: 1.48;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.45);
  padding: 6px 9px;
  border-radius: 6px;
  border-left: 2.5px solid rgba(229, 193, 88, 0.5);
}

.quad-insight {
  font-size: 0.8rem;
  line-height: 1.48;
  color: #cbd5e1;
}

/* ==========================================================================
   6효 효위론(爻位論 · 초효~상효) 시중(時中) 입체 진단표 (.report-yao-matrix-box)
   ========================================================================== */
.report-yao-matrix-box {
  margin: 0 0 26px 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.32);
}

.report-yao-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
}

.report-yao-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: #bae6fd;
  letter-spacing: 0.02em;
}

.report-yao-rule {
  font-size: 0.78rem;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.report-yao-table-wrap {
  width: 100%;
  overflow-x: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.55);
}

.report-yao-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.report-yao-table th:nth-child(1),
.report-yao-table td:nth-child(1) { width: 13%; }
.report-yao-table th:nth-child(2),
.report-yao-table td:nth-child(2) { width: 15%; }
.report-yao-table th:nth-child(3),
.report-yao-table td:nth-child(3) { width: 21%; }
.report-yao-table th:nth-child(4),
.report-yao-table td:nth-child(4) { width: 15%; text-align: center; }
.report-yao-table th:nth-child(5),
.report-yao-table td:nth-child(5) { width: 36%; }

.report-yao-table th {
  background: rgba(30, 41, 59, 0.9);
  color: #fde68a;
  padding: 8px 9px;
  font-weight: 700;
  border-bottom: 1px solid rgba(229, 193, 88, 0.3);
  white-space: normal;
  word-break: keep-all;
}

.report-yao-table td {
  padding: 7px 9px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.42;
  vertical-align: middle;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.report-yao-table tr:last-child td {
  border-bottom: none;
}

.report-yao-table tr.is-moving-row td {
  background: rgba(245, 158, 11, 0.12);
}

.report-yao-table tr.is-central-row td.yao-col-name {
  color: #fde68a;
}

.yao-col-name,
.yao-col-stage,
.yao-col-harmony,
.yao-col-status {
  white-space: normal;
  word-break: keep-all;
}

.yao-status-text {
  display: inline;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: normal;
  word-break: keep-all;
}

.yao-status-text.moving {
  color: #fca5a5;
}

.yao-status-text.static {
  color: #cbd5e1;
  font-weight: 500;
}

@media print {
  /* 2페이지 한 페이지에 4종 입체괘상 심층 도해(①~④)가 모두 들어오도록 통합 최적화 */
  .report-quad-showcase {
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    margin: 2px 0 8px 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .report-quad-header {
    border-bottom: 1.5px solid #cbd5e1 !important;
    margin-bottom: 10px !important;
    padding-bottom: 6px !important;
  }

  .report-quad-title {
    color: #0f172a !important;
    font-size: 1.05rem !important;
  }

  .report-quad-sub {
    display: none !important;
  }

  .report-quad-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .report-quad-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    gap: 6px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .report-quad-card.primary     { border-left: 4px solid #b45309 !important; }
  .report-quad-card.nuclear     { border-left: 4px solid #0284c7 !important; }
  .report-quad-card.transformed { border-left: 4px solid #059669 !important; }
  .report-quad-card.mirror      { border-left: 4px solid #db2777 !important; }

  .quad-card-top {
    border-bottom: 1px dashed #cbd5e1 !important;
    padding-bottom: 4px !important;
    gap: 4px !important;
  }

  .report-quad-card.primary     .quad-role-badge { background: #fef3c7 !important; color: #92400e !important; font-size: 0.72rem !important; padding: 2px 7px !important; }
  .report-quad-card.nuclear     .quad-role-badge { background: #e0f2fe !important; color: #075985 !important; font-size: 0.72rem !important; padding: 2px 7px !important; }
  .report-quad-card.transformed .quad-role-badge { background: #d1fae5 !important; color: #065f46 !important; font-size: 0.72rem !important; padding: 2px 7px !important; }
  .report-quad-card.mirror      .quad-role-badge { background: #fce7f3 !important; color: #9d174d !important; font-size: 0.72rem !important; padding: 2px 7px !important; }

  .quad-trigram-meta {
    color: #475569 !important;
    font-size: 0.69rem !important;
  }

  .quad-card-main {
    gap: 9px !important;
    align-items: center !important;
  }

  .quad-hex-lines {
    width: 74px !important;
    box-sizing: border-box !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    padding: 5px 5px !important;
    gap: 3px !important;
  }

  .quad-line-row {
    height: 10px !important;
    gap: 3px !important;
  }

  .quad-line-pos {
    color: #475569 !important;
    font-size: 0.58rem !important;
    width: 20px !important;
  }

  .quad-line-row.is-moving .quad-line-pos {
    color: #b91c1c !important;
  }

  .quad-line-mark {
    width: 8px !important;
    font-size: 0.58rem !important;
  }

  .quad-line-bar.yang span {
    background: #b45309 !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .quad-line-bar.yin span {
    background: #0284c7 !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .quad-line-bar.moving span {
    background: #dc2626 !important;
  }

  .quad-title-line {
    gap: 4px !important;
  }

  .quad-symbol {
    color: #0f172a !important;
    font-size: 1.12rem !important;
  }

  .quad-name {
    color: #0f172a !important;
    font-size: 0.86rem !important;
  }

  .quad-hanja {
    color: #475569 !important;
    font-size: 0.72rem !important;
  }

  .quad-judgment {
    background: #f8fafc !important;
    color: #1e293b !important;
    border-left: 2.5px solid #94a3b8 !important;
    font-size: 0.73rem !important;
    line-height: 1.36 !important;
    padding: 4px 7px !important;
  }

  .quad-insight {
    color: #334155 !important;
    font-size: 0.73rem !important;
    line-height: 1.36 !important;
  }

  /* 1페이지 하단(#printYaoSection): 6효 효위론 시중 진단표 인쇄 최적화 (동정열 배지 제거 및 여유 간격) */
  #printYaoSection {
    margin-bottom: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .report-yao-matrix-box {
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 11px 12px !important;
    margin: 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .report-yao-header {
    border-bottom: 1.5px solid #cbd5e1 !important;
    margin-bottom: 8px !important;
    padding-bottom: 6px !important;
  }

  .report-yao-title {
    color: #0f172a !important;
    font-size: 0.94rem !important;
  }

  .report-yao-rule {
    background: #fef3c7 !important;
    border: 1px solid #f59e0b !important;
    color: #92400e !important;
    font-size: 0.7rem !important;
    padding: 3px 9px !important;
    border-radius: 6px !important;
    line-height: 1.38 !important;
  }

  .report-yao-table-wrap {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    overflow: visible !important;
    overflow-x: visible !important;
    width: 100% !important;
  }

  .report-yao-table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
  }

  .report-yao-table th:nth-child(1),
  .report-yao-table td:nth-child(1) { width: 13% !important; }
  .report-yao-table th:nth-child(2),
  .report-yao-table td:nth-child(2) { width: 15% !important; }
  .report-yao-table th:nth-child(3),
  .report-yao-table td:nth-child(3) { width: 21% !important; }
  .report-yao-table th:nth-child(4),
  .report-yao-table td:nth-child(4) { width: 15% !important; text-align: center !important; }
  .report-yao-table th:nth-child(5),
  .report-yao-table td:nth-child(5) { width: 36% !important; }

  .report-yao-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-bottom: 1.5px solid #cbd5e1 !important;
    padding: 6px 6px !important;
    font-size: 0.72rem !important;
    white-space: normal !important;
    word-break: keep-all !important;
  }

  .report-yao-table td {
    color: #1e293b !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 7px 6px !important;
    font-size: 0.71rem !important;
    line-height: 1.38 !important;
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
  }

  .yao-col-name,
  .yao-col-stage,
  .yao-col-harmony,
  .yao-col-status {
    white-space: normal !important;
    word-break: keep-all !important;
  }

  .report-yao-table tr.is-moving-row td {
    background: #fffbeb !important;
  }

  .report-yao-table tr.is-central-row td.yao-col-name {
    color: #92400e !important;
  }

  .yao-status-text {
    display: inline !important;
    font-size: 0.7rem !important;
    white-space: normal !important;
    word-break: keep-all !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
  }

  .yao-status-text.moving {
    color: #dc2626 !important;
    font-weight: 700 !important;
  }

  .yao-status-text.static {
    color: #475569 !important;
    font-weight: 500 !important;
  }
}



