/* R103 (2026-11-12) / R104~R108 (2026-11-13) 회화 학습 + 콘텐츠 허브 */

/* ===== R104: 콘텐츠 허브 ===== */
#content-screen.nf-hub-on > *:not(.nf-hub) { display: none !important; }
#content-screen:not(.nf-hub-on) .nf-hub-cards { display: none; }
#content-screen.nf-hub-on .nf-hub-back { display: none; }
.nf-hub { margin: 0 0 14px; }
.nf-hub-t { margin: 6px 0 14px; font-size: 18px; font-weight: 800; color: #2b2b35; }
.nf-hub-back {
  display: inline-flex; align-items: center; margin: 0 0 12px; padding: 8px 13px;
  border: none; border-radius: 10px; background: #f1eefc; color: #7c5cff;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.nf-hub-card {
  display: flex; align-items: center; gap: 13px; width: 100%; margin-bottom: 12px;
  padding: 18px 16px; border: 1px solid #ece9f7; border-radius: 18px; background: #fff;
  text-align: left; cursor: pointer; box-shadow: 0 2px 10px rgba(80, 60, 160, 0.06);
}
.nf-hub-card.lesson { background: linear-gradient(135deg, #7c5cff 0%, #9b7cff 100%); border-color: transparent; }
.nf-hub-card.lesson strong, .nf-hub-card.lesson em, .nf-hub-card.lesson .nf-hub-go { color: #fff; }
.nf-hub-card.lesson em { opacity: 0.88; }
.nf-hub-ico { font-size: 30px; line-height: 1; flex: 0 0 auto; }
.nf-hub-body { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; }
.nf-hub-body strong { font-size: 16.5px; font-weight: 800; color: #2b2b35; }
.nf-hub-body em { font-style: normal; font-size: 12.5px; line-height: 1.5; color: #8a8a99; }
.nf-hub-go { font-size: 22px; color: #c7c2dd; }

/* ===== R107: 화면 배경 통일 ===== */
body.lesson-on { background: #f6f5fb; }
#lesson-screen.lesson-screen {
  padding: 14px 14px 110px; background: #f6f5fb; min-height: 100vh;
}
.lesson-loading, .lesson-error {
  padding: 48px 16px; text-align: center; color: #8a8a99; font-size: 14px; line-height: 1.7;
}

/* ===== 공통 ===== */
.lesson-hub-back {
  display: inline-flex; align-items: center; margin: 0 0 12px; padding: 8px 13px;
  border: none; border-radius: 10px; background: #ece8fb; color: #7c5cff;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.lesson-topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lesson-topbar-t { font-size: 14px; font-weight: 700; color: #5a5a68; }
.lesson-back {
  width: 36px; height: 36px; flex: 0 0 auto; border: none; border-radius: 50%;
  background: #ece8fb; color: #7c5cff; font-size: 18px; cursor: pointer;
}
.lesson-hero {
  padding: 20px 18px; border-radius: 18px; margin-bottom: 14px; color: #fff;
  background: linear-gradient(135deg, #7c5cff 0%, #a98bff 100%);
}
.lesson-badge {
  display: inline-block; padding: 4px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.22); font-size: 11.5px; font-weight: 700;
}
.lesson-hero-t { margin: 10px 0 4px; font-size: 20px; font-weight: 800; }
.lesson-hero-s { margin: 0; font-size: 13px; line-height: 1.6; opacity: 0.92; }
.lesson-bar { margin-top: 14px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.lesson-bar i { display: block; height: 100%; background: #fff; border-radius: 3px; }
.lesson-bar-t { display: block; margin-top: 6px; font-size: 11.5px; opacity: 0.9; }
.lesson-why {
  margin: 0 0 14px; padding: 11px 13px; border-radius: 12px;
  background: #fff8e6; color: #7a5a00; font-size: 13px; line-height: 1.55;
}

/* ===== 목록 ===== */
.lesson-items { display: flex; flex-direction: column; gap: 10px; }
.lesson-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px;
  border: 1px solid #ece9f7; border-radius: 15px; background: #fff;
  text-align: left; cursor: pointer;
}
.lesson-item.done { border-color: #d7f0dd; background: #fbfffc; }
.lesson-item-ava { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.lesson-item-body { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0; }
.lesson-item-no { font-size: 11.5px; font-weight: 700; color: #7c5cff; }
.lesson-item-t { font-size: 15px; font-weight: 700; color: #2b2b35; }
.lesson-item-s { font-size: 12px; color: #8a8a99; line-height: 1.45; }
.lesson-item-right { flex: 0 0 auto; font-size: 12px; color: #a9a9b8; font-weight: 700; }
.lesson-item.done .lesson-item-right { color: #4caf78; font-size: 16px; }

/* ===== 섹션 ===== */
.lesson-sec {
  margin-bottom: 14px; padding: 16px 15px; border-radius: 18px;
  background: #fff; border: 1px solid #efedf7;
}
.lesson-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.lesson-sec-t { margin: 0 0 12px; font-size: 14.5px; font-weight: 800; color: #2b2b35; }
.lesson-sec-head .lesson-sec-t { margin: 0; }
.lesson-play-all {
  padding: 7px 13px; border: none; border-radius: 20px; background: #7c5cff;
  color: #fff; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.lesson-play-all.on { background: #ff6b9d; }

/* 재생 버튼 */
.lesson-sp {
  flex: 0 0 auto; width: 36px; height: 36px; border: none; border-radius: 50%;
  background: #f1eefc; color: #7c5cff; font-size: 16px; line-height: 1; cursor: pointer;
}
.lesson-sp:active, .lesson-sp.playing { background: #7c5cff; color: #fff; }
.lesson-sp-lg { width: 44px; height: 44px; font-size: 19px; }

.lesson-texts { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0; }
.lesson-ja { font-size: 15.5px; font-weight: 700; color: #2b2b35; line-height: 1.5; }
.lesson-ko { font-size: 12.5px; color: #8a8a99; line-height: 1.45; }
.lesson-row { display: flex; align-items: center; gap: 12px; }
.lesson-key { padding: 15px; border-radius: 14px; background: #f5f2ff; }
.lesson-note { margin: 10px 0 0; font-size: 12px; color: #7c5cff; line-height: 1.5; }

/* 대화 */
.lesson-dialogue { display: flex; flex-direction: column; gap: 10px; }
.lesson-line { display: flex; align-items: flex-start; gap: 8px; border-radius: 12px; padding: 3px; transition: background 0.2s; }
.lesson-line.on { background: #fff4f8; }
.lesson-line.mine { flex-direction: row-reverse; }
.lesson-ava { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.lesson-bubble {
  max-width: 68%; display: flex; flex-direction: column; gap: 3px;
  padding: 10px 13px; border-radius: 14px; background: #f4f4f7;
}
.lesson-line.mine .lesson-bubble { background: #e9e3ff; }
.lesson-bubble .lesson-ja { font-size: 14.5px; }
.lesson-line .lesson-sp { width: 32px; height: 32px; font-size: 14px; align-self: center; }

/* 바꿔/따라 말하기 */
.lesson-drill {
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
  padding: 11px 13px; border: 1px dashed #d9d2f5; border-radius: 12px; background: #fff;
}

/* 단어 */
.lesson-word {
  display: flex; align-items: center; gap: 9px; margin-bottom: 8px;
  padding: 10px 12px; border: 1px solid #eee; border-radius: 12px; background: #fff;
}
.lesson-word-ja { font-size: 15px; font-weight: 700; color: #2b2b35; }
.lesson-word-rd { font-size: 12px; color: #8a8a99; }
.lesson-word-toggle {
  flex: 0 0 auto; min-width: 66px; padding: 8px 10px; border: none; border-radius: 9px;
  background: #f1eefc; color: #7c5cff; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.lesson-word-toggle.on { background: #e7f6ed; color: #3a9e6c; }
.lesson-save-all {
  width: 100%; margin-top: 8px; padding: 13px; border: none; border-radius: 12px;
  background: #7c5cff; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
}

/* CTA */
.lesson-cta { padding: 18px; border-radius: 18px; background: #fff6f9; border: 1px solid #ffe3ee; }
.lesson-cta-t { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: #2b2b35; text-align: center; }
.lesson-call-btn {
  width: 100%; padding: 15px; border: none; border-radius: 12px; background: #2EC27E;
  color: #fff; font-size: 15px; font-weight: 800; cursor: pointer;
}
.lesson-done-btn {
  width: 100%; margin-top: 8px; padding: 11px; border: none; border-radius: 12px;
  background: transparent; color: #999; font-size: 13px; cursor: pointer;
}

/* 토스트 */
.lesson-toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(10px);
  z-index: 9000; padding: 11px 18px; border-radius: 22px;
  background: rgba(0, 0, 0, 0.78); color: #fff; font-size: 13.5px; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity 0.22s, transform 0.22s;
}
.lesson-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== R118 (2026-11-13): 하단 탭바 가림 방지 ===== */
/* 목차/상세는 innerHTML 통째 교체 구조라 마지막에 실제 여백 블록을 붙인다 */
.lesson-bottom-space {
  display: block;
  width: 100%;
  height: calc(112px + env(safe-area-inset-bottom, 0px));
  flex: 0 0 auto;
  pointer-events: none;
}
#lesson-screen.lesson-screen,
#content-screen,
#history-screen {
  padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)) !important;
  box-sizing: border-box;
}

/* ===== R119 (2026-11-13): 콘텐츠 허브 풍성화 ===== */
.nf-hub-head { padding: 4px 2px 2px; }
.nf-hub-sub { margin: 4px 0 0; font-size: 13px; color: #8a8a9a; }
.nf-hub-stat {
  background: #fff; border: 1px solid #eceaf5; border-radius: 16px;
  padding: 14px 16px 12px; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(90, 70, 180, .05);
}
.nf-hub-stat-row { display: flex; gap: 8px; }
.nf-hub-stat-i { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; }
.nf-hub-stat-i b { font-size: 20px; font-weight: 800; color: #6b4ddb; line-height: 1.2; }
.nf-hub-stat-i em { font-style: normal; font-size: 11px; color: #9a99ab; margin-top: 2px; }
.nf-hub-bar { height: 6px; border-radius: 99px; background: #eeebfa; overflow: hidden; margin-top: 12px; }
.nf-hub-bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8b6bf0, #6b4ddb); }
.nf-hub-bar-t { display: block; margin-top: 6px; font-size: 11px; color: #9a99ab; text-align: right; }
.nf-hub-resume {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: linear-gradient(135deg, #7d5bf0, #6b4ddb); border: 0; border-radius: 16px;
  padding: 14px 14px; margin-bottom: 12px; cursor: pointer; color: #fff;
  box-shadow: 0 6px 16px rgba(107, 77, 219, .25);
}
.nf-hub-resume-ava {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .7); background: #fff;
}
.nf-hub-resume-b { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.nf-hub-resume-b em { font-style: normal; font-size: 11px; opacity: .85; }
.nf-hub-resume-b strong { font-size: 15px; font-weight: 700; margin-top: 2px; }
.nf-hub-resume-b span { font-size: 12px; opacity: .85; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nf-hub-resume .nf-hub-go { color: #fff; font-size: 22px; flex: 0 0 auto; }
.nf-hub-card-sub {
  display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700;
  color: #6b4ddb; background: #f1edfe; border-radius: 99px; padding: 3px 9px;
}
.nf-hub-phrase {
  display: flex; align-items: center; gap: 10px; background: #fff;
  border: 1px solid #eceaf5; border-radius: 16px; padding: 13px 14px; margin-bottom: 12px;
}
.nf-hub-phrase-l {
  flex: 0 0 auto; font-size: 10px; font-weight: 700; color: #6b4ddb;
  background: #f1edfe; border-radius: 99px; padding: 4px 9px;
}
.nf-hub-phrase-r { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.nf-hub-phrase-r strong { font-size: 15px; color: #27263a; }
.nf-hub-phrase-r em { font-style: normal; font-size: 12px; color: #8a8a9a; margin-top: 2px; }
.nf-hub-sp {
  flex: 0 0 auto; width: 36px; height: 32px; border: 0; border-radius: 10px;
  background: #f1edfe; color: #6b4ddb; font-size: 15px; cursor: pointer;
}
.nf-hub-sp:active { background: #e3dcfd; }
.nf-hub-chips { display: flex; flex-direction: column; gap: 8px; }
.nf-hub-chip {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: #fff; border: 1px solid #eceaf5; border-radius: 12px;
  padding: 10px 12px; cursor: pointer;
}
.nf-hub-chip-lv {
  flex: 0 0 auto; font-size: 10px; font-weight: 800; color: #fff;
  background: #8b6bf0; border-radius: 6px; padding: 3px 7px;
}
.nf-hub-chip-t { flex: 1 1 auto; min-width: 0; font-size: 13px; color: #3c3b52; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nf-hub-chip-n { flex: 0 0 auto; font-size: 12px; color: #9a99ab; font-weight: 700; }

/* ===== R122 (2026-11-13): 기존 노트 단어 표시 ===== */
.lesson-word-note {
  display: inline-block; margin-top: 3px; font-size: 10px; color: #9a99ab;
  background: #f4f3f8; border-radius: 99px; padding: 2px 8px; align-self: flex-start;
}