/*
 * MAPEL page layout, design-and-build-state sections 4.4 and 4.5. The container caps, the
 * header, the progress bar, the section title, the navigation, the single-select lists and
 * the type scale outside the matrix. The artboards are the reference for anything section 4
 * does not state.
 */

/* Vanilla's script pads the body for a fixed header. The MAPEL header is not fixed. */
body.mapel {
    padding-top: 0 !important;
    padding-bottom: 0;
    font-size: 15px;
    line-height: 1.6;
}

/* No automatic hyphenation anywhere, as on the artboards */
body.mapel #outerframeContainer {
    -webkit-hyphens: manual;
    hyphens: manual;
}

/*
 * Container. It fills the window and stops at a cap, with a 24px gutter outside the cap.
 * 1240px on matrix screens, 880px on every other question screen and on the opening and
 * thank-you screens.
 * A matrix screen is recognised by the matrix it holds. Browsers without :has() get the
 * same class from scripts/mapel-layout.js.
 */
body.mapel #outerframeContainer {
    width: 100%;
    max-width: calc(880px + 48px);
    margin: 0 auto;
    padding: 0 24px 56px;
}

body.mapel #outerframeContainer:has(.array-flexible-row:not(.mapel-one-q)),
body.mapel.mapel-full #outerframeContainer {
    max-width: calc(1240px + 48px);
}

/* Vanilla spaces the frame and the group containers by 15px each. The section title sets the space instead. */
body.mapel #outerframeContainer,
body.mapel #outerframeContainer .group-outer-container,
body.mapel #outerframeContainer .group-container {
    margin-top: 0;
}

/* Vanilla also leaves 30px below each group container. Without it the navigation sits 30px
   below the last question card, the same space that separates the question cards. */
body.mapel #outerframeContainer .group-outer-container,
body.mapel #outerframeContainer .group-container {
    margin-bottom: 0;
}

body.mapel #outerframeContainer #main-row,
body.mapel #outerframeContainer #main-col {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: none;
}

/*
 * Header, a bar above the progress bar. From 1024px the header and the progress bar stay
 * at the top of the window. Below 1024px only the progress bar does. The scroll padding
 * keeps anything the browser scrolls to clear of them.
 */
body.mapel .mapel-bar {
    background-color: var(--mapel-card);
    border-bottom: 1px solid var(--mapel-border);
}

html:has(body.mapel) {
    scroll-padding-top: calc(6px + 12px);
}

body.mapel .mapel-progress {
    position: sticky;
    top: 0;
    z-index: 1020;
}

@media only screen and (min-width: 1024px) {
    html:has(body.mapel) {
        scroll-padding-top: calc(65px + 6px + 12px);
    }

    body.mapel .mapel-bar {
        position: sticky;
        top: 0;
        z-index: 1021;
    }

    body.mapel .mapel-progress {
        top: 65px;
    }
}

body.mapel .mapel-bar-in {
    max-width: calc(1240px + 48px);
    height: 64px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}

/* 21px high, 8px before the wordmark, in the wordmark color, raised 1px so that it looks centered on the capitals */
body.mapel .mapel-logo {
    flex: none;
    display: block;
    width: 21px;
    height: 21px;
    margin-right: -6px;
    position: relative;
    top: -1px;
    color: var(--mapel-heading);
}

body.mapel .mapel-study {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--mapel-heading);
}

/* Progress bar, the full viewport width directly below the header */
body.mapel .mapel-progress {
    width: 100%;
    margin: 0;
    padding: 0;
}

body.mapel .mapel-progress-track {
    width: 100%;
    height: 6px;
    background-color: var(--mapel-track);
}

body.mapel .mapel-progress-fill {
    height: 100%;
    background-color: var(--mapel-primary);
    border-radius: 0 1px 1px 0;
}

/* Section title */
body.mapel .group-container > .mapel-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    margin: 56px 0 20px;
}

body.mapel .group-container > .mapel-meta .mapel-section {
    margin: 0;
    font-family: var(--mapel-font);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.015em;
    color: var(--mapel-heading);
}

/* The group description carries only the progress figure, which the header shows */
body.mapel .group-container > :has(.mapel-progress-value) {
    display: none;
}

/*
 * A screen that holds a matrix takes the 1240px cap. Every other question on it keeps the
 * 880px width of the narrow cap and is centered, so it sits exactly where it sits on a screen
 * without a matrix and option lists read at the width they were measured for. C1b continues
 * C1's card and keeps its width.
 */
@media (min-width: 1024px) {
    body.mapel #outerframeContainer:has(.array-flexible-row:not(.mapel-one-q)) .question-container:not(.array-flexible-row):not(.mapel-c1b),
    body.mapel #outerframeContainer:has(.array-flexible-row:not(.mapel-one-q)) .question-container.mapel-one-q,
    body.mapel.mapel-full #outerframeContainer .question-container:not(.array-flexible-row):not(.mapel-c1b),
    body.mapel.mapel-full #outerframeContainer .question-container.mapel-one-q {
        max-width: 880px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* The percentage completed, in the header just before the mode button */
body.mapel .mapel-bar-in .mapel-pct {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.03em;
    color: var(--mapel-primary-strong);
    white-space: nowrap;
}

body.mapel .mapel-bar-in .mapel-pct + .mapel-mode-btn {
    margin-left: 0;
}

/* Question text and helper text */
body.mapel .question-container .ls-label-question {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.015em;
    color: var(--mapel-heading);
}

body.mapel .question-container .question-valid-container,
body.mapel .question-container .question-help-container,
body.mapel .question-container .ls-questionhelp,
body.mapel .question-container .ls-question-message {
    font-size: 15px;
    line-height: 1.55;
    font-weight: 400;
    color: var(--mapel-muted);
}

/* LimeSurvey marks the tip and its icon with Bootstrap's info color, which carries !important */
body.mapel .question-container .text-info {
    color: var(--mapel-muted) !important;
}

/* The helper line carries no icon, and starts where the question text starts */
body.mapel .question-container .ls-questionhelp {
    margin-left: 0;
    margin-right: 0;
}

body.mapel .question-container .ls-questionhelp::before,
body.mapel .question-container .ls-question-message::before {
    content: none !important;
    display: none !important;
}

/* A required-answer message whose question has since been fully answered */
body.mapel .question-container .mapel-required.mapel-resolved {
    display: none !important;
}

/* Error messages take the study's red, replacing Bootstrap's, which carries !important */
body.mapel .question-container .text-danger,
body.mapel .question-container .ls-em-error,
body.mapel .question-container .ls-em-error * {
    color: var(--mapel-red) !important;
}

body.mapel .question-container .ls-label-question + *,
body.mapel .question-container .question-valid-container {
    margin-top: 6px;
}

/* The helper line carrying the answering instruction keeps the same 6px below the question text */
body.mapel .question-container .question-help-container:has(.ls-questionhelp) {
    margin-top: 6px;
}

/*
 * Every item is mandatory, so the red marker is not shown. The word stays available to
 * screen readers on every question.
 */
body.mapel .question-container .asterisk {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/*
 * Single-select and multi-select lists. Each option is its own row on the input surface
 * with a 1px border, an 8px radius, 14px by 18px padding, a 14px gap between control and
 * label and 10px between options. The non-answer option, always the last, sits below a
 * 1px rule. The whole row is the label, so a click anywhere on it selects the option.
 * Multi-select options follow the single-select treatment, so the two read alike.
 */
body.mapel ul.ls-answers.radio-list,
body.mapel ul.ls-answers.checkbox-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

body.mapel ul.ls-answers.radio-list > li.radio-item,
body.mapel ul.ls-answers.checkbox-list > li.checkbox-item {
    position: relative;
    margin: 0 0 10px 0;
    padding: 0;
    background-color: var(--mapel-card);
    border: 1px solid var(--mapel-border);
    border-radius: 8px;
}

body.mapel ul.ls-answers.radio-list > li.radio-item:hover,
body.mapel ul.ls-answers.checkbox-list > li.checkbox-item:hover {
    border-color: var(--mapel-primary);
}

body.mapel ul.ls-answers.radio-list > li.radio-item:last-child,
body.mapel ul.ls-answers.checkbox-list > li.checkbox-item:last-child {
    margin-top: 35px;
    margin-bottom: 0;
}

body.mapel ul.ls-answers.radio-list > li.radio-item:last-child::before,
body.mapel ul.ls-answers.checkbox-list > li.checkbox-item:last-child::before {
    content: "";
    position: absolute;
    left: -1px;
    right: -1px;
    top: -16px;
    height: 1px;
    background-color: var(--mapel-border);
}

body.mapel ul.ls-answers.radio-list > li.radio-item:first-child:last-child,
body.mapel ul.ls-answers.checkbox-list > li.checkbox-item:first-child:last-child {
    margin-top: 0;
}

body.mapel ul.ls-answers.radio-list > li.radio-item:first-child:last-child::before,
body.mapel ul.ls-answers.checkbox-list > li.checkbox-item:first-child:last-child::before {
    display: none;
}

/* LimeSurvey wraps a multi-select option in a grid row and column, which add nothing here */
body.mapel ul.ls-answers.checkbox-list > li.checkbox-item > .row {
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
    margin: 0;
}

body.mapel ul.ls-answers.checkbox-list > li.checkbox-item > .row > .col-auto {
    position: static;
    flex: 1 1 auto;
    width: 100%;
    padding: 0;
}

body.mapel ul.ls-answers.radio-list > li.radio-item > label,
body.mapel ul.ls-answers.checkbox-list > li.checkbox-item label {
    display: block;
    margin: 0;
    padding: 15px 18px 14px calc(18px + 21.6px + 14px);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--mapel-text);
    cursor: pointer;
}

body.mapel ul.ls-answers.radio-list > li.radio-item > input[type="radio"],
body.mapel ul.ls-answers.checkbox-list > li.checkbox-item input[type="checkbox"] {
    position: absolute;
    left: 18px;
    top: 14px;
    width: 21.6px;
    height: 21.6px;
    margin: 0;
    opacity: 0;
    z-index: 1;
}

body.mapel ul.ls-answers.radio-list > li.radio-item > input[type="radio"] + label::before,
body.mapel ul.ls-answers.checkbox-list > li.checkbox-item input[type="checkbox"] + label::before {
    left: 18px;
    top: 14px;
    margin: 0;
}

body.mapel ul.ls-answers.radio-list > li.radio-item > input[type="radio"] + label::after {
    left: calc(18px + 5.6px);
    top: calc(14px + 5.6px);
    margin: 0;
}

body.mapel ul.ls-answers.checkbox-list > li.checkbox-item input[type="checkbox"] + label::after {
    left: calc(18px + 7.55px);
    top: calc(14px + 4.05px);
    margin: 0;
}

/*
 * "Other, please specify", LimeSurvey's own Other option. It is a row like every other
 * option, with its control and label in the same place. While Other is chosen its text box
 * sits inside the row below the label, aligned with the label text and 18px from the right edge.
 */
body.mapel ul.ls-answers.checkbox-list > li.checkbox-text-item,
body.mapel ul.ls-answers.radio-list > li.radio-text-item {
    display: block;
    position: relative;
    margin: 0 0 10px 0;
    padding: 0 0 16px 0;
    background-color: var(--mapel-card);
    border: 1px solid var(--mapel-border);
    border-radius: 8px;
}

body.mapel ul.ls-answers.checkbox-list > li.checkbox-text-item:hover,
body.mapel ul.ls-answers.radio-list > li.radio-text-item:hover {
    border-color: var(--mapel-primary);
}

body.mapel ul.ls-answers.checkbox-list > li.checkbox-text-item > .row {
    display: block;
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
    margin: 0;
}

body.mapel ul.ls-answers.checkbox-list > li.checkbox-text-item > .row > .col-auto,
body.mapel ul.ls-answers.radio-list > li.radio-text-item > .col-auto,
body.mapel li.checkbox-text-item .othertext-label-checkox-container {
    display: block;
    position: static;
    flex: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

body.mapel li.checkbox-text-item .othertext-label-checkox-container > label,
body.mapel li.radio-text-item .othertext-label-checkox-container > label {
    display: block;
    margin: 0;
    padding: 15px 18px 10px calc(18px + 21.6px + 14px);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--mapel-text);
    cursor: pointer;
}

body.mapel li.checkbox-text-item .othertext-label-checkox-container > input,
body.mapel li.radio-text-item .othertext-label-checkox-container > input {
    position: absolute;
    left: 18px;
    top: 14px;
    width: 21.6px;
    height: 21.6px;
    margin: 0;
    opacity: 0;
    z-index: 1;
}

body.mapel li.checkbox-text-item .othertext-label-checkox-container > input + label::before,
body.mapel li.radio-text-item .othertext-label-checkox-container > input + label::before {
    left: 18px;
    top: 14px;
    margin: 0;
}

body.mapel li.radio-text-item .othertext-label-checkox-container > input + label::after {
    left: calc(18px + 5.6px);
    top: calc(14px + 5.6px);
    margin: 0;
}

body.mapel li.checkbox-text-item .othertext-label-checkox-container > input + label::after {
    left: calc(18px + 7.55px);
    top: calc(14px + 4.05px);
    margin: 0;
}

body.mapel ul.ls-answers.checkbox-list > li.checkbox-text-item > .row > .col-auto > .other-text-item,
body.mapel ul.ls-answers.radio-list > li.radio-text-item > .col-auto.other-text-item {
    padding: 0 18px 0 calc(18px + 21.6px + 14px);
}

body.mapel li.checkbox-text-item .other-text-item > input.form-control,
body.mapel li.radio-text-item .other-text-item > input.form-control {
    display: block;
    width: 100%;
    margin: 0 !important;
}

/*
 * The text box shows only while Other is chosen. scripts/mapel-other.js marks the row
 * mapel-other-js once it manages it and mapel-other-open while Other is chosen. A closed
 * row has the same height and padding as every other option row.
 */
body.mapel ul.ls-answers.checkbox-list > li.checkbox-text-item.mapel-other-js:not(.mapel-other-open),
body.mapel ul.ls-answers.radio-list > li.radio-text-item.mapel-other-js:not(.mapel-other-open) {
    padding-bottom: 0;
}

body.mapel li.checkbox-text-item.mapel-other-js:not(.mapel-other-open) .othertext-label-checkox-container > label,
body.mapel li.radio-text-item.mapel-other-js:not(.mapel-other-open) .othertext-label-checkox-container > label {
    padding-bottom: 14px;
}

body.mapel ul.ls-answers.checkbox-list > li.checkbox-text-item.mapel-other-js:not(.mapel-other-open) > .row > .col-auto > .other-text-item,
body.mapel ul.ls-answers.radio-list > li.radio-text-item.mapel-other-js:not(.mapel-other-open) > .col-auto.other-text-item {
    display: none;
}

/* An option set aside by an exclusive answer reads as unavailable and does not react to the pointer */
body.mapel ul.ls-answers > li.ls-disabled,
body.mapel ul.ls-answers > li.ls-disabled:hover {
    border-color: var(--mapel-border);
}

body.mapel ul.ls-answers > li.ls-disabled label {
    cursor: default;
}

/* Free text boxes, at 16px, below which iOS Safari zooms the page on focus */
body.mapel .question-container textarea.form-control,
body.mapel .question-container input[type="text"].form-control {
    width: 100%;
    min-height: 80px;
    background-color: var(--mapel-card);
    border: 1px solid var(--mapel-border);
    border-radius: 8px;
    padding: 12px 14px;
    font-family: var(--mapel-font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--mapel-text);
    box-shadow: none;
    resize: vertical;
}

body.mapel .question-container input[type="text"].form-control {
    min-height: 0;
}

body.mapel .question-container textarea.form-control:focus,
body.mapel .question-container input[type="text"].form-control:focus {
    border-color: var(--mapel-primary);
    outline: 2px solid var(--mapel-primary);
    outline-offset: 0;
    box-shadow: none;
}

/*
 * C1 and C1b, one card, design-and-build-state section 4.5. The generator marks the two
 * questions with the classes mapel-c1 and mapel-c1b. C1's card stays open at the bottom and
 * C1b continues it, carrying its question as the label of its text box, then the rule and
 * C1's column key, which scripts/mapel-key.js places there.
 */
body.mapel .question-container.mapel-c1 {
    margin-bottom: 0;
    border-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: none;
}

body.mapel .question-container.mapel-c1 table.ls-answers > tbody > tr:last-child > * {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

body.mapel .question-container.mapel-c1 + .question-container.mapel-c1b {
    margin-top: 0;
    border-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

body.mapel .question-container.mapel-c1b > .question-title-container {
    padding: 22px 32px 0;
}

body.mapel .question-container.mapel-c1b .ls-label-question {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
    color: var(--mapel-muted);
}

body.mapel .question-container.mapel-c1b > .question-help-container,
body.mapel .question-container.mapel-c1b > .question-valid-container {
    padding: 0 32px;
}

body.mapel .question-container.mapel-c1b > .answer-container {
    padding: 0 32px 26px;
    border-top: 0;
}

body.mapel .question-container.mapel-c1b > .question-valid-container {
    margin-top: 0;
}

body.mapel .question-container.mapel-c1b .ls-answers {
    margin: 0;
    padding: 0;
}

/* Column key below a factual matrix, from 1024px. On C1 it follows C1b, below a rule. */
body.mapel .mapel-key-wrap {
    padding: 22px 32px 26px;
}

body.mapel .mapel-key-rule {
    height: 1px;
    margin: 22px 0 0;
    background-color: var(--mapel-border);
}

body.mapel .mapel-key {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
    margin-top: 4px;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.35;
    color: var(--mapel-heading);
}

body.mapel .mapel-key-wrap > .mapel-key {
    margin-top: 0;
}

body.mapel .mapel-key b {
    font-weight: 600;
    margin-right: 0.5em;
}

/* Navigation. Back on the left and Next on the right, 44px tall with an 8px radius */
body.mapel .mapel-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
}

body.mapel .mapel-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 44px;
    margin: 0;
    padding: 0 22px;
    border: 1px solid var(--mapel-border);
    border-radius: 8px;
    background-color: var(--mapel-card);
    color: var(--mapel-text);
    font-family: var(--mapel-font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}

body.mapel .mapel-btn:hover {
    border-color: var(--mapel-primary);
}

body.mapel .mapel-btn:focus-visible {
    outline: 2px solid var(--mapel-primary);
    outline-offset: 2px;
}

body.mapel .mapel-btn svg {
    flex: none;
    display: block;
}

body.mapel .mapel-next {
    margin-left: auto;
    background-color: var(--mapel-primary);
    border-color: var(--mapel-primary);
    color: var(--mapel-on-primary);
}

body.mapel .mapel-next:hover {
    background-color: var(--mapel-primary-strong);
    border-color: var(--mapel-primary-strong);
}

/* Narrow type scale and spacing */
@media only screen and (max-width: 1023px) {
    body.mapel .mapel-key-wrap,
    body.mapel .mapel-key-rule,
    body.mapel .mapel-key {
        display: none;
    }

    body.mapel .question-container.mapel-c1b > .question-title-container {
        padding: 22px 20px 0;
    }

    body.mapel .question-container.mapel-c1b > .question-help-container,
    body.mapel .question-container.mapel-c1b > .question-valid-container {
        padding: 0 20px;
    }

    body.mapel .question-container.mapel-c1b > .answer-container {
        padding: 0 18px 22px;
    }

    body.mapel {
        font-size: 14px;
    }

    body.mapel .group-container > .mapel-meta {
        margin: 26px 0 14px;
    }

    body.mapel .group-container > .mapel-meta .mapel-section {
        font-size: 22px;
    }

    body.mapel .question-container .ls-label-question {
        font-size: 20px;
        line-height: 1.28;
    }

    body.mapel .mapel-btn {
        padding: 0 16px;
    }
}

/*
 * A matrix holding a single visible row, section 4.5. It renders as an ordinary single
 * question at every width, the row's statement above its options, and the options as the
 * rows of a single-select list, on a screen that takes the 880px cap of a question screen
 * unless it also holds a matrix of more than one row. scripts/mapel-narrow.js marks such a table mapel-one, and
 * re-marks it whenever relevance changes the number of rows shown. The statement takes the
 * treatment an open row's statement has in the narrow layout.
 */
body.mapel .question-container.array-flexible-row.mapel-one-q > .answer-container {
    padding: 26px 32px 28px;
}

@media only screen and (max-width: 1023px) {
    body.mapel .question-container.array-flexible-row.mapel-one-q > .answer-container {
        padding: 20px 18px 22px;
    }
}

body.mapel .array-flexible-row table.ls-answers.mapel-one {
    display: block;
    width: 100%;
    border: 0;
}

body.mapel .array-flexible-row table.ls-answers.mapel-one > colgroup,
body.mapel .array-flexible-row table.ls-answers.mapel-one > thead {
    display: none !important;
}

body.mapel .array-flexible-row table.ls-answers.mapel-one > tbody {
    display: block;
    border: 0;
}

/* Only the row LimeSurvey shows is drawn. A row it has switched off for a branch condition keeps
   LimeSurvey's own rules, so it stays hidden and cannot be reached, as section 4.5 sets out. */
body.mapel .array-flexible-row table.ls-answers.mapel-one > tbody > tr.answers-list {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

body.mapel .array-flexible-row table.ls-answers.mapel-one > tbody > tr.answers-list:not(.ls-hidden):not(.ls-irrelevant) {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

body.mapel .array-flexible-row table.ls-answers.mapel-one > tbody > tr.answers-list > th.answertext {
    display: block;
    width: auto;
    margin: 0;
    padding: 0 0 14px 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--mapel-heading);
    text-align: left;
}

body.mapel .array-flexible-row table.ls-answers.mapel-one > tbody > tr.answers-list > th.answertext .mapel-toggle,
body.mapel .array-flexible-row table.ls-answers.mapel-one > tbody > tr.answers-list > th.answertext .mapel-ans {
    display: none !important;
}

body.mapel .array-flexible-row table.ls-answers.mapel-one > tbody > tr.answers-list > td.answer-item {
    display: block;
    position: relative;
    width: auto;
    margin: 0 0 10px 0;
    padding: 0;
    border: 1px solid var(--mapel-border);
    border-radius: 8px;
    background: var(--mapel-card);
    background-image: none;
    box-shadow: none;
    text-align: left;
}

body.mapel .array-flexible-row table.ls-answers.mapel-one > tbody > tr.answers-list > td.answer-item:hover {
    border-color: var(--mapel-primary);
}

body.mapel .array-flexible-row table.ls-answers.mapel-one > tbody > tr.answers-list > td.answer-item:last-child {
    margin-top: 35px;
    margin-bottom: 0;
}

body.mapel .array-flexible-row table.ls-answers.mapel-one > tbody > tr.answers-list > td.answer-item:last-child::before {
    content: "";
    position: absolute;
    left: -1px;
    right: -1px;
    top: -16px;
    height: 1px;
    background-color: var(--mapel-border);
}

body.mapel .array-flexible-row table.ls-answers.mapel-one > tbody > tr.answers-list > td.answer-item > input[type="radio"] {
    position: absolute !important;
    left: 18px !important;
    top: 14px !important;
    width: 21.6px !important;
    height: 21.6px !important;
    margin: 0 !important;
    transform: none !important;
    opacity: 0;
    z-index: 1;
}

body.mapel .array-flexible-row table.ls-answers.mapel-one > tbody > tr.answers-list > td.answer-item > label.ls-label-xs-visibility {
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 15px 18px 14px calc(18px + 21.6px + 14px) !important;
    overflow: visible !important;
    white-space: normal !important;
    text-indent: 0 !important;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45 !important;
    color: var(--mapel-text);
    text-align: left;
    cursor: pointer;
}

body.mapel .array-flexible-row table.ls-answers.mapel-one > tbody > tr.answers-list > td.answer-item > input[type="radio"] + label::before {
    left: 18px !important;
    top: 14px !important;
    margin: 0 !important;
}

body.mapel .array-flexible-row table.ls-answers.mapel-one > tbody > tr.answers-list > td.answer-item > input[type="radio"] + label::after {
    left: calc(18px + 5.6px) !important;
    top: calc(14px + 5.6px) !important;
    margin: 0 !important;
}

/* The question the screen moves to after a failed Next takes focus for screen readers and shows no ring of its own */
body.mapel .question-container.mapel-focus-target:focus {
    outline: none;
}
