/* 4.09.2: 모바일(폭 640px 이하) 전용 스타일.
   _head_assets.html 에서 media="(max-width: 640px)" 로만 불러오므로 PC 화면에는 영향이 없다. */

:root {
  --m-line: #eef0f2;
  --m-gap: #f2f3f5;
  --m-text: #111111;
  --m-sub: #8b919c;
  --m-primary: #345ef4;
}

.m-cafe-hide { display: none !important; }

/* ── 글자: 작은 회색 글씨를 읽기 쉽게 ───────────────────────────── */
.font-bold { font-weight: 600 !important; }
.font-semibold { font-weight: 500 !important; }
.text-\[10px\] { font-size: 11px !important; }
.text-\[11px\] { font-size: 12px !important; }
.text-xs { font-size: 12.5px !important; }
.text-slate-400 { color: var(--m-sub) !important; }
main h1 { font-size: 21px !important; line-height: 1.4 !important; font-weight: 700 !important; letter-spacing: -0.4px; }

/* ── 헤더 ─────────────────────────────────────────────────────── */
header.m-header { box-shadow: none !important; }
header.m-header .m-header-row { height: 52px; padding-left: 14px; padding-right: 14px; }
header.m-header .m-logo { height: 44px; width: auto; }
header.m-header .m-account { gap: 6px !important; }
header.m-header .m-account a {
  padding: 6px 12px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  border-radius: 16px !important;
}
.m-nav ul { padding-left: 4px !important; padding-right: 4px !important; }
.m-nav a {
  padding: 10px 11px 9px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
}
.m-nav a.border-transparent { color: #111 !important; }

/* ── 방문자 수: 얇은 한 줄 ─────────────────────────────────────── */
.m-stats { box-shadow: none !important; border-bottom-color: var(--m-line) !important; }
.m-stats .visitor-stats-inner,
.m-stats .visitor-stats-inner.is-home {
  display: flex !important;
  justify-content: center !important;
  gap: 14px !important;
  min-height: 0 !important;
  padding: 7px 14px !important;
}
.m-stats .visitor-stat-pill,
.m-stats .visitor-stat-pill.is-today-home {
  width: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  flex-direction: row !important;
  gap: 4px !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
.m-stats .visitor-stat-pill > span {
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  color: #111 !important;
}
.m-stats .visitor-stat-pill > .visitor-stat-value { color: #111 !important; font-weight: 700 !important; }
.m-stats .visitor-stat-pill > .w-2 { width: 6px; height: 6px; border-radius: 50% !important; }

/* ── 푸터: 작게, 왼쪽 정렬 ─────────────────────────────────────── */
.m-footer { padding: 22px 16px 30px !important; }
.m-footer > div { text-align: left !important; }
.m-footer nav,
.m-footer address p { justify-content: flex-start !important; }
.m-footer address p { gap: 2px 10px !important; }
.m-footer address span[aria-hidden="true"] { display: none; }
.m-footer address span,
.m-footer > div > p:last-child { font-size: 11px; }

/* ── 입력칸 · 버튼 ─────────────────────────────────────────────── */
/* 16px 미만이면 아이폰이 입력할 때 화면을 확대해 버린다 */
main input[type="text"],
main input[type="email"],
main input[type="password"],
main input[type="search"],
main input[type="tel"],
main input[type="number"],
main input[type="datetime-local"],
main select,
main textarea {
  font-size: 16px !important;
  border-radius: 8px !important;
}
main button:not([data-vc]):not(.vimeo-big-play):not(.lecture-tab):not(.home-community-tab),
main a[class*="py-2"],
main a[class*="py-1.5"],
main input[type="file"]::file-selector-button {
  border-radius: 8px !important;
}

/* ── 카드형 화면: 테두리 상자 대신 화면 폭 전체 + 회색 구분띠 ───── */
main.max-w-\[1280px\] {
  padding: 0 0 28px !important;
  gap: 0 !important;
}
main.max-w-\[1280px\] > .space-y-4 > :not([hidden]) ~ :not([hidden]),
main.max-w-\[1280px\] > .space-y-5 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0 !important;
}
main.max-w-\[1280px\] .rounded-xl.border,
main.max-w-\[1280px\] .side-card {
  border: 0 !important;
  border-top: 8px solid var(--m-gap) !important;
  box-shadow: none !important;
}
main.max-w-\[1280px\] > :first-child > .rounded-xl.border:first-child,
main.max-w-\[1280px\] > :first-child > .side-card:first-child {
  border-top: 0 !important;
}
main.max-w-\[1280px\] .p-5,
main.max-w-\[1280px\] .p-6 { padding: 16px !important; }
main.max-w-\[1280px\] .px-5,
main.max-w-\[1280px\] .px-6 { padding-left: 16px !important; padding-right: 16px !important; }
main.max-w-\[1280px\] .mx-5,
main.max-w-\[1280px\] .mx-6 { margin-left: 16px !important; margin-right: 16px !important; }
.side-card > h3 { font-size: 16px; font-weight: 700; padding: 16px 16px 10px; border-bottom: 0; }
.side-body { padding: 4px 16px 16px; }

/* 아래쪽 확인 버튼은 화면 폭에 맞춰 넓게 */
.m-form-actions > a,
.m-form-actions > button {
  flex: 1 1 0;
  justify-content: center;
  text-align: center;
  padding-top: 13px !important;
  padding-bottom: 13px !important;
  font-size: 15px !important;
}

/* ── 무료강의 목록: 왼쪽 썸네일 + 오른쪽 글 ────────────────────── */
.lecture-search { padding: 12px 16px 0 !important; }
.lecture-search-form { flex-wrap: nowrap !important; }
.lecture-search-form input {
  flex: 1 1 auto !important;
  width: auto !important;
  height: 44px;
  padding: 0 16px !important;
  background: #f5f6f8 !important;
  border-color: transparent !important;
  border-radius: 22px !important;
}
.lecture-search-form button,
.lecture-search-reset {
  height: 44px;
  padding: 0 16px !important;
  border-radius: 22px !important;
  font-weight: 600 !important;
  display: inline-flex;
  align-items: center;
}
.lecture-section { padding: 24px 16px 0 !important; }
.lecture-section.hot { padding-top: 20px !important; }
.lecture-section-head { margin-bottom: 12px !important; }
.lecture-section-head h2 { font-size: 18px !important; font-weight: 700 !important; }
.cat-section-sub { font-size: 13px !important; margin-bottom: 4px !important; }
.lecture-divider { display: none; }
.cat-filter-bar { margin-top: 20px !important; }
.cat-filter-label { display: none; }
.cat-btn {
  border-radius: 18px !important;
  background: #ffffff !important;
  border-color: #dfe2e8 !important;
  color: #111 !important;
  font-weight: 500 !important;
}
.cat-btn.active { background: var(--m-primary) !important; border-color: var(--m-primary) !important; color: #ffffff !important; font-weight: 600 !important; }
.course-card:hover { transform: none !important; box-shadow: none !important; }
.course-card .card-title { font-size: 15px !important; font-weight: 500 !important; color: var(--m-text); }
.course-card .card-info { font-weight: 500 !important; font-size: 12.5px !important; }
.course-card .card-cat { margin-bottom: 3px !important; font-weight: 500 !important; }
.lecture-section.hot .course-card { flex-basis: 74% !important; border-radius: 10px !important; }
.lecture-section:not(.hot) .course-grid,
.lecture-search .course-grid { gap: 0 !important; }
.lecture-section:not(.hot) .course-card,
.lecture-search .course-card {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border: 0 !important;
  border-bottom: 1px solid var(--m-line) !important;
  box-shadow: none !important;
}
.lecture-section:not(.hot) .course-card .thumb-wrap,
.lecture-search .course-card .thumb-wrap {
  flex: 0 0 140px;
  width: 140px;
  border-radius: 8px !important;
}
.lecture-section:not(.hot) .course-card .card-body,
.lecture-search .course-card .card-body { padding: 0 !important; flex: 1 1 auto; min-width: 0; }
.lecture-section:not(.hot) .course-card .badges,
.lecture-search .course-card .badges { top: 4px; left: 4px; }
.lecture-section:not(.hot) .course-card .badge,
.lecture-search .course-card .badge { font-size: 10px !important; padding: 2px 5px !important; }
.lecture-section:not(.hot) .course-card .free-chip,
.lecture-search .course-card .free-chip { display: none; }
.lecture-section:not(.hot) .course-card .lecture-duration-chip,
.lecture-search .course-card .lecture-duration-chip { left: 4px; bottom: 4px; font-size: 10px; }

/* ── 강의 상세 (4.09.4) ─────────────────────────────────────────
   순서: 영상·제목 → 강의 설명 → 차시 → 핵심요약 → 전자책/후기 탭 */
main[data-lecture-slug] .ld-section,
main[data-lecture-slug] .ld-aside { display: contents; }
main[data-lecture-slug] #lecture-player { order: 1; border-top: 0 !important; }
main[data-lecture-slug] #lecture-description { order: 2; }
main[data-lecture-slug] #next-lessons { order: 3; }
main[data-lecture-slug] .lecture-note-card { order: 4; }
main[data-lecture-slug] #lecture-tabs { order: 5; }

/* 제목 영역 */
#lecture-player .p-5 { padding: 16px 16px 18px !important; }
#lecture-player .p-5 > div:first-child span:first-child { border-radius: 4px !important; font-size: 12px !important; }
#lecture-player h1 { font-size: 21px !important; }
#lecture-player .p-5 > .mt-3 { font-size: 13px !important; gap: 6px !important; }
#lecture-current-lesson-title { font-size: 14px !important; font-weight: 600 !important; }

/* 강의 설명 · 차시 */
#lecture-description > div:first-child,
#next-lessons > div:first-child { border-bottom: 0 !important; padding-top: 16px !important; padding-bottom: 6px !important; }
#lecture-description h2,
#next-lessons h2,
.lecture-note-card h2 { font-size: 17px !important; font-weight: 700 !important; }
#next-lessons > div:first-child > span { display: none; }
/* 설명 글이 비어 있으면 제목만 남지 않게 숨긴다 */
#lecture-description:not(:has([data-lecture-description])) { display: none; }
#lecture-description [data-lecture-description] { font-size: 15px !important; font-weight: 400 !important; line-height: 1.7 !important; color: #111 !important; padding-top: 4px !important; padding-bottom: 18px !important; }
#next-lessons .next-lesson-rail { padding: 6px 16px 16px !important; scroll-padding-left: 16px; }
#next-lessons .next-lesson-card { width: 168px !important; }
#next-lessons .lesson-thumb { border-radius: 8px !important; }
#next-lessons .next-lesson-card h3 { font-size: 14px !important; font-weight: 500 !important; }

/* 핵심요약 */
.lecture-note-card > div:first-child { border-bottom: 0 !important; padding-bottom: 4px !important; }
.lecture-note-card > div:first-child p { font-size: 13px !important; }
.lecture-note-body { padding-top: 8px !important; }
.lecture-note-list li { font-size: 15px !important; color: #111 !important; }
.lecture-note-list li span { font-weight: 400 !important; }
.lecture-note-body a { border-radius: 10px !important; font-size: 15px !important; padding: 14px !important; }

/* 탭: 반반 */
#lecture-tabs > div:first-child { padding: 0 !important; gap: 0 !important; }
#lecture-tabs .lecture-tab { flex: 1 1 0; text-align: center; padding: 14px 0 12px !important; font-size: 15px !important; font-weight: 600 !important; }
#lecture-tabs > .p-5 { padding: 18px 16px 8px !important; }
#lecture-tabs [data-tab-panel] > h2 { font-size: 18px !important; font-weight: 700 !important; }
#lecture-tabs [data-tab-panel] > h2 + p { font-size: 13.5px !important; font-weight: 400 !important; color: #111 !important; margin-bottom: 14px !important; }

/* 전자책: 바깥 테두리 상자 없이 */
main.max-w-\[1280px\] .ld-ebook-box.p-5 { border: 0 !important; padding: 0 !important; }
.ld-ebook-box > div:first-child { padding: 14px; background: #f5f6f8; border: 0 !important; border-radius: 12px !important; }
.ld-ebook-box > div:first-child strong.block.text-base { font-size: 16px !important; font-weight: 700 !important; }
.ld-ebook-box > div:first-child .text-2xl { font-size: 22px !important; font-weight: 800 !important; }
.ld-ebook-box h3 { font-size: 15px !important; font-weight: 700 !important; }
.ld-ebook-box .grid.grid-cols-2 > * { height: 9.5rem !important; border-radius: 10px !important; overflow: hidden; }
.ld-ebook-box .grid.grid-cols-2 img { height: 7.5rem !important; }
.ld-consent { font-size: 14.5px !important; line-height: 1.5; gap: 10px !important; }
.ld-consent input[type="checkbox"] { width: 20px !important; height: 20px !important; margin-top: 1px !important; }
.ld-ebook-box details { margin-left: 30px !important; border-radius: 8px !important; }
#ebook-tab-button { min-height: 52px !important; border-radius: 10px !important; font-size: 16px !important; font-weight: 700 !important; }
.ld-ebook-notes { font-size: 12.5px !important; font-weight: 400 !important; color: #111 !important; line-height: 1.55; }
.ld-ebook-box .bg-emerald-50 { border-radius: 10px !important; font-weight: 600 !important; }

/* 후기 탭 */
.ld-review-box { border: 0 !important; box-shadow: none !important; }
.ld-review-box .review-layout > div { padding: 0 0 20px !important; }
.ld-review-box .review-layout > div + div { padding-top: 20px !important; border-top: 8px solid var(--m-gap) !important; margin: 0 -16px; padding-left: 16px !important; padding-right: 16px !important; }
.ld-review-box h2 { font-size: 17px !important; font-weight: 700 !important; }
.ld-review-box h2 + p { font-size: 13.5px !important; font-weight: 400 !important; }
.ld-review-box .mt-5.border { border-radius: 10px !important; }
.ld-review-box textarea { border-radius: 0 !important; }
.ld-review-box [data-review-submit],
.ld-review-box [data-instructor-send] { border-radius: 8px !important; font-weight: 600 !important; }
.ld-review-box [data-instructor-send] { flex: 1 1 100%; padding-top: 13px !important; padding-bottom: 13px !important; }
.ld-review-box .review-mood-card { width: 64px !important; border-radius: 10px !important; }
#lecture-review-list > div { border-radius: 10px !important; }
#lecture-review-list p.text-sm { font-size: 15px !important; font-weight: 400 !important; }

/* 수강 완료 창 */
#lecture-done-modal section { border-radius: 14px !important; }
#lecture-done-modal button,
#lecture-done-modal a { border-radius: 8px !important; }

/* ── 마이페이지 (4.09.3) ─────────────────────────────────────────
   mypage.css 가 이 파일보다 늦게 불러와지므로 body.mp-body 를 앞에 붙여 우선한다. */
body.mp-body .mp-page { padding: 0 0 32px; }
body.mp-body .mp-heading { display: none; }
body.mp-body .mp-eyebrow { display: none; }
body.mp-body .mp-notice { margin: 12px 16px 0; border-radius: 8px !important; font-size: 13px; }

/* 프로필 */
body.mp-body .mp-card { border: 0; border-top: 8px solid var(--m-gap); }
body.mp-body .mp-profile { border-top: 0; flex-direction: column; align-items: stretch; gap: 18px; padding: 20px 16px 18px; }
body.mp-body .mp-profile::before { display: none; }
body.mp-body .mp-profile-identity { gap: 14px; }
body.mp-body .mp-avatar { border-radius: 50% !important; }
body.mp-body .mp-avatar-large { width: 60px; height: 60px; font-size: 24px; }
body.mp-body .mp-member { font-size: 12px; }
body.mp-body .mp-identity-text h2 { font-size: 20px; font-weight: 700; margin: 1px 0; line-height: 1.4; }
body.mp-body .mp-identity-text h2 > span { font-size: 16px; }
body.mp-body .mp-identity-text > p { font-size: 13px; }
body.mp-body .mp-edit-link {
  margin-top: 8px; padding: 5px 12px; font-size: 12.5px; font-weight: 500;
  border: 1px solid #dfe2e8; border-radius: 16px !important; color: #111;
}
body.mp-body .mp-profile-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #f5f6f8; border-radius: 12px !important; overflow: hidden;
}
body.mp-body .mp-stat { min-width: 0; padding: 12px 2px; gap: 6px; background: transparent; }
body.mp-body .mp-stat > span { font-size: 11.5px; color: #111; }
body.mp-body .mp-stat strong { font-size: 18px; color: #111; }
body.mp-body .mp-stat-social strong { color: var(--m-primary); }
body.mp-body .mp-stat i { display: none; }

/* 탭: 화면 폭을 3등분 */
body.mp-body .mp-tabs { margin: 0; gap: 0; border-top: 8px solid var(--m-gap); border-bottom: 1px solid var(--m-line); }
body.mp-body .mp-tabs a { flex: 1 1 0; justify-content: center; padding: 13px 2px 12px; font-size: 14.5px; font-weight: 600; color: #111; }
body.mp-body .mp-tabs a[aria-current] { color: #111; border-color: #111; }
body.mp-body .mp-tabs i { display: none; }

/* 본문 칸 */
body.mp-body .mp-layout { gap: 0; }
body.mp-body .mp-main-column,
body.mp-body .mp-sidebar { gap: 0; display: flex; flex-direction: column; align-items: stretch; }
body.mp-body .mp-main-column > .mp-card:first-child { border-top: 0; }
body.mp-body .mp-section-heading { padding: 18px 16px 10px; }
body.mp-body .mp-section-heading h2 { font-size: 17px; font-weight: 700; }
body.mp-body .mp-count { font-size: 15px; }
body.mp-body .mp-caption,
body.mp-body .mp-section-heading .mp-text-link { font-size: 13px; color: #111; }
body.mp-body .mp-course-list,
body.mp-body .mp-viewed-list,
body.mp-body .mp-ebook-list,
body.mp-body .mp-people-list { padding: 0 16px 6px; }
body.mp-body .mp-course { gap: 12px; padding: 14px 0; border-top-color: var(--m-line); align-items: center; }
body.mp-body .mp-course-cover { width: 64px; min-height: 64px; padding: 8px; border-radius: 10px !important; }
body.mp-body .mp-course-cover > span,
body.mp-body .mp-course-cover > small { display: none; }
body.mp-body .mp-course h3 { font-size: 15px; font-weight: 500; margin: 4px 0 2px; line-height: 1.45; }
body.mp-body .mp-course-info > p,
body.mp-body .mp-course-meta,
body.mp-body .mp-progress-label { font-size: 12px; }
body.mp-body .mp-badge { font-size: 11px; border-radius: 4px !important; }
body.mp-body .mp-progress { border-radius: 3px !important; }
body.mp-body .mp-progress-label { margin-top: 8px; }
body.mp-body .mp-viewed,
body.mp-body .mp-ebook { padding: 14px 0; border-top-color: var(--m-line); }
body.mp-body .mp-viewed-icon,
body.mp-body .mp-ebook-icon { width: 40px; height: 40px; border-radius: 10px !important; font-size: 17px; }
body.mp-body .mp-viewed h3,
body.mp-body .mp-ebook-info h3 { font-size: 15px; font-weight: 500; }
body.mp-body .mp-viewed p,
body.mp-body .mp-viewed div > span,
body.mp-body .mp-ebook-info p,
body.mp-body .mp-ebook-course { font-size: 12px; }
body.mp-body .mp-inline-empty { font-size: 14px; color: #111; padding: 6px 0 18px; }
body.mp-body .mp-activity-row { padding: 14px 16px; border-top-color: var(--m-line); }
body.mp-body .mp-activity-row h3 { font-size: 15px; font-weight: 400; line-height: 1.5; margin: 5px 0 4px; color: #111; }
body.mp-body .mp-activity-row > p { font-size: 12.5px; color: #111; }
body.mp-body .mp-section-footer { font-size: 14px; padding: 14px 16px; }

/* 비어 있을 때 */
body.mp-body .mp-empty { padding: 18px 16px 28px; }
body.mp-body .mp-empty-icon { width: 48px; height: 48px; font-size: 19px; margin-bottom: 12px; border-radius: 50% !important; }
body.mp-body .mp-empty h3 { font-size: 16px; }
body.mp-body .mp-empty p { font-size: 13.5px; line-height: 1.6; }
body.mp-body .mp-empty .mp-button,
body.mp-body .mp-empty > .mp-text-link { margin-top: 16px; }
body.mp-body .mp-button { min-height: 44px; padding: 10px 18px; font-size: 14px; border-radius: 8px !important; }
body.mp-body .mp-button i { font-size: 12px; }

/* 팔로워 · 팔로잉 */
body.mp-body .mp-heading-icon { display: none; }
body.mp-body .mp-network-tabs { display: flex; margin: 0 16px 12px; border-radius: 10px !important; }
body.mp-body .mp-network-tabs a { flex: 1 1 0; justify-content: center; font-size: 14px; border-radius: 8px !important; }
body.mp-body .mp-network-intro { margin: 0 16px; font-size: 13px; padding-bottom: 12px; }
body.mp-body .mp-person { padding: 14px 0; }
body.mp-body .mp-person h3 { font-size: 15px; }
body.mp-body .mp-person p { font-size: 12.5px; }
body.mp-body .mp-person-link { font-size: 12px; }
body.mp-body .mp-pagination { padding: 14px 16px; }
body.mp-body .mp-pagination > span,
body.mp-body .mp-page-position { font-size: 13px; }
body.mp-body .mp-page-button { width: 38px; height: 38px; border-radius: 8px !important; }

/* 오른쪽 칸: 위 숫자와 겹치는 팔로워 요약 · 홍보 문구는 숨기고 바로가기만 */
body.mp-body .mp-connections-preview,
body.mp-body .mp-community-card { display: none; }
body.mp-body .mp-shortcuts { padding: 18px 16px 6px; }
body.mp-body .mp-shortcuts h2 { font-size: 17px; margin-bottom: 4px; }
body.mp-body .mp-shortcuts a { font-size: 15px; color: #111; padding: 14px 0; border-bottom: 1px solid var(--m-line); }
body.mp-body .mp-shortcuts a:last-child { border-bottom: 0; }
body.mp-body .mp-shortcuts a span i { width: 26px; font-size: 15px; }

/* 프로필 편집 · 탈퇴 창: 아래에서 올라오는 시트 */
body.mp-body .mp-dialog {
  width: 100vw; max-width: 100vw; margin: auto 0 0; padding: 22px 16px calc(22px + env(safe-area-inset-bottom, 0px));
  border: 0; border-radius: 16px 16px 0 0 !important; max-height: 88dvh;
}
body.mp-body .mp-dialog h2 { font-size: 19px; }
body.mp-body .mp-close { border-radius: 50% !important; }
body.mp-body .mp-edit-form > p,
body.mp-body .mp-photo-editor > p,
body.mp-body .mp-photo-current > span:not(.mp-avatar) { font-size: 12.5px; }
body.mp-body .mp-input-row input,
body.mp-body .mp-dialog input:not([type="checkbox"]) { font-size: 16px !important; border-radius: 8px !important; }

/* ── 비회원이 커뮤니티 글을 눌렀을 때 안내 ─────────────────────── */
.m-members-toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  transform: translate(-50%, 12px);
  max-width: calc(100vw - 48px);
  padding: 12px 20px;
  background: rgba(17, 17, 17, 0.88);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  border-radius: 22px !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.m-members-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
