/* =========================
   공통
========================= */
.hg-guide {
    --hg-text: #263b32;
    --hg-muted: #77867e;
    --hg-accent: #526e5b;
    --hg-border: #dfe7e1;

    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 1000;
    color: var(--hg-text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
}

.hg-guide,
.hg-guide * {
    box-sizing: border-box;
}

.hg-guide [hidden] {
    display: none !important;
}

.hg-guide button,
.hg-guide a {
    -webkit-tap-highlight-color: transparent;
}

.hg-guide button {
    margin: 0;
    font: inherit;
    cursor: pointer;
}

.hg-guide button:focus-visible,
.hg-guide a:focus-visible {
    outline: 2px solid var(--hg-accent);
    outline-offset: 4px;
}

/* =========================
   우측 하단 버튼
========================= */
/* 버튼: 밝은 청록·하늘색 배경 */
.hg-guide .hg-launcher {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8f7f2, #edf5ff);
    color: #009fbb;
    box-shadow:
        inset 0 0 0 1px rgba(53, 179, 177, .15),
        0 5px 18px rgba(34, 130, 151, .1);
    transition: transform .25s ease, box-shadow .25s ease;
}

.hg-guide .hg-launcher:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 0 0 1px rgba(53, 179, 177, .2),
        0 0 16px rgba(0, 194, 186, .2),
        0 6px 22px rgba(0, 149, 221, .15);
}

/* 얇은 테두리: 옅은 바탕 위로 선명한 빛이 흐름 */
.hg-guide .hg-launcher::before,
.hg-guide .hg-launcher::after {
    content: "";
    position: absolute;
    inset: -2px;
    z-index: -1;
    padding: 2px;
    border-radius: inherit;
    background: conic-gradient(
        from 0deg,
        #c9eeeb 0%,
        #c9eeeb 12%,
        #42dbc7 28%,
        #00b9c8 42%,
        #008fdd 55%,
        #65dcd8 68%,
        #d9f2f3 83%,
        #c9eeeb 100%
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    animation: hg-launcher-orbit 4s linear infinite;
}

/* 굵은 띠처럼 보이지 않도록 빛 번짐 조절 */
.hg-guide .hg-launcher::after {
    inset: -4px;
    padding: 3px;
    filter: blur(4px);
    opacity: .4;
}

/* 밝은 배경에서도 보이는 청록색 아이콘 */
.hg-guide .hg-launcher .hg-launcher-icon {
    position: relative;
    display: block;
    flex-shrink: 0;
    overflow: visible;
    color: #00a6be;
    filter: drop-shadow(0 0 2px rgba(0, 183, 192, .2));
    transition: color .25s ease, filter .25s ease;
}

.hg-guide .hg-launcher:hover .hg-launcher-icon,
.hg-guide .hg-launcher:focus-visible .hg-launcher-icon {
    color: #008fd0;
    filter:
        drop-shadow(0 0 3px rgba(0, 192, 202, .55))
        drop-shadow(0 0 7px rgba(0, 161, 222, .35));
}

.hg-guide .hg-spark-static {
    display: none;
}

@keyframes hg-launcher-orbit {
    to {
        transform: rotate(360deg);
    }
}

/* =========================
   안내 패널
========================= */
.hg-guide .hg-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 14px);
    display: flex;
    flex-direction: column;
    width: 370px;
    max-width: calc(100vw - 40px);
    max-height: min(620px, calc(100dvh - 120px));
    overflow: hidden;
    border: 3px solid var(--hg-border);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 60px rgba(24, 44, 32, .16);
}

.hg-guide .hg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
    padding: 23px 24px 20px;
    /* border-bottom: 1px solid var(--hg-border); */
    background: #f5f8f5;
}

.hg-guide .hg-eyebrow {
    margin: 0 0 5px;
    color: var(--hg-muted);
    font-size: 10px;
    letter-spacing: .15em;
}

.hg-guide .hg-header h2 {
    margin: 0;
    color: var(--hg-text);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.4;
}

.hg-guide .hg-close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--hg-muted);
    font-size: 20px;
    line-height: 1;
}

.hg-guide .hg-close:hover {
    background: #e8eee8;
    color: var(--hg-text);
}

.hg-guide .hg-body {
    min-height: 0;
    padding: 24px 24px 12px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.hg-guide .hg-footer {
    flex-shrink: 0;
    padding: 15px 20px;
    /* border-top: 1px solid var(--hg-border); */
    color: var(--hg-muted);
    font-size: 11px;
    text-align: center;
}

/* =========================
   질문 목록
========================= */
.hg-guide .hg-greeting {
    margin: 0 0 18px;
    color: var(--hg-text);
    font-size: 15px;
    opacity:0.5;
}

.hg-guide .hg-questions {
    display: grid;
    gap: 9px;
}

/* .hg-guide .hg-questions button {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    background: #fff;
    color: var(--hg-text);
    font-weight:500;
    text-align: left;
    transition: border-color .2s ease, background .2s ease;
}

.hg-guide .hg-questions button:hover,
.hg-guide .hg-questions button[aria-pressed="true"] {
    border-color: #f0f5f0;
    background: #f0f5f0;
} */

/* 질문 버튼 */
.hg-guide .hg-questions button {
    width: 100%;
    padding: 13px 15px;
    /* border: 1px solid var(--hg-border); */
    border: 1px solid #f8f8f8;
    border-radius: 12px;
    background-color: #f8f8f8;
    background-image: linear-gradient(
        90deg,
        #eaf5ef,
        #eef6f8
    );
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 0% 100%;
    color: var(--hg-text);
    text-align: left;
    transition:
        background-size .8s cubic-bezier(.22, 1, .36, 1),
        border-color .3s ease;
}

/* 마우스를 올리거나 키보드로 선택했을 때 */
.hg-guide .hg-questions button:hover,
.hg-guide .hg-questions button:focus-visible,
.hg-guide .hg-questions button[aria-pressed="true"] {
    /* border-color: #a5c6b5; */
    border-color: #eef6f7;
    background-size: 100% 100%;
}







/* 질문 목록으로 돌아가기 */
.hg-guide .hg-back {
    display: inline-flex;
    align-items: center;
    margin: 0 0 18px;
    padding: 5px 0;
    border: 0;
    background: transparent;
    color: var(--hg-muted);
    font-size: 13px;
    transition: color .2s ease;
}

.hg-guide .hg-back:hover {
    color: var(--hg-accent);
}

/* =========================
   답변 화면
========================= */
.hg-guide .hg-answer {
    margin-top: 0;
    padding: 20px;
    /* border: 1px solid #e3eae4; */
    border: 1px solid #f5f8f5;
    border-radius: 14px;
    background: #f5f8f5;
}

.hg-guide .hg-answer:focus {
    outline: none;
}

.hg-guide .hg-answer h3 {
    margin: 0 0 10px;
    color: var(--hg-text);
    font-size: 15px;
    font-weight: 600;
}

.hg-guide .hg-answer p {
    margin: 0;
    color: #586a5e;
    font-size: 14px;
    line-height: 1.7;
}

/* 선택한 질문 */
.hg-guide .hg-answer .hg-selected-question {
    margin: 0 0 17px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--hg-border);
    color: var(--hg-accent);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
}

/* 작성한 줄바꿈 유지 */
.hg-guide .hg-answer .hg-answer-description {
    white-space: pre-line;
}

/* 관련 페이지 버튼 */
.hg-guide .hg-answer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-top: 20px;
    padding: 11px 14px;
    border: 1px solid var(--hg-border);
    border-radius: 10px;
    background: #fff;
    color: var(--hg-accent);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.hg-guide .hg-answer-link:hover {
    border-color: #9eb4a3;
    background: #edf3ed;
    text-decoration: none;
}

/* =========================
   모바일
========================= */
@media (max-width: 600px) {
    .hg-guide {
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .hg-guide .hg-launcher {
        width: 54px;
        height: 54px;
    }

    .hg-guide .hg-panel {
        max-width: calc(100vw - 32px);
        max-height: calc(
            100dvh - 110px - env(safe-area-inset-bottom, 0px)
        );
        border-radius: 18px;
    }

    .hg-guide .hg-header {
        padding:10px 20px
    }
    .hg-guide .hg-body {
        padding: 20px 20px 5px 20px
    }
    .hg-guide .hg-header h2 {
        font-weight:400
    }
    .hg-guide .hg-questions button {
        font-size: 14px;
        font-weight:600;
        background-color: #f5f8f5;
        color: #7a977a
    }
}

/* =========================
   움직임 최소화 설정
========================= */
@media (prefers-reduced-motion: reduce) {
    .hg-guide .hg-launcher::before,
    .hg-guide .hg-launcher::after {
        animation: none;
    }

    .hg-guide .hg-launcher,
    .hg-guide .hg-launcher .hg-launcher-icon,
    .hg-guide .hg-questions button,
    .hg-guide .hg-back {
        transition: none;
    }

    .hg-guide .hg-spark-morph {
        display: none;
    }

    .hg-guide .hg-spark-static {
        display: block;
    }
}

/* PC에서는 배경 필터 숨김 */
.hg-guide .hg-backdrop {
    display: none;
}

/* 모바일 배경 필터 */
@media (max-width: 600px) {
    .hg-guide .hg-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: -1;
        background: rgba(0, 0, 0, .7);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition:
            opacity .25s ease,
            visibility .25s ease;
    }

    .hg-guide.is-open .hg-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* 움직임 최소화 설정 */
@media (prefers-reduced-motion: reduce) {
    .hg-guide .hg-backdrop {
        transition: none;
    }
}

/* 안내창이 펼쳐지는 기준점 */
.hg-guide .hg-panel {
    transform-origin: right bottom;
}