/* ==========================================================================
   월하명감(月下明鑑) Tab 2 — 문학동네·창비 단행본 정본 에디토리얼 스타일시트 (v11.37)
   - 폰트: 네이버 마루부리(MaruBuri 400/600) + Cormorant Garamond + Pretendard
   - 색감: 프러시안 딥 네이비(#162A45) · 인장 테라코타(#9E3B2E) · 순백(#FFFFFF)
   - 원칙: 손톱 디자인(border-left / border-top 굵은 막대) 0% · 파스텔 상자 0% · 이모지 0%
   ========================================================================== */

/* 1. 첫 화면 『삼초 맞춤 정본 선별기 (선택 과부하 해소)』 */
.w3s-finder-sec {
  padding: 14px 16px 8px;
  background: var(--app-bg, #FFFFFF);
}
.w3s-finder-card {
  margin: 0;
  padding: 20px 18px;
  border-radius: 10px;
  background: linear-gradient(165deg, #0E1B2E 0%, #162A45 65%, #1B3354 100%);
  border: 1px solid #263E61;
  color: #F8FAFC;
  box-shadow: 0 8px 24px rgba(14, 27, 46, 0.12);
}
.w3s-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 11px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  flex-wrap: wrap;
}
.w3s-kicker {
  display: inline-block;
  font-family: 'Pretendard', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #D6B982;
  text-transform: uppercase;
}
.w3s-codex-pill {
  border: 1px solid rgba(214, 185, 130, 0.38);
  background: rgba(255, 255, 255, 0.05);
  color: #E6CFA0;
  border-radius: 5px;
  padding: 5px 10px;
  font-family: 'Pretendard', sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.15s ease;
}
.w3s-codex-pill:hover {
  background: rgba(255, 255, 255, 0.12);
}
.w3s-title {
  font-family: 'MaruBuri', 'Noto Serif KR', serif;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.48;
  color: #FFFFFF;
  margin: 0 0 6px;
  letter-spacing: -0.025em;
  word-break: keep-all;
}
.w3s-sub {
  font-family: 'Pretendard', sans-serif;
  font-size: 12.4px;
  font-weight: 400;
  color: rgba(226, 232, 240, 0.8);
  margin-bottom: 13px;
  line-height: 1.52;
  word-break: keep-all;
}
.w3s-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.w3s-chip {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #F1F5F9;
  border-radius: 6px;
  padding: 8px 12px;
  font-family: 'Pretendard', sans-serif;
  font-size: 12.6px;
  font-weight: 500;
  letter-spacing: -0.015em;
  cursor: pointer;
  transition: all 0.15s ease;
}
.w3s-chip:hover,
.w3s-chip.active {
  background: #FFFFFF;
  border-color: #FFFFFF;
  color: #111D2E;
  font-weight: 600;
}
.w3s-rec-box {
  margin-top: 12px;
  padding: 16px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid #DFE5EE;
  color: #111D2E;
}
.w3s-rec-cta {
  width: 100%;
  margin-top: 12px;
  border: none;
  border-radius: 6px;
  padding: 12px 14px;
  background: #162A45;
  color: #FFFFFF;
  font-family: 'MaruBuri', 'Pretendard', serif;
  font-size: 13.8px;
  font-weight: 600;
  letter-spacing: -0.015em;
  cursor: pointer;
  transition: background 0.15s ease;
}
.w3s-rec-cta:hover {
  background: #0F1E33;
}

/* 2. 웹리더 상단 『삼행 요지 (3줄 핵심 결론 노트)』 — 누런 배경 0% · 순백 단행본 레저 */
.t2-3line-card {
  margin: 14px 0 18px;
  padding: 18px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid #DFE5EE;
  box-shadow: 0 2px 10px rgba(15, 29, 48, 0.03);
}
.t2-3line-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 11px;
  margin-bottom: 12px;
  border-bottom: 1px solid #162A45;
  flex-wrap: wrap;
}
.t2-3line-eyebrow {
  font-family: 'Pretendard', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #9E3B2E;
}
.t2-kw-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.t2-kw-pill {
  font-family: 'Pretendard', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #162A45;
  background: #F4F6FA;
  border: 1px solid #D8E0EB;
  padding: 2px 8px;
  border-radius: 4px;
}
.t2-3line-list {
  display: flex;
  flex-direction: column;
}
.t2-3line-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #EAEEF4;
  font-family: 'Pretendard', sans-serif;
  font-size: 13.6px;
  line-height: 1.66;
  color: #222E3E;
  word-break: keep-all;
}
.t2-3line-item:first-child {
  padding-top: 2px;
}
.t2-3line-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.t2-3line-tag {
  flex-shrink: 0;
  margin-top: 3px;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10.8px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: #FFFFFF;
  border: 1px solid #162A45;
  color: #162A45;
}
.t2-3line-tag.act {
  border-color: #9E3B2E;
  color: #9E3B2E;
  background: #FFFFFF;
}

/* 3. 만세력 역산 『기왕력 변곡점 대조 카드』 */
.t2-past-card {
  margin: 14px 0 18px;
  padding: 20px 18px;
  border-radius: 10px;
  background: linear-gradient(165deg, #0E1B2E 0%, #162A45 100%);
  color: #F8FAFC;
  border: 1px solid #263E61;
}
.t2-past-item {
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  margin-top: 10px;
}
.t2-past-yr {
  display: inline-block;
  font-family: 'Cormorant Garamond', 'Pretendard', serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #E6CFA0;
  border: 1px solid rgba(214, 185, 130, 0.42);
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
}
.t2-past-hook {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(214, 185, 130, 0.32);
  font-family: 'MaruBuri', 'Noto Serif KR', serif;
  font-size: 12.8px;
  font-weight: 400;
  color: #E6CFA0;
  line-height: 1.62;
  word-break: keep-all;
}

/* 4. 사주 × 78장 타로 × 고전 원전 『삼중 교차검증 보드』 */
.t2-triple-box {
  margin: 14px 0 18px;
  padding: 18px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid #DFE5EE;
  color: #111D2E;
  box-shadow: 0 2px 10px rgba(15, 29, 48, 0.03);
}
.t2-triple-dots {
  font-family: 'Pretendard', sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #162A45;
  background: #F4F6FA;
  border: 1px solid #CFD8E3;
  padding: 3px 9px;
  border-radius: 4px;
  font-weight: 600;
}
.t2-triple-axis {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #EAEEF4;
  font-size: 12.8px;
  line-height: 1.6;
  color: #2C3747;
}

/* 5. 리더 내 소장 · 공유 · 캘린더 · 도감 · 차액승급 허브 */
.t2-action-hub {
  margin: 20px 0;
  padding: 20px 18px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid #DFE5EE;
  box-shadow: 0 2px 12px rgba(15, 29, 48, 0.03);
}
.t2-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 9px;
  margin-top: 14px;
}
.t2-hub-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 13px 14px;
  border-radius: 7px;
  border: 1px solid #D8E0EB;
  background: #FAFBFD;
  color: #111D2E;
  text-align: left;
  cursor: pointer;
  font-family: 'Pretendard', sans-serif;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.t2-hub-btn:hover {
  background: #FFFFFF;
  border-color: #162A45;
}
.t2-hub-idx {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #9E3B2E;
}
.t2-hub-btn strong {
  font-family: 'MaruBuri', 'Noto Serif KR', serif;
  font-size: 13.4px;
  font-weight: 600;
  color: #111D2E;
  letter-spacing: -0.02em;
}
.t2-hub-btn span {
  font-size: 11.6px;
  color: #526071;
  line-height: 1.48;
  word-break: keep-all;
}
.t2-upgrade-banner {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 8px;
  background: linear-gradient(160deg, #0E1B2E 0%, #162A45 100%);
  border: 1px solid #263E61;
  color: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.t2-upgrade-cta {
  border: 1px solid #D6B982;
  border-radius: 6px;
  padding: 10px 15px;
  background: #FFFFFF;
  color: #111D2E;
  font-family: 'Pretendard', sans-serif;
  font-size: 12.8px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* 6. 공용 모달 (9:16 스토리 명패 / 60일주 도감 / 궁합 초대장) */
.t2-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 17, 30, 0.72);
  backdrop-filter: blur(4px);
  z-index: 950;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.t2-modal-backdrop.open {
  display: flex;
}
.t2-modal-box {
  width: 100%;
  max-width: 456px;
  max-height: 88vh;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid #DFE5EE;
  border-radius: 12px;
  padding: 22px 20px;
  color: #111D2E;
  box-shadow: 0 24px 54px rgba(10, 17, 30, 0.36);
}
.t2-codex-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.t2-codex-cell {
  border-radius: 7px;
  padding: 9px 6px;
  text-align: center;
  border: 1px solid #E2E7EF;
  background: #FAFBFD;
}
.t2-codex-cell.unlocked {
  background: #162A45;
  border-color: #263E61;
  color: #FFFFFF;
}
.t2-codex-cell img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin: 0 auto 6px;
  border: 1px solid rgba(214, 185, 130, 0.35);
}
.t2-codex-cell.locked img {
  filter: grayscale(1) opacity(0.28);
  border-color: #DFE5EE;
}

/* 78장 타로 풀덱 스크롤 팬 */
.tarot-deck-grid.t2-deck-78 {
  grid-template-columns: repeat(8, 1fr) !important;
  max-height: 215px;
  overflow-y: auto;
  gap: 5px !important;
  padding: 10px !important;
}

/* ==========================================================================
   Stage 2 — 출생 지역 세그먼트 칩 & 내 명식 슬림 바
   ========================================================================== */
.cf-saved-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cf-saved-lbl {
  font-size: 11px;
  font-weight: 600;
  color: rgba(236, 211, 154, 0.78);
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.cf-saved-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.cf-saved-scroll::-webkit-scrollbar {
  display: none;
}
.cf-saved-pill {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.82);
  border-radius: 5px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 11.8px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cf-saved-pill small {
  font-size: 10.5px;
  opacity: 0.68;
  margin-left: 2px;
}
.cf-saved-pill.on {
  border-color: rgba(214, 185, 130, 0.85);
  background: rgba(214, 185, 130, 0.16);
  color: #FFF8E8;
  font-weight: 600;
}

.cf-region-meta {
  font-size: 11px;
  font-weight: 500;
  color: rgba(236, 211, 154, 0.85);
  background: rgba(236, 211, 154, 0.08);
  border: 1px solid rgba(236, 211, 154, 0.24);
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: -0.01em;
}
.cf-region-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
}
.cf-region-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.74);
  border-radius: 6px;
  padding: 9px 4px;
  font-family: inherit;
  font-size: 12.2px;
  font-weight: 500;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  transition: all 0.16s ease;
}
.cf-region-btn:hover {
  border-color: rgba(236, 211, 154, 0.45);
  color: #FFFFFF;
}
.cf-region-btn.on {
  border: 1px solid rgba(236, 211, 154, 0.88);
  background: rgba(236, 211, 154, 0.18);
  color: #FFF8E8;
  font-weight: 600;
}
@media (max-width: 360px) {
  .cf-region-btn { font-size: 11.4px; padding: 8px 2px; }
}
