/* 공통 푸터 — 내부(base)·공개 랜딩·인증 페이지 공용 (--wh-* / 공개 페이지 --* 변수 호환) */

.site-footer {
    --sf-border: var(--wh-border, var(--border, rgba(255, 255, 255, 0.08)));
    --sf-muted: var(--wh-text-muted, var(--text-muted, #94a3b8));
    --sf-heading: var(--wh-text-heading, var(--text-heading, #f1f5f9));
    --sf-body: var(--wh-text-body, var(--text-body, #e2e8f0));

    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    border-top: 1px solid var(--sf-border);
    padding: 2rem 1rem 2.25rem;
    font-size: 0.82rem;
    color: var(--sf-muted);
    background: transparent;
}

.site-footer__inner {
    max-width: 1100px;
    margin: 0 auto;
}

.site-footer a {
    color: var(--sf-muted);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--sf-body);
}

.site-footer__biz-title {
    text-align: center;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--sf-heading);
    margin-bottom: 1.05rem;
}

.site-footer__biz-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem 2.5rem;
    font-size: 0.78rem;
    line-height: 1.65;
}

@media (min-width: 640px) {
    .site-footer__biz-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.site-footer__biz-col {
    margin: 0;
}

.site-footer__biz-item {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.5rem 0.75rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .site-footer__biz-item {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.site-footer__biz-item:last-child {
    border-bottom: none;
}

.site-footer__biz-item dt {
    margin: 0;
    color: var(--sf-muted);
    font-weight: 500;
}

.site-footer__biz-item dd {
    margin: 0;
    color: var(--sf-body);
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* 모바일 푸터 컴팩트화 */
@media (max-width: 639px) {
    .site-footer {
        padding: 1rem 0.75rem 1.15rem;
        font-size: 0.74rem;
    }

    .site-footer__inner {
        max-width: 420px;
    }

    .site-footer__biz-title {
        font-size: 0.8rem;
        margin-bottom: 0.55rem;
    }

    .site-footer__biz-grid {
        gap: 0.35rem;
        font-size: 0.72rem;
        line-height: 1.4;
    }

    .site-footer__biz-item {
        grid-template-columns: 4.7rem 1fr;
        gap: 0.35rem 0.45rem;
        padding: 0.16rem 0;
        border-bottom: none;
    }

    .site-footer__biz-item dt,
    .site-footer__biz-item dd {
        font-size: 0.72rem;
    }
}

/* 로그인·회원가입 등 단독 페이지: 본문만 세로 중앙, 푸터는 하단 */
.standalone-auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-sizing: border-box;
}

.standalone-auth-page__main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* 전체 화면 챗봇(tax-agent, 인사노무 등): 데스크톱/모바일 공통 레이아웃 고정
   (main 스크롤이 아니라 chat 내부만 스크롤되도록 보장) */
main.wh-chat-main-layout {
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

main.wh-chat-main-layout .wh-chat-page-root {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

main.wh-chat-main-layout .wh-chat-page-root > .chat-container {
    flex: 1 1 auto;
    min-height: 0;
}

/* 챗봇/특정 페이지에서 footer 완전 숨김(PC+모바일) */
body.wh-hide-mobile-footer .site-footer,
body.wh-hide-footer .site-footer {
    display: none !important;
}

/* 모바일 기본 정책:
   - 기본은 footer 숨김
   - 홈/결제 등 footer를 보여야 하는 화면만 body에 wh-show-mobile-footer 부여 */
@media (max-width: 768px) {
    body:not(.wh-show-mobile-footer) .site-footer {
        display: none !important;
    }

    main.wh-chat-main-layout .wh-chat-page-root > .chat-container {
        height: auto !important;
        max-height: none !important;
    }

    /* 무료 크레딧 배너: 세로 공간 최소화 */
    main.wh-chat-main-layout .free-plan-banner {
        padding: 6px 10px;
        flex-shrink: 0;
    }

    main.wh-chat-main-layout .free-plan-banner__inner {
        gap: 8px;
    }

    main.wh-chat-main-layout .free-plan-banner__text {
        font-size: 12px;
        gap: 6px;
    }

    main.wh-chat-main-layout .free-plan-banner__cta {
        padding: 5px 10px;
        font-size: 12px;
    }
}
