.mgs-cq-app{--cq-primary:#b5966f;--cq-secondary:#f8f4ee;--cq-button:#8c6844;--cq-text:#332b27;max-width:500px;margin:24px auto;color:var(--cq-text);font-family:Arial,sans-serif}
.mgs-cq-screen{display:none;min-height:760px;border-radius:32px;overflow:auto;box-shadow:0 24px 70px rgba(70,50,30,.15)}
.mgs-cq-screen.is-active{display:flex}
.mgs-cq-cover{align-items:flex-end;justify-content:center;background:linear-gradient(to bottom,rgba(0,0,0,.08),rgba(0,0,0,.72)),linear-gradient(135deg,#777,#333);background-size:cover;background-position:center;color:var(--cq-cover-text,#fff)}
.mgs-cq-cover .mgs-cq-heart,.mgs-cq-cover h1,.mgs-cq-cover .mgs-cq-names,.mgs-cq-cover .mgs-cq-date{color:var(--cq-cover-text,#fff);text-shadow:var(--cq-cover-shadow,0 2px 10px rgba(0,0,0,.65))}
.mgs-cq-cover-content{width:100%;text-align:center;padding:40px 26px 52px}
.mgs-cq-cover h1{font-family:Georgia,serif;font-size:54px;line-height:.95;font-weight:500;margin:8px 0 22px}
.mgs-cq-heart{font-size:38px}.mgs-cq-heart.gold{color:var(--cq-primary)}
.mgs-cq-names{font-family:Georgia,serif;font-size:29px}.mgs-cq-date{margin:7px 0 30px;letter-spacing:1.5px;font-size:12px;text-transform:uppercase}
.mgs-cq-primary,.mgs-cq-submit-register,.mgs-cq-next{border:0;cursor:pointer;background:var(--cq-button);color:#fff;border-radius:15px;padding:17px 24px}
.mgs-cq-primary{background:var(--cq-secondary);color:var(--cq-text);border-radius:40px;font-weight:700}
.mgs-cq-register,.mgs-cq-question-screen,.mgs-cq-result{align-items:center;justify-content:center;background:var(--cq-secondary);padding:24px}
.mgs-cq-card{width:100%;background:rgba(255,255,255,.92);border-radius:25px;padding:34px;text-align:center}
.mgs-cq-card h2,.mgs-cq-result-message{font-family:Georgia,serif;font-weight:500;font-size:35px}
.mgs-cq-register-form{display:grid;gap:12px;margin-top:24px}.mgs-cq-register-form input{height:54px;border:1px solid #ddd2c7;border-radius:14px;padding:0 16px;font-size:16px}
.mgs-cq-submit-register{font-size:16px}.mgs-cq-thanks{font-family:Georgia,serif;font-size:21px;font-style:italic;margin-top:28px;color:#756357}
.mgs-cq-question-wrap{width:100%}.mgs-cq-top{display:flex;justify-content:space-between;font-size:13px;color:#75685e}
.mgs-cq-progress-track{height:7px;border-radius:20px;background:#dfd7cf;overflow:hidden;margin:12px 0 42px}.mgs-cq-progress{height:100%;background:var(--cq-primary);width:0}
.mgs-cq-question{font-family:Georgia,serif;font-size:38px;line-height:1.08;text-align:center;margin-bottom:32px}
.mgs-cq-options{display:grid;gap:12px}.mgs-cq-option{min-height:58px;background:#fff;border:1px solid #ddd2c7;border-radius:15px;text-align:left;padding:14px 16px;cursor:pointer;color:var(--cq-text)}
.mgs-cq-option span{display:inline-flex;width:27px;height:27px;align-items:center;justify-content:center;border-radius:50%;background:#f1ece6;margin-right:10px;font-size:12px}.mgs-cq-option.selected{background:#efe5d8;border-color:var(--cq-primary)}.mgs-cq-option.selected span{background:var(--cq-primary);color:#fff}
.mgs-cq-next{width:100%;margin-top:27px;font-size:16px}.mgs-cq-next:disabled{opacity:.4;cursor:default}
.mgs-cq-result-card{max-height:700px;overflow:auto}.mgs-cq-result-photo{width:125px;height:125px;border-radius:50%;object-fit:cover;border:5px solid #fff;box-shadow:0 8px 24px rgba(0,0,0,.12)}
.mgs-cq-score{font-family:Georgia,serif;font-size:68px;line-height:.9;margin-top:12px}.mgs-cq-percent{font-family:Georgia,serif;font-size:30px;margin-top:8px}.mgs-cq-result-message{margin:14px 0 6px}
.mgs-cq-qr{margin-top:25px;padding:18px;border-radius:18px;background:#f4eee6;border:1px solid #e3d7c8}.mgs-cq-qr strong{display:block;margin-bottom:10px}.mgs-cq-qr a{display:block;padding:14px 16px;border-radius:12px;background:var(--cq-button);color:#fff!important;text-decoration:none}
.mgs-cq-review-toggle{margin-top:16px;background:transparent;border:0;text-decoration:underline;cursor:pointer;color:#705b4a}.mgs-cq-review{display:none;text-align:left;margin-top:18px}.mgs-cq-review.open{display:block}.mgs-cq-review-item{padding:14px 0;border-bottom:1px solid #e5ddd6}.mgs-cq-review-item div{font-size:13px;margin-top:5px}.mgs-cq-review-item .ok{color:#647357}.mgs-cq-review-item .bad{color:#ab5f59}.mgs-cq-review-item small{display:block;margin-top:5px;color:#8e8177}

/* Dashboard */
.mgs-cq-empty-state{padding:24px;border:1px solid #e8dfd6;border-radius:18px;background:#fff}
.mgs-cq-dashboard{max-width:1180px;margin:24px auto;font-family:Arial,sans-serif}
.mgs-cq-dashboard-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-end;margin-bottom:18px}
.mgs-cq-dashboard-head h2{margin:0 0 6px;font-size:28px;font-family:Georgia,serif}
.mgs-cq-dashboard-head p{margin:0;color:#6f6359;max-width:700px}
.mgs-cq-event-switcher{min-width:230px}.mgs-cq-event-switcher label{display:block;font-size:12px;color:#7c6f64;margin-bottom:6px}
.mgs-cq-event-switcher select{width:100%;padding:11px 12px;border:1px solid #ddd;border-radius:12px;background:#fff}
.mgs-cq-dashboard-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}
.mgs-cq-summary-card{padding:18px;border-radius:16px;background:#fff;border:1px solid #ece2d7;box-shadow:0 8px 30px rgba(90,65,40,.04)}
.mgs-cq-summary-card b{display:block;font-size:30px;color:#3f2f23}.mgs-cq-summary-card span{font-size:12px;color:#7c6f64;text-transform:uppercase;letter-spacing:.6px}
.mgs-cq-dashboard-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.mgs-cq-dashboard-tabs button{border:1px solid #ddd;border-radius:12px;padding:11px 16px;background:#fff;cursor:pointer}
.mgs-cq-dashboard-tabs button.is-active{background:#8c6844;color:#fff;border-color:#8c6844}
.mgs-cq-dtab{display:none}.mgs-cq-dtab.is-active{display:block}
.mgs-cq-two-col{display:grid;grid-template-columns:1.2fr .8fr;gap:18px}
.mgs-cq-two-col.question-layout{grid-template-columns:1fr 1fr}
.mgs-cq-panel{background:#fff;border:1px solid #ece2d7;border-radius:18px;padding:22px;box-shadow:0 12px 40px rgba(90,65,40,.04)}
.mgs-cq-panel h3{margin-top:0;font-size:22px;font-family:Georgia,serif}
.mgs-cq-dashboard-form,.mgs-cq-add-question-form{display:grid;gap:14px}
.mgs-cq-dashboard-form label,.mgs-cq-add-question-form label{display:grid;gap:6px;font-weight:600;color:#43362b}
.mgs-cq-dashboard-form input:not([type=checkbox]):not([type=color]),.mgs-cq-dashboard-form textarea,.mgs-cq-dashboard-form select,.mgs-cq-add-question-form input,.mgs-cq-add-question-form textarea,.mgs-cq-add-question-form select{width:100%;padding:12px 13px;border:1px solid #ddd;border-radius:10px;background:#fff;box-sizing:border-box}
.mgs-cq-dashboard-form textarea,.mgs-cq-add-question-form textarea{min-height:110px}
.mgs-cq-color-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.mgs-cq-color-grid label input[type=color]{width:100%;height:52px;padding:4px;border:1px solid #ddd;border-radius:10px;background:#fff}
.mgs-cq-check{display:flex !important;align-items:center;gap:10px;font-weight:500 !important}
.mgs-cq-save-settings,.mgs-cq-add-question-form button,.mgs-cq-media-button,.mgs-cq-media-remove{padding:13px 18px;border:0;border-radius:10px;background:#8c6844;color:#fff;cursor:pointer}
.mgs-cq-media-remove{background:#9d8a79}
.mgs-cq-media-field{display:grid;gap:12px}
.mgs-cq-media-preview{border:1px dashed #d9cec1;border-radius:14px;padding:10px;min-height:160px;display:flex;align-items:center;justify-content:center;background:#faf7f2}
.mgs-cq-media-preview img{max-width:100%;max-height:260px;border-radius:10px;display:block}
.mgs-cq-media-placeholder{color:#8a7d71}
.mgs-cq-media-actions{display:flex;gap:10px;flex-wrap:wrap}
.mgs-cq-info-list{display:grid;gap:10px;margin-bottom:18px}.mgs-cq-info-list div{padding:12px;border-radius:12px;background:#faf7f2}
.mgs-cq-note{padding:14px;border-radius:12px;background:#f1ebe2;color:#5f5144}
.mgs-cq-question-list{display:grid;gap:12px}
.mgs-cq-qrow{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:14px;border:1px solid #eee;border-radius:12px;background:#fafafa}
.mgs-cq-qrow small{display:block;margin-top:6px;color:#7f7266}
.mgs-cq-delete-question{border:0;background:#a65757;color:#fff;border-radius:8px;padding:8px 11px;cursor:pointer;white-space:nowrap}
.mgs-cq-results-table-wrap{overflow:auto}.mgs-cq-results-table{width:100%;border-collapse:collapse;background:#fff}
.mgs-cq-results-table th,.mgs-cq-results-table td{padding:12px;border-bottom:1px solid #eee;text-align:left;vertical-align:top}
.mgs-cq-results-detail-row td{background:#fcfaf7}
.mgs-cq-player-review summary{cursor:pointer;font-weight:700}
.mgs-cq-player-review-list{margin-top:12px;display:grid;gap:12px}
.mgs-cq-player-review-item{padding:12px;border:1px solid #e9e1d7;border-radius:12px;background:#fff}
.mgs-cq-player-review-item .ok{color:#647357;margin-top:5px}.mgs-cq-player-review-item .bad{color:#ab5f59;margin-top:5px}.mgs-cq-player-review-item small{display:block;margin-top:6px;color:#8e8177}
.mgs-cq-dashboard-msg{margin-top:16px;font-weight:700;color:#4a3a2b}
@media(max-width:900px){.mgs-cq-dashboard-head{display:block}.mgs-cq-dashboard-summary{grid-template-columns:1fr 1fr}.mgs-cq-two-col,.mgs-cq-two-col.question-layout{grid-template-columns:1fr}}
@media(max-width:600px){.mgs-cq-app{margin:0;max-width:none}.mgs-cq-screen{min-height:100vh;border-radius:0}.mgs-cq-cover h1{font-size:46px}.mgs-cq-color-grid{grid-template-columns:1fr}.mgs-cq-summary-card b{font-size:26px}.mgs-cq-dashboard-summary{grid-template-columns:1fr 1fr}.mgs-cq-qrow{display:block}.mgs-cq-delete-question{margin-top:10px}}

/* v0.3 customer-friendly design + live preview */
.mgs-cq-design-layout{display:grid;grid-template-columns:minmax(0,1fr) 390px;gap:18px;align-items:start}
.mgs-cq-section-help{margin-top:-6px;margin-bottom:18px;color:#76695f;font-size:13px;line-height:1.5}
.mgs-cq-admin-details{margin-top:20px;border-top:1px solid #eee;padding-top:14px}
.mgs-cq-admin-details summary{cursor:pointer;font-weight:700;color:#6d5b4c}
.mgs-cq-admin-details .mgs-cq-info-list{margin-top:12px}
.mgs-cq-live-preview{position:sticky;top:24px;background:#fff;border:1px solid #ece2d7;border-radius:18px;padding:16px;box-shadow:0 12px 40px rgba(90,65,40,.05)}
.mgs-cq-preview-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}
.mgs-cq-preview-head strong{display:block;font-size:16px}
.mgs-cq-preview-head span{display:block;color:#8a7d71;font-size:12px;margin-top:2px}
.mgs-cq-preview-step-label{font-size:12px;color:#7a6858;background:#f5efe7;padding:7px 10px;border-radius:999px;white-space:nowrap}
.mgs-cq-preview-phone{--p-primary:#b5966f;--p-bg:#f8f4ee;--p-button:#8c6844;--p-text:#332b27;--p-cover-text:#fff;--p-cover-shadow:0 2px 8px rgba(0,0,0,.65);width:100%;aspect-ratio:9/16;border:10px solid #151515;border-radius:34px;overflow:hidden;background:var(--p-bg);box-shadow:0 18px 45px rgba(0,0,0,.18);position:relative}
.mgs-cq-preview-screen{display:none;width:100%;height:100%;background:var(--p-bg);color:var(--p-text);overflow:auto}
.mgs-cq-preview-screen.is-active{display:flex}
.mgs-cq-preview-screen[data-preview-screen="cover"]{align-items:flex-end;justify-content:center;background:linear-gradient(135deg,#7a746f,#3b3734);background-size:cover;background-position:center;color:#fff}
.mgs-cq-preview-cover-content{width:100%;text-align:center;padding:24px 18px 28px}
.mgs-cq-preview-heart{font-size:28px;line-height:1}
.mgs-cq-preview-heart.gold{color:var(--p-primary)}
.mgs-cq-preview-cover-content h4{font-family:Georgia,serif;font-weight:500;font-size:31px;line-height:.98;margin:8px 0 16px}
.mgs-cq-preview-names{font-family:Georgia,serif;font-size:20px}
.mgs-cq-preview-date{font-size:10px;letter-spacing:1.2px;text-transform:uppercase;margin:5px 0 18px}
.mgs-cq-preview-phone button{border:0;border-radius:13px;padding:12px 16px;background:var(--p-button);color:#fff;font-size:12px}
.mgs-cq-preview-cover-content button{background:var(--p-bg);color:var(--p-text);border-radius:28px}
.mgs-cq-preview-inner{width:100%;padding:22px 18px;display:flex;flex-direction:column}
.mgs-cq-preview-inner.centered{justify-content:center;text-align:center}
.mgs-cq-preview-inner h4{font-family:Georgia,serif;font-size:25px;font-weight:500;margin:10px 0 8px}
.mgs-cq-preview-inner p{font-size:11px;color:#85776d;margin:0 0 16px}
.mgs-cq-preview-input{border:1px solid #ddd2c7;background:#fff;border-radius:11px;padding:12px;text-align:left;font-size:11px;color:#94867c;margin-bottom:9px}
.mgs-cq-preview-inner button{margin-top:8px}
.mgs-cq-preview-question-top{display:flex;justify-content:space-between;font-size:10px;color:#75685e}
.mgs-cq-preview-progress{height:5px;border-radius:10px;background:#dfd7cf;overflow:hidden;margin:8px 0 22px}
.mgs-cq-preview-progress span{display:block;height:100%;width:20%;background:var(--p-primary)}
.mgs-cq-preview-question-text{text-align:center!important;font-size:23px!important;line-height:1.05!important;margin:0 0 20px!important}
.mgs-cq-preview-options{display:grid;gap:8px}
.mgs-cq-preview-option{min-height:42px;background:#fff;border:1px solid #ddd2c7;border-radius:11px;padding:10px;font-size:10px;display:flex;align-items:center;gap:8px}
.mgs-cq-preview-option span{display:inline-flex;width:22px;height:22px;border-radius:50%;align-items:center;justify-content:center;background:#f1ece6;font-size:9px}
.mgs-cq-preview-score{font-family:Georgia,serif;font-size:48px;line-height:.9;margin-top:10px}
.mgs-cq-preview-percent{font-family:Georgia,serif;font-size:23px;margin-top:5px}
.mgs-cq-preview-inner.result h4{font-size:22px}
.mgs-cq-preview-qr{margin-top:14px;padding:10px;border-radius:10px;background:#f4eee6;color:#665347;font-size:10px;font-weight:700}
.mgs-cq-preview-controls{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
.mgs-cq-preview-controls button{border:1px solid #ded5cc;background:#fff;color:#5c4c3f;border-radius:10px;padding:10px;cursor:pointer}
@media(max-width:1100px){.mgs-cq-design-layout{grid-template-columns:1fr}.mgs-cq-live-preview{position:relative;top:auto;max-width:430px;margin:0 auto;width:100%}}

.mgs-cq-preview-cover-content,.mgs-cq-preview-cover-content h4,.mgs-cq-preview-names,.mgs-cq-preview-date,.mgs-cq-preview-cover-content .mgs-cq-preview-heart{color:var(--p-cover-text,#fff);text-shadow:var(--p-cover-shadow,0 2px 8px rgba(0,0,0,.65))}
.mgs-cq-share-grid{display:grid;grid-template-columns:1fr .8fr;gap:18px}
.mgs-cq-share-link{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center}
.mgs-cq-share-link input{width:100%;padding:13px;border:1px solid #ddd;border-radius:10px;background:#fafafa;font-size:13px}
.mgs-cq-copy-link,.mgs-cq-open-live,.mgs-cq-download-qr{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:10px;padding:13px 16px;background:#8c6844;color:#fff!important;text-decoration:none;cursor:pointer;font-weight:600}
.mgs-cq-share-actions{margin-top:12px}
.mgs-cq-share-tip{margin-top:18px;padding:14px;background:#f5efe7;border-radius:12px;color:#5e5146;font-size:13px}
.mgs-cq-qr-panel{text-align:center}
.mgs-cq-qr-preview{background:#fff;border:1px solid #eee;border-radius:16px;padding:14px;display:inline-flex;margin:4px auto 14px}
.mgs-cq-qr-preview img{width:min(280px,100%);height:auto;display:block}
.mgs-cq-download-qr{width:100%;box-sizing:border-box;margin-bottom:10px}
.mgs-cq-qr-panel small{display:block;color:#7c6f64;line-height:1.5}
.mgs-cq-public-page{padding:24px 16px}
@media(max-width:900px){.mgs-cq-share-grid{grid-template-columns:1fr}}
@media(max-width:600px){.mgs-cq-share-link{grid-template-columns:1fr}.mgs-cq-copy-link{width:100%}}


/* v0.4.1 standalone quiz page */
html .mgs-cq-standalone-page{
    margin:0;
    padding:0;
    background:var(--cq-secondary, #f8f4ee);
}
.mgs-cq-public-page--standalone{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
    margin:0;
    background:var(--cq-secondary, #f8f4ee);
}
.mgs-cq-public-page--standalone .mgs-cq-app{
    margin:0 auto;
}
@media(max-width:600px){
    .mgs-cq-public-page--standalone{
        padding:0;
    }
}

/* result text refinements */
.mgs-cq-result-note{
    margin:12px 0 0;
}
.mgs-cq-result-thanks{
    font-size:17px;
    line-height:1.2;
    margin-bottom:8px;
    white-space:nowrap;
}
.mgs-cq-result-presence{
    font-size:14px;
    line-height:1.45;
    color:#4c433d;
    max-width:340px;
    margin:0 auto;
}
.mgs-cq-powered-by{
    margin-top:18px;
    font-size:11px;
    line-height:1.2;
    letter-spacing:.4px;
    color:#8c7c6f;
    text-transform:none;
}


/* v0.4.2 — true mobile fullscreen layout */
html,
body.mgs-cq-standalone-page{
    width:100%;
    min-height:100%;
    margin:0!important;
    padding:0!important;
    overflow-x:hidden;
}

body.mgs-cq-standalone-page{
    background:#f8f4ee;
}

body.mgs-cq-standalone-page .mgs-cq-public-page--standalone{
    width:100%;
    min-height:100dvh;
    margin:0;
    padding:0;
    display:block;
}

body.mgs-cq-standalone-page .mgs-cq-app{
    width:100%;
    max-width:500px;
    min-height:100dvh;
    margin:0 auto;
}

body.mgs-cq-standalone-page .mgs-cq-screen{
    min-height:100dvh;
    height:auto;
}

/* Results should not be trapped inside a small inner scroller on phones */
body.mgs-cq-standalone-page .mgs-cq-result-card{
    max-height:none;
    overflow:visible;
}

/* Keep the result content visually centered without making it enormous */
body.mgs-cq-standalone-page .mgs-cq-result{
    align-items:flex-start;
    padding-top:22px;
    padding-bottom:30px;
}

/* Mobile */
@media (max-width: 600px){
    body.mgs-cq-standalone-page{
        background:var(--cq-secondary,#f8f4ee);
    }

    body.mgs-cq-standalone-page .mgs-cq-public-page--standalone{
        min-height:100dvh;
    }

    body.mgs-cq-standalone-page .mgs-cq-app{
        width:100%;
        max-width:none;
        min-height:100dvh;
        margin:0;
    }

    body.mgs-cq-standalone-page .mgs-cq-screen{
        width:100%;
        min-height:100dvh;
        border-radius:0;
        box-shadow:none;
        overflow:visible;
    }

    body.mgs-cq-standalone-page .mgs-cq-cover{
        min-height:100dvh;
        background-size:cover;
    }

    body.mgs-cq-standalone-page .mgs-cq-cover-content{
        padding:
            max(28px, env(safe-area-inset-top))
            22px
            max(34px, calc(24px + env(safe-area-inset-bottom)));
    }

    body.mgs-cq-standalone-page .mgs-cq-register,
    body.mgs-cq-standalone-page .mgs-cq-question-screen,
    body.mgs-cq-standalone-page .mgs-cq-result{
        padding-left:18px;
        padding-right:18px;
        padding-top:max(20px, env(safe-area-inset-top));
        padding-bottom:max(26px, calc(18px + env(safe-area-inset-bottom)));
    }

    body.mgs-cq-standalone-page .mgs-cq-card{
        width:100%;
        border-radius:22px;
        padding:26px 20px;
        box-shadow:none;
        background:rgba(255,255,255,.96);
    }

    body.mgs-cq-standalone-page .mgs-cq-question-wrap{
        width:100%;
        max-width:none;
    }

    body.mgs-cq-standalone-page .mgs-cq-question{
        font-size:34px;
        line-height:1.05;
        margin-bottom:26px;
    }

    body.mgs-cq-standalone-page .mgs-cq-options{
        gap:10px;
    }

    body.mgs-cq-standalone-page .mgs-cq-option{
        min-height:56px;
        font-size:15px;
        padding:13px 14px;
    }

    body.mgs-cq-standalone-page .mgs-cq-next{
        min-height:56px;
        margin-top:22px;
    }

    body.mgs-cq-standalone-page .mgs-cq-result{
        display:block;
        min-height:100dvh;
    }

    body.mgs-cq-standalone-page .mgs-cq-result-card{
        width:100%;
        max-width:none;
        max-height:none;
        overflow:visible;
        margin:0;
        border-radius:22px;
        padding:24px 18px 20px;
    }

    body.mgs-cq-standalone-page .mgs-cq-result-photo{
        width:112px;
        height:112px;
    }

    body.mgs-cq-standalone-page .mgs-cq-score{
        font-size:60px;
    }

    body.mgs-cq-standalone-page .mgs-cq-percent{
        font-size:28px;
    }

    body.mgs-cq-standalone-page .mgs-cq-result-message{
        font-size:31px;
        line-height:1.05;
        margin-top:16px;
    }

    body.mgs-cq-standalone-page .mgs-cq-result-thanks{
        font-size:14px;
        white-space:nowrap;
    }

    body.mgs-cq-standalone-page .mgs-cq-result-presence{
        font-size:13px;
        line-height:1.4;
        max-width:300px;
    }

    body.mgs-cq-standalone-page .mgs-cq-powered-by{
        margin-top:18px;
        padding-bottom:max(4px, env(safe-area-inset-bottom));
    }
}

/* Narrow phones */
@media (max-width: 390px){
    body.mgs-cq-standalone-page .mgs-cq-cover h1{
        font-size:42px;
    }

    body.mgs-cq-standalone-page .mgs-cq-question{
        font-size:30px;
    }

    body.mgs-cq-standalone-page .mgs-cq-result-message{
        font-size:28px;
    }

    body.mgs-cq-standalone-page .mgs-cq-result-thanks{
        font-size:13px;
    }
}


/* v0.4.3 — hard isolation of the public quiz from the site theme */
body.mgs-cq-standalone-page > header,
body.mgs-cq-standalone-page > footer,
body.mgs-cq-standalone-page .site-header,
body.mgs-cq-standalone-page .site-footer,
body.mgs-cq-standalone-page #masthead,
body.mgs-cq-standalone-page #colophon,
body.mgs-cq-standalone-page .elementor-location-header,
body.mgs-cq-standalone-page .elementor-location-footer,
body.mgs-cq-standalone-page .ast-primary-header-bar,
body.mgs-cq-standalone-page .main-header-bar{
    display:none!important;
}

body.mgs-cq-standalone-page .mgs-cq-public-page--standalone{
    width:100%!important;
    max-width:none!important;
    min-height:100dvh!important;
    margin:0!important;
    padding:0!important;
}

/* Keep the existing desktop appearance unchanged */
@media (min-width: 601px){
    body.mgs-cq-standalone-page .mgs-cq-app{
        max-width:500px;
        margin:24px auto;
    }
}

/* On phones the quiz starts immediately below Safari itself — no site chrome */
@media (max-width: 600px){
    body.mgs-cq-standalone-page .mgs-cq-app{
        margin:0!important;
        width:100%!important;
        max-width:none!important;
    }
}


/* v0.4.4 clean route matching Never Miss A Moment approach */
body.mgs-cq-clean-quiz-mode .mgs-cq-public-page--standalone{
    width:100%!important;
    max-width:none!important;
    min-height:100dvh!important;
    margin:0!important;
    padding:0!important;
    background:var(--cq-secondary,#f8f4ee)!important;
}
body.mgs-cq-clean-quiz-mode .mgs-cq-public-page--standalone .mgs-cq-app{
    margin-left:auto!important;
    margin-right:auto!important;
}
@media(max-width:600px){
    body.mgs-cq-clean-quiz-mode .mgs-cq-public-page--standalone .mgs-cq-app{
        width:100%!important;
        max-width:none!important;
        margin:0!important;
    }
}


/* v0.4.5 — mobile hard-cover mode.
   Desktop stays exactly as in v0.4.4.
   On phones the quiz viewport sits above any mobile theme header/footer. */
@media (max-width: 600px){
    html:has(.mgs-cq-public-page--standalone),
    body.mgs-cq-clean-quiz-mode{
        margin:0!important;
        padding:0!important;
        overflow:hidden!important;
        background:var(--cq-secondary,#f8f4ee)!important;
    }

    body.mgs-cq-clean-quiz-mode .mgs-cq-public-page--standalone{
        position:fixed!important;
        inset:0!important;
        z-index:2147483000!important;
        width:100vw!important;
        height:100dvh!important;
        min-height:100dvh!important;
        max-width:none!important;
        margin:0!important;
        padding:0!important;
        overflow-y:auto!important;
        overflow-x:hidden!important;
        -webkit-overflow-scrolling:touch;
        overscroll-behavior-y:contain;
        background:var(--cq-secondary,#f8f4ee)!important;
    }

    body.mgs-cq-clean-quiz-mode .mgs-cq-public-page--standalone .mgs-cq-app{
        width:100%!important;
        max-width:none!important;
        min-height:100dvh!important;
        margin:0!important;
        padding:0!important;
    }

    body.mgs-cq-clean-quiz-mode .mgs-cq-public-page--standalone .mgs-cq-screen{
        width:100%!important;
        min-height:100dvh!important;
        border-radius:0!important;
        box-shadow:none!important;
    }
}


/* v0.5 Demo Mode */
.mgs-cq-demo{position:relative}
.mgs-cq-demo-badge{
    position:absolute;
    top:18px;
    right:18px;
    z-index:3;
    padding:8px 12px;
    border-radius:999px;
    background:rgba(255,255,255,.92);
    color:#493b31;
    font-size:11px;
    line-height:1;
    font-weight:800;
    letter-spacing:1.2px;
    box-shadow:0 6px 22px rgba(0,0,0,.12);
}
.mgs-cq-demo-privacy{
    margin-top:18px;
    padding:12px 14px;
    border-radius:12px;
    background:#f5efe7;
    color:#77685d;
    font-size:12px;
    line-height:1.45;
}
.mgs-cq-demo-actions{
    display:grid;
    gap:10px;
    margin-top:22px;
}
.mgs-cq-demo-replay,
.mgs-cq-demo-buy{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:50px;
    padding:12px 16px;
    border-radius:13px;
    font-size:14px;
    font-weight:700;
    box-sizing:border-box;
}
.mgs-cq-demo-replay{
    border:1px solid #d8ccbf;
    background:#fff;
    color:#5f5045;
    cursor:pointer;
}
.mgs-cq-demo-buy{
    border:0;
    background:var(--cq-button);
    color:#fff!important;
    text-decoration:none!important;
}
.mgs-cq-demo .mgs-cq-result-thanks{
    white-space:normal;
    font-size:15px;
}
@media(max-width:600px){
    .mgs-cq-demo-badge{
        top:max(14px, env(safe-area-inset-top));
        right:14px;
    }
}


/* v0.5.3 — global admin-only intro screen */
.mgs-cq-intro{
    align-items:center;
    justify-content:center;
    padding:24px;
    background:
        radial-gradient(circle at top,#3d342d 0,transparent 42%),
        linear-gradient(180deg,#171411,#090807);
    color:#fff;
}
.mgs-cq-intro-inner{
    width:100%;
    max-width:420px;
    margin:auto;
    text-align:center;
}
.mgs-cq-intro-media{
    width:100%;
    max-height:520px;
    overflow:hidden;
    border-radius:24px;
    background:#000;
    box-shadow:0 24px 55px rgba(0,0,0,.35);
}
.mgs-cq-intro-media video,
.mgs-cq-intro-media img{
    display:block;
    width:100%;
    max-height:520px;
    object-fit:contain;
    background:#000;
}
.mgs-cq-intro-copy{
    padding:24px 4px 0;
}
.mgs-cq-intro-title{
    font-family:Georgia,serif;
    font-size:34px;
    line-height:1;
    letter-spacing:.04em;
    color:#fff;
}
.mgs-cq-intro-subtitle{
    margin:10px auto 18px;
    max-width:320px;
    font-size:14px;
    line-height:1.45;
    color:rgba(255,255,255,.78);
}
.mgs-cq-intro-start{
    width:100%;
    min-height:56px;
    padding:14px 18px;
    border:1px solid rgba(255,255,255,.16);
    border-radius:999px;
    background:linear-gradient(135deg,#8c6844,#b5966f,#d7bea1);
    color:#fff;
    font-size:14px;
    font-weight:900;
    letter-spacing:.035em;
    cursor:pointer;
    box-shadow:0 14px 32px rgba(140,104,68,.28);
}
.mgs-cq-intro-start:hover{
    transform:translateY(-2px);
}

.mgs-cq-empty-state--purchase{
    text-align:center;
    padding:36px 26px;
}
.mgs-cq-empty-state--purchase h3{
    margin:8px 0 10px;
    font-family:Georgia,serif;
    font-size:27px;
    color:#3f342c;
}
.mgs-cq-empty-state--purchase p{
    max-width:560px;
    margin:0 auto 22px;
    color:#74675e;
    line-height:1.6;
}
.mgs-cq-empty-heart{
    font-size:38px;
    color:#b5966f;
}
.mgs-cq-purchase-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:52px;
    padding:0 24px;
    border-radius:999px;
    background:#8c6844;
    color:#fff!important;
    text-decoration:none!important;
    font-weight:900;
    box-shadow:0 12px 30px rgba(140,104,68,.22);
}

@media(max-width:600px){
    .mgs-cq-intro{
        min-height:100dvh!important;
        padding:18px;
        box-sizing:border-box;
    }
    .mgs-cq-intro-media{
        max-height:58dvh;
        border-radius:20px;
    }
    .mgs-cq-intro-media video,
    .mgs-cq-intro-media img{
        max-height:58dvh;
    }
    .mgs-cq-intro-title{
        font-size:29px;
    }
    .mgs-cq-intro-copy{
        padding-top:18px;
    }
    .mgs-cq-purchase-button{
        width:100%;
        box-sizing:border-box;
    }
}
