:root{
    --lncqp-bg: rgba(0,0,0,.55);
    --lncqp-card: #fff;
    --lncqp-text: #111;
    --lncqp-muted: rgba(0,0,0,.6);
    --lncqp-border: rgba(0,0,0,.12);
    --lncqp-radius: 14px;
    --lncqp-shadow: 0 16px 55px rgba(0,0,0,.22);
    --lncqp-space: 16px;
    --lncqp-font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

.lncqp-quiz-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: 500 13px/1 var(--lncqp-font);
    border: none;
    background: transparent;
    color: rgb(59, 130, 246);
    border-radius: 50%;
    padding: 8px;
    margin: 10px 0 18px 0;
    cursor: pointer;
    transition: background 0.15s ease;
    width: 32px;
    height: 32px;
}

.lncqp-quiz-btn svg {
    flex-shrink: 0;
}

.lncqp-quiz-btn:hover{ background: transparent; }
.lncqp-quiz-btn:hover svg {
    color: rgb(59, 130, 246);
    stroke-width: 2.5;
    filter: brightness(0.9);
}
.lncqp-quiz-btn:focus{ outline: 0; outline-offset: 2px; }

.lncqp-overlay{
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: var(--lncqp-sbw, 0px);
    background: var(--lncqp-bg);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 999999;
    /* Let the user scroll the page behind the modal for reference. */
    pointer-events: none;
}

.lncqp-overlay.is-open{ display: flex; }

.lncqp-noscroll{ overflow: hidden; }

.lncqp-modal{
    pointer-events: auto;
    width: min(560px, 100%);
    background: var(--lncqp-card);
    color: var(--lncqp-text);
    border-radius: var(--lncqp-radius);
    box-shadow: var(--lncqp-shadow);
    position: relative;
    padding: 18px;
    max-height: 90vh;
    overflow-y: auto;
}

.lncqp-close{
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: none !important;
    background: transparent !important;
    cursor: pointer;
    font: 600 20px/1 var(--lncqp-font);
    color: #111 !important;
    transition: background 0.15s ease;
    z-index: 1;
}

.lncqp-close:hover{ color: #666 !important; background: transparent !important; border-color: transparent !important; }
.lncqp-close:focus{ outline: 0; }

.lncqp-head{ padding: 6px 44px 10px 4px; }
.lncqp-title{ font: 700 18px/1.25 var(--lncqp-font); letter-spacing: -.01em; }
.lncqp-sub{ font: 400 13px/1.35 var(--lncqp-font); color: var(--lncqp-muted); margin-top: 4px; }

.lncqp-body{ padding: 6px 4px 4px 4px; }

.lncqp-loading{
    display: flex;
    align-items: center;
    gap: 10px;
    font: 500 14px/1.4 var(--lncqp-font);
    color: var(--lncqp-muted);
    padding: 18px 0;
}

.lncqp-spinner{
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,0,0,.15);
    border-top-color: rgba(0,0,0,.55);
    border-radius: 999px;
    animation: lncqp-spin 0.9s linear infinite;
}
@keyframes lncqp-spin { to { transform: rotate(360deg); } }

.lncqp-toprow{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.lncqp-progress{
    font: 600 12px/1 var(--lncqp-font);
    color: var(--lncqp-muted);
}

.lncqp-q{
    font: 700 16px/1.35 var(--lncqp-font);
    letter-spacing: -.01em;
    margin-bottom: 12px;
}

.lncqp-options{
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.lncqp-option{
    text-align: left;
    border: 1px solid var(--lncqp-border);
    background: #fff;
    border-radius: 12px;
    padding: 12px 12px;
    cursor: pointer;
    font: 500 14px/1.35 var(--lncqp-font);
    transition: all 0.15s ease;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--lncqp-text);
}

.lncqp-option:hover:not(:disabled){ background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.2); color: var(--lncqp-text); }
.lncqp-option:focus{ outline: 2px solid rgba(0,0,0,.25); outline-offset: 2px; }

.lncqp-option.is-correct{
    background: rgba(72, 187, 120, 0.15);
    border-color: rgb(72, 187, 120);
    color: rgb(34, 84, 61);
}

.lncqp-option.is-wrong{
    background: rgba(252, 129, 129, 0.15);
    border-color: rgb(252, 129, 129);
    color: rgb(127, 29, 29);
}

.lncqp-option.is-disabled {
    opacity: 0.5;
    color: var(--lncqp-muted);
}

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

.lncqp-option-text {
    color: inherit;
}

.lncqp-check {
    color: rgb(72, 187, 120);
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.lncqp-cross {
    color: rgb(252, 129, 129);
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.lncqp-feedback{ margin: 10px 0 12px 0; }
.lncqp-fb{
    border: 1px solid var(--lncqp-border);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(0,0,0,.02);
}

.lncqp-fb-correct {
    background: rgba(72, 187, 120, 0.1);
    border-color: rgba(72, 187, 120, 0.3);
}

.lncqp-fb-wrong {
    background: rgba(191, 219, 254, 0.5);
    border-color: rgba(147, 197, 253, 0.5);
}

.lncqp-fb-title{
    font: 700 14px/1.3 var(--lncqp-font);
    margin-bottom: 4px;
}
.lncqp-fb-text{
    font: 400 13px/1.4 var(--lncqp-font);
    color: var(--lncqp-text);
}

.lncqp-actions{
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

.lncqp-actions.is-complete{
    justify-content: space-between;
    align-items: center;
}

.lncqp-complete-label{
    font: 600 13px/1 var(--lncqp-font);
    color: var(--lncqp-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lncqp-btn{
    border: 1px solid rgba(0,0,0,.18);
    background: #111;
    color: #fff;
    border-radius: 999px;
    padding: 10px 14px;
    cursor: pointer;
    font: 700 13px/1 var(--lncqp-font);
    transition: opacity 0.15s ease;
}

.lncqp-btn:hover{ opacity: .92; }
.lncqp-btn:focus{ outline: 2px solid rgba(0,0,0,.25); outline-offset: 2px; }

.lncqp-btn.lncqp-secondary{
    background: #fff;
    color: #111;
    border: 1px solid var(--lncqp-border);
}

.lncqp-btn.lncqp-primary{
    background: rgb(59, 130, 246);
    color: #fff;
    border: 1px solid rgb(59, 130, 246);
}

.lncqp-btn.lncqp-primary:hover{
    background: rgb(37, 99, 235);
    border-color: rgb(37, 99, 235);
    opacity: 1;
}

.lncqp-card{
    border: 1px solid var(--lncqp-border);
    border-radius: 12px;
    padding: 14px;
    background: rgba(0,0,0,.02);
}
.lncqp-done-title{
    font: 800 18px/1.25 var(--lncqp-font);
    margin-bottom: 6px;
}
.lncqp-done-sub{
    font: 500 14px/1.4 var(--lncqp-font);
    color: var(--lncqp-muted);
    margin-bottom: 12px;
}

.lncqp-msg {
    font: 500 14px/1.4 var(--lncqp-font);
    margin-bottom: 6px;
}

.lncqp-muted {
    font: 400 13px/1.4 var(--lncqp-font);
    color: var(--lncqp-muted);
    margin-bottom: 12px;
}

@media (max-width: 420px){
    .lncqp-modal{ padding: 16px; }
    .lncqp-actions{ justify-content: stretch; }
    .lncqp-btn{ flex: 1; text-align: center; }
}

.quiz-controls {
    margin: 0;
    float: right;
    position: relative;
    z-index: 10;
}

.quiz-content {
    display: block;
    clear: both;
}