.grade-intro,
.content-narrow {
    max-width: 1040px;
}

.calculator-card,
.result-card,
.related-card {
    border-radius: 1rem;
}

.grade-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) minmax(140px, 1fr) minmax(140px, 1fr) 46px;
    gap: .75rem;
    align-items: end;
}

.grade-grid-header {
    color: #596475;
    font-size: .875rem;
    font-weight: 600;
    padding: 0 .25rem .5rem;
}

.grade-row {
    border-top: 1px solid #e8edf3;
    padding: .85rem 0;
}

.grade-row:first-child {
    border-top: 0;
}

.remove-row {
    width: 46px;
    height: 38px;
}

.result-card {
    position: sticky;
    top: 1rem;
}

.result-stat {
    background: #f7f9fc;
    border: 1px solid #e4eaf2;
    border-radius: .8rem;
    display: flex;
    flex-direction: column;
    padding: .9rem;
}

.result-label {
    color: #596475;
    font-size: .82rem;
    font-weight: 600;
}

.result-value,
.result-value-sm {
    color: #173b66;
    line-height: 1.15;
    margin: .2rem 0;
}

.result-value {
    font-size: 1.75rem;
}

.result-value-sm {
    font-size: 1.35rem;
}

.result-stat small {
    color: #687385;
}

.step-box,
.formula-box {
    background: #fff;
    border: 1px solid #e3e9f1;
    border-radius: .85rem;
    padding: 1.1rem;
}

.step-number {
    align-items: center;
    background: #e8f0ff;
    border-radius: 50%;
    color: #2457a6;
    display: inline-flex;
    font-weight: 700;
    height: 2rem;
    justify-content: center;
    margin-bottom: .65rem;
    width: 2rem;
}

.formula-box {
    color: #173b66;
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

.interpretation-table th {
    background: #eef3fa;
    white-space: nowrap;
}

.related-card {
    border: 1px solid #e2e8f0;
    transition: transform .15s ease, box-shadow .15s ease;
}

.related-card:hover,
.related-card:focus-visible {
    box-shadow: 0 .5rem 1rem rgba(27, 50, 82, .1);
    transform: translateY(-2px);
}

@media (max-width: 767.98px) {
    .grade-grid {
        grid-template-columns: 1fr 1fr;
    }

    .grade-row > div:first-child {
        grid-column: 1 / -1;
    }

    .remove-row {
        grid-column: 1 / -1;
        width: 100%;
    }

    .result-card {
        position: static;
    }

    .interpretation-table th {
        white-space: normal;
    }
}

@media (max-width: 420px) {
    .grade-grid {
        grid-template-columns: 1fr;
    }

    .grade-row > div:first-child,
    .remove-row {
        grid-column: auto;
    }
}
