/* ==========================================================================
   월하명감(月下明鑑) Tab 2 — 문학동네·창비 단행본 정본 에디토리얼 스타일시트 (v11.37)
   - 폰트: 네이버 마루부리(MaruBuri 400/600) + Cormorant Garamond + Pretendard
   - 색감: 프러시안 딥 네이비(#18181B) · 인장 테라코타(#9E3B2E) · 순백(#FFFFFF)
   - 원칙: 손톱 디자인(border-left / border-top 굵은 막대) 0% · 파스텔 상자 0% · 이모지 0%
   ========================================================================== */

/* 1. 첫 화면 『한지 백자 원형 명사 메달리온 큐레이션 (v12.01)』 */
.w3s-finder-sec {
  padding: 22px 16px 24px;
  background: #FFFFFF;
  border-bottom: 6px solid #F3EFE8;
  margin: 0;
}
.w3s-finder-card {
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  color: #1F1B16;
  box-shadow: none;
}
.worry-guide-sec {
  display: none !important;
}
.w3s-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.w3s-title {
  font-family: 'GyeonggiBatang', 'Noto Serif KR', serif;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
  color: #1F1B16;
  margin: 0;
  letter-spacing: -0.035em;
  word-spacing: -0.02em;
  word-break: keep-all;
}
.w3s-codex-link,
.w3s-back-link {
  border: 1px solid #ECE8E0;
  background: #FAF9F6;
  color: #3F3A34;
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.w3s-codex-link:hover,
.w3s-back-link:hover {
  background: #F2EFE9;
  border-color: #DCD6CA;
  color: #111827;
}
.w3s-sub {
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #6B7280;
  margin: 5px 0 15px;
  line-height: 1.45;
  letter-spacing: -0.025em;
  word-break: keep-all;
}

/* 1단계: 한지 백자 원형 명사 메달리온 허브 (2열 x 3행) */
.w3s-medallion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.w3s-medallion-card {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #ECE8E0;
  border-radius: 16px;
  background: #FAF9F6;
  padding: 15px 10px 13px;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 9px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(32, 28, 22, 0.035);
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.w3s-medallion-card:hover {
  transform: translateY(-2px);
  background: #F5F2EB;
  border-color: #DDD5C7;
  box-shadow: 0 6px 16px rgba(32, 28, 22, 0.07);
}
.w3s-medallion-card:hover .w3s-medallion-ring img {
  transform: scale(1.2);
}
.w3s-medallion-ring {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 3px 10px rgba(32, 28, 22, 0.08), inset 0 0 0 1px rgba(17, 24, 39, 0.04);
  flex-shrink: 0;
}
.w3s-medallion-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 8%;
  transform: scale(1.15);
  transform-origin: center 14%;
  display: block;
  transition: transform 0.24s ease;
}
.w3s-medallion-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  width: 100%;
}
.w3s-medallion-label {
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
  font-size: 14.5px;
  font-weight: 800;
  color: #1A1917;
  letter-spacing: -0.03em;
  line-height: 1.3;
  word-break: keep-all;
}
.w3s-medallion-persona {
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: #7A6F64;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

/* 2단계: 세부 고민 선택 리스트 (잘림 없는 원형 초상 아바타) */
.w3s-sub-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.w3s-sub-card {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #ECE8E0;
  border-radius: 14px;
  background: #FAF9F6;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}
.w3s-sub-card:hover,
.w3s-sub-card:active {
  background: #F4F1EA;
  border-color: #DCD4C6;
}
.w3s-sub-avatar-wrap {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(32, 28, 22, 0.07), inset 0 0 0 1px rgba(17, 24, 39, 0.04);
  flex-shrink: 0;
}
.w3s-sub-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 8%;
  transform: scale(1.15);
  transform-origin: center 14%;
  display: block;
}
.w3s-sub-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.w3s-sub-master {
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
  font-size: 11.4px;
  font-weight: 700;
  color: #9E3B2E;
  letter-spacing: -0.015em;
}
.w3s-sub-txt {
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
  font-size: 13.8px;
  font-weight: 700;
  color: #1A1917;
  letter-spacing: -0.025em;
  line-height: 1.38;
  word-break: keep-all;
}
.w3s-sub-chev {
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #9CA3AF;
  flex-shrink: 0;
}

/* 3단계: 한지 백자 맞춤 도서 처방 카드 */
.w3s-seg-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: #F4F1EA;
  border: 1px solid #ECE8E0;
  border-radius: 10px;
  margin: 12px 0 12px;
}
.w3s-seg-btn {
  border: none;
  background: transparent;
  color: #6B645B;
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding: 7px 6px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}
.w3s-seg-btn.active {
  background: #FFFFFF;
  color: #1A1917;
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(32, 28, 22, 0.08);
}
.w3s-book-rec {
  border: 1px solid #ECE8E0;
  border-radius: 16px;
  background: #FAF9F6;
  padding: 14px;
  box-shadow: 0 2px 10px rgba(32, 28, 22, 0.04);
}
.w3s-book-top {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 12px;
}
.w3s-book-thumb {
  width: 74px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 3px 10px rgba(32, 28, 22, 0.08), inset 0 0 0 1px rgba(17, 24, 39, 0.05);
  flex-shrink: 0;
}
.w3s-book-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 8%;
  transform: scale(1.12);
  transform-origin: center 14%;
  display: block;
}
.w3s-book-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.w3s-rec-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.w3s-rec-persona {
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: #9E3B2E;
  letter-spacing: -0.015em;
}
.w3s-rec-price {
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #3F3A34;
  background: #EFECE5;
  padding: 2px 8px;
  border-radius: 999px;
}
.w3s-rec-title {
  font-family: 'Noto Serif KR', 'MaruBuri', serif;
  font-size: 17.5px;
  font-weight: 800;
  color: #1A1917;
  line-height: 1.32;
  letter-spacing: -0.03em;
  word-break: keep-all;
}
.w3s-book-desc {
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
  font-size: 12.8px;
  font-weight: 500;
  color: #57524B;
  line-height: 1.5;
  letter-spacing: -0.02em;
  word-break: keep-all;
  margin: 0;
}
.w3s-rec-cta {
  width: 100%;
  border: none;
  border-radius: 11px;
  padding: 12px 14px;
  background: #1A1917;
  color: #FFFFFF;
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.w3s-rec-cta:hover {
  background: #000000;
}

/* 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 #18181B;
  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: #18181B;
  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 #18181B;
  color: #18181B;
}
.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, #18181B 0%, #18181B 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: #18181B;
  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: #18181B;
  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: #18181B;
  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: #18181B;
}
.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: #18181B;
  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, #18181B 0%, #18181B 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: #18181B;
  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: #18181B;
  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: #18181B;
  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; }
}
