@charset "utf-8";

/* =========================================================
   POPPI Footer — Figma 1191-508 1:1
   container 1920×595, top corners radius 100
   상단 드립+배경: footer-PC.png (풀폭), 정보 3컬럼 + rights 3컬럼
   ========================================================= */

/* index/sub-page section wrap — 배경 제거(투명) 처리. 내부 .poppi-footer 만
   시각적으로 노출되도록 한다. 상단 마이너스 마진은 이전 푸터 라이즈 요구 유지. */
.poppi-footer-wrap {
  position: relative;
  margin-top: clamp(-40px, -3.65vw, -70px);
  background: transparent;
  width: 100%;
  overflow: hidden;
}

/* Figma 1191-508 — footer-PC.png(높이 기준) 위에 콘텐츠 오버레이, 부족분은 ::after 배경 */
.poppi-footer {
  --footer-text: #fde2cf;
  --footer-title: clamp(16px, 1.04vw, 20px);
  --footer-body: clamp(14px, 0.83vw, 16px);
  --footer-line: 2.1;
  --footer-pad-top: clamp(72px, 11.05vw, 212px);
  --footer-pad-x: clamp(24px, 5vw, 250px);
  --footer-pad-bottom: clamp(32px, 5vw, 96px);
  --footer-bottom-bg: #4C3630;
  --footer-rights-block: clamp(72px, 8vw, 136px);
  --footer-content-gap: clamp(20px, 2.5vw, 48px);

  position: relative;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  display: grid;
  grid-template-areas: "footer-stack";
  padding: 0;
  gap: 0;
  min-height: auto;
  color: var(--footer-text);
  overflow: hidden;
  border: none;
  outline: none;
  box-shadow: none;
  border-radius: clamp(40px, 5.21vw, 100px) clamp(40px, 5.21vw, 100px) 0 0;
  font-family: "Paperlogy", "Pretendard", "Noto Sans KR", sans-serif;
}

/* 콘텐츠가 이미지보다 길어질 때 하단 배경 채움 */
.poppi-footer::after {
  content: "";
  grid-area: footer-stack;
  align-self: stretch;
  width: 100%;
  min-height: 100%;
  border: none;
  outline: none;
  border-radius: inherit;
  background: var(--footer-bottom-bg);
  z-index: 0;
  pointer-events: none;
}

/* in-flow: 이미지 높이 = footer 기본 높이, 비율 유지 */
.footer-bg {
  grid-area: footer-stack;
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  align-self: start;
  z-index: 1;
  border: 0;
  outline: none;
  box-shadow: none;
  pointer-events: none;
  user-select: none;
}

/* ── INFO 행: Contact | 중앙 로고 | Quick Menu — 이미지 위 오버레이 ── */
.footer-info {
  grid-area: footer-stack;
  align-self: end;
  z-index: 2;
  box-sizing: border-box;
  width: 100%;
  margin-bottom: calc(var(--footer-rights-block) + var(--footer-content-gap));
  padding: var(--footer-pad-top) var(--footer-pad-x) 0;
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  align-items: flex-end;
  gap: clamp(24px, 5vw, 228px);
}

/* ── RIGHTS 행: made fresh ... | 소셜 | © 2025 — 이미지 위 오버레이 ── */
.footer-rights {
  grid-area: footer-stack;
  align-self: end;
  z-index: 2;
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 0;
  padding: 0 var(--footer-pad-x) var(--footer-pad-bottom);
  display: grid;
  grid-template-columns: max-content auto max-content;
  align-items: end;
  justify-content: space-between;
  justify-items: center;
  gap: clamp(20px, 5vw, 330px);
}

.poppi-footer h2 {
  margin: 0 0 15px;
  font-family: "Paperlogy", sans-serif;
  font-size: var(--footer-title);
  font-weight: 700;
  line-height: 1.2;
  color: var(--footer-text);
  letter-spacing: 0;
}

.poppi-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.poppi-footer a {
  color: inherit;
  text-decoration: none;
}

/* Contact / Quick Menu 본문 공통 — 16px Paperlogy Regular, line-height 2.1 */
.footer-contact li,
.footer-contact a,
.menu-grid a,
.footer-brand-copy,
.footer-tagline,
.footer-copyright {
  font-family: "Paperlogy", sans-serif;
  font-size: var(--footer-body);
  font-weight: 400;
  line-height: var(--footer-line);
  color: var(--footer-text);
  letter-spacing: 0;
}

/* Contact 컬럼 (좌) — 기본은 유동 폭(PC 고정 폭은 1201px+에서 적용) */
.footer-contact {
  justify-self: start;
  width: auto;
  min-width: 0;
  max-width: 100%;
}

.footer-contact li {
  margin: 0;
}

.footer-contact li,
.footer-contact a {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* 중앙 로고 컬럼 */
.footer-center {
  justify-self: center;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 1.04vw, 20px);
  width: auto;
  min-width: 0;
  max-width: 100%;
}

.footer-logo {
  display: block;
  width: clamp(170px, 12.92vw, 248px);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.footer-tagline {
  margin: 0;
  text-align: center;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}

/* Quick Menu (우) — 2컬럼 grid, h2·링크 열 왼쪽 정렬 통일 */
.footer-menu {
  justify-self: end;
  width: auto;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-menu h2 {
  text-align: left !important;
  align-self: stretch;
  width: 100%;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 50px;
  align-self: stretch;
  width: 100%;
  justify-content: start;
  justify-items: start;
}

.menu-grid li {
  margin: 0;
  text-align: left;
}

.menu-grid a {
  white-space: normal;
  overflow-wrap: anywhere;
  transition: opacity 0.2s ease;
}

.menu-grid a:hover,
.footer-contact a:hover {
  opacity: 0.7;
}

/* RIGHTS 행 좌/우 텍스트 */
.footer-brand-copy {
  margin: 0;
  justify-self: start;
  text-align: left;
  width: auto;
  min-width: 0;
  max-width: 100%;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

.footer-copyright {
  margin: 0;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}

/* 소셜 아이콘 */
.footer-socials {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: clamp(22px, 1.83vw, 35px);
  width: 185px;
  height: clamp(28px, 1.77vw, 40px);
}

.footer-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: clamp(28px, 1.77vw, 40px);
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.9;
}

.footer-socials a:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.footer-socials img {
  display: block;
  width: auto;
  height: clamp(24px, 1.77vw, 34px);
}

/* 법적 링크 — footer-rights 좌측 (brand-copy 자리)
   사용자 요청: 이용약관/개인정보처리방침을 "버튼" 형태로 표시. */
.footer-legal {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(8px, 0.83vw, 14px);
  justify-self: start;
  margin: 0;
  width: max-content;
  min-width: max-content;
  max-width: none;
  font-family: "Paperlogy", sans-serif;
  line-height: 1.4;
}

.footer-legal a,
.footer-legal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(6px, 0.52vw, 10px) clamp(12px, 1.04vw, 18px);
  font-family: "Paperlogy", sans-serif;
  font-size: clamp(12px, 0.78vw, 14px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--footer-text);
  background: transparent;
  border: none;                                                 /* 사용자 요청 — 버튼 테두리 제거 */
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.85;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.footer-legal a:hover,
.footer-legal__btn:hover {
  opacity: 1;
  text-decoration: none;
}

/* Align first legal button's text with Contact column start (no left padding). */
.footer-legal a:first-of-type,
.footer-legal__btn:first-of-type {
  padding-left: 0 !important;
}

.footer-legal__sep {
  opacity: 0.55;
  user-select: none;
  font-size: clamp(12px, 0.78vw, 14px);
  line-height: 1;
}

/* ───────────── 태블릿 (630~1200px) — 3컬럼, 드립·배경 정렬, Figma 간격 ───────────── */
@media (max-width: 1200px) and (min-width: 630px) {

  .poppi-footer-wrap,
  .poppi-footer-wrap[data-common-footer] {
    position: relative;
    margin-top: clamp(-56px, -6vw, -84px);
    width: 100%;
    overflow: hidden;
    background: transparent !important;
  }

  .poppi-footer {
    --footer-title: 14px;
    --footer-body: 14px;
    --footer-line: 2.1;
    --footer-h2-gap: 15px;
    --footer-pad-top: clamp(92px, 14.5vw, 148px);
    --footer-pad-x: clamp(16px, 3.5vw, 56px);
    --footer-pad-bottom: clamp(28px, 4vw, 48px);
    --footer-rights-block: clamp(56px, 7vw, 80px);
    --footer-content-gap: clamp(16px, 2.2vw, 28px);
    --footer-info-gap: clamp(6px, 1.2vw, 20px);
    --footer-menu-col-gap: clamp(8px, 1.6vw, 24px);

    position: relative;
    overflow: hidden;
    min-height: 0;
    max-width: 100%;
    border-radius: clamp(36px, 5vw, 72px) clamp(36px, 5vw, 72px) 0 0;
    line-height: 0;

    /* [보정 핵심] 투명 대신 푸터 본연의 갈색 배경색을 주어 1px 테두리 미세 틈새를 메웁니다 */
    background-color: #4c3630 !important;
  }

  .poppi-footer::after {
    align-self: stretch;
    min-height: 100%;
    border-radius: inherit;
    background: var(--footer-bottom-bg, #4c3630);
    z-index: 0;
  }

  .footer-bg {
    display: block;
    width: calc(100% + 1px);
    /* [보정 핵심] 아주 미세하게 너비를 넓혀 안티앨리어싱 잘림을 완충합니다 */
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: inherit;
    z-index: 1;
    /* 서브픽셀 렌더링 부드럽게 처리 */
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  .poppi-footer h2 {
    margin: 0 0 var(--footer-h2-gap);
    font-size: var(--footer-title);
    font-weight: 400;
    line-height: 1.2;
  }

  .footer-info {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--footer-info-gap);
    row-gap: 0;
    justify-content: stretch;
    align-items: flex-end;
    margin-bottom: calc(var(--footer-rights-block) + var(--footer-content-gap));
    padding: var(--footer-pad-top) var(--footer-pad-x) 0;
    line-height: normal;
    overflow: hidden;
  }

  .footer-info > .footer-contact,
  .footer-info > .footer-center,
  .footer-info > .footer-menu {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .footer-contact {
    justify-self: start;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-bottom: 0;
    overflow: hidden;
  }

  .footer-contact ul {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 100%;
  }

  .footer-contact li {
    margin: 0;
  }

  .footer-contact li,
  .footer-contact a {
    font-size: var(--footer-body);
    font-weight: 400;
    line-height: var(--footer-line);
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 100%;
  }

  .footer-center {
    justify-self: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-bottom: 0;
    gap: 12px;
    line-height: normal;
  }

  .footer-logo {
    width: clamp(110px, 14vw, 160px);
    max-width: 100%;
  }

  .footer-tagline {
    margin: 0;
    font-size: var(--footer-body);
    font-weight: 400;
    line-height: 1.35;
    white-space: normal;
    max-width: 100%;
  }

  .footer-menu {
    justify-self: end;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-bottom: 0;
    overflow: hidden;
    line-height: normal;
  }

  .footer-menu h2 {
    text-align: left;
    align-self: stretch;
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 100%;
  }

  .menu-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--footer-menu-col-gap);
    row-gap: 0;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    justify-content: start;
    justify-items: start;
  }

  .menu-grid li {
    margin: 0;
    text-align: left;
    min-width: 0;
    max-width: 100%;
  }

  .menu-grid a {
    font-size: var(--footer-body);
    font-weight: 400;
    line-height: var(--footer-line);
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 100%;
  }

  .footer-rights {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    column-gap: var(--footer-info-gap);
    align-items: end;
    justify-content: stretch;
    justify-items: center;
    padding: 0 var(--footer-pad-x) var(--footer-pad-bottom);
    line-height: normal;
    overflow: hidden;
  }

  .footer-rights > .footer-legal,
  .footer-rights > .footer-brand-copy,
  .footer-rights > .footer-copyright {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .footer-legal {
    width: auto;
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }

  .footer-brand-copy {
    justify-self: start;
    width: auto;
    min-width: 0;
    max-width: 100%;
    font-size: var(--footer-body);
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .footer-copyright {
    justify-self: end;
    width: auto;
    min-width: 0;
    max-width: 100%;
    font-size: var(--footer-body);
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: right;
  }

  .footer-socials {
    width: auto;
    height: 28px;
    gap: clamp(16px, 2.5vw, 28px);
    flex-shrink: 0;
  }

  .footer-socials a {
    height: 28px;
  }

  .footer-socials img {
    height: 22px;
  }

  /* 태블릿 — 이용약관/개인정보처리방침 버튼 사이즈 축소 */
  .footer-legal {
    display: inline-flex;
    gap: 8px;
  }

  .footer-legal a,
  .footer-legal__btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* 태블릿 좁은 폭 (630~900px) — 677px 등 초좁은 3열 추가 축소 */
@media (max-width: 900px) and (min-width: 630px) {
  .poppi-footer {
    --footer-pad-x: clamp(12px, 2.5vw, 24px);
    --footer-info-gap: clamp(4px, 1vw, 10px);
    --footer-menu-col-gap: clamp(6px, 1.4vw, 12px);
    --footer-pad-top: clamp(80px, 13vw, 120px);
    --footer-body: clamp(10px, 1.45vw, 13px);
    --footer-line: 1.75;
  }

  .poppi-footer h2 {
    font-size: clamp(10px, 1.45vw, 13px);
    margin-bottom: clamp(6px, 1.2vw, 10px);
  }

  .footer-logo {
    width: clamp(76px, 9.5vw, 110px);
  }

  .footer-tagline {
    font-size: clamp(9px, 1.35vw, 12px);
    line-height: 1.3;
  }

  .footer-contact li,
  .footer-contact a,
  .menu-grid a,
  .footer-copyright,
  .footer-brand-copy {
    font-size: clamp(9px, 1.35vw, 12px);
    line-height: 1.7;
  }

  .footer-legal a,
  .footer-legal__btn {
    font-size: clamp(9px, 1.25vw, 11px);
    padding: 4px 8px;
  }
}

/* ───────────── 모바일 (≤629px) — Figma 모바일 footer ───────────── */
@media (max-width: 629px) {
  .poppi-footer {
    --footer-body: 13px;
    --footer-line: 1.65;
    --footer-pad-top: clamp(48px, 14vw, 72px);
    --footer-pad-x: 20px;
    --footer-pad-bottom: clamp(28px, 7vw, 36px);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: clamp(400px, 105vw, 480px);
    padding: var(--footer-pad-top) var(--footer-pad-x) var(--footer-pad-bottom);
    border-radius: clamp(24px, 8.53vw, 32px) clamp(24px, 8.53vw, 32px) 0 0;
  }

  .poppi-footer::after {
    position: absolute;
    inset: 0;
    grid-area: unset;
  }

  .footer-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    grid-area: unset;
  }

  /* 제거: Quick Menu, tagline, PC 카피, Contact 제목 */
  .footer-menu,
  .footer-tagline,
  .footer-brand-copy {
    display: none !important;
  }

  .footer-contact h2 {
    display: none;
  }

  .footer-info {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: clamp(18px, 5vw, 24px);
    grid-area: unset;
    align-self: auto;
    text-align: center;
  }

  .footer-center {
    order: 1;
    width: 100%;
    max-width: none;
    margin-bottom: 0;
    gap: 0;
  }

  .footer-contact {
    order: 2;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-bottom: 0;
  }

  .footer-contact ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1.6vw, 10px);
    width: 100%;
  }

  .footer-contact li,
  .footer-contact a {
    font-size: 13px;
    line-height: 1.65;
    white-space: normal;
    text-align: center;
  }

  .footer-logo {
    width: min(168px, 52vw);
    height: auto;
  }

  .footer-rights {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: clamp(20px, 5vw, 28px) 0 0;
    gap: clamp(16px, 4vw, 22px);
    grid-area: unset;
    align-self: auto;
    grid-template-columns: unset;
  }

  .footer-socials {
    order: 1;
    width: auto;
    height: auto;
    gap: clamp(20px, 6vw, 28px);
    justify-content: center;
  }

  .footer-socials a {
    height: auto;
  }

  .footer-socials img {
    height: 22px;
  }

  /* 모바일 — 버튼은 가운데 정렬, 사이즈 살짝 작게 */
  .footer-legal {
    order: 2;
    display: inline-flex;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
  }

  .footer-legal a,
  .footer-legal__btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .footer-copyright {
    order: 3;
    width: auto;
    max-width: none;
    min-width: 0;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
  }
}

/* =========================================================
   Common footer refinement
   - footer HTML은 main.js에서 자동 주입되므로, 여기는 시각 규칙만 관리
   ========================================================= */
.poppi-footer {
  max-width: var(--site-wide, 1920px);
}

.poppi-footer-wrap[data-common-footer] {
  margin-left: auto;
  margin-right: auto;
}

/* PC 전용 — 1201px+ (Figma 고정 폭·nowrap) */
@media (min-width: 1201px) {
  .footer-info {
    grid-template-columns: max-content 1fr max-content;
    gap: clamp(40px, 5vw, 228px);
    overflow: visible;
  }

  .footer-info > .footer-contact,
  .footer-info > .footer-center,
  .footer-info > .footer-menu {
    overflow: visible;
  }

  .footer-rights {
    grid-template-columns: max-content auto max-content;
    gap: clamp(20px, 5vw, 330px);
    overflow: visible;
  }

  .footer-contact {
    width: max-content;
    min-width: max-content;
    max-width: none;
  }

  .footer-contact li,
  .footer-contact a {
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .footer-center {
    width: 450px;
    max-width: 450px;
  }

  .footer-tagline {
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .footer-menu {
    width: 251px !important;
    min-width: 251px !important;
    max-width: 251px !important;
  }

  .menu-grid a {
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .footer-brand-copy {
    width: max-content;
    min-width: max-content;
    max-width: none;
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .footer-copyright {
    white-space: nowrap;
    overflow-wrap: normal;
    max-width: none;
  }

  .footer-legal {
    width: max-content;
    min-width: max-content;
    max-width: none;
    flex-wrap: nowrap;
  }
}

/* =========================================================
   ★ Legal 모달 — 이용약관 / 개인정보처리방침 ★
   - 모달 박스 : width 680px, background #FFFCF6, radius 30
   - 콘텐츠    : 가운데 정렬, 제목/소제목 Paperlogy Bold 20, 본문 Paperlogy Regular 16
   - 화면이 작으면 max-height 90vh + 내부 스크롤 (긴 약관도 안전하게 표시)
   ========================================================= */
.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  /* Extra top/right padding so the close button (which now overhangs
     the box's top-right corner) never gets clipped by the viewport. */
  padding: 36px 32px 24px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-tap-highlight-color: transparent;
}

.legal-modal.is-open {
  display: flex;
  animation: legal-modal-fade 0.18s ease-out;
}

@keyframes legal-modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.legal-modal__overlay {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

/* Panel = box + close button wrapper.
   We hold the width/max-height constraints here so the close button
   can be absolute-positioned and overhang the box's top-right corner
   without being clipped by the box's `overflow:auto`. */
.legal-modal__panel {
  position: relative;
  width: 680px;
  max-width: 100%;
  max-height: calc(100dvh - 60px);
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 1;
}

.legal-modal__box {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100dvh - 60px);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: #FFFCF6;
  border-radius: 30px;
  padding: clamp(56px, 6vw, 72px) clamp(40px, 5vw, 64px) clamp(48px, 5vw, 64px) clamp(32px, 5vw, 56px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  text-align: left;
  font-family: var(--font-paperlogy, 'Paperlogy', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif);
  color: #000000;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(237, 99, 37, 0.55) transparent;
  scrollbar-gutter: stable;
}

.legal-modal__box::-webkit-scrollbar {
  width: 8px;
}
.legal-modal__box::-webkit-scrollbar-track {
  background: transparent;
  /* Reserve the rounded-corner zone (radius 30px + small breathing space)
     so the scrollbar never overlaps the rounded edge of the box. */
  margin: 36px 0;
}
.legal-modal__box::-webkit-scrollbar-thumb {
  background: rgba(237, 99, 37, 0.45);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.legal-modal__box::-webkit-scrollbar-thumb:hover {
  background: rgba(237, 99, 37, 0.75);
  background-clip: padding-box;
}

/* Close button — positioned relative to the panel so it overhangs
   the box's top-right corner (always visible, never scrolls with
   the modal content). Matches the design reference: orange circle
   sitting on top of the corner. */
.legal-modal__close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ED6325;
  border: 0;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(237, 99, 37, 0.35);
  transition: background 0.18s ease, transform 0.18s ease;
  z-index: 2;
}

.legal-modal__close:hover { background: #d65419; transform: scale(1.05); }
.legal-modal__close:focus-visible {
  outline: 2px solid #ED6325;
  outline-offset: 3px;
}

/* 메인 타이틀 — Paperlogy Bold 20 */
.legal-modal__title {
  margin: 0 0 24px;
  font-family: inherit;
  font-weight: 700;
  font-size: 20px;
  color: #000000;
  letter-spacing: -0.01em;
}

/* 소제목 (제1조, 1. 수집하는 …) — Paperlogy Bold 20 */
.legal-modal__h {
  margin: 28px 0 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: 20px;
  color: #000000;
  letter-spacing: -0.01em;
}

.legal-modal__h:first-of-type { margin-top: 8px; }

/* 본문 — Paperlogy Regular 16 */
.legal-modal__p {
  margin: 0 0 16px;
  font-family: inherit;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: #000000;
  white-space: pre-line;
}

.legal-modal__p:last-child { margin-bottom: 0; }

/* PC — 콘텐츠 높이만큼 확장, 긴 약관은 max-height 안에서 스크롤 */
@media (min-width: 769px) {
  .legal-modal__panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .legal-modal__box {
    flex: 1 1 auto;
    min-height: min(560px, calc(100dvh - 100px));
    min-height: min(560px, calc(100vh - 100px));
  }
}

/* Background scroll lock while a legal modal is open */
html.is-modal-open,
body.is-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}
html:has(body.is-modal-open) {
  overflow: hidden;
  overscroll-behavior: none;
}

/* 모바일·터치 — 모달 높이 축소 + 내부 콘텐츠 스크롤 */
@media (max-width: 768px) {
  .legal-modal {
    padding: 20px 16px;
    align-items: center;
  }
  .legal-modal__overlay {
    touch-action: none;
  }
  .legal-modal__panel {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
  }
  .legal-modal__box {
    display: block;
    flex: none;
    width: 100%;
    max-height: 55svh;
    max-height: 55vh;
    overflow-y: scroll;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    /* iOS: flex % 높이 대신 명시적 max-height 로 스크롤 컨테이너 확정 */
    transform: translateZ(0);
  }
  .legal-modal__box,
  .legal-modal__close {
    touch-action: manipulation;
  }
}

/* 모바일 — 폰트 약간 축소 */
@media (max-width: 540px) {
  .legal-modal {
    padding: 16px 14px;
  }
  .legal-modal__box {
    border-radius: 24px;
    padding: 32px 18px 28px;
    max-height: 50svh;
    max-height: 50vh;
  }
  .legal-modal__title,
  .legal-modal__h { font-size: 18px; }
  .legal-modal__p  { font-size: 14px; line-height: 1.65; }
  .legal-modal__close { top: -12px; right: -12px; width: 40px; height: 40px; font-size: 22px; }
}