
.affe-quiz {
    --affe-navy: #132b43;
    --affe-text: #26394b;
    --affe-muted: #6b7885;
    --affe-line: #d9e0e7;
    --affe-soft: #f6f8fa;
    --affe-accent: #f5b21b;
    max-width: 1160px;
    margin: 28px auto 42px;
    padding: 30px;
    border: 1px solid var(--affe-line);
    border-radius: 14px;
    background: #fff;
    color: var(--affe-text);
    box-shadow: 0 2px 12px rgba(19,43,67,.04);
}

.affe-quiz h2 {
    margin: 0 0 10px;
    color: var(--affe-navy);
    font-size: 30px;
    line-height: 1.2;
}

.affe-quiz-kicker {
    margin-bottom: 8px;
    color: #6a7682;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .09em;
}

.affe-quiz-intro {
    max-width: 820px;
    margin: 0 0 24px;
    color: #4f5f6f;
    font-size: 16px;
    line-height: 1.65;
}

.affe-quiz-intro strong {
    color: var(--affe-navy);
    font-weight: 700;
}

.affe-quiz-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.affe-quiz-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    color: #26394b;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.affe-quiz-field select {
    width: 100%;
    min-height: 48px;
    padding: 0 42px 0 13px;
    border: 1px solid #bdc8d3;
    border-radius: 8px;
    background-color: #fff;
    color: #152d45;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: none;
    cursor: pointer;
}

.affe-quiz-field select:hover { border-color: #93a2b0; }
.affe-quiz-field select:focus {
    border-color: #365c7f;
    outline: 3px solid rgba(54,92,127,.12);
}

.affe-quiz-consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 22px 0 16px;
    padding: 13px 14px;
    border-radius: 9px;
    background: var(--affe-soft);
    color: #536272;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.55;
}

.affe-quiz-consent input {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin: 2px 0 0;
}

.affe-quiz-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    background: var(--affe-accent);
    color: #111;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}
.affe-quiz-submit:hover { filter: brightness(.97); }

.affe-quiz-status {
    min-height: 20px;
    margin: 8px 0 0;
    color: #607080;
    font-size: 13px;
    line-height: 1.45;
}

.affe-quiz-results {
    margin-top: 34px;
    padding-top: 28px;
    border-top: 1px solid var(--affe-line);
}

.affe-results-head {
    margin-bottom: 18px;
}
.affe-results-head > span {
    display: block;
    margin-bottom: 5px;
    color: #7a8793;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
}
.affe-results-head h3 {
    margin: 0 0 5px;
    color: var(--affe-navy);
    font-size: 26px;
    line-height: 1.2;
}
.affe-results-head p {
    margin: 0;
    color: var(--affe-muted);
    font-size: 14px;
}
.affe-results-empty { color: var(--affe-muted); }

/* The generic frontend cards are also used for quiz recommendations. Keep them
   visually compact inside the quiz and prevent theme styles from flattening them. */
.affe-quiz-results .affe-card-list {
    gap: 16px;
}
.affe-quiz-results .affe-product-card {
    width: 100%;
    margin: 0;
}
.affe-quiz-results .affe-product-media img {
    margin: 0;
}

@media (max-width: 700px) {
    .affe-quiz {
        margin: 18px 0 30px;
        padding: 18px 14px;
        border-radius: 12px;
    }
    .affe-quiz h2 { font-size: 24px; }
    .affe-quiz-intro {
        margin-bottom: 20px;
        font-size: 15px;
    }
    .affe-quiz-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .affe-quiz-field select { min-height: 46px; }
    .affe-quiz-submit { width: 100%; }
    .affe-results-head h3 { font-size: 22px; }
    .affe-quiz-results { margin-top: 26px; padding-top: 22px; }
}

/* Recommendation rationale, 0.16.5. */
.affe-recommendation-list {
    display: grid;
    gap: 28px;
}
.affe-recommendation-item {
    display: grid;
    gap: 12px;
}
.affe-recommendation-note {
    box-sizing: border-box;
    width: 100%;
    padding: 14px 16px 15px;
    border: 1px solid #dbe3ea;
    border-radius: 10px;
    background: #f8fafc;
    color: #536272;
}
.affe-recommendation-note--alternative {
    border-color: #ead8ad;
    background: #fffaf0;
}
.affe-recommendation-note-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.affe-rec-rank,
.affe-rec-title,
.affe-rec-score {
    box-sizing: border-box;
    line-height: 1.25;
}
.affe-rec-rank {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eaf0f5;
    color: #38536c;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
    white-space: nowrap;
}
.affe-recommendation-note--alternative .affe-rec-rank {
    background: #fff0c8;
    color: #77520a;
}
.affe-rec-title {
    flex: 0 1 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eef5fb;
    color: #17324c;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.affe-recommendation-note--alternative .affe-rec-title {
    background: #fff4d8;
    color: #6f4f10;
}
.affe-rec-score {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 5px 9px;
    border: 1px solid #d7e0e8;
    border-radius: 999px;
    background: #fff;
    color: #40576c;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.affe-rec-score strong {
    color: #17324c;
    font-size: 13px;
    font-weight: 800;
}
.affe-rec-reason {
    max-width: 880px;
    margin: 10px 0 0 !important;
    color: #4f6273 !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    font-weight: 400 !important;
}
@media (max-width: 700px) {
    .affe-recommendation-list {
        gap: 24px;
    }
    .affe-recommendation-item {
        gap: 10px;
    }
    .affe-recommendation-note {
        padding: 13px 14px 14px;
    }
    .affe-recommendation-note-head {
        display: grid;
        grid-template-columns: max-content minmax(0, 1fr);
        gap: 8px;
        align-items: center;
    }
    .affe-rec-rank {
        grid-column: 1;
    }
    .affe-rec-title {
        grid-column: 2;
        justify-self: start;
        white-space: normal;
    }
    .affe-rec-score {
        grid-column: 1 / -1;
        justify-self: start;
        margin-left: 0;
    }
    .affe-rec-reason {
        margin-top: 9px !important;
        font-size: 13.5px !important;
        line-height: 1.58 !important;
    }
}
