.mqm-app {
    --mqm-bg: #f5f7fb;
    --mqm-card: #ffffff;
    --mqm-text: #151a23;
    --mqm-muted: #667085;
    --mqm-line: #dfe4ec;
    --mqm-primary: #4f46e5;
    --mqm-primary-dark: #3730a3;
    --mqm-success: #16a34a;
    --mqm-danger: #dc2626;
    --mqm-soft: #eef2ff;
    color: var(--mqm-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mqm-app * {
    box-sizing: border-box;
}

.mqm-shell {
    width: min(100%, 720px);
    min-height: 640px;
    margin: 0 auto;
    padding: 20px;
    background: var(--mqm-bg);
}

.mqm-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 24px;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(79, 70, 229, 0.24);
}

.mqm-kicker {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .82;
}

.mqm-hero h1 {
    margin: 0;
    color: #fff;
    font-size: 30px;
    line-height: 1.08;
    font-weight: 900;
}

.mqm-score-pill {
    min-width: 72px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    text-align: center;
    font-weight: 900;
    white-space: nowrap;
}

.mqm-view {
    display: grid;
    gap: 14px;
}

.mqm-loading,
.mqm-public-error,
.mqm-card,
.mqm-result {
    border: 1px solid var(--mqm-line);
    border-radius: 16px;
    background: var(--mqm-card);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

.mqm-loading,
.mqm-public-error {
    padding: 20px;
}

.mqm-card {
    width: 100%;
    padding: 18px;
    text-align: left;
}

button.mqm-card {
    cursor: pointer;
    border-color: transparent;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

button.mqm-card:hover,
button.mqm-card:focus {
    transform: translateY(-1px);
    border-color: #c7d2fe;
    box-shadow: 0 14px 30px rgba(79, 70, 229, .12);
    outline: none;
}

.mqm-card-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 900;
}

.mqm-card-meta,
.mqm-question-meta,
.mqm-feedback,
.mqm-muted {
    color: var(--mqm-muted);
    font-size: 14px;
}

.mqm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mqm-back {
    border: 0;
    color: var(--mqm-primary);
    background: transparent;
    font-weight: 900;
    cursor: pointer;
}

.mqm-question-box {
    padding: 20px;
    border-radius: 16px;
    background: var(--mqm-card);
    border: 1px solid var(--mqm-line);
}

.mqm-question-meta {
    margin: 0 0 10px;
    font-weight: 800;
}

.mqm-question {
    margin: 0;
    font-size: 22px;
    line-height: 1.28;
    font-weight: 900;
}

.mqm-options {
    display: grid;
    gap: 10px;
}

.mqm-option {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--mqm-line);
    border-radius: 14px;
    background: #fff;
    color: var(--mqm-text);
    text-align: left;
    cursor: pointer;
    font-weight: 700;
}

.mqm-option:disabled {
    cursor: default;
}

.mqm-letter {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--mqm-soft);
    color: var(--mqm-primary);
    font-weight: 900;
}

.mqm-option.is-correct {
    border-color: rgba(22, 163, 74, .35);
    background: #ecfdf3;
}

.mqm-option.is-wrong {
    border-color: rgba(220, 38, 38, .35);
    background: #fef2f2;
}

.mqm-feedback {
    min-height: 22px;
    font-weight: 800;
}

.mqm-feedback.is-correct {
    color: var(--mqm-success);
}

.mqm-feedback.is-wrong {
    color: var(--mqm-danger);
}

.mqm-actions-row {
    display: flex;
    gap: 10px;
}

.mqm-btn {
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: var(--mqm-primary);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.mqm-btn:hover,
.mqm-btn:focus {
    background: var(--mqm-primary-dark);
}

.mqm-btn.secondary {
    background: #e5e7eb;
    color: var(--mqm-text);
}

.mqm-result {
    padding: 24px;
    text-align: center;
}

.mqm-result h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 900;
}

.mqm-result-score {
    margin: 16px auto;
    width: 128px;
    height: 128px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--mqm-soft);
    color: var(--mqm-primary);
    font-size: 30px;
    font-weight: 900;
}

@media (max-width: 520px) {
    .mqm-shell {
        padding: 12px;
    }

    .mqm-hero {
        padding: 20px;
        border-radius: 16px;
    }

    .mqm-hero h1 {
        font-size: 24px;
    }

    .mqm-question {
        font-size: 19px;
    }

    .mqm-actions-row {
        flex-direction: column;
    }

    .mqm-btn {
        width: 100%;
    }
}
