.first-math {
    color: var(--quiz-ink, #233d3a);
    scroll-margin-top: 6rem;
}
.first-math__controls h2, .first-math__offer h3, .first-math__paper h3 {
    margin: 0 0 .5rem;
}
.first-math__settings {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.25rem 0 1.75rem;
}
.first-math__settings .field { min-width: 0; }
.first-math__paper {
    max-width: 49rem;
    padding: clamp(1rem, 3vw, 2.8rem);
    margin-inline: auto;
    border: 1px solid #b9c9c0;
    border-top: 5px solid #487b69;
    border-radius: .75rem;
    background: #fff;
}
.first-math__paper header { padding-bottom: 1rem; border-bottom: 1px solid #9dafaa; }
.first-math__paper h3 { font-size: clamp(1.5rem, 3vw, 2.35rem); line-height: 1.16; }
.first-math__paper p { margin: .4rem 0; }
.first-math__meta { font-weight: 650; color: #466054; }
.first-math__name { display: flex; max-width: 19rem; gap: .5rem; margin-top: 1rem; }
.first-math__name span { flex: 1; border-bottom: 1px solid #73887e; }
.first-math__tasks { padding-left: 2rem; margin: 0; font-size: 1.1rem; }
.first-math__tasks li { padding: .75rem .15rem .3rem; break-inside: avoid; }
.first-math__tasks li::marker { font-weight: bold; }
.first-math__problem { font-size: 1.15em; font-weight: 600; overflow-wrap: anywhere; }
.first-math__cell {
    display: inline-block;
    box-sizing: content-box;
    width: .75em;
    height: .75em;
    width: 1cap;
    height: 1cap;
    border: 1px solid currentColor;
    vertical-align: -1px;
}
.first-math__line { min-height: 1.6rem; border-bottom: 1px solid #91a298; }
.first-math__print, .first-math__offer { margin: 1rem auto; max-width: 49rem; }
.first-math__print { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.first-math__print p { margin: 0; font-size: .88rem; color: #4c6056; }
.first-math__offer { margin-top: 2rem; padding: 1.25rem; border-radius: .75rem; background: #eef5ef; }
.first-math__offer > a:last-child { display: block; margin-top: 1rem; }
@media (max-width: 560px) {
    .first-math__settings { display: grid; grid-template-columns: minmax(0,1fr); }
    .first-math__tasks { padding-left: 1.5rem; }
}
@page first-grade-sheet { size: A4 portrait; margin: 15mm; }
@media print {
    .first-math, .first-math__paper { page: first-grade-sheet; color: #111; }
    .first-math__controls, .first-math__print, .first-math__offer { display: none !important; }
    .first-math__paper { padding: 0; border: 0; border-radius: 0; margin: 0; max-width: none; }
    .first-math__paper h3 { font-size: 23pt; }
    .first-math__meta { color: inherit; }
    .first-math__tasks { font-size: 14pt; line-height: 1.4; }
    .first-math__tasks li { padding-top: 4mm; }
    .first-math__line { height: 11mm; border-color: #666; }
}
