.teacher-page {
    box-sizing: border-box;
    max-width: 53rem;
    margin: 0 auto;
    padding: 2rem 1.2rem 4rem;
    color-scheme: light;
    background: #fff;
    color: #242325;
    line-height: 1.55;
}

/* The shared site theme sets white directly on text elements and shadows on divs. */
.teacher-page :where(h1, h2, h3, h4, h5, h6, p, div, span, li, label, legend, td, th, a) {
    color: inherit;
    filter: none;
    text-shadow: none;
}

.teacher-page h1, .teacher-page h2, .teacher-page legend {
    line-height: 1.2;
}

.teacher-page fieldset {
    border: 1px solid #a8a5a1;
    border-radius: .45rem;
    margin: 1.6rem 0;
    padding: 1rem;
}

.teacher-page legend {
    font-size: 1.25rem;
    font-weight: 650;
    padding: 0 .35rem;
}

.teacher-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 0 1rem;
}

.teacher-page label {
    display: block;
    margin: .6rem 0;
}

.teacher-page input:not([type=checkbox]), .teacher-page textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    font: inherit;
    color: #1d1b19;
    background: #fff;
    border: 1px solid #777;
    border-radius: .25rem;
    padding: .45rem;
}

.teacher-page textarea {
    min-height: 5rem;
}

.teacher-page label.choice {
    display: flex;
    align-items: baseline;
    gap: .65rem;
    padding: .25rem 0;
}

.teacher-page .choice:has(input:disabled) {
    color: #59545a;
}

.teacher-topics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: .75rem;
}

.teacher-topics-grid label.choice {
    margin: 0;
    min-height: 2rem;
    gap: .4rem;
    overflow-wrap: anywhere;
}

.teacher-topics-grid input[type=checkbox] {
    flex: none;
}

.teacher-page button {
    border: 0;
    border-radius: .35rem;
    padding: .75rem 1.4rem;
    font: inherit;
    color: #fff;
    background: #403453;
    cursor: pointer;
}

.teacher-page a {
    color: #46316a;
    text-decoration: underline;
}

.teacher-note, .teacher-page [role=status] {
    padding: .75rem 1rem;
    border-left: 3px solid #655078;
    background: #f5f2f8;
}

.teacher-card {
    border-top: 1px solid #aaa;
    padding: 1rem 0;
    overflow-wrap: anywhere;
    display: flow-root;
}

.teacher-card img {
    width: 96px;
    height: 144px;
    object-fit: cover;
    border-radius: .5rem;
    float: right;
    margin: 0 0 .65rem 1rem;
}

.teacher-card .teacher-social-row {
    margin: .35rem 0;
    font-size: .75rem;
    line-height: 1.45;
}

.teacher-card .teacher-social-row > a {
    font-size: inherit;
}

.teacher-card .teacher-social-icon {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    margin-inline-end: .35em;
    vertical-align: -.2em;
}

.teacher-search {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem 1rem;
    margin: 1.5rem 0;
    padding: 1rem 1.1rem;
    border: 1px solid #d2cbd8;
    border-radius: .65rem;
    background: #faf8fb;
}
.teacher-search label { margin: 0; min-width: 0; }
.teacher-search .teacher-keyword, .teacher-search-actions { grid-column: 1 / -1; }
.teacher-search select, .teacher-search input[type=search] {
    min-height: 44px;
    margin-top: .25rem;
    width: 100%;
    box-sizing: border-box;
    padding: .45rem;
    font: inherit;
    color: #242325;
    background: #fff;
    border: 1px solid #807a84;
    border-radius: .3rem;
}
.teacher-search-actions, .teacher-pagination { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.teacher-result-count { margin: 1rem 0; }
.teacher-rank { margin: 1.35rem 0 .4rem; font-size: 1.25rem; }
.teacher-results-list { list-style: none; padding: 0; margin: 0; }
.teacher-results-list li { margin: 0; padding: 0; border-bottom: 1px solid #e0dbe3; }
.teacher-page a.teacher-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 48px;
    padding: .5rem .75rem;
    box-sizing: border-box;
    color: #33263f;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.teacher-page a.teacher-result:hover, .teacher-page a.teacher-result:focus-visible { background: #f3f0f5; }
.teacher-page a.teacher-result:focus-visible { outline: 2px solid #604675; outline-offset: -2px; }
.teacher-result strong { font-weight: 600; }
.teacher-result-meta, .teacher-result small { display: block; font-size: .875rem; }
.teacher-result-arrow { font-size: 1.4rem; }
.teacher-pagination { margin-top: 1.25rem; }
.teacher-back { display: inline-block; margin: 0 0 1rem; }
.teacher-card h1, .teacher-card h2 { margin-top: 0; }
.teacher-card h3 { margin: 1rem 0 .35rem; }
.teacher-card .teacher-bio { white-space: pre-line; }
.teacher-card-topics { padding-inline-start: 1.25rem; margin-block: .3rem .8rem; }
.teacher-card-topics li { margin: .15rem 0; }
@media (max-width: 620px) {
    .teacher-search { grid-template-columns: 1fr; gap: .55rem; }
}
