/* 교육채팅 공통 알림 */
.i-chat-notify {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: .6rem;
    vertical-align: middle;
}

.i-chat-notify[hidden],
.chat-notify-pc-item[hidden] {
    display: none !important;
}

.chat-notify-btn {
    position: relative;
    display: inline-flex;
    min-width: 4.4rem;
    height: 4.4rem;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: 0 .8rem;
    border: 0;
    border-radius: 1.2rem;
    background: transparent;
    color: #27313b;
    cursor: pointer;
    font: inherit;
}

.chat-notify-btn:hover,
.chat-notify-btn:focus-visible {
    background: #f4f6f8;
    outline: .2rem solid transparent;
}

.chat-notify-icon {
    position: relative;
    display: inline-block;
    width: 2.2rem;
    height: 1.7rem;
    border: .2rem solid currentColor;
    border-radius: .7rem;
    box-sizing: border-box;
}

.chat-notify-icon::after {
    content: '';
    position: absolute;
    left: .35rem;
    bottom: -.55rem;
    width: .7rem;
    height: .7rem;
    border-left: .2rem solid currentColor;
    border-bottom: .2rem solid currentColor;
    background: #fff;
    transform: skewY(-35deg);
}

.chat-notify-label {
    font-size: 1.3rem;
    font-weight: 700;
    white-space: nowrap;
}

.chat-notify-badge {
    position: absolute;
    top: .1rem;
    right: .1rem;
    display: none;
    min-width: 1.9rem;
    height: 1.9rem;
    align-items: center;
    justify-content: center;
    padding: 0 .5rem;
    border: .2rem solid #fff;
    border-radius: 999px;
    background: #ed6b4f;
    color: #fff;
    box-sizing: border-box;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
}

.chat-notify-btn.has-unread .chat-notify-badge {
    display: inline-flex;
}

.chat-notify-btn.is-new {
    animation: chatNotifyPulse .46s ease 3;
}

@keyframes chatNotifyPulse {
    0%, 100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-.3rem) scale(1.04);
    }
}

/*
 * 전역 헤더(.auth-area)의 display/position은 건드리지 않는다.
 * 모바일 기존 햄버거/로고/검색 헤더가 채팅 CSS 때문에 깨지지 않게 한다.
 */
.chat-notify-modal {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 2147483000 !important;
    display: none !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: 100vh;
    margin: 0 !important;
    padding: 2rem;
    overflow: hidden;
    background: rgba(18, 27, 36, .48);
}

.chat-notify-modal.is-open,
.chat-notify-modal[aria-hidden="false"] {
    display: flex !important;
}

.chat-notify-modal[aria-hidden="true"] {
    display: none !important;
}

html.chat-notify-open,
body.chat-notify-open {
    overflow: hidden !important;
}

.chat-notify-dialog {
    position: relative;
    display: flex;
    width: min(54rem, 100%);
    max-height: calc(100vh - 4rem);
    flex-direction: column;
    overflow: hidden;
    border-radius: 2rem;
    background: #fff;
    box-shadow: 0 2.4rem 6rem rgba(15, 23, 42, .22);
}

.chat-notify-head {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    min-height: 6.4rem;
    padding: 1.8rem 6.4rem 1.5rem 2.2rem;
    border-bottom: .1rem solid #e8edf2;
    box-sizing: border-box;
}

.chat-notify-title {
    min-width: 0;
}

.chat-notify-title strong,
.chat-notify-title span {
    display: block;
}

.chat-notify-title strong {
    color: #17212b;
    font-size: 2rem;
    font-weight: 800;
}

.chat-notify-title span {
    margin-top: .4rem;
    color: #74808c;
    font-size: 1.2rem;
}

.chat-notify-close {
    position: absolute !important;
    top: 1.2rem !important;
    right: 1.2rem !important;
    z-index: 10 !important;
    display: inline-flex !important;
    visibility: visible !important;
    width: 4rem !important;
    height: 4rem !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    opacity: 1 !important;
    background: #f3f5f7 !important;
    color: #303943 !important;
    cursor: pointer;
    font-size: 2.4rem !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    text-indent: 0 !important;
    transform: none !important;
    appearance: none;
    -webkit-appearance: none;
}

.chat-notify-close::before,
.chat-notify-close::after {
    content: none !important;
}

.chat-notify-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(58rem, calc(100vh - 14rem));
    padding: 1.4rem;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.chat-notify-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .8rem;
    margin-bottom: 1.2rem;
}

.chat-notify-summary-item {
    display: flex;
    min-height: 5.2rem;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding: 1.1rem 1.2rem;
    border: .1rem solid #e7ebef;
    border-radius: 1.3rem;
    background: #f8fafb;
    box-sizing: border-box;
}

.chat-notify-summary-item span {
    color: #66727e;
    font-size: 1.2rem;
    font-weight: 700;
}

.chat-notify-summary-item strong {
    color: #9aa3ab;
    font-size: 1.6rem;
    font-weight: 800;
}

.chat-notify-summary-item.has-count {
    border-color: #f0d1c9;
    background: #fff8f6;
}

.chat-notify-summary-item.has-count strong {
    color: #d9563d;
}

.chat-notify-room {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    margin-bottom: 1rem;
    padding: 1.6rem;
    border: .1rem solid #e6ebf0;
    border-radius: 1.6rem;
    background: #fff;
}

.chat-notify-room:last-child {
    margin-bottom: 0;
}

.chat-notify-room.has-unread {
    border-color: #f2c5b9;
    background: #fffaf8;
}

.chat-notify-room-info {
    flex: 1;
    min-width: 0;
}

.chat-notify-room-name {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-width: 0;
}

.chat-notify-room-name strong {
    overflow: hidden;
    color: #17212b;
    font-size: 1.5rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-notify-room-unread {
    display: inline-flex;
    flex: 0 0 auto;
    min-width: 2.2rem;
    height: 2.2rem;
    align-items: center;
    justify-content: center;
    padding: 0 .7rem;
    border-radius: 999px;
    background: #ed6b4f;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
}

.chat-notify-room-period {
    margin-top: .6rem;
    color: #74808c;
    font-size: 1.2rem;
}

.chat-notify-kinds {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1rem;
}

.chat-notify-kind {
    display: inline-flex;
    min-height: 3.2rem;
    align-items: center;
    gap: .6rem;
    padding: 0 1rem;
    border: .1rem solid #e0e5ea;
    border-radius: 999px;
    background: #fff;
    color: #37414b;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 700;
}

.chat-notify-kind:hover,
.chat-notify-kind:focus-visible {
    border-color: #d9a99d;
    background: #fff7f4;
    outline: 0;
}

.chat-notify-kind b {
    display: inline-flex;
    min-width: 1.8rem;
    height: 1.8rem;
    align-items: center;
    justify-content: center;
    padding: 0 .5rem;
    border-radius: 999px;
    background: #ed6b4f;
    color: #fff;
    box-sizing: border-box;
    font-size: 1rem;
    font-weight: 800;
}

.chat-notify-enter {
    flex: 0 0 auto;
    min-width: 9.6rem;
    height: 4rem;
    border: 0;
    border-radius: 1.1rem;
    background: #27313b;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
}

.chat-notify-empty,
.chat-notify-loading {
    padding: 4rem 1.5rem;
    color: #74808c;
    text-align: center;
    font-size: 1.35rem;
}

@media only screen and (max-width: 768px) {
    .i-chat-notify {
        flex: 0 0 auto;
        margin-left: .35rem;
    }

    .chat-notify-label {
        display: none;
    }

    .chat-notify-btn {
        min-width: 4rem;
        width: 4rem;
        height: 4rem;
        padding: 0;
    }

    .chat-notify-modal {
        padding: 0;
    }

    .chat-notify-dialog {
        width: 100%;
        max-width: none;
        max-height: 82vh;
        margin: 0;
        border-radius: 2rem 2rem 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .chat-notify-head {
        min-height: 6rem;
        padding: 1.6rem 6rem 1.3rem 1.8rem;
    }

    .chat-notify-title strong {
        font-size: 1.8rem;
    }

    .chat-notify-title span {
        padding-right: .5rem;
        font-size: 1.15rem;
        line-height: 1.45;
    }

    .chat-notify-close {
        top: 1rem !important;
        right: 1rem !important;
        width: 4.4rem !important;
        height: 4.4rem !important;
        background: #f3f5f7 !important;
        color: #1f2933 !important;
        font-size: 2.6rem !important;
    }

    .chat-notify-list {
        max-height: none;
        padding: 1.2rem;
    }

    .chat-notify-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chat-notify-summary-item {
        min-height: 4.8rem;
    }

    .chat-notify-room {
        align-items: stretch;
        flex-direction: column;
        gap: 1rem;
        padding: 1.4rem;
    }

    .chat-notify-enter {
        width: 100%;
        min-height: 4.4rem;
    }
}

@supports (height: 100dvh) {
    
    .chat-notify-dialog {
        max-height: calc(100dvh - 4rem);
    }

    @media only screen and (max-width: 768px) {
        .chat-notify-dialog {
            max-height: 82dvh;
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .chat-notify-btn.is-new {
        animation: none;
    }
}

/* 사용자 이름과 채팅 알림을 같은 줄에 배치 */
.auth-area > ul > li:first-child {
    display: inline-flex;
    align-items: center;
}

@media only screen and (max-width: 768px) {
    .i-chat-notify {
        margin-left: .4rem;
    }
}
