/* MathTrail admissions landing preview.
   Futuristic palette (MT-012) on INSPINIA 5.2.0 Bootstrap components.
   Solid shapes carry timetable facts from the posters. Dashed, hatched shapes
   mark content that still waits for the team's confirmation. */

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

.mt-landing {
    --mt-plum: #11052c;
    --mt-purple: #3d087b;
    --mt-purple-deep: #2a0558;
    --mt-yellow: #ffe459;
    --mt-pink: #f43b86;
    --mt-ink-soft: #564e6b;      /* secondary text, 7.6:1 on white */
    --mt-edge: #7c768b;          /* control boundaries, 4.4:1 on white */
    --mt-hair: #dcd7e4;          /* decorative hairlines */
    --mt-wash: #f6f2fb;
    --mt-wash-deep: #ebe3f6;
    --mt-pink-wash: #fde0eb;
    --mt-hatch: repeating-linear-gradient(135deg, rgba(17, 5, 44, .05) 0 1px, transparent 1px 9px);
    /* Latin letters and numerals come from TikTok Sans, one of the families INSPINIA 5.2.0 lists.
       Chinese text uses each device's own Simplified Chinese face, so no large font download. */
    --mt-font-text: "TikTok Sans", "Open Sans", "PingFang SC", "Noto Sans CJK SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
    --mt-font-display: var(--mt-font-text);
    --mt-bar-h: 3.5rem;
    --mt-header-h: 0rem;

    --theme-primary: var(--mt-purple);
    --theme-primary-rgb: 61, 8, 123;
    --theme-primary-text-emphasis: var(--mt-purple-deep);
    --theme-body-color: var(--mt-plum);
    --theme-body-color-rgb: 17, 5, 44;
    --theme-body-bg: #fff;
    --theme-body-font-family: var(--mt-font-text);
    --theme-body-font-size: 1rem;
    --theme-body-line-height: 1.6;
    --theme-font-family-secondary: var(--mt-font-display);
    --theme-secondary-color: var(--mt-ink-soft);
    --theme-border-color: var(--mt-hair);
    --theme-link-color: var(--mt-purple);
    --theme-link-color-rgb: 61, 8, 123;
    --theme-link-hover-color: var(--mt-purple-deep);
    --theme-link-hover-color-rgb: 42, 5, 88;
    --theme-gutter-x: 2rem;

    font-family: var(--mt-font-text);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--mt-plum);
    background: #fff;
    line-break: strict;
    overflow-wrap: break-word;
}

.mt-landing .container { --theme-gutter-x: 2rem; }

.mt-landing h1,
.mt-landing h2,
.mt-landing h3 {
    font-family: var(--mt-font-display);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    color: var(--mt-plum);
    text-wrap: balance;
}

.mt-landing p { text-wrap: pretty; }

:where(.mt-landing) a {
    color: var(--mt-purple);
    text-decoration: underline;
    text-decoration-thickness: .08em;
    text-underline-offset: .22em;
}

:where(.mt-landing) a:hover { color: var(--mt-purple-deep); }

/* INSPINIA removes outlines from links and buttons; the public page restores them. */
.mt-landing :focus-visible {
    outline: 3px solid var(--mt-purple) !important;
    outline-offset: 2px;
}

.mt-landing main:focus-visible { outline: none !important; }

.mt-landing .mt-preview :focus-visible,
.mt-landing .mt-week-panel :focus-visible,
.mt-landing .mt-footer :focus-visible { outline-color: var(--mt-yellow) !important; }

html:not(.mt-notes) .mt-note { display: none !important; }

/* Out of the flow while focused, so the whole box shows above the sticky header. */
.mt-skip {
    position: fixed;
    top: .5rem;
    left: .5rem;
    z-index: 100;
    padding: .75rem 1rem;
    border-radius: .5rem;
    background: var(--mt-yellow);
    color: var(--mt-plum);
    font-weight: 700;
}

/* Buttons */

.mt-landing .btn {
    --theme-btn-font-size: 1rem;
    --theme-btn-font-weight: 600;
    --theme-btn-padding-x: 1.25rem;
    --theme-btn-padding-y: .5rem;
    --theme-btn-border-radius: .625rem;
    --theme-btn-line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2.75rem;
    font-family: var(--mt-font-text);
    text-decoration: none;
}

.mt-landing .btn-lg {
    --theme-btn-font-size: 1.0625rem;
    --theme-btn-padding-x: 1.5rem;
    min-height: 3.25rem;
}

.mt-landing .btn-primary {
    --theme-btn-color: #fff;
    --theme-btn-bg: var(--mt-purple);
    --theme-btn-border-color: var(--mt-purple);
    --theme-btn-hover-color: #fff;
    --theme-btn-hover-bg: var(--mt-purple-deep);
    --theme-btn-hover-border-color: var(--mt-purple-deep);
    --theme-btn-active-color: #fff;
    --theme-btn-active-bg: var(--mt-plum);
    --theme-btn-active-border-color: var(--mt-plum);
}

.mt-landing .btn-outline-primary {
    --theme-btn-color: var(--mt-purple);
    --theme-btn-bg: #fff;
    --theme-btn-border-color: var(--mt-purple);
    --theme-btn-hover-color: #fff;
    --theme-btn-hover-bg: var(--mt-purple);
    --theme-btn-hover-border-color: var(--mt-purple);
    --theme-btn-active-color: #fff;
    --theme-btn-active-bg: var(--mt-purple-deep);
    --theme-btn-active-border-color: var(--mt-purple-deep);
}

.mt-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    font-weight: 600;
}

/* Internal preview bar */

.mt-preview {
    background: var(--mt-plum);
    color: #fff;
    font-size: .8125rem;
    line-height: 1.45;
}

.mt-preview__in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding-block: .375rem;
}

.mt-preview__text { margin: 0; }
.mt-preview__text strong { color: var(--mt-yellow); font-weight: 700; }

.mt-notes-toggle {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.5rem;
    padding: 0 .25rem;
    border: 0;
    background: none;
    color: #fff;
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
}

.mt-notes-toggle__track {
    order: 1;
    position: relative;
    width: 2.125rem;
    height: 1.25rem;
    border: 1.5px solid #fff;
    border-radius: 999px;
}

.mt-notes-toggle [data-notes-state] { order: 2; min-width: 1em; }

.mt-notes-toggle__track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: .8125rem;
    height: .8125rem;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s ease;
}

.mt-notes-toggle[aria-pressed="true"] .mt-notes-toggle__track {
    border-color: var(--mt-yellow);
    background: var(--mt-yellow);
}

.mt-notes-toggle[aria-pressed="true"] .mt-notes-toggle__track::after {
    transform: translateX(.875rem);
    background: var(--mt-plum);
}

/* Public navigation */

.mt-header {
    background: #fff;
    border-bottom: 1px solid var(--mt-hair);
}

.mt-nav { padding-block: .375rem; }

.mt-brand {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    font-family: var(--mt-font-display);
    font-size: 1.4375rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--mt-plum);
    text-decoration: none;
}

.mt-brand:hover { color: var(--mt-purple); }

.mt-nav .navbar-nav { padding-block: .5rem .75rem; }

.mt-nav .nav-link {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: .5rem 0;
    border-top: 1px solid var(--mt-hair);
    color: var(--mt-plum);
    font-size: 1.0625rem;
    font-weight: 600;
    text-decoration: none;
}

.mt-nav .nav-link:hover { color: var(--mt-purple); }

.mt-lang {
    display: inline-block;
    margin-bottom: .75rem;
    padding: .125rem .625rem;
    border: 1.5px dashed var(--mt-edge);
    border-radius: 999px;
    font-size: .8125rem;
    color: var(--mt-ink-soft);
    white-space: nowrap;
}

html:not(.js) .mt-nav .collapse { display: block; }
html:not(.js) .mt-menu-btn { display: none; }

@media (max-width: 991.98px) {
    .mt-menu-btn {
        display: inline-flex;
        align-items: center;
        gap: .375rem;
        min-height: 2.75rem;
        padding: 0 .875rem;
        border: 1px solid var(--mt-edge);
        border-radius: .625rem;
        background: #fff;
        color: var(--mt-plum);
        font-size: .9375rem;
        font-weight: 600;
    }

    .mt-menu-btn[aria-expanded="true"] {
        border-color: var(--mt-plum);
        background: var(--mt-plum);
        color: #fff;
    }
}

@media (min-width: 992px) {
    .mt-landing { --mt-header-h: 4rem; }
    html { scroll-padding-top: 5rem; }

    .mt-header {
        position: sticky;
        top: 0;
        z-index: 40;
    }

    .mt-nav { min-height: var(--mt-header-h); padding-block: 0; }
    .mt-nav .navbar-nav { gap: .25rem; padding: 0; }

    .mt-nav .nav-link {
        padding: .5rem .875rem;
        border: 0;
        border-radius: .5rem;
        font-size: 1rem;
    }

    .mt-nav .nav-link:hover { background: var(--mt-wash); }
    .mt-lang { margin: 0 0 0 .75rem; }
}

/* Hero and the week matrix */

.mt-hero { padding-top: 1.75rem; }

.mt-hero__grid {
    display: grid;
    gap: 1.75rem;
}

.mt-hero h1 span { display: inline-block; }

.mt-hero h1 {
    margin: 0 0 .875rem;
    font-size: clamp(1.875rem, 1.35rem + 2.6vw, 3.5rem);
    font-weight: 800;
    line-height: 1.18;
}

.mt-hero__lead {
    max-width: 32em;
    margin: 0 0 1.25rem;
    font-size: 1.0625rem;
    color: var(--mt-ink-soft);
}

.mt-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1.5rem;
}

.mt-week-panel {
    margin-inline: -1rem;
    padding: 1.125rem .75rem 1rem;
    background: var(--mt-plum);
    color: #fff;
}

.mt-week-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .25rem 1rem;
    padding-inline: .25rem;
}

.mt-landing .mt-week-panel h2 {
    margin: 0;
    font-size: 1.125rem;
    color: #fff;
}

.mt-legend {
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .8125rem;
}

.mt-legend li {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
}

.mt-dot {
    display: inline-block;
    width: .625rem;
    height: .625rem;
    border-radius: 50%;
    background: #fff;
}

.mt-dot--p {
    border-radius: 2px;
    background: var(--mt-pink);
}

.mt-matrix {
    width: 100%;
    margin: .625rem 0 .5rem;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 3px;
}

.mt-matrix thead td,
.mt-matrix tbody th { width: 5.25rem; }

.mt-matrix th,
.mt-matrix td {
    padding: 0;
    font-weight: inherit;
    text-align: left;
}

.mt-matrix a {
    color: #fff;
    text-decoration: none;
}

.mt-matrix thead a {
    display: grid;
    place-items: center;
    height: 2.25rem;
    border-radius: .5rem;
    font-size: .9375rem;
    font-weight: 700;
}

.mt-matrix tbody th a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 2.75rem;
    padding: .125rem .375rem;
    border-radius: .5rem;
    line-height: 1.25;
}

.mt-matrix tbody th b {
    font-family: var(--mt-font-display);
    font-size: .8125rem;
    font-weight: 700;
    white-space: nowrap;
}

.mt-matrix tbody th a > span:not(.visually-hidden) {
    font-size: .75rem;
    color: rgba(255, 255, 255, .82);
    white-space: nowrap;
}

.mt-matrix thead a:hover,
.mt-matrix tbody th a:hover {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.mt-cell {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: 3px;
    height: 2.75rem;
    padding: 3px;
    border-radius: .5rem;
    background: rgba(255, 255, 255, .1);
}

.mt-cell--none {
    background: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}

.mt-cell i {
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: #fff;
}

.mt-cell i.p {
    border-radius: 2px;
    background: var(--mt-pink);
}

a.mt-cell:hover,
.mt-cell[data-state="on"] { background: var(--mt-yellow); }

a.mt-cell:hover i,
.mt-cell[data-state="on"] i { background: var(--mt-plum); }

.mt-cell[data-state="off"] { opacity: .4; }

.mt-week-panel__help {
    margin: 0;
    padding-inline: .25rem;
    font-size: .8125rem;
    color: rgba(255, 255, 255, .82);
}

.mt-week-panel__keys { margin-top: .25rem; }

/* One arrival moment: a ripple runs through the week from Monday to Sunday.
   The dots are never hidden, so the matrix reads even where animation is paused. */
@media (prefers-reduced-motion: no-preference) {
    .mt-cell i {
        animation: mt-ripple .55s ease-out;
        animation-delay: calc(var(--mt-col, 0) * 70ms + 250ms);
    }

    .mt-matrix td:nth-child(3) { --mt-col: 1; }
    .mt-matrix td:nth-child(4) { --mt-col: 2; }
    .mt-matrix td:nth-child(5) { --mt-col: 3; }
    .mt-matrix td:nth-child(6) { --mt-col: 4; }
    .mt-matrix td:nth-child(7) { --mt-col: 5; }
    .mt-matrix td:nth-child(8) { --mt-col: 6; }

    @keyframes mt-ripple {
        35% { transform: scale(.3); }
        70% { transform: scale(1.3); }
    }
}

@media (min-width: 576px) {
    .mt-week-panel {
        margin-inline: 0;
        padding: 1.5rem 1.25rem 1.25rem;
        border-radius: 1.25rem;
    }

    .mt-matrix thead td,
    .mt-matrix tbody th { width: 6.5rem; }
    .mt-matrix tbody th b { font-size: .9375rem; }
    .mt-matrix tbody th a > span:not(.visually-hidden) { font-size: .8125rem; }

    .mt-cell {
        gap: 4px;
        height: 3rem;
    }

    .mt-cell i {
        width: .625rem;
        height: .625rem;
    }
}

@media (min-width: 992px) {
    .mt-hero { padding-block: 3.5rem 1rem; }

    .mt-hero__grid {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
        align-items: center;
        gap: 3.5rem;
    }

    .mt-hero__lead { font-size: 1.125rem; }
    .mt-week-panel { padding: 1.75rem 1.5rem 1.5rem; }
}

/* Sections */

.mt-section { padding-block: 2.75rem; }
.mt-section--wash { background: var(--mt-wash); }
.mt-section--tight { padding-top: 0; }
.mt-timetable { padding-top: 2.5rem; }

.mt-section__head {
    max-width: 40rem;
    margin-bottom: 1.25rem;
}

.mt-landing .mt-section h2 {
    margin: 0 0 .375rem;
    font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2.125rem);
}

.mt-section__head p {
    margin: 0;
    color: var(--mt-ink-soft);
}

@media (min-width: 992px) {
    .mt-section { padding-block: 4.5rem; }
    .mt-section--tight { padding-top: 0; }
    .mt-timetable { padding-top: 3.5rem; }
    .mt-section__head { margin-bottom: 1.75rem; }
}

/* Course guide and enquiry FAQ */

.mt-disclosure {
    border: 1px solid var(--mt-hair);
    border-radius: .875rem;
    background: var(--mt-wash);
}

.mt-timetable .mt-course-guide { margin-bottom: 1rem; }
.mt-contact .mt-enquiry-faq { margin-bottom: 1rem; }
.mt-action .mt-enquiry-faq { width: 100%; font-size: .9375rem; }

.mt-disclosure summary {
    padding: .75rem 1rem;
    color: var(--mt-purple);
    font-weight: 700;
    cursor: pointer;
}

.mt-disclosure__body { padding: .375rem 1rem 1rem; }

.mt-disclosure dl {
    display: grid;
    gap: .75rem 1.5rem;
    margin: 0;
}

.mt-disclosure dt { margin: 0 0 .125rem; }
.mt-disclosure dd { margin: 0; }
.mt-course-guide p { margin: .75rem 0 0; color: var(--mt-ink-soft); }

@media (min-width: 768px) {
    .mt-course-guide dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Pending content and reviewer notes */

.mt-pending {
    padding: .75rem .875rem;
    border: 1.5px dashed var(--mt-edge);
    border-radius: .75rem;
    background: var(--mt-hatch) #fff;
    font-size: .9375rem;
}

.mt-landing p.mt-pending { margin: 0; }

.mt-source {
    margin: 0;
    padding-left: .75rem;
    border-left: 2px dashed var(--mt-edge);
    font-size: .875rem;
    color: var(--mt-ink-soft);
}

.mt-pending-line {
    display: flex;
    align-items: center;
    gap: .375rem;
    margin: 0;
    font-size: .9375rem;
    font-weight: 600;
}

.mt-review {
    margin-bottom: 1rem;
    border: 1.5px dashed var(--mt-edge);
    border-radius: .875rem;
    background: var(--mt-hatch) #fff;
    font-size: .9375rem;
}

.mt-review > summary {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 3rem;
    padding: .5rem 1rem;
    border-radius: .875rem;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.mt-review > summary::-webkit-details-marker { display: none; }

.mt-review__chevron {
    margin-left: auto;
    transition: transform .15s ease;
}

.mt-review[open] .mt-review__chevron { transform: rotate(180deg); }

.mt-review__body {
    max-width: 46rem;
    padding: 0 1rem 1rem;
    overflow-x: auto;
}

.mt-landing .mt-review__body h3 {
    margin: 1.25rem 0 .25rem;
    font-size: 1rem;
}

.mt-review__body p { margin: 0 0 .5rem; }
.mt-review__body ul { margin: 0 0 1rem; padding-left: 1.2rem; }

.mt-review__table {
    width: 100%;
    margin: .5rem 0;
    border-collapse: collapse;
    background: #fff;
    font-variant-numeric: tabular-nums;
}

.mt-review__table th,
.mt-review__table td {
    padding: .375rem .5rem;
    border: 1px solid var(--mt-hair);
    font-size: .875rem;
    text-align: left;
}

.mt-review__table th { font-weight: 600; }
.mt-review__table th,
.mt-review__table td:nth-child(3) { white-space: nowrap; }

/* Timetable: filter bar, filter panel and results */

/* Filtering removes rows; without this the browser re-anchors on a surviving row
   and drags the filter bar and panel away from where the parent is tapping. */
.mt-tt {
    position: relative;
    overflow-anchor: none;
}

.mt-side {
    position: sticky;
    top: 0;
    z-index: 20;
    margin-inline: -1rem;
    padding-inline: 1rem;
    border-block: 1px solid var(--mt-hair);
    background: #fff;
}

.mt-bar {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-height: var(--mt-bar-h);
}

.mt-bar__text {
    flex: 1;
    min-width: 0;
}

.mt-bar__count {
    margin: 0;
    font-size: .9375rem;
    font-weight: 700;
    line-height: 1.3;
}

/* The extra class outranks `.mt-landing p { text-wrap: pretty }`, which would
   otherwise turn wrapping back on and defeat the one-line ellipsis. */
.mt-landing .mt-bar__summary {
    margin: 0;
    overflow: hidden;
    font-size: .8125rem;
    line-height: 1.35;
    color: var(--mt-ink-soft);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mt-bar__clear {
    flex: none;
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    font-size: .9375rem;
    font-weight: 600;
    white-space: nowrap;
}

.mt-bar__toggle {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    min-height: 2.75rem;
    padding: 0 .875rem;
    border: 1px solid var(--mt-plum);
    border-radius: .625rem;
    background: #fff;
    color: var(--mt-plum);
    font-size: .9375rem;
    font-weight: 600;
}

.mt-bar__toggle[aria-expanded="true"] {
    background: var(--mt-plum);
    color: #fff;
}

.mt-filters {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    max-height: calc(100vh - var(--mt-bar-h) - 2px);
    max-height: calc(100dvh - var(--mt-bar-h) - 2px);
    padding: 1rem 1rem 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-bottom: 1px solid var(--mt-plum);
    background: #fff;
    box-shadow: 0 1.5rem 2rem -1rem rgba(17, 5, 44, .45);
}

.mt-side[data-open="true"] .mt-filters { display: block; }

.mt-fieldset {
    min-width: 0;
    margin: 0 0 1.125rem;
    padding: 0;
    border: 0;
}

.mt-fieldset legend {
    float: none;
    width: auto;
    margin: 0 0 .5rem;
    padding: 0;
    font-size: .875rem;
    font-weight: 600;
    color: var(--mt-ink-soft);
}

.mt-fieldset__note {
    margin: .5rem 0 0;
    font-size: .8125rem;
    color: var(--mt-ink-soft);
}

.mt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.mt-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
}

.mt-chip {
    position: relative;
    display: inline-flex;
    margin: 0;
}

.mt-chip input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.mt-chip__face {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    min-height: 2.75rem;
    padding: .375rem .875rem;
    border: 1px solid var(--mt-edge);
    border-radius: 999px;
    background: #fff;
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color .12s ease, border-color .12s ease;
}

.mt-chip__face .ti-check { display: none; }
.mt-chip__latin { font-weight: 400; color: var(--mt-ink-soft); }
.mt-chip:hover .mt-chip__face { border-color: var(--mt-plum); background: var(--mt-wash); }

.mt-chip input:checked + .mt-chip__face {
    border-color: var(--mt-plum);
    background: var(--mt-yellow);
    box-shadow: inset 0 0 0 1px var(--mt-plum);
}

.mt-chip input:checked + .mt-chip__face .ti-check { display: inline-block; }
.mt-chip input:checked + .mt-chip__face .mt-chip__latin { color: var(--mt-plum); }

.mt-chip input:focus-visible + .mt-chip__face {
    outline: 3px solid var(--mt-purple);
    outline-offset: 2px;
}

/* The weekday filter is the same seven-cell week as the matrix and the row markers. */
.mt-chips--days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .25rem;
    max-width: 24rem;
}

.mt-chip--day .mt-chip__face {
    justify-content: center;
    width: 100%;
    padding-inline: 0;
    border-radius: .5rem;
}

/* A selected weekday keeps its width; the heavy ring and underline mark it besides the colour. */
.mt-chip--day input:checked + .mt-chip__face {
    box-shadow: inset 0 0 0 2px var(--mt-plum);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: .25em;
}

.mt-chip--tile { display: flex; }

.mt-chip--tile .mt-chip__face {
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    min-height: 3.5rem;
    padding: .5rem .625rem;
    border-radius: .75rem;
    line-height: 1.3;
}

.mt-chip--tile b {
    font-family: var(--mt-font-display);
    font-size: .9375rem;
    font-weight: 700;
    white-space: nowrap;
}

.mt-chip--tile .mt-chip__face > span {
    font-size: .8125rem;
    font-weight: 400;
    color: var(--mt-ink-soft);
    white-space: nowrap;
}

.mt-chip--tile input:checked + .mt-chip__face > span { color: var(--mt-plum); }

.mt-chip__grade {
    display: block;
    font-size: .75rem;
}

.mt-chip--tile .ti-check {
    position: absolute;
    top: .375rem;
    right: .4375rem;
}

.mt-filters__foot {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: .75rem;
    padding: .75rem 0;
    border-top: 1px solid var(--mt-hair);
    background: #fff;
}

.mt-filters__foot .btn { flex: 1; }
.mt-landing .mt-nojs { display: none; }

html:not(.js) .mt-landing .mt-nojs { display: inline-flex; }
html:not(.js) .mt-filters__done,
html:not(.js) .mt-bar__toggle { display: none; }
html:not(.js) .mt-side { position: static; }

html:not(.js) .mt-filters {
    display: block;
    position: static;
    max-height: none;
    padding-inline: 0;
    border: 0;
    box-shadow: none;
}

.mt-results {
    min-width: 0;
    padding-top: .25rem;
}

.mt-group { margin-bottom: 1.25rem; }

.mt-group__head {
    position: sticky;
    top: var(--mt-bar-h);
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 .75rem;
    padding: .875rem 0 .5rem;
    background: #fff;
}

.mt-landing .mt-group__head h3 {
    margin: 0;
    font-size: 1.1875rem;
}

.mt-group__aud {
    font-size: .875rem;
    color: var(--mt-ink-soft);
}

.mt-group__count {
    margin-left: auto;
    font-size: .8125rem;
    color: var(--mt-ink-soft);
    white-space: nowrap;
}

.mt-slots {
    display: grid;
    gap: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--mt-hair);
    border-radius: .875rem;
    background: var(--mt-hair);
    list-style: none;
}

.mt-slot { scroll-margin-top: calc(var(--mt-bar-h) + var(--mt-header-h) + 4rem); }

.mt-slot__link {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    grid-template-areas:
        "when when when code go"
        "how tutor flag flag go";
    align-items: center;
    gap: .25rem .625rem;
    min-height: 4.25rem;
    padding: .5rem .5rem .5rem .875rem;
    background: #fff;
    color: var(--mt-plum);
    text-decoration: none;
}

.mt-slot__link:hover {
    background: var(--mt-wash);
    color: var(--mt-plum);
}

.mt-landing .mt-slot__link:focus-visible { outline-offset: -3px; }

.mt-slot:target .mt-slot__link {
    background: #fff9d6;
    box-shadow: inset .25rem 0 0 var(--mt-yellow);
}

.mt-slot__when {
    grid-area: when;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 .5rem;
    font-family: var(--mt-font-display);
    font-size: 1.0625rem;
    line-height: 1.35;
    white-space: nowrap;
}

.mt-slot__day { font-weight: 600; }

.mt-slot__time {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Seven squares, Monday to Sunday: the weekday reads by position down the list. */
.mt-week {
    --cell: .4375rem;
    --gap: .125rem;
    --step: calc(var(--cell) + var(--gap));
    flex: none;
    width: calc(var(--step) * 7 - var(--gap));
    height: var(--cell);
    background:
        linear-gradient(var(--mt-mark, var(--mt-purple)), var(--mt-mark, var(--mt-purple)))
            calc((var(--d) - 1) * var(--step)) 0 / var(--cell) var(--cell) no-repeat,
        repeating-linear-gradient(90deg, var(--mt-hair) 0 var(--cell), transparent var(--cell) var(--step));
}

.mt-slot[data-format="physical"] .mt-week { --mt-mark: var(--mt-pink); }

.mt-slot__how { grid-area: how; }

.mt-slot__tutor {
    grid-area: tutor;
    font-size: .9375rem;
    font-weight: 600;
    white-space: nowrap;
}

.mt-slot__label {
    margin-right: .25rem;
    font-size: .8125rem;
    font-weight: 400;
    color: var(--mt-ink-soft);
}

.mt-slot__code {
    grid-area: code;
    justify-self: end;
}

.mt-slot__flag {
    grid-area: flag;
    min-width: 0;
}

.mt-slot__go {
    grid-area: go;
    font-size: 1.25rem;
    color: var(--mt-edge);
    transition: transform .12s ease;
}

.mt-slot__link:hover .mt-slot__go {
    color: var(--mt-purple);
    transform: translateX(2px);
}

.mt-tag {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .125rem .5rem;
    border-radius: 999px;
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.mt-tag--online { background: var(--mt-wash-deep); color: var(--mt-purple); }
.mt-tag--physical { background: var(--mt-pink-wash); color: var(--mt-plum); }
.mt-tag--term { background: var(--mt-plum); color: #fff; }
.mt-tag--plain { box-shadow: inset 0 0 0 1px var(--mt-edge); }

.mt-code {
    display: inline-block;
    min-width: 2.375rem;
    padding: 0 .375rem;
    border: 1px solid var(--mt-edge);
    border-radius: .375rem;
    font-family: var(--mt-font-display);
    font-size: .8125rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
}

.mt-flag {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: 0 .4375rem;
    border: 1.5px dashed var(--mt-plum);
    border-radius: .375rem;
    background: #fff;
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.mt-flag__why {
    display: none;
    margin-left: .125rem;
    font-weight: 400;
}

.mt-empty {
    margin-top: 1rem;
    padding: 1.5rem 1.25rem;
    border-radius: .875rem;
    background: var(--mt-wash);
}

.mt-landing .mt-empty h3 {
    margin: 0 0 .5rem;
    font-size: 1.1875rem;
}

.mt-empty p {
    max-width: 34em;
    color: var(--mt-ink-soft);
}

@media (min-width: 768px) {
    .mt-side { display: contents; }

    .mt-bar {
        position: sticky;
        top: 0;
        z-index: 20;
        border-block: 1px solid var(--mt-hair);
        background: #fff;
    }

    .mt-bar__toggle { display: none; }

    .mt-filters {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "level level"
            "format place"
            "day tutor";
        column-gap: 2rem;
        position: static;
        max-height: none;
        padding: 1rem 0 0;
        overflow: visible;
        border: 0;
        box-shadow: none;
    }

    .mt-fieldset--level { grid-area: level; }
    .mt-fieldset--format { grid-area: format; }
    .mt-fieldset--place { grid-area: place; }
    .mt-fieldset--day { grid-area: day; }
    .mt-fieldset--tutor { grid-area: tutor; }
    .mt-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .mt-filters__foot { display: none; }

    html:not(.js) .mt-filters { display: grid; }

    html:not(.js) .mt-filters__foot {
        display: flex;
        grid-column: 1 / -1;
        position: static;
    }

    .mt-week {
        --cell: .5rem;
        --gap: .1875rem;
    }
}

/* A one-line row needs about 43rem to show a review flag. From 992px to 1199px the
   results column beside the filters is only 38rem wide, so that range keeps the
   two-line row. */
@media (min-width: 768px) and (max-width: 991.98px), (min-width: 1200px) {
    .mt-slot__link {
        grid-template-columns: 15.5rem 7rem 5.75rem 3.5rem minmax(0, 1fr) 1.5rem;
        grid-template-areas: "when how tutor code flag go";
        column-gap: .75rem;
        min-height: 3.5rem;
        padding: .5rem .75rem .5rem 1rem;
    }

    .mt-slot__when { flex-wrap: nowrap; }
    .mt-slot__code { justify-self: start; }
}

@media (min-width: 992px) {
    .mt-tt {
        display: grid;
        grid-template-columns: 17.5rem minmax(0, 1fr);
        align-items: start;
        gap: 2.5rem;
    }

    .mt-side {
        display: block;
        position: sticky;
        top: calc(var(--mt-header-h) + 1rem);
        max-height: calc(100vh - var(--mt-header-h) - 2rem);
        margin: 0;
        padding: .25rem 1.25rem 0;
        overflow-y: auto;
        border: 1px solid var(--mt-hair);
        border-radius: 1rem;
    }

    .mt-bar {
        position: static;
        flex-wrap: wrap;
        gap: 0 .625rem;
        min-height: 0;
        padding-block: .75rem;
        border-top: 0;
    }

    .mt-landing .mt-bar__summary { white-space: normal; }

    .mt-filters {
        display: block;
        padding-top: 1rem;
    }

    /* Without scripts the 768px grid rule would still win here and squeeze the form. */
    html:not(.js) .mt-filters { display: block; }

    .mt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mt-fieldset { margin-bottom: .875rem; }
    .mt-chip__face { min-height: 2.25rem; }
    .mt-chip--tile .mt-chip__face { min-height: 3rem; padding-block: .375rem; }
    .mt-results { padding-top: 0; }
    .mt-group__head { top: var(--mt-header-h); padding-top: .5rem; }
}

@media (min-width: 1400px) {
    .mt-flag__why { display: inline; }
}

/* Tutors */

.mt-tutors {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mt-tutor {
    display: flex;
    flex-direction: column;
    gap: .875rem;
    padding: 1.125rem;
    border: 1px solid var(--mt-hair);
    border-radius: 1rem;
    background: #fff;
    scroll-margin-top: 1.5rem;
}

.mt-tutor:target {
    border-color: var(--mt-plum);
    box-shadow: 0 0 0 4px var(--mt-yellow);
}

.mt-tutor__id {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.mt-portrait {
    flex: none;
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border: 1.5px dashed var(--mt-edge);
    border-radius: 50%;
    background: var(--mt-hatch) #fff;
    font-size: 1.375rem;
    font-weight: 600;
}

/* A photo the teacher published replaces the dashed placeholder. */
.mt-portrait--photo {
    display: block;
    border: 0;
    background: var(--mt-edge);
    object-fit: cover;
}

.mt-landing .mt-tutor h3 {
    margin: 0;
    font-size: 1.25rem;
}

.mt-tutor__status {
    margin: 0;
    font-size: .8125rem;
    color: var(--mt-ink-soft);
}

.mt-tutor__facts {
    display: grid;
    gap: .5rem;
    margin: 0;
    font-size: .9375rem;
}

.mt-tutor__facts dt {
    font-size: .8125rem;
    font-weight: 400;
    color: var(--mt-ink-soft);
}

.mt-tutor__facts dd { margin: 0; }
.mt-tutor > .btn { margin-top: auto; }

.mt-tutor--todo {
    border: 1.5px dashed var(--mt-edge);
    background: var(--mt-hatch) #fff;
    font-size: .9375rem;
}

.mt-landing .mt-tutor--todo h3 { font-size: 1.0625rem; }
.mt-tutor--todo ul { margin: 0; padding-left: 1.2rem; }
.mt-tutor--todo p { margin: 0; color: var(--mt-ink-soft); }

.mt-tutor--inline {
    padding: 1rem;
    gap: .5rem;
}

.mt-tutor__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.5rem;
    margin: 0;
}

/* A teacher with a draft bio: identity and bio first, facts and review notes beside them. */

.mt-tutor__latin {
    margin: 0;
    font-size: .875rem;
    color: var(--mt-ink-soft);
}

.mt-tutor__role {
    margin: .125rem 0 0;
    font-size: .875rem;
}

.mt-tutor__mark {
    color: var(--mt-ink-soft);
    white-space: nowrap;
}

.mt-tutor__summary {
    margin: 0;
    max-width: 38em;
}

.mt-tutor--profile {
    grid-column: 1 / -1;
    gap: 1.25rem;
    padding: 1.25rem;
}

.mt-landing .mt-tutor--profile h3 { font-size: 1.5rem; }

.mt-tutor__main,
.mt-tutor__side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.mt-tutor__bio p {
    max-width: 38em;
    margin: 0 0 .75rem;
}

.mt-tutor__bio p:last-child { margin-bottom: 0; }

.mt-tutor--profile .mt-tutor__facts {
    padding: .875rem 1rem;
    border-radius: .75rem;
    background: var(--mt-wash);
}

.mt-tutor__side > .btn { margin-top: auto; }

.mt-tutor__review { font-size: .875rem; }

.mt-tutor__review-title {
    display: flex;
    align-items: center;
    gap: .375rem;
    margin: 0 0 .375rem;
    font-weight: 600;
}

.mt-tutor__review ul {
    display: grid;
    gap: .375rem;
    margin: 0;
    padding-left: 1.1rem;
}

@media (min-width: 576px) {
    .mt-tutors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
    .mt-tutor { scroll-margin-top: 5.5rem; }

    .mt-tutor--profile {
        flex-direction: row;
        gap: 2.5rem;
        padding: 1.75rem;
    }

    .mt-tutor--profile .mt-tutor__main { flex: 1.6 1 0; }
    .mt-tutor--profile .mt-tutor__side { flex: 1 1 0; }

    .mt-tutor--profile .mt-portrait {
        width: 4.5rem;
        height: 4.5rem;
        font-size: 1.75rem;
    }
}

@media (min-width: 1200px) {
    .mt-tutors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* About, achievements and parent feedback */

.mt-about {
    display: grid;
    gap: 2rem;
}

.mt-about__lead {
    max-width: 34em;
    font-size: 1.125rem;
}

.mt-landing .mt-about h3 {
    margin: 1.75rem 0 .5rem;
    font-size: 1.1875rem;
}

.mt-about__main p { max-width: 36em; }
.mt-about__main .mt-source { margin-top: .75rem; }

.mt-goals {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    max-width: 36em;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mt-goals li {
    padding: .375rem .875rem;
    border-radius: 999px;
    background: var(--mt-wash-deep);
    font-weight: 600;
}

/* Class practice: label and text side by side, stacked on very narrow screens */

.mt-practice {
    display: grid;
    max-width: 36em;
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--mt-hair);
}

.mt-practice li {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: .75rem;
    padding: .625rem 0;
    border-bottom: 1px solid var(--mt-hair);
}

.mt-practice b {
    font-weight: 400;
    color: var(--mt-ink-soft);
}

.mt-practice .mt-link { display: inline-block; }
.mt-practice + .mt-source { margin-top: .75rem; }

@media (max-width: 359.98px) {
    .mt-practice li { grid-template-columns: minmax(0, 1fr); gap: .125rem; }
}

.mt-tutor__hint { max-width: 36em; }

.mt-about__side {
    align-self: start;
    padding: 1.25rem;
    border-radius: 1rem;
    background: var(--mt-wash);
}

.mt-landing .mt-about__side h3 { margin-top: 0; }

.mt-places {
    display: grid;
    gap: 1rem;
    margin: 0 0 1rem;
}

.mt-places dt {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-weight: 700;
}

.mt-places dd {
    margin: 0;
    color: var(--mt-ink-soft);
}

.mt-places__address {
    display: block;
    margin-top: .375rem;
    font-size: .875rem;
    overflow-wrap: anywhere;
}

.mt-placeholder { padding: 1.25rem; }
.mt-placeholder p { margin: 0; }

.mt-placeholder__title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .375rem !important;
    font-weight: 700;
}

.mt-skeleton {
    display: grid;
    gap: .5rem;
    margin: .875rem 0;
    padding: 0;
    list-style: none;
}

.mt-skeleton li {
    display: grid;
    grid-template-columns: 2fr 1fr 3fr;
    gap: .5rem;
}

.mt-skeleton span {
    padding: .5rem .625rem;
    border: 1px dashed var(--mt-edge);
    border-radius: .5rem;
    background: #fff;
    font-size: .8125rem;
    color: var(--mt-ink-soft);
}

/* Feedback. Featured summaries align on desktop; expanded cards can grow independently. */

.mt-feedback__source { margin-bottom: 1rem; }

.mt-quotes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
    align-items: start;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mt-quote {
    display: flex;
    flex-direction: column;
    gap: .875rem;
    max-width: 44rem;
    padding: 1.25rem;
    border: 1px solid var(--mt-hair);
    border-radius: 1rem;
    background: #fff;
    scroll-margin-top: 1.5rem;
}

.mt-quote:target {
    border-color: var(--mt-plum);
    box-shadow: 0 0 0 4px var(--mt-yellow);
}

.mt-quote figure {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .625rem;
    margin: 0;
}

.mt-quote__glyph {
    font-size: 1.375rem;
    line-height: 1;
    color: var(--mt-pink);
}

.mt-quote blockquote { margin: 0; }
.mt-quote blockquote p { margin: 0 0 .75rem; }
.mt-quote blockquote p:last-child { margin-bottom: 0; }

.mt-quote figure blockquote {
    font-size: 1.0625rem;
    font-weight: 500;
    line-height: 1.65;
}

.mt-quote figcaption {
    display: grid;
    gap: .125rem;
    margin-top: auto;
    padding-top: .375rem;
    font-size: .9375rem;
}

.mt-quote figcaption span {
    font-size: .875rem;
    color: var(--mt-ink-soft);
}

.mt-quote__full { border-top: 1px solid var(--mt-hair); }

.mt-quote__full > summary {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-height: 2.75rem;
    font-weight: 600;
    color: var(--mt-purple);
    list-style: none;
    cursor: pointer;
}

.mt-feedback summary::-webkit-details-marker { display: none; }
.mt-quote__full > summary:hover { color: var(--mt-purple-deep); text-decoration: underline; }
.mt-feedback summary .ti-chevron-down { transition: transform .15s ease; }
.mt-feedback details[open] > summary .ti-chevron-down { transform: rotate(180deg); }
.mt-feedback details:not([open]) > summary .mt-feedback__when-open,
.mt-feedback details[open] > summary .mt-feedback__when-closed { display: none; }
.mt-quote__full blockquote { padding-bottom: .25rem; }
.mt-quote__title { font-weight: 600; }

.mt-feedback__more { margin-top: 1.5rem; }

.mt-feedback__more > summary {
    --theme-btn-bg: transparent;
    display: flex;
    width: fit-content;
    justify-content: center;
    gap: .5rem;
    margin-inline: auto;
    list-style: none;
    cursor: pointer;
}

.mt-quotes--more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mt-quotes--more .mt-quote__glyph { display: none; }
.mt-quotes--more, .mt-quotes--pending { margin-top: 1rem; }

@media (max-width: 575.98px) {
    .mt-quotes--more { grid-template-columns: 1fr; }
    .mt-feedback__more > summary { width: 100%; }
}

.mt-quote mark {
    padding: .0625em 0;
    background: var(--mt-yellow);
    color: inherit;
    font-weight: 600;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.mt-quote--waiting {
    border: 1.5px dashed var(--mt-edge);
    background: var(--mt-hatch) #fff;
}

.mt-quote--waiting .mt-quote__full { border-top-color: var(--mt-edge); }

.mt-quote__review { font-size: .875rem; }

.mt-quote--waiting .mt-quote__review {
    padding-top: .875rem;
    border-top: 1.5px dashed var(--mt-edge);
}

.mt-quote__review-title {
    display: flex;
    align-items: center;
    gap: .375rem;
    margin: 0 0 .375rem;
    font-weight: 600;
}

.mt-quote__review ul {
    display: grid;
    gap: .375rem;
    margin: 0;
    padding-left: 1.1rem;
}

@media (min-width: 992px) {
    .mt-quote { scroll-margin-top: 5.5rem; }
    .mt-quotes--featured:has(> :nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mt-quotes--featured:not(:has(.mt-quote__full[open])) { align-items: stretch; }
}

@media (min-width: 992px) {
    .mt-about {
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
        gap: 4rem;
    }
}

/* Enquiry */

.mt-contact { background: var(--mt-yellow); }
.mt-contact .mt-section__head p { color: var(--mt-plum); }

.mt-steps {
    display: grid;
    gap: 1rem;
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
    counter-reset: mt-step;
}

.mt-steps li {
    position: relative;
    min-height: 2rem;
    padding-left: 2.75rem;
    counter-increment: mt-step;
}

.mt-steps li::before {
    content: counter(mt-step);
    position: absolute;
    top: .0625rem;
    left: 0;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--mt-plum);
    color: var(--mt-yellow);
    font-family: var(--mt-font-display);
    font-weight: 800;
}

.mt-steps b { display: block; }

.mt-channels {
    display: grid;
    gap: 1rem;
}

.mt-channel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .625rem;
    padding: 1.25rem;
    border-radius: 1rem;
    background: #fff;
}

.mt-landing .mt-channel h3 {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    font-size: 1.125rem;
}

.mt-channel p { margin: 0; }

@media (min-width: 768px) {
    .mt-steps,
    .mt-notes .mt-channels {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .mt-channels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mt-steps, .mt-channels { gap: 1.25rem; }
}

/* Footer */

.mt-footer {
    padding-block: 2.5rem;
    background: var(--mt-plum);
    color: rgba(255, 255, 255, .86);
    font-size: .9375rem;
}

.mt-footer__grid {
    display: grid;
    gap: 1.75rem;
}

.mt-footer p { margin: 0 0 .375rem; }

.mt-footer__brand {
    font-family: var(--mt-font-display);
    font-size: 1.4375rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: #fff;
}

.mt-landing .mt-footer h2 {
    margin: 0 0 .375rem;
    font-size: .9375rem;
    color: #fff;
}

.mt-footer ul {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mt-footer li { padding-block: .1875rem; }

.mt-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    color: #fff;
}

.mt-footer a:hover { color: var(--mt-yellow); }
.mt-footer nav li { padding-block: 0; }

.mt-footer__note,
.mt-footer__address {
    display: block;
    font-size: .8125rem;
    color: rgba(255, 255, 255, .72);
    overflow-wrap: anywhere;
}

@media (min-width: 768px) {
    .mt-footer__grid { grid-template-columns: 1.4fr 1fr 1.2fr 1.4fr; gap: 2.5rem; }
}

/* Curriculum guide */

.mt-curriculum__hero { padding-block: 1rem 2.5rem; }
.mt-curriculum__hero h1 {
    max-width: 34ch;
    margin-block: .75rem 1rem;
    font-size: clamp(1.75rem, 1.35rem + 1.6vw, 3rem);
}

.mt-curriculum__hero h1 span {
    display: block;
    margin-top: .5rem;
    color: var(--mt-ink-soft);
    font-size: clamp(1.0625rem, .95rem + .6vw, 1.4375rem);
    font-weight: 600;
}

.mt-curriculum__hero p { max-width: 46em; margin: 0; }

.mt-curriculum__layout {
    display: grid;
    gap: 1.75rem;
}

.mt-curriculum__toc {
    align-self: start;
    padding: .875rem 1rem;
    border: 1px solid var(--mt-hair);
    border-radius: .875rem;
    background: #fff;
}

.mt-curriculum__toc p { margin: 0 0 .25rem; font-weight: 700; }
.mt-curriculum__toc ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }

.mt-curriculum__toc a {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding-inline: .5rem;
    border-radius: .375rem;
    color: var(--mt-purple);
    font-size: .9375rem;
    text-decoration: none;
}

.mt-curriculum__toc a:hover,
.mt-curriculum__toc a:focus-visible {
    background: var(--mt-wash);
    text-decoration: underline;
}

.mt-curriculum__body { min-width: 0; max-width: 53rem; }
.mt-curriculum__body p { max-width: 46em; line-height: 1.75; }
.mt-curriculum__body h3 { margin-block: 1.5rem .625rem; font-size: 1.25rem; }

.mt-curriculum__body > section {
    margin-top: 2.25rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--mt-hair);
    scroll-margin-top: 1rem;
}

.mt-curriculum__body > section:target h2 { color: var(--mt-purple); }

.mt-curriculum__note {
    margin-block: 1.25rem;
    padding: .875rem 1rem;
    border-inline-start: .25rem solid var(--mt-purple);
    background: var(--mt-wash);
}

.mt-curriculum__comparison {
    display: grid;
    gap: 1px;
    overflow: hidden;
    margin-block: .75rem 1.25rem;
    border: 1px solid var(--mt-hair);
    border-radius: .875rem;
    background: var(--mt-hair);
}

.mt-curriculum__comparison > div { padding: .875rem 1rem; background: var(--mt-wash); }
.mt-curriculum__comparison dt { color: var(--mt-purple); }
.mt-curriculum__comparison dd { margin: .25rem 0 0; }

.mt-curriculum__references li { margin-bottom: .625rem; }

@media (min-width: 576px) {
    .mt-curriculum__comparison { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
    .mt-curriculum__layout { grid-template-columns: 13rem minmax(0, 1fr); gap: 2.75rem; }
    .mt-curriculum__toc {
        position: sticky;
        top: calc(var(--mt-header-h) + 1rem);
        max-height: calc(100vh - var(--mt-header-h) - 2rem);
        overflow-y: auto;
    }
    .mt-curriculum__toc ul { grid-template-columns: 1fr; }
}

.mt-curriculum__table {
    overflow: hidden;
    border: 1px solid var(--mt-hair);
    border-radius: 1rem;
}

.mt-curriculum__table .table {
    margin: 0;
    table-layout: fixed;
}

.mt-curriculum__table th,
.mt-curriculum__table td {
    padding: .75rem;
    border-color: var(--mt-hair);
    vertical-align: top;
    overflow-wrap: anywhere;
}

.mt-curriculum__table thead th { background: var(--mt-wash); }
.mt-curriculum__table tbody tr:last-child > * { border-bottom: 0; }
.mt-curriculum__detail { display: block; color: var(--mt-ink-soft); font-size: .875rem; }
.mt-curriculum__uec { margin: .875rem 0 1.25rem; }

/* Teacher story */

.mt-story__hero { padding-block: 1rem 2.5rem; }

.mt-story__intro {
    display: grid;
    justify-items: start;
    gap: .875rem;
    padding-top: 1rem;
}

.mt-story__intro h1 { margin: 0 0 .25rem; }
.mt-story__intro .mt-portrait { width: 4.5rem; height: 4.5rem; }

.mt-story__lead {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--mt-plum);
}

.mt-story__facts {
    margin: 0;
    border: 1px solid var(--mt-hair);
    border-radius: 1rem;
}

.mt-story__facts .card-body { padding: 1.25rem; }
.mt-landing .mt-story__facts h2 { font-size: 1.25rem; }
.mt-story__facts .mt-tutor__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem 1rem;
}
.mt-story__body > p {
    max-width: 43em;
}

.mt-story__body h2:not(:first-child) {
    margin-top: 2rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--mt-hair);
}

.mt-story__body h3 { margin-top: 1.25rem; font-size: 1.125rem; }

/* Class page */

.mt-class { padding-block: 1rem 3.5rem; }

.mt-back {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    min-height: 2.75rem;
    font-weight: 600;
}

.mt-class__head { padding-block: .75rem 1.75rem; }

.mt-class__tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 .75rem;
    padding: 0;
    list-style: none;
}

.mt-class__tags .mt-tag {
    padding: .1875rem .625rem;
    font-size: .875rem;
}

.mt-landing .mt-class h1 {
    margin: 0 0 1.125rem;
    font-size: clamp(1.75rem, 1.3rem + 2.2vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
}

.mt-class__code {
    display: inline-block;
    padding: 0 .5rem;
    border-radius: .5rem;
    background: var(--mt-yellow);
    white-space: nowrap;
}

.mt-class__when {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1.25rem;
}

.mt-class__when p {
    margin: 0;
    font-family: var(--mt-font-display);
    font-size: clamp(1.375rem, 1.15rem + 1.2vw, 2rem);
    line-height: 1.2;
}

.mt-class__when p span { font-weight: 600; }

.mt-class__when p strong {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mt-days {
    display: flex;
    gap: .25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mt-days li {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .375rem;
    background: var(--mt-wash-deep);
    font-size: .9375rem;
    font-weight: 600;
    color: var(--mt-ink-soft);
}

.mt-days li.is-on {
    background: var(--mt-plum);
    color: #fff;
}

.mt-class__grid {
    display: grid;
    gap: 1.75rem;
}

.mt-class__main { display: contents; }
.mt-class__main > section { order: 3; min-width: 0; }
.mt-class__main > section:first-child { order: 1; }

.mt-class__side {
    order: 2;
    display: grid;
    gap: 1rem;
}

.mt-landing .mt-class h2 {
    margin: 0 0 .75rem;
    font-size: 1.25rem;
}

.mt-landing .mt-class .mt-pending h2 {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
    font-size: 1.0625rem;
}

.mt-class .mt-pending { padding: 1rem 1.125rem; }
.mt-class .mt-pending p { margin: 0 0 .5rem; }
.mt-issue + .mt-issue { margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--mt-edge); }
.mt-unknown { margin: 0; padding-left: 1.2rem; }

.mt-facts {
    margin: 0 0 .5rem;
    border-top: 1px solid var(--mt-hair);
}

.mt-facts > div {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: .75rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--mt-hair);
}

.mt-facts dt {
    font-weight: 400;
    color: var(--mt-ink-soft);
}

.mt-facts dd {
    margin: 0;
    font-weight: 600;
}

.mt-facts dd a {
    margin-left: .5rem;
    font-weight: 400;
    white-space: nowrap;
}

.mt-facts__note {
    display: block;
    margin-top: .25rem;
    font-size: .875rem;
    font-weight: 400;
    color: var(--mt-ink-soft);
    overflow-wrap: anywhere;
}

.mt-action {
    display: grid;
    justify-items: start;
    gap: .625rem;
    padding: 1.25rem;
    border: 1px solid var(--mt-hair);
    border-radius: 1rem;
    background: #fff;
}

.mt-action:first-child {
    border-color: var(--mt-yellow);
    background: var(--mt-yellow);
}

.mt-landing .mt-action h2 { margin: 0; }
.mt-action p { margin: 0; }
.mt-action .btn { width: 100%; }
.mt-action__fine { font-size: .875rem; }

.mt-action .mt-source {
    display: grid;
    gap: .375rem;
    border-left-color: var(--mt-plum);
    color: var(--mt-plum);
}

.mt-action blockquote {
    margin: 0;
    padding: .625rem .75rem;
    border: 1px dashed var(--mt-plum);
    border-radius: .5rem;
    background: #fff;
    font-size: .9375rem;
}

.mt-action__url {
    font-size: .875rem;
    color: var(--mt-ink-soft);
    overflow-wrap: anywhere;
}

.mt-action__buttons {
    display: grid;
    gap: .5rem;
    width: 100%;
}

.mt-action__status {
    min-height: 1.5em;
    font-size: .875rem;
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .mt-class__head { padding-block-end: 1rem; }
    .mt-class__side { display: contents; }
    .mt-class__side .mt-action:not(.mt-action--enquire) { order: 2; }
    .mt-class .mt-action--enquire h2 { display: none; }
}

.mt-missing { padding-block: 3.5rem 5rem; }

.mt-landing .mt-missing h1 {
    margin: 0 0 .75rem;
    font-size: clamp(1.75rem, 1.3rem + 2.2vw, 2.75rem);
    font-weight: 800;
}

.mt-missing p {
    max-width: 34em;
    margin-bottom: 1.5rem;
    color: var(--mt-ink-soft);
}

@media (min-width: 992px) {
    .mt-class { padding-block: 1.5rem 5rem; }

    .mt-class__grid {
        grid-template-columns: minmax(0, 1fr) 22rem;
        align-items: start;
        gap: 3.5rem;
    }

    .mt-class__main {
        grid-area: 1 / 1;
        display: grid;
        gap: 2rem;
        min-width: 0;
    }

    .mt-class__side {
        grid-area: 1 / 2;
        position: sticky;
        top: calc(var(--mt-header-h) + 1rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mt-landing *,
    .mt-landing *::before,
    .mt-landing *::after {
        transition: none !important;
        animation: none !important;
    }
}
