/* 회원 푸터: 기존 블랙 푸터의 바탕·글씨·로고를 두 테마에서 유지한다. */
.member-footer-policy { display: contents; }
.member-footer-business { display: none; }
html.light body footer.moneying-global-footer,
html.light body:is(.mypage-renewal,.light-page,.editor-page,.md-app-live) footer.moneying-global-footer {
  background: var(--member-footer-surface, #25262b) !important;
  color: var(--member-footer-text, #ffffff) !important;
  box-shadow: none !important;
}
html.light body footer.moneying-global-footer :is(a,p,.moneying-global-footer__wordmark,.moneying-global-footer__info,.moneying-global-footer__links),
html.light body footer.moneying-global-footer .moneying-global-footer__social a {
  color: var(--member-footer-text, #ffffff) !important;
}
html.light body footer.moneying-global-footer .moneying-global-footer__wordmark span {
  color: var(--member-footer-logo, #c3ff00) !important;
}
html.light body footer.moneying-global-footer .moneying-global-footer__blog {
  background: var(--member-footer-text, #ffffff) !important;
  color: var(--member-footer-surface, #25262b) !important;
}

/* 이미 푸터가 있는 라이트 편집기에서 고정 저장 바가 마지막 링크를 가리지 않게 한다.
 * 본문·버튼은 옮기지 않고 푸터 안의 여백만 확보한다. 기존 블랙에는 적용하지 않는다. */
@media (max-width: 1023px) {
  html.light body:has(:is(#rScheduledAt,#mobileSettingsSaveBar,#stickyBar)) footer.moneying-global-footer {
    height: auto;
    padding-bottom: calc(124px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
html.light body:has(#mlFormBlockWorkspace):has(#saveBar:not(.hidden)) footer.moneying-global-footer {
  height: auto;
  padding-bottom: calc(124px + env(safe-area-inset-bottom, 0px)) !important;
}

/* 새로 푸터가 생기는 틀만 정렬한다. 기존 블랙 본문·푸터 배치는 건드리지 않는다. */
.ml-workspace-footer { min-height: 0; display: block; }
.member-footer-frame { container: member-footer / inline-size; }
.member-footer-frame .moneying-global-footer { height: auto; min-height: 209px; }
/* 하단 탐색 바가 있는 설치형 앱은 기존 푸터 숨김 정책을 유지한다. */
@media (display-mode: standalone) {
  body.md-preview-shell.md-app-live .member-footer-frame { display: none; }
}
/* PC 이용 안내의 전체 a 버튼 규칙이 새 푸터 링크에 번지지 않게 한다. */
body.partners-ui .member-footer-frame footer a {
  display: inline-block; width: auto; margin: 0; padding: 0;
  border: 0; border-radius: 0; text-align: inherit; background: transparent;
}
@container member-footer (min-width: 761px) and (max-width: 1260px) {
  .member-footer-frame .moneying-global-footer { min-height: 0; padding: 48px 0 52px; }
  .member-footer-frame .moneying-global-footer__inner { width: calc(100% - 48px); grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 28px 32px; }
  .member-footer-frame .moneying-global-footer__inner > :first-child { grid-column: 1 / -1; }
  .member-footer-frame .moneying-global-footer__wordmark { font-size: 32px; }
}
@container member-footer (max-width: 760px) {
  .member-footer-frame .moneying-global-footer { min-height: 0; padding: 40px 0 44px; }
  .member-footer-frame .moneying-global-footer__inner { width: calc(100% - 36px); grid-template-columns: 1fr; gap: 26px; }
  .member-footer-frame .moneying-global-footer__wordmark { font-size: 24px; }
  .member-footer-frame .moneying-global-footer__info { font-size: 12px; }
  .member-footer-frame .moneying-global-footer__business-desktop { display: none; }
  .member-footer-frame .moneying-global-footer__business-mobile { display: block; }
  .member-footer-frame .moneying-global-footer__links { gap: 8px; font-size: 11px; line-height: 20px; }
  .member-footer-frame .moneying-global-footer__right { align-items: flex-start; }
  .member-footer-frame .moneying-global-footer__social,.member-footer-frame .moneying-global-footer__links { justify-content: flex-start; }
}
/* 새 PC 푸터의 마지막 링크가 기존 맨 위로 버튼 아래에 놓이지 않게 한다. */
@media (min-width: 1024px) {
  body:has(#scrollTopBtn) .member-footer-frame .moneying-global-footer { padding-bottom: 84px; }
}

/* 11/08 대표 결정: 회원 휴대폰 푸터만 간결하게. PC·공개 원본은 유지한다. */
@media (max-width: 767px) {
  body.ml-dashboard-page footer.moneying-global-footer { display: none !important; }
  .member-footer-policy .moneying-global-footer { height: auto; min-height: 0; padding: 16px 0 !important; }
  .member-footer-policy .moneying-global-footer__inner { width: calc(100% - 32px); grid-template-columns: 1fr; gap: 8px; }
  .member-footer-policy .moneying-global-footer__wordmark { font-size: 24px; }
  .member-footer-policy .moneying-global-footer__business-desktop,
  .member-footer-policy .moneying-global-footer__copyright,
  .member-footer-policy .moneying-global-footer__social { display: none; }
  .member-footer-policy .member-footer-business,
  .member-footer-policy .moneying-global-footer__business-mobile { display: block; }
  .member-footer-policy .member-footer-business summary { min-height: 44px; padding: 10px 0; color: #fff !important; background: transparent !important; font-size: 13px; font-weight: 700; line-height: 24px; cursor: pointer; list-style-position: inside; }
  .member-footer-policy .member-footer-business summary:focus-visible { outline: 2px solid #fff !important; outline-offset: 2px; border-radius: 4px; }
  .member-footer-business .moneying-global-footer__business-mobile { padding: 4px 0 12px; font-size: 12px; }
  .member-footer-policy .moneying-global-footer__right { align-items: flex-start; gap: 0; }
  .member-footer-policy .moneying-global-footer__links { justify-content: flex-start; gap: 4px 12px; font-size: 12px; line-height: 20px; }
  body:has(#scrollTopBtn) .member-footer-policy .moneying-global-footer__links { padding-right: 64px; }
  html body:has(:is(#rScheduledAt,#mobileSettingsSaveBar,#stickyBar,.bld-sticky-inner)) .member-footer-policy footer.moneying-global-footer,
  html body:has(#mlFormBlockWorkspace):has(#saveBar:not(.hidden)) .member-footer-policy footer.moneying-global-footer { padding: 16px 0 !important; margin-bottom: calc(124px + env(safe-area-inset-bottom, 0px)); }
}

/* PC의 좁은 작업 열에서도 사업자 정보가 닫힌 모바일 details 안으로만 숨지 않게 한다. */
@media (min-width: 768px) {
  .member-footer-policy .moneying-global-footer__business-desktop { display: block; }
}
