/* ═══════════════════════════════════════════════════
   인생의 책 (Life Book) — 프리미엄 사주 심층 분석 UI
   CODE-DESTINY v2.0 — 운명의 기록자 에디션
═══════════════════════════════════════════════════ */

/* ── CSS 변수 ─────────────────────────────────── */
:root {
  --lb-void: #050210;
  --lb-deep: #0b0620;
  --lb-dark: #100830;
  --lb-surface: #160c38;
  --lb-border: rgba(180, 140, 255, 0.18);
  --lb-border-bright: rgba(210, 170, 255, 0.45);
  --lb-gold: #f5d78e;
  --lb-gold-dim: rgba(245, 215, 142, 0.65);
  --lb-amethyst: #a78bfa;
  --lb-violet: #7c3aed;
  --lb-lilac: #c4b5fd;
  --lb-white: #f5f0ff;
  --lb-text: rgba(225, 210, 255, 0.88);
  --lb-glow-violet: rgba(124, 58, 237, 0.45);
  --lb-glow-gold: rgba(245, 200, 80, 0.35);
}

/* ── 타일 카드 — 풀블리드 히어로 포스터 ─────────── */
.lifebook-tile {
  position: relative;
  display: block;
  width: 100%;
  border: none;
  border-radius: 22px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: var(--lb-void) url('/fuctionassets/lifebook.webp') center 20% / cover no-repeat;
  min-height: 420px;
  box-shadow:
    0 12px 48px rgba(80, 30, 180, 0.6),
    0 0 0 1.5px rgba(200, 160, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.36s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  text-align: left;
  font-family: 'Gowun Dodum', 'Noto Serif KR', serif;
  contain: layout paint style;
}

/* Hide the <img> inside — we use CSS background-image now */
.lifebook-tile__img-wrap { display: none; }
.lifebook-tile__img { display: none; }

.lifebook-tile:hover,
.lifebook-tile:focus-visible {
  transform: translateY(-6px) scale(1.015);
  box-shadow:
    0 28px 72px rgba(120, 50, 255, 0.65),
    0 0 0 2px rgba(220, 190, 255, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  outline: none;
}

.lifebook-tile:active {
  transform: translateY(-2px) scale(0.99);
}

/* 이미지 위 스크림: 위쪽은 살짝 어둡게, 아래 2/3는 더 진하게 텍스트 가독성 확보 */
.lifebook-tile__bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(8, 3, 22, 0.42) 0%,
      rgba(8, 3, 22, 0.1) 28%,
      rgba(4, 1, 15, 0.0) 42%,
      rgba(6, 2, 20, 0.55) 62%,
      rgba(5, 1, 18, 0.88) 80%,
      rgba(4, 1, 15, 0.97) 100%
    );
  pointer-events: none;
  z-index: 0;
}

/* 파티클 — 색상을 amber/gold 계열로 변경해 이미지와 어울리게 */
.lifebook-tile__particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.lb-p {
  position: absolute;
  color: rgba(253, 230, 138, 0.55);
  font-size: 0.85rem;
  animation: lb-float 6s ease-in-out infinite;
}
.lb-p--1 { top: 10%; left: 6%; animation-delay: 0s; font-size: 0.7rem; }
.lb-p--2 { top: 14%; right: 8%; animation-delay: -1.5s; color: rgba(196, 181, 253, 0.5); }
.lb-p--3 { bottom: 32%; left: 4%; animation-delay: -3s; font-size: 0.65rem; }
.lb-p--4 { top: 50%; right: 5%; animation-delay: -2s; color: rgba(253, 230, 138, 0.45); }
.lb-p--5 { bottom: 16%; right: 12%; animation-delay: -4.5s; font-size: 0.7rem; }
.lb-p--6 { top: 68%; left: 10%; animation-delay: -1s; font-size: 0.6rem; color: rgba(196, 181, 253, 0.4); }

@keyframes lb-float {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.4; }
  50% { transform: translateY(-10px) rotate(12deg); opacity: 0.75; }
}

@media (max-width: 768px) {
  .lb-p {
    animation: none;
    opacity: 0.5;
  }
}

/* 내부 레이아웃 — 포스터형: 배지 상단, 텍스트 하단 */
.lifebook-tile__inner {
  position: relative;
  z-index: 2;
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
}

/* 상단: PREMIUM / 코인 배지 행 */
.lifebook-tile__label-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.lifebook-tile__label-badge {
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.25em;
  color: #fde68a;
  background: rgba(14, 8, 2, 0.75);
  border: 1px solid rgba(250, 204, 21, 0.55);
  border-radius: 5px;
  padding: 4px 9px;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.lifebook-tile__coin-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #ede9fe;
  background: rgba(10, 5, 30, 0.78);
  border: 1px solid rgba(160, 120, 255, 0.5);
  border-radius: 999px;
  padding: 4px 12px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.45);
}

.lifebook-tile__coin-badge::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 33% 28%, #fffde0 0%, #ffd040 48%, #c97a08 100%);
  border: 1px solid rgba(255, 200, 50, 0.55);
  box-shadow: 0 0 4px rgba(255, 195, 40, 0.55), inset 0 1px 2px rgba(255, 255, 200, 0.6);
  flex-shrink: 0;
}

/* 하단: 바디 텍스트 영역 */
.lifebook-tile__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.lifebook-tile__title {
  font-size: 1.6rem;
  font-weight: 900;
  color: #faf5ff;
  margin: 0;
  letter-spacing: 0.03em;
  line-height: 1.18;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8), 0 0 32px rgba(80, 20, 180, 0.4);
}

.lifebook-tile__subtitle {
  font-size: 0.88rem;
  color: #d8b4fe;
  margin: 0;
  letter-spacing: 0.07em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.lifebook-tile__desc {
  font-size: 0.82rem;
  color: rgba(220, 210, 255, 0.85);
  margin: 0;
  line-height: 1.55;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
}

/* 기능 태그 */
.lifebook-tile__features {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.lb-feat {
  font-size: 0.68rem;
  color: #ede9fe;
  background: rgba(8, 3, 20, 0.72);
  border: 1px solid rgba(160, 120, 255, 0.4);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* CTA — 황금 버튼 느낌 */
.lifebook-tile__cta {
  margin-top: 14px;
  font-size: 0.92rem;
  font-weight: 800;
  color: #1a0a3a;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #ffd54f 0%, #ffaa00 50%, #ff8c00 100%);
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  text-align: center;
  transition: filter 0.22s, transform 0.22s;
  box-shadow:
    0 4px 20px rgba(255, 160, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 220, 0.35);
}
.lifebook-tile:hover .lifebook-tile__cta {
  filter: brightness(1.08);
  transform: none;
}

/* 모바일: 최소 높이 줄이기 */
@media (max-width: 480px) {
  .lifebook-tile { min-height: 360px; background-position: center 15%; }
  .lifebook-tile__inner { min-height: 360px; padding: 16px 16px 20px; }
  .lifebook-tile__title { font-size: 1.35rem; }
}

/* ── iOS 스크롤 잠금 ── */
body.lb-modal-open {
  overflow: hidden !important;
  -webkit-overflow-scrolling: auto !important;
}

/* ── 모달 ─────────────────────────────────── */
.lb-modal {
  position: fixed;
  inset: 0;
  z-index: 100120;
  /* 모바일: 단색 배경으로 하단 콘텐츠 완전 차단 */
  background: #08041a;
  font-family: 'Gowun Dodum', 'Noto Serif KR', sans-serif;
}

.lb-modal__overlay {
  display: none; /* 모바일: 패널이 풀스크린이므로 오버레이 숨김 */
  position: absolute;
  inset: 0;
  background: rgba(5, 0, 20, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

/* 모바일: 패널 = 전체화면 */
.lb-modal__panel {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(100, 50, 220, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(70, 20, 180, 0.12) 0%, transparent 55%),
    linear-gradient(170deg, #08041a 0%, #110928 45%, #0d061e 100%);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* 데스크톱: 가운데 카드 스타일 */
@media (min-width: 620px) {
  .lb-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
  }
  .lb-modal__overlay {
    display: block;
  }
  .lb-modal__panel {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    max-width: 760px;
    max-height: calc(100vh - 60px);
    border-radius: 24px;
    margin: 30px;
    border: 1px solid rgba(155, 100, 255, 0.32);
    box-shadow:
      0 0 0 1px rgba(200, 160, 255, 0.08),
      0 40px 100px rgba(0, 0, 0, 0.75),
      0 0 80px rgba(80, 20, 200, 0.15) inset;
  }
}

/* 모달 헤더 */
.lb-modal__header {
  position: relative;
  padding: 32px 28px 26px;
  text-align: center;
  border-bottom: 1px solid rgba(155, 100, 255, 0.15);
  flex-shrink: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(100, 40, 220, 0.14) 0%, transparent 70%);
}

.lb-modal__header-deco {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}
.lb-header-star { color: #d4b0ff; font-size: 0.75rem; }
.lb-header-line {
  height: 1px;
  width: 60px;
  background: linear-gradient(90deg, transparent, #9b5de5, transparent);
}
.lb-header-gem { color: #b08aff; font-size: 0.65rem; }

.lb-modal__badge {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--lb-gold);
  text-transform: uppercase;
  margin-bottom: 10px;
  text-shadow: 0 0 12px var(--lb-glow-gold);
}

.lb-modal__title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--lb-white);
  margin: 0 0 8px;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 20px rgba(150, 80, 255, 0.4);
}

.lb-modal__subtitle {
  font-size: 0.88rem;
  color: var(--lb-amethyst);
  margin: 0;
  letter-spacing: 0.06em;
}

.lb-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(210, 170, 255, 0.28);
  border-radius: 50%;
  background: rgba(100, 40, 200, 0.12);
  color: var(--lb-lilac);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s;
  z-index: 10;
}
.lb-modal__close:hover {
  background: rgba(139, 92, 246, 0.45);
  color: #fff;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.5);
}

/* ── 시작 화면 ─────────────────────────────── */
.lb-start-screen {
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

.lb-preview-chapters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(109, 40, 217, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 14px;
  padding: 20px;
}

.lb-chapter-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.lb-ch-num {
  font-size: 0.7rem;
  font-weight: 800;
  color: #7c3aed;
  min-width: 28px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lb-ch-title {
  font-size: 0.9rem;
  color: #ddd6fe;
  line-height: 1.4;
}

.lb-start-info {
  text-align: center;
}

.lb-start-desc {
  font-size: 0.9rem;
  color: #c4b5fd;
  line-height: 1.6;
  margin: 0 0 12px;
}

.lb-start-warning {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0;
}

.lb-btn-generate {
  width: 100%;
  padding: 17px 24px;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 50%, #4c1d95 100%);
  color: var(--lb-white);
  border: 1px solid rgba(210, 170, 255, 0.45);
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.28s;
  box-shadow:
    0 8px 28px rgba(124, 58, 237, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-family: inherit;
  text-shadow: 0 1px 4px rgba(80, 10, 160, 0.5);
}
.lb-btn-generate:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 100%);
  transform: translateY(-2px);
  box-shadow:
    0 14px 38px rgba(124, 58, 237, 0.6),
    0 0 24px rgba(167, 139, 250, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.lb-btn-generate:active {
  transform: translateY(0);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}
.lb-btn-icon {
  color: var(--lb-gold);
  font-size: 0.9rem;
  text-shadow: 0 0 10px var(--lb-glow-gold);
}

/* ── 로딩 화면 ─────────────────────────────── */
.lb-loading-screen {
  padding: 36px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  flex: 1;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* 별 파티클 */
.lb-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.lb-star {
  position: absolute;
  color: rgba(196, 181, 253, 0.5);
  font-size: 0.7rem;
  animation: lb-star-float 5s ease-in-out infinite;
}
.lb-star--1  { top:  8%; left:  7%; animation-delay: 0s;    color: rgba(245,215,142,0.55); font-size: 0.75rem; }
.lb-star--2  { top: 15%; right: 9%; animation-delay: -1.2s; color: rgba(196,181,253,0.45); }
.lb-star--3  { top: 40%; left:  4%; animation-delay: -2.5s; color: rgba(245,215,142,0.4);  font-size: 0.6rem; }
.lb-star--4  { top: 55%; right: 6%; animation-delay: -0.8s; color: rgba(196,181,253,0.5);  font-size: 0.65rem; }
.lb-star--5  { top: 72%; left: 10%; animation-delay: -3.5s; color: rgba(245,215,142,0.5);  font-size: 0.7rem; }
.lb-star--6  { top: 25%; left: 50%; animation-delay: -1.8s; color: rgba(196,181,253,0.35); font-size: 0.55rem; }
.lb-star--7  { top: 80%; right:12%; animation-delay: -4.2s; color: rgba(245,215,142,0.45); font-size: 0.6rem; }
.lb-star--8  { top: 90%; left: 30%; animation-delay: -2.9s; color: rgba(196,181,253,0.4);  }

@keyframes lb-star-float {
  0%, 100% { transform: translateY(0) scale(1);   opacity: 0.6; }
  40%       { transform: translateY(-8px) scale(1.15); opacity: 1; }
  70%       { transform: translateY(4px)  scale(0.9);  opacity: 0.5; }
}

.lb-loading-orb {
  width: 110px;
  height: 110px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  filter: drop-shadow(0 0 24px rgba(124, 58, 237, 0.55));
}

.lb-orb-ring {
  position: absolute;
  border-radius: 50%;
  border-style: solid;
  border-color: transparent #7c3aed transparent var(--lb-gold);
  animation: lb-spin 2.5s linear infinite;
}
.lb-orb-ring--1 { width: 110px; height: 110px; border-width: 2px; animation-duration: 2.4s; opacity: 0.65; }
.lb-orb-ring--2 { width:  84px; height:  84px; border-width: 2px; animation-direction: reverse; animation-duration: 1.7s; opacity: 0.5; border-color: transparent var(--lb-gold) transparent #7c3aed; }
.lb-orb-ring--3 { width:  60px; height:  60px; border-width: 1.5px; animation-duration: 3s; opacity: 0.4; }

@keyframes lb-spin {
  to { transform: rotate(360deg); }
}

.lb-orb-core {
  font-size: 2rem;
  animation: lb-pulse 2.2s ease-in-out infinite;
  z-index: 2;
}

@keyframes lb-pulse {
  0%, 100% { transform: scale(1);    filter: none; }
  50%       { transform: scale(1.18); filter: drop-shadow(0 0 12px rgba(245,215,142,0.7)); }
}

.lb-loading-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--lb-gold);
  margin: 0;
  letter-spacing: 0.04em;
  text-shadow: 0 0 18px rgba(245,200,80,0.45);
  z-index: 1;
}

/* 챕터 번호 + 분석 메시지 박스 */
.lb-loading-chapter-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 1;
}
.lb-loading-chapter-num {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--lb-amethyst);
  text-transform: uppercase;
  background: rgba(124,58,237,0.18);
  border: 1px solid rgba(167,139,250,0.3);
  border-radius: 20px;
  padding: 3px 12px;
}
.lb-loading-chapter {
  font-size: 0.9rem;
  color: var(--lb-lilac);
  margin: 0;
  min-height: 1.3em;
  animation: lb-txt-fade 0.5s ease;
}

@keyframes lb-txt-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 신비로운 운명 멘트 */
.lb-mystic-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(196,181,253,0.18);
  border-radius: 12px;
  max-width: 360px;
  z-index: 1;
}
.lb-mystic-deco {
  color: var(--lb-gold-dim);
  font-size: 0.75rem;
  flex-shrink: 0;
}
.lb-mystic-quote {
  font-size: 0.82rem;
  color: rgba(196,181,253,0.8);
  margin: 0;
  line-height: 1.5;
  font-style: italic;
  transition: opacity 0.4s ease;
}
.lb-mystic-quote.lb-fade-out {
  opacity: 0;
}

/* 챕터 그리드 */
.lb-ch-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 360px;
  z-index: 1;
}
.lb-ch-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(140,90,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  color: rgba(196,168,255,0.7);
  background: rgba(20,10,56,0.75);
  transition: all 0.4s ease;
  font-family: 'Gowun Dodum', serif;
}
.lb-ch-dot--done {
  background: linear-gradient(135deg, rgba(124,58,237,0.7), rgba(109,40,217,0.5));
  border-color: rgba(167,139,250,0.7);
  color: var(--lb-lilac);
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.5);
  animation: lb-ch-pop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.lb-ch-dot--active {
  border-color: var(--lb-gold);
  color: var(--lb-gold);
  background: rgba(245,215,142,0.1);
  box-shadow: 0 0 10px rgba(245,200,80,0.4);
  animation: lb-ch-glow 1.4s ease-in-out infinite;
}

@keyframes lb-ch-pop {
  0%  { transform: scale(0.7); opacity: 0.3; }
  60% { transform: scale(1.25); }
  100%{ transform: scale(1); opacity: 1; }
}
@keyframes lb-ch-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(245,200,80,0.35); }
  50%       { box-shadow: 0 0 16px rgba(245,200,80,0.7); }
}

.lb-loading-progress {
  width: 100%;
  max-width: 340px;
  height: 5px;
  background: rgba(109, 40, 217, 0.18);
  border-radius: 999px;
  overflow: hidden;
  z-index: 1;
}

.lb-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7c3aed, var(--lb-gold));
  border-radius: 999px;
  transition: width 0.7s ease;
  box-shadow: 0 0 8px rgba(245,200,80,0.4);
}

.lb-progress-text {
  font-size: 0.8rem;
  color: #7c6fa0;
  margin: 0;
  z-index: 1;
}

/* ── 결과 화면 ─────────────────────────────── */
.lb-result-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.lb-result-header {
  padding: 20px 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.lb-result-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: #a78bfa;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.lb-result-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f5f0ff;
  margin: 0 0 4px;
}

.lb-result-date {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0;
}

.lb-btn-pdf {
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.7) 0%, rgba(79, 70, 229, 0.7) 100%);
  border: 1px solid rgba(196, 181, 253, 0.45);
  border-radius: 10px;
  color: #f0e8ff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  font-family: inherit;
  flex-shrink: 0;
}
.lb-btn-pdf:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.9) 0%, rgba(99, 102, 241, 0.9) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.35);
}

.lb-btn-regen {
  padding: 9px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(196,181,253,0.25);
  border-radius: 10px;
  color: #a78bfa;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  font-family: inherit;
  flex-shrink: 0;
}
.lb-btn-regen:hover {
  background: rgba(124,58,237,0.18);
  border-color: rgba(196,181,253,0.5);
  transform: translateY(-1px);
}

.lb-save-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  padding: 8px 13px;
  background: rgba(250,204,21,0.08);
  border: 1px solid rgba(250,204,21,0.22);
  border-radius: 8px;
  font-size: 0.75rem;
  color: #fde68a;
  line-height: 1.45;
}

.lb-storage-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 10px 0 4px;
  padding: 10px 14px;
  background: rgba(250,204,21,0.07);
  border: 1px solid rgba(250,204,21,0.2);
  border-radius: 10px;
  font-size: 0.76rem;
  color: rgba(253,230,138,0.85);
  line-height: 1.55;
  text-align: left;
}
.lb-storage-notice strong { color: #fde68a; }

.lb-btn-kakao {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(254, 229, 0, 0.55);
  border-radius: 10px;
  padding: 9px 14px;
  background: rgba(254, 229, 0, 0.12);
  color: #fde68a;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  white-space: nowrap;
  font-family: inherit;
  flex-shrink: 0;
}
.lb-btn-kakao:hover { background: rgba(254, 229, 0, 0.24); transform: translateY(-1px); }

/* TOC 네비게이션 */
.lb-toc {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
  flex-shrink: 0;
  scrollbar-width: none;
}
.lb-toc::-webkit-scrollbar { display: none; }

.lb-toc-item {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(80, 20, 180, 0.08);
  color: #6b7580;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s;
  opacity: 0.45;
  font-family: inherit;
}
.lb-toc-item.loaded {
  opacity: 1;
  color: var(--lb-lilac);
  background: rgba(100, 40, 200, 0.16);
  border-color: rgba(167, 139, 250, 0.3);
}
.lb-toc-item.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.65), rgba(79, 46, 180, 0.55));
  border-color: rgba(210, 180, 255, 0.65);
  color: #f5f0ff;
  box-shadow:
    0 4px 14px rgba(124, 58, 237, 0.4),
    inset 0 1px 0 rgba(255,255,255,0.1);
}
.lb-toc-item:hover:not(.active) {
  background: rgba(109, 40, 217, 0.3);
  color: var(--lb-white);
  border-color: rgba(180, 140, 255, 0.45);
  opacity: 1;
}

/* 챕터 콘텐츠 */
.lb-chapter-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 32px;
}

.lb-chapter-wrap {
  padding: 28px 24px;
}

.lb-chapter-header {
  margin-bottom: 32px;
  padding-bottom: 22px;
  border-bottom: none;
  position: relative;
}
.lb-chapter-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(124,58,237,0.5) 20%,
    rgba(180,130,255,0.8) 50%,
    rgba(124,58,237,0.5) 80%,
    transparent 100%);
}

.lb-chapter-num {
  font-size: 0.64rem;
  letter-spacing: 0.26em;
  color: var(--lb-gold);
  text-transform: uppercase;
  display: block;
  margin-bottom: 10px;
  text-shadow: 0 0 12px var(--lb-glow-gold);
}

.lb-chapter-title {
  font-size: 1.42rem;
  font-weight: 800;
  color: var(--lb-white);
  margin: 0 0 9px;
  line-height: 1.3;
  text-shadow: 0 2px 16px rgba(150, 80, 255, 0.3);
}

.lb-chapter-sub {
  font-size: 0.87rem;
  color: var(--lb-amethyst);
  margin: 0;
  letter-spacing: 0.05em;
}

.lb-chapter-body {
  color: rgba(225, 215, 255, 0.92);
  line-height: 1.9;
  font-size: 0.94rem;
}

/* Markdown 렌더 스타일 */
.lb-md-h1,
.lb-md-h2 {
  font-size: 1.13rem;
  font-weight: 700;
  color: #edd9ff;
  margin: 30px 0 13px;
  padding: 8px 14px;
  border-left: 3px solid var(--lb-amethyst);
  background: rgba(100, 40, 200, 0.09);
  border-radius: 0 6px 6px 0;
  line-height: 1.4;
  text-shadow: 0 0 18px rgba(150, 80, 255, 0.2);
}
.lb-md-h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--lb-lilac);
  margin: 22px 0 9px;
  padding-left: 10px;
  border-left: 2px solid rgba(167, 139, 250, 0.45);
}
.lb-md-h4 {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--lb-amethyst);
  margin: 16px 0 6px;
}
.lb-md-p {
  margin: 0 0 14px;
}
.lb-md-ul {
  margin: 0 0 14px;
  padding-left: 22px;
}
.lb-md-li {
  margin-bottom: 7px;
  line-height: 1.7;
}
.lb-md-hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.35), transparent);
  margin: 26px 0;
}
.lb-md-blockquote {
  border-left: 3px solid var(--lb-gold);
  background: rgba(124, 58, 237, 0.1);
  padding: 12px 18px;
  margin: 18px 0;
  border-radius: 0 10px 10px 0;
  color: var(--lb-gold);
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.7;
  box-shadow: inset 0 0 20px rgba(200, 150, 50, 0.04);
}
.lb-chapter-body strong {
  color: #f4ecff;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(200, 160, 255, 0.15);
}
.lb-chapter-body em {
  color: var(--lb-lilac);
  font-style: italic;
}
.lb-ch-empty {
  color: #64748b;
  font-size: 0.88rem;
  padding: 24px;
  text-align: center;
}

/* ── 에러 화면 ─────────────────────────────── */
.lb-error-screen {
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  flex: 1;
  text-align: center;
}

.lb-error-icon { font-size: 2.4rem; }

.lb-error-msg {
  font-size: 0.92rem;
  color: #fca5a5;
  margin: 0;
  max-width: 380px;
  line-height: 1.6;
}

.lb-btn-retry {
  padding: 12px 28px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(252, 165, 165, 0.4);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.lb-btn-retry:hover {
  background: rgba(239, 68, 68, 0.35);
}

/* ── 마무리 배너 ── */
.lb-epilogue-banner {
  margin: 28px 0 8px;
  padding: 32px 24px 28px;
  background: linear-gradient(135deg, rgba(10, 20, 50, 0.78) 0%, rgba(30, 58, 138, 0.52) 55%, rgba(10, 20, 50, 0.78) 100%);
  border: 1px solid rgba(147, 197, 253, 0.32);
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 4px 28px rgba(99, 102, 241, 0.14);
  animation: lbEpilogueFadeIn 0.8s ease both;
}
@keyframes lbEpilogueFadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lb-epilogue-deco {
  font-size: 1.4rem;
  letter-spacing: .35em;
  color: #bfdbfe;
  margin-bottom: 14px;
}
.lb-epilogue-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: #e0f2fe;
  margin: 0 0 10px;
  letter-spacing: .02em;
}
.lb-epilogue-msg {
  font-size: 0.92rem;
  color: rgba(224, 242, 254, 0.88);
  line-height: 1.75;
  margin: 0 0 22px;
}
.lb-epilogue-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.lb-btn-regen {
  border: 1px solid rgba(147, 197, 253, 0.38);
  border-radius: 10px;
  padding: 10px 20px;
  background: rgba(30, 58, 138, 0.28);
  color: #e0f2fe;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.lb-btn-regen:hover { background: rgba(30, 58, 138, 0.5); }

/* ── 반응형 ─────────────────────────────────── */

/* ── 599px 이하: 모달 풀스크린 ── */
@media (max-width: 599px) {
  /* 모달 전체: 바닥에서 올라오는 풀스크린 */
  .lb-modal {
    align-items: flex-end;
  }

  .lb-modal__panel {
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    max-width: 100%;
    border-radius: 0;
    margin: 0;
    border-left: none;
    border-right: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }

  /* 헤더: 컴팩트하게 */
  .lb-modal__header {
    padding: 16px 16px 12px;
    padding-top: max(16px, env(safe-area-inset-top, 16px));
  }

  .lb-modal__close {
    top: max(10px, env(safe-area-inset-top, 10px));
    right: 12px;
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  /* 결과 헤더: 세로 스택 */
  .lb-result-header {
    padding: 12px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .lb-result-title-area {
    width: 100%;
  }

  .lb-result-name {
    font-size: 1rem;
  }

  .lb-result-label {
    font-size: 0.62rem;
  }

  .lb-result-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  /* 버튼: 균등 분배, 최소 터치타겟 44px */
  .lb-btn-pdf,
  .lb-btn-kakao {
    flex: 1;
    justify-content: center;
    font-size: 0.8rem;
    padding: 10px 10px;
    min-height: 44px;
    border-radius: 10px;
  }

  /* TOC: 큰 터치 타겟 */
  .lb-toc {
    padding: 8px 12px;
    gap: 6px;
  }

  .lb-toc-item {
    width: 40px;
    height: 40px;
    font-size: 0.7rem;
    border-radius: 9px;
  }

  /* 챕터 본문 */
  .lb-chapter-wrap {
    padding: 18px 14px;
  }

  .lb-chapter-body {
    font-size: 0.89rem;
    line-height: 1.88;
  }

  .lb-md-h1,
  .lb-md-h2 {
    font-size: 1rem;
    padding: 7px 12px;
  }

  .lb-md-h3 {
    font-size: 0.94rem;
  }

  /* 시작 화면 */
  .lb-start-screen {
    padding: 16px;
  }

  .lb-btn-generate {
    width: 100%;
    max-width: none;
    justify-content: center;
    font-size: 0.9rem;
    padding: 16px 20px;
  }

  /* 로딩 */
  .lb-loading-screen {
    padding: 22px 14px 18px;
    gap: 14px;
  }
  .lb-loading-orb {
    width: 90px;
    height: 90px;
  }
  .lb-orb-ring--1 { width: 90px; height: 90px; }
  .lb-orb-ring--2 { width: 70px; height: 70px; }
  .lb-orb-ring--3 { width: 50px; height: 50px; }
  .lb-mystic-wrap {
    max-width: 280px;
    padding: 8px 12px;
  }
  .lb-ch-grid {
    gap: 5px;
    max-width: 280px;
  }
  .lb-ch-dot {
    width: 28px;
    height: 28px;
    font-size: 0.56rem;
  }

  /* 에러 */
  .lb-error-screen {
    padding: 24px 16px;
  }
}

/* ── 360px 이하 초소형 ── */
@media (max-width: 360px) {
  .lb-toc-item {
    width: 34px;
    height: 34px;
    font-size: 0.62rem;
  }

  .lb-chapter-body {
    font-size: 0.85rem;
  }

  .lb-btn-pdf,
  .lb-btn-kakao {
    font-size: 0.74rem;
    padding: 9px 8px;
  }

  .lb-md-h1,
  .lb-md-h2 {
    font-size: 0.93rem;
  }
}

/* ── 가로모드 소형 기기 ── */
@media (max-height: 500px) and (max-width: 900px) {
  .lb-modal__header {
    padding: 8px 16px 6px;
  }

  .lb-modal__header-deco {
    display: none;
  }

  .lb-start-screen {
    padding: 10px 14px;
  }
}

@media (min-width: 640px) {
  .lifebook-tile__inner {
    flex-direction: row;
    align-items: flex-start;
  }
  .lifebook-tile__img-wrap {
    width: 220px;
    flex-shrink: 0;
    aspect-ratio: auto;
    height: 180px;
    max-height: none;
  }
  .lifebook-tile__body {
    flex: 1;
  }
  .lifebook-tile__label-row {
    position: absolute;
    top: 16px;
    left: 20px;
    right: 20px;
  }
  .lifebook-tile__inner {
    padding-top: 52px;
  }
}

/* ═══════════════════════════════════════════════════════
   인생의 책 — 마케팅 상세 페이지 (2026 개편)
═══════════════════════════════════════════════════════ */

/* 신뢰 배지 (trust badges) */
.lb-marketing-hero {
  padding: 20px 20px 12px;
  text-align: center;
}
.lb-trust-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}
.lb-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(186,134,255,0.18), rgba(120,60,200,0.12));
  border: 1px solid rgba(186,134,255,0.35);
  color: #d4aaff;
  white-space: nowrap;
}
.lb-trust-badge--coin {
  background: linear-gradient(135deg, rgba(251,191,36,0.22), rgba(200,130,0,0.14));
  border-color: rgba(251,191,36,0.5);
  color: #fde68a;
}
/* 코인 안내 박스 */
.lb-coin-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(200,130,0,0.08));
  border: 1px solid rgba(251,191,36,0.4);
  border-radius: 10px;
  padding: 10px 16px;
  margin: 12px 0 10px;
  font-size: 0.82rem;
  color: #fde68a;
}
.lb-coin-icon { font-size: 1.1rem; }
.lb-coin-label strong { color: #fbbf24; }
/* 버튼 내 코인 배지 */
.lb-btn-coin {
  display: inline-flex;
  align-items: center;
  background: rgba(251,191,36,0.22);
  border: 1px solid rgba(251,191,36,0.55);
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: 0.03em;
  margin-right: 4px;
}
.lb-feat--trust {
  background: linear-gradient(135deg, rgba(255,200,80,0.2), rgba(200,140,0,0.1)) !important;
  border-color: rgba(255,200,80,0.4) !important;
  color: #ffd966 !important;
}
.lb-marketing-headline {
  font-size: 1.12rem;
  font-weight: 700;
  color: #f0e0ff;
  margin: 0 0 8px;
  line-height: 1.4;
}
.lb-marketing-headline strong { color: #c89bff; }
.lb-marketing-sub {
  font-size: 0.82rem;
  color: rgba(220,200,255,0.75);
  line-height: 1.6;
  margin: 0;
}

/* Why 섹션 */
.lb-why-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid rgba(186,134,255,0.15);
  border-bottom: 1px solid rgba(186,134,255,0.15);
  margin: 10px 0;
}
.lb-why-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(186,134,255,0.12);
  border-radius: 10px;
  padding: 10px 12px;
}
.lb-why-icon { font-size: 1.3rem; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.lb-why-item strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #d4aaff;
  margin-bottom: 3px;
}
.lb-why-item span { font-size: 0.72rem; color: rgba(210,190,255,0.7); line-height: 1.45; }

/* 목차 레이블 */
.lb-toc-label {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(186,134,255,0.7);
  margin: 14px 0 8px;
}

/* 추천 섹션 */
.lb-recommend-section {
  padding: 12px 18px;
  background: rgba(186,134,255,0.05);
  border-radius: 12px;
  margin: 8px 16px;
  border: 1px solid rgba(186,134,255,0.15);
}
.lb-recommend-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: rgba(186,134,255,0.7);
  letter-spacing: 0.06em;
  text-align: center;
  margin: 0 0 8px;
}
.lb-recommend-list { display: flex; flex-direction: column; gap: 5px; }
.lb-recommend-item {
  font-size: 0.78rem;
  color: rgba(230,220,255,0.78);
  padding: 6px 10px;
  border-left: 2px solid rgba(186,134,255,0.35);
  line-height: 1.4;
}

@media (max-width: 480px) {
  .lb-why-section { grid-template-columns: 1fr; }
  .lb-marketing-headline { font-size: 1rem; }
}

/* ═══════════════════════════════════════════════════════
   모바일 최적화 패치 (2026-04)
═══════════════════════════════════════════════════════ */

/* 먹싄 노드리기 + 터치 피드백 */
.lb-toc-item,
.lb-btn-generate,
.lb-btn-retry,
.lb-nav-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.lb-btn-generate,
.lb-btn-retry {
  min-height: 48px;
}

/* 모달 오버스크롤 차단 */
.lb-modal-wrap {
  overscroll-behavior: contain;
}
.lb-reader-body {
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}
.lb-toc-list {
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 540px) {
  /* 모늬 라운드 + 내부 패딩 */
  .lb-modal {
    border-radius: 14px 14px 0 0;
    max-height: 96dvh;
    max-height: 96vh; /* dvh fallback */
  }
  /* 헤더 */
  .lb-modal-header {
    padding: 12px 14px 10px;
  }
  .lb-modal-title {
    font-size: 1rem;
  }
  /* TOC 아이템 터치 대역 48px */
  .lb-toc-item {
    min-height: 46px;
    padding: 10px 12px;
    font-size: 0.82rem;
  }
  .lb-toc-item .lb-chapter-num {
    font-size: 0.7rem;
  }
  /* 생성 버튼 */
  .lb-btn-generate {
    font-size: 0.92rem;
    padding: 14px 20px;
    width: 100%;
  }
  /* 리더 콘텐츠 */
  .lb-reader-body {
    padding: 14px 14px 60px;
    font-size: 0.88rem;
    line-height: 1.8;
  }
  /* 리더 내 제목 */
  .lb-chapter-title {
    font-size: 1.1rem;
  }
  /* 브레드크럼 */
  .lb-loading-screen {
    padding: 24px 16px;
  }
  .lb-loading-quote {
    font-size: 0.82rem;
    padding: 0 8px;
  }
  /* 타일 내 코인 배지 가독성 */
  .lifebook-tile__coin-badge {
    font-size: 0.72rem;
    padding: 3px 8px;
  }
  .lifebook-tile__title {
    font-size: 1.1rem;
  }
  .lifebook-tile__desc {
    font-size: 0.78rem;
    line-height: 1.55;
  }
  /* 마케팅 페이지 모바일 */
  .lb-marketing-hero {
    padding: 20px 14px;
  }
  .lb-marketing-title {
    font-size: 1.2rem;
  }
  .lb-sample-section {
    padding: 12px 14px;
  }
}

@media (max-width: 360px) {
  .lb-modal-title { font-size: 0.92rem; }
  .lb-toc-item { font-size: 0.78rem; }
  .lb-reader-body { font-size: 0.84rem; }
  .lb-btn-generate { font-size: 0.85rem; }
}

/* ═══════════════════════════════════════════════════════
   자미두수 인생 총람 모달 — zbScreen / lb-screen 클래스
═══════════════════════════════════════════════════════ */

/* 공통 화면 래퍼 */
.lb-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── 시작 화면 ── */
.lb-screen--start {
  padding: 28px 24px 32px;
  gap: 20px;
}

.lb-start__hero {
  text-align: center;
  padding: 8px 0 4px;
}

.lb-start__icon {
  display: block;
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 10px;
}

.lb-start__headline {
  font-size: 1.2rem;
  font-weight: 800;
  color: #f0e8ff;
  margin: 0 0 10px;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 16px rgba(150,80,255,0.3);
}

.lb-start__desc {
  font-size: 0.88rem;
  color: rgba(196,181,253,0.8);
  line-height: 1.7;
  margin: 0;
}

.lb-start__profile-box {
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(167,139,250,0.22);
  border-radius: 12px;
  padding: 14px 16px;
}

.lb-start__profile-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(167,139,250,0.6);
  margin-bottom: 6px;
}

.lb-start__profile-content {
  font-size: 0.88rem;
  color: #e2d9f3;
  line-height: 1.55;
}

/* ── 숙요 상대방 입력 폼 ── */
.lb-start__partner-box {
  background: rgba(14, 30, 60, 0.55) !important;
  border-color: rgba(125, 211, 252, 0.28) !important;
}

.lb-start__partner-box .lb-start__profile-label {
  color: rgba(125, 211, 252, 0.75);
}

.lb-start__partner-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.sk-partner-field {
  margin: 0 !important;
}

.sk-partner-inp {
  background: rgba(10, 20, 45, 0.7) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(125, 211, 252, 0.28) !important;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}

.sk-partner-inp:focus {
  outline: none;
  border-color: rgba(125, 211, 252, 0.65) !important;
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.12);
}

.sk-partner-radio-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sk-partner-radio-row label {
  color: #94a3b8;
  font-size: 0.83rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sk-partner-radio-row input[type="radio"] {
  accent-color: #7dd3fc;
}

.sk-partner-field .toggle-wrap {
  display: flex;
  gap: 8px;
}

.sk-partner-field .tog-btn {
  flex: 1;
  padding: 8px 0;
  background: rgba(10, 20, 45, 0.6);
  color: #94a3b8;
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 9px;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.sk-partner-field .tog-btn.on {
  background: rgba(125, 211, 252, 0.18);
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.5);
  font-weight: 700;
}

.sk-partner-field .row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lb-start__cta {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 50%, #4c1d95 100%);
  color: #f5f0ff;
  border: 1px solid rgba(210,170,255,0.45);
  border-radius: 14px;
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.04em;
  font-family: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.25s;
  box-shadow: 0 8px 24px rgba(124,58,237,0.45), inset 0 1px 0 rgba(255,255,255,0.1);
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-start__cta:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 100%);
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(124,58,237,0.6), inset 0 1px 0 rgba(255,255,255,0.12);
}

.lb-start__cta:active {
  transform: translateY(0);
  box-shadow: 0 4px 14px rgba(124,58,237,0.4);
}

.lb-start__note {
  font-size: 0.75rem;
  color: rgba(167,139,250,0.5);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

/* ── 시작화면 챕터 미리보기 목록 ── */
.lb-start__chapters {
  margin: 4px 0 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(139,92,246,0.18);
  border-radius: 12px;
  overflow: hidden;
}

.lb-start__ch-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(167,139,250,0.6);
  padding: 10px 14px 6px;
  border-bottom: 1px solid rgba(139,92,246,0.12);
}

.lb-start__ch-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 210px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lb-start__ch-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 14px;
  border-bottom: 1px solid rgba(139,92,246,0.08);
  font-size: 0.8rem;
  color: rgba(203,213,225,0.75);
  line-height: 1.45;
}

.lb-start__ch-item:last-child { border-bottom: none; }

.lb-start__ch-num {
  font-size: 0.62rem;
  font-weight: 700;
  color: rgba(167,139,250,0.5);
  min-width: 22px;
  padding-top: 2px;
  flex-shrink: 0;
}

/* ── 로딩 화면 ── */
.lb-screen--loading {
  padding: 36px 24px 28px;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.lb-loading__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lb-loading__symbol {
  font-size: 3.2rem;
  line-height: 1;
  animation: lb-pulse 2.2s ease-in-out infinite;
  filter:
    drop-shadow(0 0 28px rgba(138,78,255,0.75))
    drop-shadow(0 0 12px rgba(245,200,80,0.5));
}

.lb-loading__status {
  font-size: 0.96rem;
  color: #ffe394;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.03em;
  text-shadow:
    0 0 20px rgba(255,210,60,0.75),
    0 1px 4px rgba(0,0,0,0.5);
  min-height: 1.4em;
  transition: color 0.24s ease, text-shadow 0.24s ease;
}

.lb-progress__wrap {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.lb-progress__bar-bg {
  height: 6px;
  background: rgba(109,40,217,0.32);
  border-radius: 999px;
  overflow: hidden;
}

.lb-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8b5cf6, #fbbf24, #ffe394);
  border-radius: 999px;
  transition: width 0.7s ease;
  box-shadow: 0 0 12px rgba(251,191,36,0.55), 0 0 4px rgba(139,92,246,0.4);
}

.lb-progress__text {
  font-size: 0.82rem;
  color: #c4aeed;
  font-weight: 600;
  text-align: right;
  text-shadow: 0 0 8px rgba(164,144,240,0.35);
}

.lb-loading__chapter-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.lb-loading__chapter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124,58,237,0.22);
  border: 1px solid rgba(167,139,250,0.45);
  border-radius: 20px;
  padding: 7px 18px;
  box-shadow: 0 2px 18px rgba(124,58,237,0.2), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.lb-loading__chapter-num {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #fad55c;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(250,196,40,0.6);
}

.lb-loading__chapter-title {
  font-size: 0.9rem;
  color: rgba(242,234,255,0.97);
  font-weight: 500;
  min-height: 1.3em;
  transition: color 0.24s ease;
}

.lb-loading__dots-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 340px;
}

.lb-ch-dot--pending {
  opacity: 0.52;
}

.lb-loading__status--pulse {
  animation: lb-status-pulse 0.56s ease;
}

.lb-loading__chapter.is-updating {
  animation: lb-chapter-pulse 0.62s ease;
}

.lb-ch-dot--just-done {
  animation: lb-ch-burst 0.72s cubic-bezier(0.2, 0.88, 0.25, 1.2);
}

@keyframes lb-status-pulse {
  0% { opacity: 0.62; transform: translateY(3px); }
  45% { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes lb-chapter-pulse {
  0% { transform: scale(0.96); box-shadow: 0 2px 8px rgba(124,58,237,0.18); }
  50% { transform: scale(1.03); box-shadow: 0 4px 24px rgba(245,200,80,0.3); }
  100% { transform: scale(1); box-shadow: 0 2px 18px rgba(124,58,237,0.2), inset 0 1px 0 rgba(255,255,255,0.05); }
}

@keyframes lb-ch-burst {
  0% { transform: scale(0.78); filter: brightness(1); }
  55% { transform: scale(1.22); filter: brightness(1.24); }
  100% { transform: scale(1); filter: brightness(1); }
}

.lb-loading__mystic {
  font-size: 0.84rem;
  color: rgba(228,214,255,0.96);
  font-style: italic;
  line-height: 1.65;
  text-align: center;
  max-width: 320px;
  margin: 0;
  background: rgba(124,58,237,0.16);
  border: 1px solid rgba(196,181,253,0.35);
  border-radius: 12px;
  padding: 11px 18px;
  box-shadow: 0 2px 18px rgba(124,58,237,0.14);
  text-shadow: 0 1px 6px rgba(80,40,160,0.4);
}

/* ── 꽃돼지 모드 가독성 강화 ── */
body.theme-pig .lb-modal__title {
  color: #fdf8ff;
  text-shadow: 0 2px 20px rgba(190,130,255,0.5);
}

body.theme-pig .lb-modal__subtitle {
  color: #f2d8ff;
  text-shadow: 0 1px 10px rgba(0,0,0,0.45);
}

body.theme-pig .lb-loading__status {
  color: #ffefbf;
  text-shadow: 0 0 20px rgba(255,220,120,0.82), 0 1px 6px rgba(0,0,0,0.62);
}

body.theme-pig .lb-progress__text {
  color: #e7d7ff;
  text-shadow: 0 0 10px rgba(190,160,255,0.38);
}

body.theme-pig .lb-loading__chapter {
  background: rgba(138,78,255,0.3);
  border-color: rgba(220,185,255,0.62);
  box-shadow: 0 3px 22px rgba(138,78,255,0.28), inset 0 1px 0 rgba(255,255,255,0.11);
}

body.theme-pig .lb-loading__chapter-num {
  color: #ffe8a1;
  text-shadow: 0 0 12px rgba(255,214,116,0.72);
}

body.theme-pig .lb-loading__chapter-title {
  color: #fff6d4;
  text-shadow: 0 1px 8px rgba(0,0,0,0.42);
}

body.theme-pig .lb-loading__mystic {
  color: rgba(246,236,255,0.98);
  background: rgba(138,78,255,0.22);
  border-color: rgba(214,186,255,0.5);
}

body.theme-pig .lb-ch-dot--pending {
  opacity: 0.78;
  border-color: rgba(204,162,255,0.7);
  color: rgba(238,218,255,0.96);
  background: rgba(31,15,78,0.82);
}

/* ── 결과 화면 ── */
.lb-screen--result {
  overflow-y: auto;
}

.lb-result__header {
  padding: 24px 24px 18px;
  text-align: center;
  border-bottom: 1px solid rgba(139,92,246,0.15);
  flex-shrink: 0;
}

.lb-result__symbol {
  display: block;
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 18px rgba(124,58,237,0.55));
}

.lb-result__title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--lb-white, #f5f0ff);
  margin: 0 0 8px;
}

.lb-result__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lb-result__name {
  font-size: 0.88rem;
  color: var(--lb-amethyst, #a78bfa);
  font-weight: 700;
}

.lb-result__date {
  font-size: 0.78rem;
  color: #64748b;
}

.lb-result__content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 32px;
}

.lb-result__actions {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid rgba(139,92,246,0.15);
  flex-shrink: 0;
  justify-content: center;
  flex-wrap: wrap;
}

.lb-result__pdf-btn {
  padding: 11px 20px;
  background: linear-gradient(135deg, rgba(124,58,237,0.7), rgba(79,70,229,0.7));
  border: 1px solid rgba(196,181,253,0.45);
  border-radius: 10px;
  color: #f0e8ff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  touch-action: manipulation;
}

.lb-result__pdf-btn:hover {
  background: linear-gradient(135deg, rgba(124,58,237,0.9), rgba(99,102,241,0.9));
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(124,58,237,0.35);
}

.lb-result__close-btn {
  padding: 11px 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(196,181,253,0.25);
  border-radius: 10px;
  color: #a78bfa;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  touch-action: manipulation;
}

.lb-result__close-btn:hover {
  background: rgba(124,58,237,0.18);
  border-color: rgba(196,181,253,0.5);
}

/* ── 오류 화면 ── */
.lb-screen--error {
  padding: 48px 24px;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.lb-error__icon {
  font-size: 2.4rem;
}

.lb-error__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fca5a5;
  margin: 0;
}

.lb-error__msg {
  font-size: 0.88rem;
  color: rgba(252,165,165,0.8);
  margin: 0;
  max-width: 360px;
  line-height: 1.6;
}

.lb-error__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.lb-error__retry {
  padding: 11px 24px;
  background: rgba(239,68,68,0.2);
  border: 1px solid rgba(252,165,165,0.4);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  touch-action: manipulation;
}

.lb-error__retry:hover {
  background: rgba(239,68,68,0.35);
}

.lb-error__close {
  padding: 11px 24px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(196,181,253,0.25);
  border-radius: 10px;
  color: #a78bfa;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  touch-action: manipulation;
}

.lb-error__close:hover {
  background: rgba(124,58,237,0.18);
  border-color: rgba(196,181,253,0.5);
}

/* 헤더 영문 타이틀 */
.lb-header-title-en {
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  color: rgba(196,181,253,0.6);
  text-transform: uppercase;
  font-weight: 700;
}

/* ── 모바일 조정 ── */
@media (max-width: 599px) {
  .lb-screen--start {
    padding: 20px 16px 24px;
    gap: 16px;
  }
  .lb-screen--loading {
    padding: 24px 16px 20px;
    gap: 14px;
  }
  .lb-screen--error {
    padding: 28px 16px;
    gap: 14px;
  }
  .lb-start__cta {
    font-size: 0.92rem;
    padding: 14px 20px;
  }
  .lb-loading__dots-wrap {
    max-width: 280px;
    gap: 5px;
  }
}
