@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css");

:root {
    --sanjilive-wide-width: 1280px;
    --sanjilive-narrow-width: 980px;
    --sanjilive-mobile-gutter: 15px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-width: 0;
    min-height: 100%;
    color: #202124;
    font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Noto Sans KR", "Segoe UI", sans-serif;
    background: #ffffff;
}

body {
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    background: none;
    cursor: pointer;
    word-break: keep-all;
}

svg {
    display: block;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    border-bottom: 1px solid #e5e8ee;
    background: #ffffff;
}

.site-header-spacer {
    /* header.js 가 실측 높이로 --site-header-height 갱신 (PC compact 시 여백 어긋남 방지) */
    height: var(--site-header-height, 139px);
    flex-shrink: 0;
}

.site-bottom-nav {
    display: none;
}

/* 로그인 확인 전 회원 전용 메뉴가 CSS display 규칙으로 드러나지 않도록 한다. */
[data-auth-user][hidden],
[data-auth-guest][hidden] {
    display: none !important;
}

.site-header__inner {
    width: min(100% - 40px, 1280px);
    margin: 0 auto;
    padding:0 15px;
}

.site-header__top {
    border-bottom: 1px solid #edf0f4;
}

.site-header__top-inner {
    display: grid;
    grid-template-columns: 220px minmax(280px, 560px) minmax(260px, auto);
    align-items: center;
    gap: 32px;
    min-height: 86px;
}

.site-header__back {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #202124;
    cursor: pointer;
}

/* LB.Modal은 body 끝에 추가된다. 기존 패널의 디자인은 내부 DOM에 유지한다. */
.sanji-modal-host {
    position: fixed;
    inset: 0;
}

.sanji-modal-host [hidden] {
    display: none !important;
}

.site-header__back svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.site-header__back:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
    border-radius: 6px;
}

.site-header__compact-category {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #202124;
}

.site-header__mobile-actions,
.site-header__mobile-nav,
.site-category-panel__mobile-menu {
    display: none;
}

.site-header__logo {
    margin: 0;
}

.site-header__logo a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.site-header__logo img {
    display: block;
    width: auto;
    height: 36px;
}

.site-header__search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: center;
    height: 48px;
    border: 1px solid #202124;
    border-radius: 4px;
    background: #ffffff;
}

.site-header__search input {
    min-width: 0;
    width: 100%;
    height: 100%;
    padding: 0 16px;
    border: 0;
    color: #202124;
    font-size: 15px;
    outline: 0;
}

.site-header__search input::placeholder {
    color: #8a8f98;
}

.site-header__search button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: #202124;
    white-space: nowrap;
    word-break: keep-all;
}

.site-header__search svg,
.site-header__quick svg,
.site-header__mobile-icon svg,
.site-header__category svg,
.site-header__compact-category svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.site-header__quick {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    min-width: 0;
}

.site-header__quick-item {
    position: relative;
    display: inline-grid;
    justify-items: center;
    gap: 5px;
    min-width: 54px;
    color: #333842;
    font-size: 13px;
    white-space: nowrap;
    word-break: keep-all;
}

.site-header__quick-item em,
.site-header__mobile-icon em {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dd4a2c;
    color: #ffffff;
    font-size: 11px;
    line-height: 1;
    font-style: normal;
    font-weight: 700;
}

.site-header__quick-item em {
    top: -5px;
    right: 4px;
}

.site-header__nav-row {
    background: #ffffff;
    /* PC: 스크롤해도 상단과 함께 fixed 헤더 안에 유지 (숨기지 않음) */
}

.site-header__nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 52px;
}

.site-header__main-nav,
.site-header__auth {
    display: flex;
    align-items: center;
}

.site-header__main-nav {
    gap: 14px;
    min-width: 0;
}

.site-header__nav-item,
.site-header__auth-button {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    color: #202124;
    font-size: 15px;
    white-space: nowrap;
    word-break: keep-all;
}

.site-header__quick-item.is-active,
.site-header__nav-item.is-active,
.site-header__auth-button.is-active {
    color: #dd4a2c;
}

.site-header__category {
    gap: 8px;
}

.site-header__category[aria-expanded="true"],
.site-header__compact-category[aria-expanded="true"] {
    color: #dd4a2c;
}

.site-header__divider {
    width: 1px;
    height: 14px;
    background: #d9dde5;
}

.site-header__auth {
    gap: 16px;
    color: #4c5563;
}

.site-header__auth-button {
    font-size: 14px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    line-height: inherit;
}

.site-header__auth-button[hidden],
.site-category-panel__mobile-menu [hidden] {
    display: none !important;
}

.site-category-panel__logout {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}

.live-card-badges {
    position: absolute;
    z-index: 1;
    top: 12px;
    left: 12px;
    display: flex;
    align-items: center;
}

.live-card-status,
.live-card-viewer {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    color: #ffffff;
    font-size: 13px;
    line-height: 1;
    word-break: keep-all;
}

.live-card-status {
    padding: 0 10px;
    border-radius: 4px 0 0 4px;
    background: #dd4a2c;
    font-weight: 700;
}

.live-card-viewer {
    padding: 0 9px;
    border-radius: 0 4px 4px 0;
    background: rgba(32, 33, 36, 0.52);
}

/* PC 스크롤 compact: 상단(로고/검색)만 살짝 축소, 네비 행은 같이 고정 유지 */
.site-header.is-compact .site-header__top {
    border-bottom: 0;
}

.site-header.is-compact .site-header__top-inner {
    grid-template-columns: 170px minmax(260px, 460px) minmax(220px, auto);
    gap: 18px;
    min-height: 64px;
}

/* 네비가 항상 보이므로 PC compact 햄버거(compact-category)는 불필요 — 숨김 */
.site-header.is-compact .site-header__compact-category {
    display: none;
}

.site-header.is-compact .site-header__logo img {
    height: 28px;
}

.site-header.is-compact .site-header__search {
    height: 42px;
    max-width: 460px;
}

.site-header.is-compact .site-header__search button {
    width: 42px;
    height: 42px;
}

.site-header.is-compact .site-header__nav-row {
    display: block; /* 이전: display:none 으로 스크롤 시 네비가 사라져 버림 */
    border-top: 1px solid #edf0f4; /* compact 시 top border 제거 보완 */
}

.site-header.is-compact .site-header__nav-inner {
    min-height: 48px;
}

.site-category-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border-top: 1px solid #edf0f4;
    border-bottom: 1px solid #dfe4ea;
    background: #ffffff;
}

.site-category-panel[hidden] {
    display: none;
}

.site-category-panel__inner {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    min-height: auto;
    padding: 20px 0 24px;
    gap: 0;
}

.site-category-panel__primary {
    display: flex;
    flex-wrap: wrap;
    align-content: start;
    gap: 10px;
    padding: 0 0 16px;
}

.site-category-panel__primary a {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 58px;
    padding: 0 18px;
    border: 1px solid #e1e5ec;
    border-radius: 6px;
    background: #ffffff;
    color: #2f343b;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    word-break: keep-all;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.site-category-panel__primary a:hover {
    border-color: #dd4a2c;
    background: #fff1ed;
    color: #dd4a2c;
}

.site-category-panel__primary a:active {
    transform: translateY(1px);
}

.site-category-panel__promo {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 28px 0 28px 32px;
    color: #202124;
}

.site-category-panel__promo img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 4px;
}

.site-category-panel__promo strong {
    margin-top: 8px;
    font-size: 18px;
    line-height: 1.35;
}

.site-category-panel__promo span {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    word-break: keep-all;
}

.site-footer { 
    background: #fbfbfb;
}

.site-footer__inner {
    width: min(100% - 40px, 1280px);
    margin: 0 auto;
    padding: 44px 0 40px;
}

.site-footer__brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 30px;
}

.site-footer__logo {
    display: inline-flex;
    align-items: center;
}

.site-footer__logo img {
    display: block;
    width: auto;
    height: 32px;
}

.site-footer__nav {
    display: flex;
    align-items: center;
    gap: 22px;
    color: #414650;
    font-size: 14px;
    line-height: 1.45;
    word-break: keep-all;
}

.site-footer__nav a {
    width: fit-content;
}

.site-footer__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 56px;
    align-items: start;
}

.site-footer__info {
    max-width: 780px;
    color: #657080;
    font-size: 14px;
    line-height: 1.65;
}

.site-footer__meta,
.site-footer__address,
.site-footer__service p,
.site-footer__bottom p {
    margin: 0;
}

.site-footer__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 0;
}

.site-footer__meta span {
    display: inline-flex;
    align-items: center;
}

.site-footer__meta span + span::before {
    display: inline-block;
    width: 1px;
    height: 10px;
    margin: 0 10px;
    background: #d9dde3;
    content: "";
}

.site-footer__address {
    margin-top: 3px;
}

.site-footer__service {
    justify-self: end;
    color: #657080;
    font-size: 14px;
    line-height: 1.6;
    text-align: right;
}

.site-footer__service strong {
    display: block;
    margin-bottom: 8px;
    color: #202124;
    font-size: 15px;
    font-weight: 700;
}

.site-footer__tel {
    color: #202124;
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
}

.site-footer__bottom {
    margin-top: 38px;
    color: #8a8f98;
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 1400px) {
    /* Header */
    /* .site-header__inner {
        width: min(100% - 30px, 1280px);
    } */

    /* Footer */
    .site-footer__inner {
        width: min(100% - 30px, 1280px);
    }
}

@media (max-width: 1024px) {
    /* Header */
    .site-header-spacer {
        height: var(--site-header-height, 107px);
    }

    /* 모바일/태블릿도 로고 중심 앱바를 사용하므로 햄버거를 표시하지 않음 */
    .site-header.is-compact .site-header__compact-category {
        display: none;
    }

    .site-header__top-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        min-height: 58px;
        padding: 0;
    }

    .site-header.is-compact .site-header__top-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 58px;
    }

    .site-header.is-compact .site-header__top {
        border-bottom: 1px solid #edf0f4;
    }

    .site-header__compact-category {
        display: none;
    }

    .site-header__logo {
        min-width: 0;
    }

    .site-header__logo a {
        max-width: 100%;
    }

    .site-header__logo img,
    .site-header.is-compact .site-header__logo img {
        max-width: min(210px, 100%);
        height: 28px;
    }

    .site-header__search,
    .site-header__quick {
        display: none;
    }

    .site-header__mobile-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
    }

    .site-header__mobile-activity {
        display: inline-flex;
        align-items: center;
        min-height: 32px;
        padding: 0 10px;
        border: 1px solid #d9dde5;
        border-radius: 4px;
        color: #202124;
        font-size: 13px;
        font-weight: 600;
        white-space: nowrap;
    }

    .site-header__mobile-icon {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        color: #202124;
    }

    .site-header__mobile-icon em {
        top: 1px;
        right: -1px;
    }

    .site-header__mobile-icon.is-active,
    .site-header__mobile-activity.is-active {
        color: #dd4a2c;
    }

    .site-header__nav-inner {
        display: block;
        min-height: 48px;
        padding: 0;
    }

    .site-header.is-compact .site-header__nav-row {
        display: block;
    }

    .site-header__main-nav,
    .site-header__auth {
        display: none;
    }

    .site-header__mobile-nav {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: stretch;
        min-height: 48px;
    }

    .site-header__mobile-nav a,
    .site-header__mobile-nav button {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        background: transparent;
        color: #5f6672;
        font-size: 15px;
        font-weight: 500;
        white-space: nowrap;
    }

    .site-header__mobile-nav a.is-active,
    .site-header__mobile-nav button[aria-expanded="true"] {
        color: #dd4a2c;
        font-weight: 700;
    }

    .site-header__mobile-nav a.is-active::after,
    .site-header__mobile-nav button[aria-expanded="true"]::after {
        content: "";
        position: absolute;
        right: 18px;
        bottom: -1px;
        left: 18px;
        height: 2px;
        background: #dd4a2c;
    }

    .site-category-panel {
        top: 58px;
        z-index: 2;
        max-height: calc(100dvh - 58px);
        overflow-y: auto;
    }

    .site-category-panel__mobile-menu {
        display: none;
    }

    .site-category-panel__inner {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        width: 100%;
        min-height: auto;
        padding: 12px 20px 20px;
    }

    .site-category-panel__primary {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding: 0 0 12px;
        border-left: 0;
        border-bottom: 1px solid #edf0f4;
        background: #ffffff;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .site-category-panel__primary::-webkit-scrollbar {
        display: none;
    }

    .site-category-panel__primary a {
        flex: 0 0 auto;
        justify-content: center;
        min-height: 36px;
        padding: 0 13px;
        border-radius: 999px;
        font-size: 15px;
        font-weight: 500;
    }

    .site-category-panel__promo {
        display: none;
    }
}

@media (max-width: 1024px) {
    /* Header — mobile-nav 숨김 후 top 영역만 남음 (JS 실측 전 fallback) */
    .site-header-spacer {
        height: var(--site-header-height, 58px);
    }

    body {
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }

    /* 하단 네비와 메뉴가 겹치므로 헤더 mobile-nav / nav-row 숨김 */
    .site-header__mobile-nav,
    .site-header__nav-row {
        display: none;
    }

    .site-header__mobile-activity {
        display: none;
    }

    .site-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 35;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        min-height: calc(64px + env(safe-area-inset-bottom));
        padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
        border-top: 1px solid rgba(223, 227, 234, 0.92);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 -12px 30px rgba(17, 24, 39, 0.08);
        backdrop-filter: blur(14px);
    }

    .site-bottom-nav__item {
        display: inline-grid;
        align-content: center;
        justify-items: center;
        gap: 3px;
        min-width: 0;
        min-height: 52px;
        border-radius: 12px;
        color: #6f7680;
        font-size: 12px;
        line-height: 1.15;
        font-weight: 600;
        white-space: nowrap;
        transition:
            color 0.18s ease,
            background 0.18s ease,
            transform 0.18s ease;
    }

    .site-bottom-nav__item:active {
        transform: translateY(1px) scale(0.98);
    }

    .site-bottom-nav__item svg {
        width: 23px;
        height: 23px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .site-bottom-nav__item.is-active {
        background: #fff1ed;
        color: #dd4a2c;
    }

}

@media (max-width: 768px) {
    /* Footer — 좁은 모바일 화면에서 사이트 푸터 숨김 */
    .site-footer,
    [data-site-footer] {
        display: none !important;
    }

    /* 마이페이지 셸만 모바일에서도 사이트 푸터 표시 */
    body:has(main.mypage) .site-footer,
    body:has(main.mypage-sub) .site-footer,
    body:has(main.mypage) [data-site-footer],
    body:has(main.mypage-sub) [data-site-footer] {
        display: block !important;
    }

    .site-footer__inner {
        width: 100%;
        max-width: none;
        padding: 28px 16px calc(28px + 72px + env(safe-area-inset-bottom));
        box-sizing: border-box;
    }

    .site-footer__brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 24px;
    }

    .site-footer__logo {
        flex-shrink: 0;
    }

    .site-footer__nav {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px 14px;
        width: 100%;
    }

    .site-footer__nav a {
        width: auto;
        white-space: nowrap;
    }

    .site-footer__body {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .site-footer__info {
        max-width: none;
        overflow-wrap: anywhere;
        word-break: keep-all;
    }

    .site-footer__service {
        justify-self: stretch;
        text-align: left;
    }

    .site-footer__tel {
        font-size: 20px;
        white-space: nowrap;
    }

    .site-footer__bottom {
        margin-top: 24px;
    }

    .site-header__logo img,
    .site-header.is-compact .site-header__logo img {
        height: 26px;
    }
}

/*
 * Native app WebView (AOS/iOS): 웹과 같은 1024px 기준으로 하단 탭 표시.
 * 웹 브라우저는 위 max-width:1024px 반응형 규칙을 사용.
 * 하단 탭이 항상 있으므로 헤더 mobile-nav는 숨김.
 */
html.is-lb-app .site-header__mobile-nav {
    display: none;
}

@media (max-width: 1024px) {
    html.is-lb-app .site-header__nav-row {
        display: none;
    }
}

@media (max-width: 1024px) {
html.is-lb-app body {
    /* Native shell already keeps the WebView above the system bottom inset. */
    padding-bottom: 72px;
}

html.is-lb-app .site-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: 64px;
    padding: 6px 10px;
    border-top: 1px solid rgba(223, 227, 234, 0.92);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -12px 30px rgba(17, 24, 39, 0.08);
    backdrop-filter: blur(14px);
}

html.is-lb-app .site-bottom-nav__item {
    display: inline-grid;
    align-content: center;
    justify-items: center;
    gap: 3px;
    min-width: 0;
    min-height: 52px;
    border-radius: 12px;
    color: #6f7680;
    font-size: 12px;
    line-height: 1.15;
    font-weight: 600;
    white-space: nowrap;
    transition:
        color 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease;
}

html.is-lb-app .site-bottom-nav__item:active {
    transform: translateY(1px) scale(0.98);
}

html.is-lb-app .site-bottom-nav__item svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

html.is-lb-app .site-bottom-nav__item.is-active {
    background: #fff1ed;
    color: #dd4a2c;
}
}

html.is-lb-app .site-footer,
html.is-lb-app [data-site-footer] {
    display: none !important;
}

html.is-lb-app body:has(main.mypage) .site-footer,
html.is-lb-app body:has(main.mypage-sub) .site-footer,
html.is-lb-app body:has(main.mypage) [data-site-footer],
html.is-lb-app body:has(main.mypage-sub) [data-site-footer] {
    display: block !important;
}

/* 라이브 시청 상세는 앱에서도 하단 탭 숨김 */
html.is-lb-app body.is-live-detail-page {
    padding-bottom: 0;
}

html.is-lb-app body.is-live-detail-page .site-bottom-nav {
    display: none;
}

@media (max-width: 480px) {
    /* Header */
    .site-header__inner {
        width: min(100% - 30px, 1280px);
    }

    .site-header__top-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
    }

    .site-header__compact-category {
        width: 40px;
        height: 40px;
    }

    .site-header__logo img,
    .site-header.is-compact .site-header__logo img {
        max-width: min(142px, 100%);
        height: 22px;
    }

    .site-header__mobile-actions {
        gap: 6px;
    }

    .site-header__mobile-activity {
        display: none;
    }

    .site-header__mobile-icon {
        width: 32px;
        height: 32px;
    }

    .site-header__quick {
        gap: 12px;
    }

    .site-header__quick-item {
        min-width: 48px;
        font-size: 13px;
    }

    .site-header__main-nav {
        gap: 10px;
    }

    /* Footer */
    .site-footer__meta {
        display: grid;
        gap: 3px;
    }

    .site-footer__meta span + span::before {
        display: none;
    }
}

/* 메인 팝업 (admin popups 노출) — icefood/lb_edu 카드형 + sanjilive 브랜드 */
#sitePopupRoot:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.site-popup-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: rgba(15, 23, 42, 0.48);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: sitePopupFadeIn 0.2s ease;
    box-sizing: border-box;
}

@keyframes sitePopupFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.site-popup-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(100%, 440px);
    max-height: min(80vh, 720px);
    margin: auto;
    overflow: hidden;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e8ee;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    animation: sitePopupSlideIn 0.22s ease;
}

@keyframes sitePopupSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    padding: 16px 16px 16px 20px;
    border-bottom: 1px solid #edf0f4;
    background: #ffffff;
}

.site-popup-title {
    margin: 0;
    min-width: 0;
    flex: 1;
    color: #202124;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-popup-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #f5f6f8;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.site-popup-x:hover {
    background: #edf0f4;
    color: #202124;
}

.site-popup-x:focus-visible {
    outline: 2px solid #dd4a2c;
    outline-offset: 2px;
}

.site-popup-x svg {
    width: 18px;
    height: 18px;
}

.site-popup-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
    color: #414650;
    font-size: 15px;
    line-height: 1.65;
    -webkit-overflow-scrolling: touch;
}

.site-popup-body.ql-viewer,
.site-popup-body .ql-viewer {
    font-size: 15px;
    line-height: 1.65;
    color: #414650;
}

.site-popup-body p {
    margin: 0 0 12px;
}

.site-popup-body p:last-child {
    margin-bottom: 0;
}

.site-popup-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 8px 0;
    border-radius: 8px;
}

.site-popup-body a {
    color: #dd4a2c;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.site-popup-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    padding: 14px 16px 14px 20px;
    border-top: 1px solid #edf0f4;
    background: #fafbfc;
}

.site-popup-hide-today {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.3;
    cursor: pointer;
    user-select: none;
    word-break: keep-all;
}

.site-popup-hide-today span {
    min-width: 0;
}

.site-popup-hide-today input {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #dd4a2c;
    cursor: pointer;
}

.site-popup-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 40px;
    margin: 0;
    padding: 8px 18px;
    border: 0;
    border-radius: 8px;
    background: #dd4a2c;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease;
}

.site-popup-close:hover {
    background: #c53f24;
}

.site-popup-close:focus-visible {
    outline: 2px solid #dd4a2c;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .site-popup-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .site-popup-panel {
        width: 100%;
        max-height: min(88vh, 720px);
        border-radius: 16px 16px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
    }

    .site-popup-header {
        padding: 14px 12px 14px 16px;
    }

    .site-popup-title {
        font-size: 16px;
    }

    .site-popup-body {
        padding: 16px;
        font-size: 14px;
    }

    .site-popup-footer {
        padding: 12px 12px 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .site-popup-close {
        min-height: 44px;
        padding: 10px 18px;
    }
}

@media (max-width: 1024px) {
    .site-header.has-mobile-back .site-header__top-inner {
        grid-template-columns: 44px minmax(0, 1fr) auto;
    }

    .site-header__back {
        display: inline-flex;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-popup-overlay,
    .site-popup-panel {
        animation: none;
    }

    .site-popup-x,
    .site-popup-close {
        transition: none;
    }
}
