.tmf-fmc {
    width: auto;
    max-width: 1200px;
    margin: 30px auto;
    padding: 25px;
    background: #262626;
    border-radius: 10px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, .3);
}

.tmf-fmc .tmf-fmc-hero {
    border-top: 3px solid var(--fmc-accent);
}

.tmf-fmc .tmf-fmc-step {
    --fmc-step-rail: 58px;
}

/*
 * Native fieldset legends sit in the fieldset border in several browsers.
 * Float the semantic legend into the normal padded content flow so every
 * discovery step gets the same deliberate top breathing room.
 */
.tmf-fmc .tmf-fmc-step > legend {
    float: left;
    width: 100%;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin: 0 0 18px;
}

.tmf-fmc .tmf-fmc-step > legend + * {
    clear: both;
}

.tmf-fmc .tmf-fmc-step > legend > span:last-child {
    min-width: 0;
    padding-top: 5px;
}

.tmf-fmc .tmf-fmc-step__description {
    max-width: 760px;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 24px;
    color: var(--fmc-muted);
    font-size: .9rem;
    line-height: 1.55;
}

/* Keep every answer control on the same visual rail as the question text. */
.tmf-fmc .tmf-fmc-step > :not(legend) {
    margin-left: var(--fmc-step-rail);
}

/* Step navigation follows that same rail instead of jumping back to the panel edge. */
.tmf-fmc .tmf-fmc-quiz__actions {
    padding-left: 88px;
}

.tmf-fmc .tmf-fmc-card-images--pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}

.tmf-fmc .tmf-fmc-card-images--pair img {
    width: 100%;
    border-radius: 10px;
    background: #111;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .34);
}

.tmf-fmc .tmf-fmc-featured__image.tmf-fmc-card-images--pair img:first-child {
    transform: rotate(-2deg) translateY(6px);
    transform-origin: bottom right;
}

.tmf-fmc .tmf-fmc-featured__image.tmf-fmc-card-images--pair img:last-child {
    transform: rotate(2deg) translateY(6px);
    transform-origin: bottom left;
}

.tmf-fmc .tmf-fmc-alt__image.tmf-fmc-card-images--pair {
    gap: 4px;
}

.tmf-fmc .tmf-fmc-alt__image.tmf-fmc-card-images--pair img {
    border-radius: 6px;
    box-shadow: 0 7px 15px rgba(0, 0, 0, .3);
}

.tmf-fmc .tmf-fmc-card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 15px;
}

.tmf-fmc .tmf-fmc-card-links .tmf-fmc-card-link {
    margin-top: 0;
}

.tmf-fmc .tmf-fmc-badge--pair {
    border-color: rgba(240, 84, 84, .42);
    background: rgba(240, 84, 84, .09);
    color: #ffaaaa;
}

@media (max-width: 768px) {
    .tmf-fmc {
        margin: 15px;
        padding: 18px;
    }
}

@media (max-width: 660px) {
    .tmf-fmc .tmf-fmc-step {
        --fmc-step-rail: 46px;
    }

    .tmf-fmc .tmf-fmc-step > legend {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }

    .tmf-fmc .tmf-fmc-quiz__actions {
        padding-left: 63px;
    }

    .tmf-fmc .tmf-fmc-featured__image.tmf-fmc-card-images--pair {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .tmf-fmc .tmf-fmc-featured__image.tmf-fmc-card-images--pair img:first-child,
    .tmf-fmc .tmf-fmc-featured__image.tmf-fmc-card-images--pair img:last-child {
        transform: none;
    }
}

@media (max-width: 520px) {
    .tmf-fmc {
        margin: 10px;
        padding: 14px;
    }
}

@media (max-width: 430px) {
    .tmf-fmc .tmf-fmc-featured__image.tmf-fmc-card-images--pair {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: min(330px, 92vw);
    }
}