/* Client 공통 스타일. 모바일 반응형(≤ 768px, ≤ 480px) 브레이크포인트는 파일 하단 참고. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR",
               "Apple SD Gothic Neo", "맑은 고딕", sans-serif;
  color: #1f2937;
  background: #f5f6fa;
  -webkit-font-smoothing: antialiased;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 로그인 화면 ==================================================== */
.login-body { background: #f5f6fa; min-height: 100vh; }

.login-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.event-head {
  text-align: center;
  padding: 0 8px 28px;
}
.event-society {
  margin: 0 0 8px;
  font-size: 13px;
  color: #6b7280;
  letter-spacing: 0.02em;
}
.event-title {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  color: #111827;
  word-break: keep-all;
}
.event-period {
  margin: 0 0 18px;
  font-size: 14px;
  color: #374151;
}
.event-summary {
  margin: 16px 0 0;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.65;
  color: #374151;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-align: left;
  white-space: normal;
}

.login-box {
  margin-top: 20px;
  padding: 28px 24px 32px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.login-title {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

/* 필드 공통 */
.fld {
  display: block;
  margin-bottom: 14px;
}
.fld-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}
.fld input[type="text"],
.fld input[type="password"],
.fld input[type="email"] {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.fld textarea {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: #111827;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  outline: none;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.fld textarea:focus,
.fld input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* 버튼 */
.btn {
  display: inline-block;
  padding: 0 16px;
  height: 38px;
  line-height: 36px;
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
}
.btn:hover { background: #f9fafb; }
.btn-primary {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-block {
  display: block;
  width: 100%;
  height: 44px;
  line-height: 42px;
  margin-top: 6px;
}
.btn-sm {
  height: 28px;
  line-height: 26px;
  padding: 0 10px;
  font-size: 12px;
}

/* Flash */
.flash {
  margin-bottom: 14px;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid transparent;
}
.flash-error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}
.flash-info {
  color: #1e3a8a;
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* ===== 안내(Notice) 페이지 =========================================== */
.notice-wrap { padding-top: 96px; }
.notice-box {
  padding: 32px 28px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.notice-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}
.notice-message {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: #4b5563;
  word-break: keep-all;
}

/* ===== 로그인 이후 내부 페이지 (layout.php) =========================== */
.event-shell { min-height: 100vh; display: flex; flex-direction: column; }

.event-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.event-top-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.event-brand {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: #111827;
  text-decoration: none;
  line-height: 1.25;
}
.event-brand:hover { text-decoration: none; }
.event-brand-society {
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-brand-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-top-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #374151;
  flex-shrink: 0;
}
.event-top-user .inline { display: inline; margin: 0; }
.event-top-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 13px;
  font-weight: 700;
  user-select: none;
}
.event-top-name {
  font-weight: 600;
  color: #111827;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-content { flex: 1; padding: 24px; max-width: 1120px; width: 100%; margin: 0 auto; }
.event-foot { padding: 16px 24px; color: #9ca3af; font-size: 12px; text-align: center; }

.btn-ghost {
  height: 32px;
  line-height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
}
.btn-ghost:hover { background: #f3f4f6; color: #111827; border-color: #9ca3af; }

.card {
  padding: 24px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.card-title { margin: 0 0 12px; font-size: 16px; font-weight: 700; color: #111827; }
.card-desc  { margin: 0 0 12px; font-size: 14px; color: #4b5563; }
.empty { margin: 0; padding: 16px 0; color: #9ca3af; font-size: 13px; text-align: center; }

/* ===== 홈 화면 ======================================================= */
.event-content { max-width: 1120px; }

.event-banner {
  margin-bottom: 16px;
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  /* PC: 가로 4:1 비율로 고정하고, 세로가 과하게 커지지 않도록 max-height 가드.
     원본이 세로로 길면 object-fit: cover 로 중앙만 노출. */
  aspect-ratio: 4 / 1;
  max-height: 280px;
}
.event-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.home-profile {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.home-profile-item { display: flex; align-items: baseline; gap: 8px; }
.home-profile-label {
  font-size: 12px;
  color: #6b7280;
  letter-spacing: 0.02em;
}
.home-profile-value {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
}
.home-col-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home-col-side { display: flex; flex-direction: column; gap: 16px; }

.home-overview {
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 6px 12px;
  font-size: 14px;
}
.home-overview dt { color: #6b7280; font-weight: 500; }
.home-overview dd { margin: 0; color: #111827; }

.home-summary {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed #e5e7eb;
  font-size: 14px;
  line-height: 1.65;
  color: #374151;
  word-break: keep-all;
}

.material-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.material-item {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.material-link {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #111827;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.material-link:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  text-decoration: none;
}
.material-download {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #2563eb;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.material-download:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  text-decoration: none;
}
.material-download:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.material-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #dc2626;
  border-radius: 6px;
  letter-spacing: 0.02em;
}
.material-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.material-size {
  flex: 0 0 auto;
  font-size: 12px;
  color: #6b7280;
}

.home-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.home-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.home-menu-item:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  text-decoration: none;
}
.home-menu-arrow { font-size: 18px; line-height: 1; opacity: 0.6; }
.home-menu-label { flex: 1; min-width: 0; }
.home-menu-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-right: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #dc2626;
  border-radius: 999px;
}
.home-menu-item:hover .home-menu-badge { background: #fff; color: #dc2626; }

/* ===== Q&A =========================================================== */
.qna-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.qna-head .card-title { margin: 0; }

.qna-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qna-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: background .15s, border-color .15s;
}
.qna-row:hover { background: #eff6ff; border-color: #bfdbfe; }
.qna-row-new { border-color: #fecaca; background: #fff7ed; }
.qna-row-new:hover { background: #fff1e6; border-color: #fdba74; }

.qna-row-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: #111827;
  text-decoration: none;
}
.qna-row-link:hover { text-decoration: none; }

.qna-row-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
}
.qna-row-status.is-answered { color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; }
.qna-row-status.is-waiting  { color: #6b7280; background: #f3f4f6; border: 1px solid #e5e7eb; }

.qna-row-question {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qna-new-tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: #dc2626;
  border-radius: 999px;
}

.qna-row-date {
  flex: 0 0 auto;
  font-size: 12px;
  color: #6b7280;
}

.qna-row-del {
  flex: 0 0 auto;
  margin: 0 12px 0 0;
}

/* Write form */
.qna-form textarea { min-height: 200px; }
.qna-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* Detail */
.qna-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}
.qna-detail-date { margin-left: auto; font-size: 12px; color: #6b7280; }

.qna-block { margin-bottom: 16px; }
.qna-block:last-child { margin-bottom: 0; }
.qna-block-label {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #6b7280;
  text-transform: uppercase;
}
.qna-block-body {
  padding: 14px 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.65;
  color: #111827;
  word-break: break-word;
}
.qna-block-answer .qna-block-body { background: #eff6ff; border-color: #bfdbfe; }
.qna-block-empty {
  padding: 14px 16px;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  border-radius: 8px;
  color: #9ca3af;
  font-size: 13px;
  text-align: center;
}
.qna-block-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
  text-align: right;
}

/* ===== 페이지 공통 ==================================================== */
.page-nav {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
}
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  color: #4b5563;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  text-decoration: none;
}
.page-back:hover { background: #f3f4f6; color: #111827; text-decoration: none; }

/* ===== 강의프로그램 =================================================== */
.program-image {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.program-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* ===== 반응형 ======================================================== */
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-col-side { order: -1; }
}

@media (max-width: 768px) {
  /* 내부 페이지 헤더 */
  .event-top-inner { padding: 10px 14px; gap: 10px; }
  .event-brand-society { font-size: 10px; }
  .event-brand-title { font-size: 15px; }
  .event-top-avatar { width: 28px; height: 28px; font-size: 12px; }
  .event-top-name { max-width: 80px; font-size: 12px; }
  .btn-ghost { height: 30px; line-height: 28px; padding: 0 10px; font-size: 11px; }
  .event-content { padding: 14px; }
  .event-foot { padding: 12px 14px; }

  /* 배너 / 홈 — 모바일은 원본 비율 유지(잘라내지 않음) */
  .event-banner {
    margin-bottom: 12px;
    border-radius: 8px;
    aspect-ratio: auto;
    max-height: none;
  }
  .event-banner img { height: auto; object-fit: unset; }
  .home-profile {
    gap: 12px 16px;
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 8px;
  }
  .home-profile-label { font-size: 11px; }
  .home-profile-value { font-size: 13px; }

  .home-grid { gap: 14px; }
  .home-col-main { gap: 12px; }

  .card { padding: 16px; border-radius: 8px; }
  .card-title { font-size: 15px; margin-bottom: 10px; }

  .home-overview { grid-template-columns: 72px 1fr; font-size: 13px; }

  .material-link { padding: 9px 12px; gap: 10px; }
  .material-icon { width: 36px; height: 36px; font-size: 10px; }
  .material-name { font-size: 13px; }
  .material-size { font-size: 11px; }
  .material-download { width: 40px; }

  .home-menu { padding: 6px; }
  .home-menu-item { padding: 12px 14px; font-size: 13px; }

  .qna-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .qna-row-link { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .qna-row-question { flex: 1 1 100%; white-space: normal; }
  .qna-row-date { margin-left: auto; }
  .qna-form textarea { min-height: 160px; font-size: 15px; /* iOS 확대 방지 */ }

  /* 로그인 */
  .login-wrap { padding: 28px 16px 40px; }
  .event-head { padding: 0 4px 20px; }
  .event-title { font-size: 20px; }
  .event-period { font-size: 13px; }
  .event-summary { padding: 12px 14px; font-size: 13px; }
  .login-box { padding: 22px 18px 26px; border-radius: 8px; }
  .login-title { font-size: 15px; margin-bottom: 14px; }
  .fld input[type="text"],
  .fld input[type="password"],
  .fld input[type="email"] { height: 44px; font-size: 15px; /* iOS 자동 확대 방지 */ }
  .btn-block { height: 46px; line-height: 44px; font-size: 15px; }

  /* 안내 페이지 */
  .notice-wrap { padding-top: 56px; }
  .notice-box { padding: 24px 20px; }
  .notice-title { font-size: 17px; }
}

@media (max-width: 480px) {
  .event-top-inner { padding: 8px 12px; }
  .event-brand-society { display: none; }
  .event-top-name { max-width: 56px; }
  .event-content { padding: 12px; }

  /* 행사 개요: 좁은 화면에서 라벨/값 세로 배치 */
  .home-overview { grid-template-columns: 1fr; gap: 2px 0; }
  .home-overview dt { font-size: 11px; color: #6b7280; }
  .home-overview dd { margin-bottom: 6px; }
  .home-overview dd:last-child { margin-bottom: 0; }

  .material-link { flex-wrap: wrap; }
  .material-name { flex: 1 1 100%; order: 2; white-space: normal; overflow: visible; text-overflow: clip; }
  .material-icon { order: 1; width: 32px; height: 32px; }
  .material-size { order: 3; margin-left: auto; }
  .material-download { width: 38px; }

  .login-wrap { padding: 20px 12px 32px; }
  .event-title { font-size: 18px; }
}

/* ===== 강의 영상 목록 / 수강 팝업 ===================================== */
.video-list-head { padding: 4px 0 16px; border-bottom: 1px solid #e5e7eb; margin-bottom: 16px; }
.video-list-title { margin: 0 0 4px; font-size: 20px; font-weight: 700; color: #111827; }
.video-list-sub   { margin: 0; font-size: 13px; color: #6b7280; }

.video-score-banner {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
  padding: 12px 16px; margin: 0 0 16px;
  background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 10px;
  color: #3730a3;
}
.video-score-label { font-size: 13px; color: #4338ca; margin-right: 4px; }
.video-score-value { font-size: 22px; font-weight: 700; color: #1e1b4b; }
.video-score-slash { color: #6b7280; }
.video-score-max   { font-size: 15px; font-weight: 600; color: #3730a3; }
.video-score-hint  { margin-left: auto; font-size: 12px; color: #6b7280; }

.video-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.video-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 10px;
}
.video-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.video-row-title { margin: 0; font-size: 15px; font-weight: 600; color: #111827; word-break: break-word; }
.video-row-badge { display: inline-block; margin-left: 8px; padding: 1px 6px; font-size: 11px; font-weight: 600; background: #10b981; color: #fff; border-radius: 4px; vertical-align: 2px; }
.video-row-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #6b7280; }
.video-row-meta strong { color: #111827; font-weight: 600; font-variant-numeric: tabular-nums; }
.video-row-progress { display: flex; align-items: center; gap: 10px; }
.video-row-bar { flex: 1; height: 6px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.video-row-bar-fill { height: 100%; background: #4f46e5; transition: width .3s ease; }
.video-row-pct { font-size: 12px; color: #4b5563; font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.video-row-pct strong { color: #111827; font-weight: 600; }
.video-row-action { flex: 0 0 auto; }
.video-row-action .btn { min-width: 92px; }

@media (max-width: 640px) {
  .video-row { flex-direction: column; align-items: stretch; }
  .video-row-action { display: flex; }
  .video-row-action .btn { width: 100%; }
  .video-score-hint { margin-left: 0; width: 100%; }
}

/* 수강 팝업 */
.watch-modal { position: fixed; inset: 0; z-index: 100; display: block; }
.watch-modal[hidden] { display: none; }
.watch-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.6); }
.watch-modal-dialog {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: calc(100% - 24px); max-width: 960px;
  max-height: calc(var(--watch-vh, 100vh) - 32px);
  background: #fff; border-radius: 12px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
}
.watch-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid #e5e7eb; background: #f9fafb;
}
.watch-modal-title { margin: 0; font-size: 16px; font-weight: 700; color: #111827; flex: 1; min-width: 0; word-break: break-word; }
.watch-modal-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.watch-modal-body { padding: 14px 16px 18px; overflow: auto; }
.watch-modal-player {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: 8px; overflow: hidden; margin-bottom: 12px;
}
.watch-modal-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* iframe(cross-origin) 이 마우스 이벤트를 흡수하므로 그 위에 투명 캡처 레이어를 덮어 mousemove/click 을 부모로 전달 */
.watch-player-capture {
  position: absolute; inset: 0; z-index: 1;
  background: transparent; cursor: pointer;
}
.watch-modal-player.is-idle .watch-player-capture { cursor: none; }

/* 중앙 오버레이 컨트롤 그룹 (뒤로 / 재생토글 / 앞으로) */
.watch-player-overlay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 18px;
  z-index: 2;
  opacity: 1; transition: opacity .2s ease;
}
.watch-player-overlay[data-state="playing"] { opacity: 0; }
.watch-modal-player:hover .watch-player-overlay,
.watch-player-overlay:focus-within { opacity: 1; }

.watch-player-toggle {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); color: #fff; border: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .18s ease, transform .12s ease;
}
.watch-player-toggle:hover { background: rgba(0, 0, 0, 0.78); transform: scale(1.06); }
.watch-player-toggle:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
.watch-player-toggle .watch-player-icon { width: 32px; height: 32px; display: none; }
.watch-player-toggle[data-state="paused"] .watch-player-icon-play { display: block; }
.watch-player-toggle[data-state="playing"] .watch-player-icon-pause { display: block; }

/* 상단 헤더 아이콘 토글 */
.watch-icon-btn-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  background: #4f46e5; border: 1px solid #4f46e5; color: #fff; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.watch-icon-btn-toggle:hover { background: #4338ca; border-color: #4338ca; }
.watch-icon-btn-toggle:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
.watch-icon-btn-toggle .watch-player-icon { width: 18px; height: 18px; display: none; }
.watch-icon-btn-toggle[data-state="paused"] .watch-player-icon-play { display: block; }
.watch-icon-btn-toggle[data-state="playing"] .watch-player-icon-pause { display: block; }

/* 전체화면 아이콘 버튼 */
.watch-icon-btn-fs {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; border: 1px solid #d1d5db; color: #374151; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.watch-icon-btn-fs:hover { background: #f3f4f6; border-color: #9ca3af; color: #111827; }
.watch-icon-btn-fs:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
.watch-icon-btn-fs .watch-fs-icon { width: 18px; height: 18px; display: none; }
.watch-icon-btn-fs[data-fs="off"] .watch-fs-icon-enter { display: block; }
.watch-icon-btn-fs[data-fs="on"]  .watch-fs-icon-exit  { display: block; }

/* 전체화면 종료 버튼 — 기본 숨김, fullscreen / fallback 상태에서만 표시 */
.watch-player-fs-exit {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  height: 40px; padding: 0 14px 0 10px; gap: 6px;
  border: 0; border-radius: 999px;
  background: rgba(0, 0, 0, 0.62); color: #fff;
  display: none; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; font-weight: 600;
  transition: background .15s ease, opacity .3s ease, transform .12s ease;
}
.watch-player-fs-exit:hover { background: rgba(0, 0, 0, 0.85); transform: scale(1.03); }
.watch-player-fs-exit:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.watch-player-fs-exit svg { width: 18px; height: 18px; display: block; }
.watch-player-fs-exit-text { line-height: 1; }

/* 네이티브 fullscreen — .watch-modal-player 가 전체화면이 되는 경우 */
.watch-modal-player:fullscreen         { aspect-ratio: auto; width: 100vw; height: 100vh; border-radius: 0; margin: 0; background: #000; }
.watch-modal-player:-webkit-full-screen{ aspect-ratio: auto; width: 100vw; height: 100vh; border-radius: 0; margin: 0; background: #000; }
.watch-modal-player:fullscreen iframe,
.watch-modal-player:-webkit-full-screen iframe { width: 100vw; height: 100vh; }
.watch-modal-player:fullscreen .watch-player-toggle,
.watch-modal-player:-webkit-full-screen .watch-player-toggle { width: 88px; height: 88px; }
.watch-modal-player:fullscreen .watch-player-toggle .watch-player-icon,
.watch-modal-player:-webkit-full-screen .watch-player-toggle .watch-player-icon { width: 40px; height: 40px; }

/* 전체화면 상태에서 종료 버튼 노출 */
.watch-modal-player:fullscreen         .watch-player-fs-exit,
.watch-modal-player:-webkit-full-screen .watch-player-fs-exit,
body.watch-fs-fallback                 .watch-player-fs-exit { display: inline-flex; }

/* 전체화면 idle — 일정시간 움직임 없으면 커서/컨트롤 숨김 (JS 가 is-idle 클래스 토글) */
.watch-modal-player.is-idle { cursor: none; }
.watch-modal-player.is-idle .watch-player-overlay,
.watch-modal-player.is-idle .watch-player-fs-exit {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity .4s ease;
}
.watch-modal-player .watch-player-overlay,
.watch-modal-player .watch-player-fs-exit { transition: opacity .2s ease, background .15s ease, transform .12s ease; }

/* iOS 대체(네이티브 fullscreen 미지원) — body 에 watch-fs-fallback 클래스가 붙음 */
body.watch-fs-fallback { overflow: hidden; }
body.watch-fs-fallback .watch-modal-dialog {
  position: fixed; inset: 0; transform: none;
  width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh;
  border-radius: 0;
}
body.watch-fs-fallback .watch-modal-body { padding: 6px 10px; overflow: auto; }
body.watch-fs-fallback .watch-modal-player { aspect-ratio: auto; height: calc(100vh - 56px - 72px); }
body.watch-fs-fallback .watch-seek,
body.watch-fs-fallback .watch-modal-meta,
body.watch-fs-fallback .watch-modal-sponsors { display: none; }
/* 시크 프로그레스바 */
.watch-seek { display: flex; align-items: center; gap: 12px; margin: 0 2px 10px; }
.watch-seek-track {
  position: relative; flex: 1; height: 10px; border-radius: 999px;
  background: #e5e7eb; cursor: pointer; overflow: visible;
}
.watch-seek-reached {
  position: absolute; left: 0; top: 0; height: 100%;
  background: #c7d2fe; border-radius: 999px; transition: width .15s linear;
}
.watch-seek-played {
  position: absolute; left: 0; top: 0; height: 100%;
  background: #4f46e5; border-radius: 999px; transition: width .12s linear;
}
.watch-seek-thumb {
  position: absolute; top: 50%; width: 16px; height: 16px; margin-left: -8px;
  transform: translateY(-50%);
  background: #4f46e5; border: 2px solid #fff; border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2); pointer-events: none;
  transition: left .12s linear, transform .1s ease;
}
.watch-seek-track:hover .watch-seek-thumb { transform: translateY(-50%) scale(1.15); }
.watch-seek-times {
  font-size: 12px; color: #4b5563; font-variant-numeric: tabular-nums;
  display: inline-flex; gap: 4px; white-space: nowrap;
}
.watch-seek-sep { color: #9ca3af; }

/* pending (seek 버퍼링 중) */
.watch-seek.is-pending .watch-seek-track { cursor: progress; }
.watch-seek.is-pending .watch-seek-played {
  background: linear-gradient(90deg, #4f46e5 0%, #a5b4fc 50%, #4f46e5 100%);
  background-size: 200% 100%;
  animation: watch-seek-shimmer 1.1s linear infinite;
  opacity: 0.85;
}
@keyframes watch-seek-shimmer {
  from { background-position: 0% 0; }
  to   { background-position: -200% 0; }
}
.watch-seek.is-pending .watch-seek-thumb {
  background: #fff; border: 2px solid rgba(79, 70, 229, 0.25); border-top-color: #4f46e5;
  animation: watch-seek-spin 0.7s linear infinite;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}
@keyframes watch-seek-spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

.watch-modal-meta { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; }
.watch-modal-stats { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #6b7280; }
.watch-modal-stats strong { color: #111827; font-weight: 600; font-variant-numeric: tabular-nums; }
.watch-modal-hint { color: #9ca3af; }

.watch-modal-sponsors { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #e5e7eb; }
.watch-modal-sponsors-title { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; }
.watch-modal-sponsors-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.watch-modal-sponsors-list li { background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 1; }
.watch-modal-sponsors-list img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

body.modal-open { overflow: hidden; }

/* 모바일 landscape — 수강 팝업 풀 뷰포트 활용 (주소창 대응) */
@media (orientation: landscape) and (max-height: 520px) {
  .watch-modal-dialog {
    position: fixed; inset: 0; top: 0; left: 0; right: 0; bottom: 0;
    transform: none;
    width: 100vw; height: var(--watch-vh, 100vh);
    max-width: 100vw; max-height: var(--watch-vh, 100vh);
    border-radius: 0;
  }
  .watch-modal-head { padding: 6px 12px; }
  .watch-modal-title { font-size: 13px; }
  .watch-modal-body { padding: 8px 12px; overflow: auto; }
  .watch-modal-player { aspect-ratio: auto; height: calc(var(--watch-vh, 100vh) - 56px - 74px); margin-bottom: 6px; }
  .watch-seek { margin-bottom: 4px; }
  .watch-modal-meta { padding: 6px 10px; }
  .watch-modal-sponsors { display: none; }
  .watch-icon-btn-toggle { width: 34px; height: 34px; }
  .watch-icon-btn-fs { width: 30px; height: 30px; }
  .watch-icon-btn-fs .watch-fs-icon { width: 16px; height: 16px; }
  .watch-icon-btn-toggle .watch-player-icon { width: 14px; height: 14px; }
}

/* 모바일 portrait — 모달을 주소창 아래 실제 뷰포트에 꽉 맞춤 */
@media (max-width: 480px) and (orientation: portrait) {
  .watch-modal-dialog {
    position: fixed; top: 0; left: 0; right: 0; bottom: auto;
    transform: none;
    width: 100vw;
    height: var(--watch-vh, 100vh);
    max-height: var(--watch-vh, 100vh);
    border-radius: 0;
  }
  .watch-modal-body { padding: 10px 12px 14px; }
  .watch-modal-sponsors-list { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* 이수내역 */
.record-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.record-table th, .record-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; text-align: left; font-size: 13px; }
.record-table thead th { background: #f9fafb; color: #374151; font-weight: 600; }
.record-table tbody tr:last-child td { border-bottom: 0; }
.record-table .col-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.record-summary { margin-top: 14px; padding: 12px 16px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; color: #374151; }
.record-summary strong { color: #111827; }

@media (max-width: 640px) {
  .record-table thead { display: none; }
  .record-table tbody tr { display: block; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
  .record-table tbody td { display: flex; justify-content: space-between; border: 0; padding: 6px 12px; }
  .record-table tbody td::before { content: attr(data-label); font-weight: 600; color: #6b7280; }
}
