body.qml-modal-open {
    overflow: hidden;
}

.qml-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    font-family: Arial, sans-serif;
}

.qml-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
}

.qml-card {
    position: relative;
    z-index: 2;
    width: min(94vw, 820px);
    max-height: 92vh;
    margin: 4vh auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
    overflow: hidden;
}

.qml-inner {
    padding: 24px;
    max-height: 92vh;
    overflow-y: auto;
}

.qml-close {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 999px;
    background: #f1f1f1;
    color: #333;
    font-size: 24px;
    line-height: 34px;
    cursor: pointer;
}

.qml-header {
    text-align: center;
    padding: 4px 38px 18px;
    border-bottom: 1px solid #eee;
    margin-bottom: 18px;
}

.qml-header h2 {
    margin: 10px 0 8px;
    color: #111;
    font-size: 26px;
}

.qml-header p {
    margin: 0;
    color: #666;
}

.qml-badge {
    display: inline-block;
    padding: 6px 12px;
    background: #fff3f3;
    color: #d71920;
    border: 1px solid #ffd2d2;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.qml-loading,
.qml-error-box {
    text-align: center;
    padding: 38px 12px;
}

.qml-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #eee;
    border-top-color: #e21b2d;
    border-radius: 50%;
    margin: 0 auto 18px;
    animation: qml-spin 1s linear infinite;
}

@keyframes qml-spin {
    to { transform: rotate(360deg); }
}

.qml-steps {
    display: grid;
    gap: 14px;
}

.qml-step {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid #eee;
    border-radius: 14px;
    background: #fafafa;
}

.qml-step-num {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #e21b2d;
    color: #fff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qml-step-body h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.qml-step-body p {
    margin: 0 0 8px;
    color: #333;
}

.qml-red {
    color: #e21b2d;
}

.qml-keyword-box,
.qml-keyword-alt {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.qml-keyword-box strong,
.qml-keyword-alt strong {
    display: inline-block;
    background: #222;
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    font-family: monospace;
    font-size: 15px;
}

.qml-copy-btn,
.qml-google-btn,
.qml-submit-btn,
.qml-primary-btn,
.qml-change-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
}

.qml-copy-btn,
.qml-google-btn,
.qml-submit-btn,
.qml-primary-btn {
    background: #0b75ff;
    color: #fff;
}

.qml-copy-btn.qml-copied {
    background: #21a453;
}

.qml-change-btn {
    background: #f1f1f1;
    color: #222;
}

.qml-guide-img {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    margin-top: 10px;
}

.qml-code-form {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #eaeaea;
    border-radius: 14px;
    background: #fff;
    align-items: center;
    flex-wrap: wrap;
}

.qml-code-input {
    flex: 1;
    min-width: 220px;
    padding: 13px 14px;
    border: 1px solid #cfd4dc;
    border-radius: 999px;
    font-size: 16px;
}

.qml-input-error {
    border-color: #e21b2d;
}

.qml-message {
    width: 100%;
    margin: 4px 0 0;
    min-height: 22px;
    font-weight: 700;
}

.qml-message.qml-error {
    color: #e21b2d;
}

.qml-message.qml-success {
    color: #1b8f3a;
}

.qml-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    color: #666;
}

@media (max-width: 640px) {
    .qml-inner {
        padding: 18px;
    }

    .qml-header h2 {
        font-size: 21px;
    }

    .qml-step {
        grid-template-columns: 36px 1fr;
        padding: 12px;
    }

    .qml-code-form {
        display: block;
    }

    .qml-code-input,
    .qml-submit-btn {
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 10px;
    }

    .qml-actions {
        flex-direction: column;
    }
}