/* kakao_login.php 전용 마이페이지 */
.view.mypage {
    --mp-bg: #ffffff;
    --mp-soft: #f4f8f7;
    --mp-soft-strong: #e7f1ee;
    --mp-line: #dce7e4;
    --mp-text: #29433e;
    --mp-muted: #6d807c;
    --mp-accent: #3f756c;
    --mp-accent-dark: #2d5b53;

    width: min(calc(100% - 32px), 880px);
    max-width: 880px;
    min-width: 0;
    margin: 18px auto 32px;
    padding: 24px;
    overflow: hidden;
    border: 1px solid var(--mp-line);
    border-radius: 16px;
    background: var(--mp-bg);
    color: var(--mp-text);
    box-shadow: 0 8px 24px rgba(35, 67, 62, .06);
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.view.mypage,
.view.mypage * {
    box-sizing: border-box;
}

.view.mypage a {
    color: var(--mp-accent);
    text-decoration: none;
}

.mypage-admin-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 12px;
    padding: 10px;
    border: 1px solid var(--mp-line);
    border-radius: 10px;
    background: var(--mp-soft);
    color: var(--mp-muted);
    font-size: .82rem;
}

.mypage-admin-summary span {
    padding: 3px 7px;
    border-radius: 6px;
    background: var(--mp-bg);
}

.mypage-admin-summary a {
    margin-left: auto;
    font-weight: 700;
}

.mypage-header {
    margin: 0 0 22px;
}

.mypage-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    margin-bottom: 18px;
}

.mypage-avatar {
    display: inline-flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--mp-soft-strong);
    color: var(--mp-accent);
    font-size: 1.15rem;
}

.mypage-profile-text {
    min-width: 0;
}

.mypage-profile h1 {
    margin: 0 0 2px;
    color: var(--mp-text);
    font-size: 1.28rem;
    line-height: 1.3;
}

.view.mypage .mypage-nickname {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    color: var(--mp-muted);
    font-size: .88rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.mypage-nickname i {
    flex: 0 0 auto;
    color: var(--mp-muted);
    font-size: .75em;
}

.mypage-tabs {
    position: static !important;
    inset: auto !important;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    transform: none !important;
    border: 0;
    background: transparent !important;
    box-shadow: none !important;
}

.view.mypage .mypage-tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 42px;
    padding: 8px 7px;
    border: 1px solid var(--mp-line);
    border-radius: 9px;
    background: var(--mp-bg);
    color: #526863;
    font-size: .88rem;
    font-weight: 650;
    line-height: 1.2;
    text-align: center;
}

.mypage-tabs a i {
    flex: 0 0 auto;
    color: #71847f;
    font-size: .92em;
}

.view.mypage .mypage-tabs a:hover,
.view.mypage .mypage-tabs a:focus-visible,
.view.mypage .mypage-tabs a.is-active {
    border-color: #8db1a9;
    background: var(--mp-soft-strong);
    color: var(--mp-accent-dark);
}

.view.mypage .mypage-tabs a.is-active {
    box-shadow: inset 0 0 0 1px #8db1a9;
}

.mypage-tabs a.is-active i {
    color: var(--mp-accent);
}

.mypage-content {
    width: 100%;
    min-width: 0;
}

.mypage-content hr {
    margin: 20px 0 10px;
    border: 0;
    border-top: 1px solid var(--mp-line);
}

.mypage-content hr + div[style] {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
    padding: 7px 0 12px !important;
    color: var(--mp-text);
    line-height: 1.55;
}

.mypage-content hr + div[style] > b {
    min-width: 0;
    font-size: .98rem;
    overflow-wrap: anywhere;
}

.mypage-content hr + div[style] > i,
.mypage-content > .xi-border {
    display: inline-flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 8px;
    background: var(--mp-soft-strong);
    color: var(--mp-accent);
    font-size: .95rem;
}

.mypage-accordion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    margin: 6px 0;
    padding: 10px 13px;
    border: 1px solid var(--mp-line);
    border-radius: 9px;
    background: var(--mp-bg);
    color: var(--mp-text);
    font: inherit;
    font-size: .94rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.mypage-accordion span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.mypage-accordion i {
    flex: 0 0 auto;
    margin: 0;
    color: var(--mp-muted);
    transition: transform .18s ease;
}

.mypage-accordion:hover,
.mypage-accordion:focus-visible,
.mypage-accordion.is-open {
    border-color: #9bbab3;
    background: var(--mp-soft);
    outline: none;
}

.mypage-accordion.is-open {
    margin-bottom: 0;
    border-radius: 9px 9px 0 0;
}

.mypage-accordion.is-open i {
    transform: rotate(180deg);
}

.mypage-accordion-panel {
    display: block;
    width: 100%;
    min-width: 0;
    max-height: calc(17.5em + 26px);
    margin: 0 0 9px;
    padding: 12px 13px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--mp-line);
    border-top: 0;
    border-radius: 0 0 9px 9px;
    background: #fbfdfc;
    color: #435a55;
    line-height: 1.75;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.mypage-accordion-panel[hidden] {
    display: none !important;
}

.mypage-accordion-panel::-webkit-scrollbar {
    width: 6px;
}

.mypage-accordion-panel::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #b8c9c5;
}

.mypage-accordion-panel a {
    color: var(--mp-accent-dark);
    font-weight: 650;
    overflow-wrap: anywhere;
}

.mypage-accordion-panel a:hover {
    text-decoration: underline;
}

.mypage-footer {
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid var(--mp-line);
}

.view.mypage .mypage-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid var(--mp-line);
    border-radius: 8px;
    background: var(--mp-bg);
    color: var(--mp-muted);
    font-size: .86rem;
    font-weight: 650;
}

.mypage-login-card {
    width: min(100%, 480px);
    margin: 14px auto;
    padding: 28px 20px;
    border: 1px solid var(--mp-line);
    border-radius: 14px;
    background: var(--mp-soft);
    text-align: center;
}

.mypage-login-card > i {
    display: block;
    margin-bottom: 10px;
    color: var(--mp-accent);
    font-size: 2.5rem;
}

.mypage-login-card small {
    display: block;
    margin-top: 5px;
    color: var(--mp-muted);
    font-size: .83rem;
}

.mypage-login-card img {
    display: block;
    width: min(100%, 190px);
    height: auto;
    margin: 18px auto 12px;
}

.mypage-login-card label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--mp-muted);
    font-size: .88rem;
}

.mypage-login-card input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--mp-accent);
}

body.dark-theme .view.mypage {
    --mp-bg: #233038;
    --mp-soft: #2b3a42;
    --mp-soft-strong: #32464a;
    --mp-line: #41545a;
    --mp-text: #e6eeec;
    --mp-muted: #b4c3bf;
    --mp-accent: #9bc8bd;
    --mp-accent-dark: #b7ded5;
    background: var(--mp-bg);
    color: var(--mp-text);
}

body.dark-theme .mypage-accordion-panel {
    background: #26353c;
}

@media (max-width: 720px) {
    .view.mypage {
        width: 100%;
        max-width: none;
        min-width: 0;
        margin: 8px 0 18px;
        padding: 17px 12px 26px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .mypage-admin-summary {
        gap: 5px;
        font-size: .77rem;
    }

    .mypage-profile {
        margin-bottom: 15px;
    }

    .mypage-avatar {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
    }

    .mypage-profile h1 {
        font-size: 1.17rem;
    }

    .mypage-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .view.mypage .mypage-tabs a {
        min-height: 42px;
        padding: 7px 4px;
        font-size: .84rem;
    }

    .mypage-content hr {
        margin-top: 18px;
    }

    .mypage-accordion {
        min-height: 45px;
        padding: 9px 11px;
        font-size: .91rem;
    }

    .mypage-accordion-panel {
        padding: 11px;
        font-size: .94rem;
    }

    .mypage-login-card img {
        width: min(75vw, 160px);
        max-width: 160px;
        margin-top: 16px;
        margin-bottom: 10px;
    }
}

@media (max-width: 350px) {
    .view.mypage {
        padding-right: 9px;
        padding-left: 9px;
    }

    .view.mypage .mypage-tabs a {
        gap: 4px;
        font-size: .79rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mypage-accordion i {
        transition: none;
    }
}
