#gptModal.terms-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    padding: 24px;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    box-sizing: border-box;
    z-index: 3200;
}

#gptModal .terms-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(640px, calc(100vw - 48px));
    max-width: 640px;
    min-height: 0;
    max-height: calc(100vh - 48px);
    padding: 0;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

#gptModal .terms-modal-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: transparent;
    padding: 0;
    line-height: 0;
    color: #aaa;
    cursor: pointer;
    z-index: 4;
    transition: color 0.2s ease, background 0.2s ease;
}

#gptModal .terms-modal-close-btn:hover {
    background: #f1f5f9;
    color: #667085;
}

#gptModal .terms-modal-close-btn:hover path {
    fill: #667085;
}

#gptModal .terms-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.gpt-modal-header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 52px;
}

.gpt-modal-header-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.12);
    flex: 0 0 auto;
}

.gpt-modal-header-copy {
    min-width: 0;
    flex: 1 1 auto;
}

#gptModal .modal-title {
    margin: 0;
    color: #111827;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.35;
    text-align: left;
}

#gptModal .terms-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
    background: #ffffff;
}

#gptModal .gpt-modal-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}

#gptModal .gpt-modal-meta.is-loading {
    color: #94a3b8;
}

#gptModal .gpt-modal-meta.is-error {
    color: #b42318;
}

#gptModal .gpt-modal-meta-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #10b981;
    flex: 0 0 auto;
}

#gptModal .gpt-modal-meta.is-error .gpt-modal-meta-dot {
    background: #ef4444;
}

#gptModalContent {
    margin: 0;
}

.gpt-guide-intro {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    background: #f8faff;
    color: #4338ca;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.8;
}

.gpt-guide-intro-badge {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 800;
    flex: 0 0 auto;
}

.gpt-guide-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.gpt-guide-timeline::before {
    display: none;
}

.gpt-guide-step {
    position: relative;
    padding-left: 34px;
}

.gpt-guide-step-index {
    position: absolute;
    left: 0;
    top: 1px;
    z-index: 1;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: #1f2937;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    box-shadow: none;
}

.gpt-guide-step + .gpt-guide-step .gpt-guide-step-index {
    background: #111827;
    color: #ffffff;
}

.gpt-guide-step-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    opacity: 1;
    padding-left: 8px;
}

.gpt-guide-step-label {
    display: none;
}

.gpt-guide-step-content {
    padding: 0;
}

.gpt-guide-step-title {
    margin: 0 0 4px;
    color: #111827;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.45;
    text-align: left;
}

.gpt-guide-step-desc {
    margin: 0 0 8px;
    color: #667085;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.55;
    text-align: left;
}

.gpt-guide-step-desc:empty {
    display: none;
}

.gpt-guide-code-wrap {
    width: 100%;
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: #0f172a;
}

.gpt-guide-code-label {
    position: absolute;
    top: 10px;
    left: 12px;
    color: #98a2b3;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: var(--learnix-font-mono);
}

.gpt-guide-copy {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: #1f2937;
    color: #cbd5e1;
    cursor: pointer;
    opacity: 1;
    transition: color 0.2s ease, background 0.2s ease;
}

.gpt-guide-copy svg {
    flex: 0 0 auto;
}

.gpt-guide-copy span {
    display: none;
}

.gpt-guide-copy:hover {
    background: #334155;
    color: #ffffff;
}

.gpt-guide-copy.is-copied {
    color: #86efac;
}

.gpt-guide-code {
    margin: 0;
    padding: 32px 16px 16px;
    color: #34d399;
    font-size: 13px;
    line-height: 1.75;
    font-family: var(--learnix-font-mono);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    text-align: left;
}

.gpt-guide-fallback {
    padding: 16px 18px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.8;
}

.gpt-guide-fallback > :first-child {
    margin-top: 0;
}

.gpt-guide-fallback > :last-child {
    margin-bottom: 0;
}

.gpt-guide-fallback pre {
    margin: 16px 0;
    padding: 16px;
    border-radius: 12px;
    background: #f3f4f6;
    overflow-x: auto;
}

.gpt-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
}

.gpt-modal-feedback {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: #667085;
    font-size: 13px;
    font-weight: 500;
}

.gpt-modal-feedback-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 26px;
    padding: 0 6px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.gpt-modal-feedback-btn:hover {
    background: transparent;
}

.gpt-modal-feedback-btn svg {
    pointer-events: none;
    width: 18px;
    height: 18px;
    transition: color 0.2s ease, fill 0.2s ease, stroke 0.2s ease;
}

.gpt-modal-feedback-count {
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.gpt-modal-feedback-btn[aria-label="도움됨"]:hover {
    color: #4f46e5;
}

.gpt-modal-feedback-btn[aria-label="도움 안 됨"]:hover {
    color: #e11d48;
}

.gpt-modal-feedback-btn.is-active[aria-label="도움됨"] {
    color: #4f46e5;
    background: #eef2ff;
}

.gpt-modal-feedback-btn.is-active[aria-label="도움 안 됨"] {
    color: #e11d48;
    background: #fff1f2;
}

.gpt-modal-confirm {
    min-width: 180px;
    height: 44px;
    padding: 0 22px;
    box-sizing: border-box;
    border: 0;
    border-radius: 12px;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.gpt-modal-confirm:hover {
    background: #000000;
}

@media (max-width: 980px) {
    .gpt-modal-footer {
        flex-wrap: wrap;
    }

    .gpt-modal-confirm {
        margin-left: auto;
    }
}

@media (max-width: 768px) {
    #gptModal.terms-modal-overlay {
        padding: 0;
    }

    #gptModal .terms-modal-content {
        width: 100vw;
        max-width: none;
        min-height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    #gptModal .terms-modal-header {
        padding: 18px 16px 14px;
    }

    #gptModal .terms-modal-close-btn {
        top: 16px;
        right: 16px;
    }

    .gpt-modal-header-brand {
        align-items: center;
        padding-right: 44px;
    }

    #gptModal .modal-title {
        font-size: 16px;
    }

    #gptModal .terms-modal-body {
        padding: 18px;
    }

    .gpt-modal-footer {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 16px 14px;
    }

    .gpt-modal-confirm {
        width: 100%;
        min-width: 0;
    }
}
