.teaching-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.primath-page {
    flex: 1;
    padding-top: 30px;
    padding-bottom: 48px;
}

.primath-back {
    display: inline-block;
    margin-bottom: 34px;
    color: var(--primary-dark);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.primath-back:hover { text-decoration: underline; }
.primath-back:focus-visible { outline: 3px solid var(--primary-color); outline-offset: 3px; }

.primath-hero {
    margin-bottom: 28px;
}

.primath-heading {
    margin-bottom: 26px;
}

.primath-kind {
    margin-bottom: 12px;
    color: #596678;
    font-size: 14px;
}

.primath-heading h1 {
    margin-bottom: 19px;
    color: #172335;
    font-size: clamp(30px, 3.2vw, 39px);
    font-weight: 650;
    letter-spacing: -.025em;
    line-height: 1.28;
    text-wrap: balance;
}

.primath-lead {
    color: #344256;
    font-size: 18px;
    line-height: 1.75;
}

.primath-heading .primath-status {
    margin-top: 14px;
    color: #647084;
    font-size: 15px;
}

.primath-cover {
    margin: 28px 0 0;
}

.primath-cover img {
    display: block;
    width: 100%;
    height: auto;
}

.primath-article {
    width: 100%;
}

.primath-section {
    padding: 31px 0 33px;
    border-top: 1px solid var(--border-color);
}

.primath-section h2 {
    margin-bottom: 18px;
    color: #202a39;
    font-size: 25px;
    font-weight: 650;
    letter-spacing: -.012em;
    line-height: 1.4;
}

.primath-section p {
    margin-bottom: 15px;
    color: #394557;
    font-size: 17px;
    line-height: 1.9;
    text-wrap: pretty;
}

.primath-section p:last-child { margin-bottom: 0; }

.primath-section .primath-note {
    color: #566375;
    font-size: 15px;
}

.primath-example {
    margin: 24px 0;
    padding-left: 20px;
    border-left: 2px solid #9bb9dc;
}

.primath-example h3 {
    margin-bottom: 8px;
    color: #213f68;
    font-size: 19px;
    font-weight: 600;
}

.primath-example p { margin: 0; }

.primath-features { margin: 5px 0 18px; }

.primath-feature {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 20px;
    padding: 18px 0;
    border-top: 1px solid var(--border-color);
}

.primath-feature:last-child { border-bottom: 1px solid var(--border-color); }

.primath-feature h3 {
    color: #213f68;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.6;
}

.primath-section .primath-feature p {
    margin: 0;
    font-size: 16px;
    line-height: 1.8;
}

.primath-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 410px);
    align-items: center;
    gap: 12px 28px;
    min-width: 0;
    padding: 16px 0 18px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.primath-entry h2 {
    margin-bottom: 3px;
    color: #202a39;
    font-size: 19px;
    font-weight: 600;
}

.primath-entry p {
    margin: 0;
    color: #657184;
    font-size: 14px;
    line-height: 1.6;
}

.primath-entry .primath-entry-status {
    margin-top: 7px;
    color: #7b6243;
}

.primath-entry-form label {
    display: block;
    margin-bottom: 7px;
    color: #263447;
    font-size: 14px;
    font-weight: 600;
}

.primath-entry-controls {
    display: flex;
    gap: 8px;
}

.primath-entry-controls input {
    min-width: 0;
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #cbd3df;
    border-radius: 4px;
    background: #fff;
    color: #1b2637;
    font: inherit;
}

.primath-entry-controls input:disabled { background: #f5f6f8; }

.primath-entry-controls button {
    padding: 10px 14px;
    border: 1px solid var(--primary-dark);
    border-radius: 4px;
    background: var(--primary-dark);
    color: #fff;
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.primath-entry-controls button:disabled {
    border-color: #c8ced8;
    background: #c8ced8;
    color: #4f5967;
    cursor: not-allowed;
}

.primath-entry-controls input:focus-visible,
.primath-entry-controls button:focus-visible { outline: 3px solid var(--primary-color); outline-offset: 2px; }

.primath-placeholder { min-height: 45vh; }
.primath-placeholder .primath-heading { margin-bottom: 25px; }
.primath-placeholder .primath-status { font-size: 17px; }
.primath-bottom-back { margin: 20px 0 0; }

@media (max-width: 900px) {
    .primath-heading { margin-bottom: 20px; }
    .primath-cover { margin-top: 22px; }
    .primath-entry { grid-template-columns: 1fr; }
}

@media (min-width: 769px) and (max-width: 1100px) {
    .nav-brand { font-size: 19px; white-space: nowrap; }
    .nav-menu { gap: 10px; }
    .nav-menu a { font-size: 15px; }
}

@media (max-width: 640px) {
    .primath-page { padding: 24px 18px 36px; }
    .primath-back { margin-bottom: 28px; }
    .primath-heading { margin-bottom: 20px; }
    .primath-heading h1 { font-size: 29px; }
    .primath-lead { font-size: 17px; }
    .primath-section { padding: 26px 0 28px; }
    .primath-section h2 { font-size: 22px; }
    .primath-section p { font-size: 16px; }
    .primath-example { padding-left: 15px; }
    .primath-feature { grid-template-columns: 1fr; gap: 4px; padding: 15px 0; }
    .primath-entry { grid-template-columns: 1fr; gap: 8px; }
    .primath-entry h2 { font-size: 18px; }
    .primath-entry-controls { flex-wrap: wrap; }
    .primath-entry-controls input { flex-basis: 100%; }
}
