.rsarticlequiz {
    margin: 2.5rem 0;
    color: #26302d;
}

.rsarticlequiz [hidden] {
    display: none !important;
}

.rsarticlequiz__entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.4rem;
    border: 1px solid #d8d3c7;
    border-left: 5px solid #b45d32;
    background: #fffdf8;
    border-radius: 8px;
}

.rsarticlequiz__headline {
    margin: 0 0 .25rem;
    font-size: 1.35rem;
    line-height: 1.2;
}

.rsarticlequiz__summary {
    margin: 0;
    color: #5d6762;
}

.rsarticlequiz__start,
.rsarticlequiz__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: .75rem 1.1rem;
    border: 1px solid #cfc8bc;
    border-radius: 6px;
    background: #fff;
    color: #26302d;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.rsarticlequiz__start,
.rsarticlequiz__button--primary {
    border-color: #31413c;
    background: #31413c;
    color: #fff;
}

.rsarticlequiz__start:hover,
.rsarticlequiz__button:hover {
    transform: translateY(-1px);
}

.rsarticlequiz__button:disabled {
    cursor: not-allowed;
    opacity: .55;
    transform: none;
}

.rsarticlequiz-is-open {
    overflow: hidden;
}

.rsarticlequiz-is-open.rsarticlequiz-is-peeking {
    overflow: auto;
}

.rsarticlequiz__overlay {
    --rsarticlequiz-safe-top: clamp(4.75rem, 11vh, 7rem);

    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    align-items: start;
    justify-items: center;
    padding: var(--rsarticlequiz-safe-top) clamp(1rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2.5rem);
    background: rgba(23, 28, 26, .56);
    opacity: 0;
    pointer-events: none;
    transition: background .18s ease, opacity .18s ease;
}

.rsarticlequiz__overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.rsarticlequiz__dialog {
    width: min(720px, 100%);
    max-height: min(720px, calc(100vh - var(--rsarticlequiz-safe-top) - 1rem));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border-radius: 8px;
    background: #fffdf9;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
    transform: translateY(10px) scale(.99);
    transition: box-shadow .22s ease, max-height .22s ease, transform .22s ease, width .22s ease;
}

.rsarticlequiz__overlay.is-open .rsarticlequiz__dialog {
    transform: translateY(0) scale(1);
}

.rsarticlequiz__topbar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid #e3ded4;
}

.rsarticlequiz__meter {
    height: .45rem;
    overflow: hidden;
    border-radius: 999px;
    background: #ebe6dd;
}

.rsarticlequiz__meter span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #59785e, #d6a33b);
    transition: width .24s ease;
}

.rsarticlequiz__counter {
    min-width: 6rem;
    text-align: right;
    font-weight: 700;
    color: #5d6762;
}

.rsarticlequiz__close {
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 999px;
    background: #f0ece3;
    cursor: pointer;
    position: relative;
}

.rsarticlequiz__close::before,
.rsarticlequiz__close::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1rem;
    height: 2px;
    background: #26302d;
}

.rsarticlequiz__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.rsarticlequiz__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.rsarticlequiz__body {
    max-height: min(560px, calc(100vh - var(--rsarticlequiz-safe-top) - 8rem));
    overflow: auto;
    padding: 1.35rem 1.45rem;
    opacity: 1;
    transition: max-height .24s ease, opacity .16s ease, padding .24s ease;
}

.rsarticlequiz .rsarticlequiz__questionTitle {
    margin: 0 0 .8rem;
    padding: 0;
    font-size: 1.7rem;
    line-height: 1.15;
    letter-spacing: 0;
}

.rsarticlequiz__question {
    margin-bottom: 1.2rem;
    color: #3d4642;
    font-size: 1.08rem;
    line-height: 1.65;
}

.rsarticlequiz__blank {
    display: inline-block;
    width: min(12rem, 45vw);
    height: .18em;
    margin: 0 .15em .12em;
    border-bottom: .16em solid #b45d32;
    vertical-align: baseline;
}

.rsarticlequiz__question p,
.rsarticlequiz__feedback p {
    margin: 0 0 .85rem;
}

.rsarticlequiz__answers {
    display: grid;
    gap: .7rem;
}

.rsarticlequiz__answers.is-relation {
    gap: .55rem;
}

.rsarticlequiz__answers.is-order,
.rsarticlequiz__answers.is-matching,
.rsarticlequiz__answers.is-truefalse {
    gap: .65rem;
}

.rsarticlequiz__hint {
    margin: 0 0 .25rem;
    color: #6a736e;
    font-size: .96rem;
}

.rsarticlequiz__answer {
    display: grid;
    grid-template-columns: 1.25rem 1fr;
    gap: .8rem;
    align-items: start;
    padding: .95rem 1rem;
    border: 1px solid #d9d3c8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.rsarticlequiz__answer:hover,
.rsarticlequiz__matchItem:hover {
    border-color: #aeb9ad;
    background: #faf8f3;
}

.rsarticlequiz__answer input {
    margin-top: .25rem;
    accent-color: #59785e;
}

.rsarticlequiz__answer.is-selected {
    border-color: #59785e;
    background: #f4faf4;
    box-shadow: 0 0 0 2px rgba(89, 120, 94, .12);
}

.rsarticlequiz__answer p {
    margin: 0;
}

.rsarticlequiz__answerRole {
    display: block;
    margin-bottom: .25rem;
    color: #5d6762;
    font-size: .82rem;
    font-weight: 800;
}

.rsarticlequiz__orderBadge {
    width: 1.65rem;
    height: 1.65rem;
    display: grid;
    place-items: center;
    margin-top: -.05rem;
    border: 1px solid #cfc8bc;
    border-radius: 999px;
    color: #5d6762;
    font-weight: 800;
    line-height: 1;
}

.rsarticlequiz__answers.is-order .rsarticlequiz__answer {
    grid-template-columns: 1.25rem 1.65rem 1fr;
}

.rsarticlequiz__answers.is-order .rsarticlequiz__answer.is-selected .rsarticlequiz__orderBadge {
    border-color: #59785e;
    background: #59785e;
    color: #fff;
}

.rsarticlequiz__matching {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.rsarticlequiz__matchingColumn {
    display: grid;
    align-content: start;
    gap: .55rem;
}

.rsarticlequiz__matchingLabel {
    color: #5d6762;
    font-size: .82rem;
    font-weight: 800;
}

.rsarticlequiz__matchItem {
    min-height: 3.3rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: .8rem 2.4rem .8rem .9rem;
    border: 1px solid #d9d3c8;
    border-radius: 8px;
    background: #fff;
    color: #26302d;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.rsarticlequiz__matchItem.is-selected {
    border-color: #b45d32;
    box-shadow: 0 0 0 2px rgba(180, 93, 50, .14);
}

.rsarticlequiz__matchItem.is-paired {
    border-color: #59785e;
    background: #f4faf4;
}

.rsarticlequiz__matchItem[data-match-index]::after {
    content: attr(data-match-index);
    position: absolute;
    right: .75rem;
    top: 50%;
    width: 1.5rem;
    height: 1.5rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #59785e;
    color: #fff;
    font-size: .82rem;
    font-weight: 800;
    transform: translateY(-50%);
}

.rsarticlequiz__matchItem:disabled {
    cursor: default;
}

.rsarticlequiz__matchText {
    display: block;
}

.rsarticlequiz__answers.is-relation .rsarticlequiz__answer {
    border-style: dashed;
}

.rsarticlequiz__answers.is-relation .rsarticlequiz__answer:nth-of-type(3) {
    margin-bottom: .45rem;
}

.rsarticlequiz__answers.is-truefalse {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rsarticlequiz__answers.is-truefalse .rsarticlequiz__hint {
    grid-column: 1 / -1;
}

.rsarticlequiz__answers.is-truefalse .rsarticlequiz__answer {
    align-items: center;
    min-height: 5rem;
}

.rsarticlequiz__answer.is-correct,
.rsarticlequiz__matchItem.is-correct {
    border-color: #59785e;
    background: #eef5ee;
}

.rsarticlequiz__answer.is-wrong,
.rsarticlequiz__matchItem.is-wrong {
    border-color: #b45d32;
    background: #fbede7;
}

.rsarticlequiz__feedback {
    margin-top: 1.2rem;
    padding: 1rem 1.1rem;
    border-radius: 8px;
    border: 1px solid #d9d3c8;
    background: #f8f6f0;
    line-height: 1.6;
}

.rsarticlequiz__feedback strong {
    display: block;
    margin-bottom: .35rem;
}

.rsarticlequiz__feedback.is-correct {
    border-color: #a9c5ac;
    background: #edf6ee;
}

.rsarticlequiz__feedback.is-wrong {
    border-color: #e0b79f;
    background: #fff0e8;
}

.rsarticlequiz__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .65rem;
    padding: 1rem 1.1rem;
    border-top: 1px solid #e3ded4;
    background: #faf8f3;
}

.rsarticlequiz__overlay.is-peeking {
    align-items: end;
    padding: 1rem;
    background: transparent;
    pointer-events: none;
}

.rsarticlequiz__overlay.is-peeking .rsarticlequiz__dialog {
    width: min(720px, 100%);
    max-height: none;
    pointer-events: auto;
    box-shadow: 0 16px 50px rgba(0, 0, 0, .22);
}

.rsarticlequiz__overlay.is-peeking .rsarticlequiz__body {
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
}

.rsarticlequiz__overlay.is-peeking .rsarticlequiz__topbar {
    padding: .65rem .9rem;
}

.rsarticlequiz__overlay.is-peeking .rsarticlequiz__actions {
    padding: .75rem .9rem;
}

.rsarticlequiz__score {
    width: 9rem;
    height: 9rem;
    display: grid;
    place-items: center;
    margin: 0 auto 1.2rem;
    border-radius: 50%;
    background: conic-gradient(#59785e var(--rsarticlequiz-score, 75%), #ebe6dd 0);
}

.rsarticlequiz__score span {
    width: 7rem;
    height: 7rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fffdf9;
    font-size: 2rem;
    font-weight: 800;
}

.rsarticlequiz-evidence-highlight {
    animation: rsarticlequiz-highlight 5s ease;
    scroll-margin: 20vh;
}

@keyframes rsarticlequiz-highlight {
    0%, 100% {
        background-color: transparent;
        box-shadow: none;
    }
    12%, 70% {
        background-color: #fff0b8;
        box-shadow: 0 0 0 .35rem #fff0b8;
    }
}

@media (max-width: 640px) {
    .rsarticlequiz__entry {
        align-items: stretch;
        flex-direction: column;
    }

    .rsarticlequiz__start,
    .rsarticlequiz__button {
        width: 100%;
    }

    .rsarticlequiz__topbar {
        grid-template-columns: 1fr auto;
    }

    .rsarticlequiz__meter {
        grid-column: 1 / -1;
        order: 2;
    }

    .rsarticlequiz__counter {
        min-width: auto;
        text-align: left;
    }

    .rsarticlequiz__actions {
        justify-content: stretch;
    }

    .rsarticlequiz__answers.is-truefalse {
        grid-template-columns: 1fr;
    }

    .rsarticlequiz__matching {
        grid-template-columns: 1fr;
    }

    .rsarticlequiz__body {
        padding: 1rem;
    }

    .rsarticlequiz .rsarticlequiz__questionTitle {
        font-size: 1.35rem;
    }
}
