/* MathTrail backend, on INSPINIA 5.2.0's own shell, menu, cards, buttons and tables.
   Colours are named by what they are for, never by their hue. The meaning of each name, and what it may
   sit on, is in work/colour-audit/tokens/README.md. A rule below uses a name; only the two blocks of
   values here hold colours.
   Solid shapes are confirmed timetable facts. Dashed shapes still wait for the team's check,
   the same convention the admissions preview uses. */

/* Values: the Futuristic palette (MT-012). The sign-in, family and share pages always use these. */
:root,
[data-bs-theme="light"] {
    --mt-text: .9375rem;          /* running text; the staff shell sets a smaller one below */
    --mt-font: "TikTok Sans", "PingFang SC", "Noto Sans CJK SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;

    /* Foundations */
    --mt-canvas: #f6f2fb;
    --mt-surface: #fff;
    --mt-sunken: #f6f2fb;
    --mt-hover: #f6f2fb;
    --mt-ink: #11052c;
    --mt-ink-rgb: 17, 5, 44;
    --mt-ink-soft: #564e6b;
    --mt-border: #dcd7e4;
    --mt-border-strong: #7c768b;
    /* Menu */
    --mt-nav-bg: #11052c;
    --mt-nav-border: #11052c;
    --mt-nav-title: #fff;
    --mt-nav-ink: #cfc6e6;
    --mt-nav-ink-soft: #9d92ba;
    --mt-nav-hover-bg: rgba(255, 255, 255, .07);
    --mt-nav-hover-ink: #fff;
    --mt-nav-current-bg: rgba(255, 228, 89, .1);
    --mt-nav-current-ink: #ffe459;
    --mt-nav-mark: #ffe459;
    --mt-nav-focus: #ffe459;
    --mt-nav-count-bg: rgba(255, 255, 255, .12);
    --mt-nav-count-ink: #fff;
    /* The inverse surface: the day panel, the sign-in side, today's column */
    --mt-panel: #11052c;
    --mt-on-panel: #fff;
    --mt-on-panel-soft: #cfc6e6;
    --mt-on-panel-accent: #ffe459;
    --mt-mine-edge: #7d4bc4;
    /* Things to press */
    --mt-accent: #3d087b;
    --mt-accent-rgb: 61, 8, 123;
    --mt-accent-hover: #2a0558;
    --mt-accent-wash: #ebe3f6;
    --mt-accent-ink: #2a0558;
    --mt-link: #3d087b;
    --mt-link-rgb: 61, 8, 123;
    --mt-link-hover: #2a0558;
    --mt-focus: #3d087b;
    --mt-selected-bg: #11052c;
    --mt-selected-ink: #fff;
    --mt-button-hover-bg: #ebe3f6;
    /* States */
    --mt-done: #3d087b;
    --mt-on-done: #fff;
    --mt-done-ink: #564e6b;
    --mt-now: #ffe459;
    --mt-now-ink: #11052c;
    --mt-now-wash: #fff6c2;
    --mt-wait: #ffe459;
    --mt-wait-wash: #fff6c2;
    --mt-wait-ink: #11052c;
    --mt-late: #ffe459;
    --mt-on-late: #11052c;
    --mt-alert: #b3124f;
    --mt-alert-solid: #b3124f;
    --mt-on-alert: #fff;
    --mt-alert-wash: #fde0eb;
    --mt-attention: #f43b86;
    --mt-on-attention: #11052c;
    --mt-info: #3d087b;
    --mt-leave-ink: #11052c;
    --mt-leave-wash: #ebe3f6;
    --mt-note-wash: #fff6c2;
    --mt-tag-bg: #fff6c2;
    --mt-tag-ink: #11052c;
    --mt-avatar: #ffe459;
    --mt-on-avatar: #11052c;

    /* The old names, kept so that work in progress elsewhere still resolves. Do not use them in new rules. */
    --mt-plum: var(--mt-ink);
    --mt-purple: var(--mt-accent);
    --mt-purple-deep: var(--mt-accent-hover);
    --mt-yellow: var(--mt-now);
    --mt-pink: var(--mt-attention);
    --mt-pink-deep: var(--mt-alert);
    --mt-edge: var(--mt-border-strong);
    --mt-hair: var(--mt-border);
    --mt-wash: var(--mt-sunken);
    --mt-wash-deep: var(--mt-accent-wash);
    --mt-pink-wash: var(--mt-alert-wash);
    --mt-yellow-wash: var(--mt-note-wash);
    --mt-on-plum: var(--mt-on-panel-soft);

    --theme-primary: var(--mt-accent);
    --theme-primary-rgb: var(--mt-accent-rgb);
    --theme-body-color: var(--mt-ink);
    --theme-body-color-rgb: var(--mt-ink-rgb);
    --theme-body-bg: var(--mt-canvas);
    --theme-body-font-size: .9375rem;
    --theme-secondary-color: var(--mt-ink-soft);
    --theme-border-color: var(--mt-border);
    --theme-link-color: var(--mt-link);
    --theme-link-color-rgb: var(--mt-link-rgb);
    --theme-link-hover-color: var(--mt-link-hover);
    --theme-font-sans-serif: var(--mt-font);
    --theme-heading-color: var(--mt-ink);
}

/* Values: "Ink and one accent", for the staff pages only. A neutral page and a light menu; brand purple is
   the one accent; green, amber, red and blue are states and nothing else. The staff shell turns it on
   with data-mt-colours="ink" on <html>, from the MATHTRAIL_STAFF_COLOURS setting. Every name above is
   set again here, so the two sets can never drift apart by one forgotten name. */
html[data-mt-colours="ink"] {
    /* Foundations */
    --mt-canvas: #f4f4f6;
    --mt-surface: #fff;
    --mt-sunken: #eeeef1;
    --mt-hover: #f3f3f6;
    --mt-ink: #18181b;
    --mt-ink-rgb: 24, 24, 27;
    --mt-ink-soft: #52525b;
    --mt-border: #e4e4e7;
    --mt-border-strong: #85858f;
    /* Menu */
    --mt-nav-bg: #fbfbfc;
    --mt-nav-border: #e4e4e7;
    --mt-nav-title: #18181b;
    --mt-nav-ink: #3f3f46;
    --mt-nav-ink-soft: #6c6c75;
    --mt-nav-hover-bg: #f0f0f3;
    --mt-nav-hover-ink: #18181b;
    --mt-nav-current-bg: #ede9fb;
    --mt-nav-current-ink: #4c1d95;
    --mt-nav-mark: #5b21b6;
    --mt-nav-focus: #5b21b6;
    --mt-nav-count-bg: #e4e4e7;
    --mt-nav-count-ink: #3f3f46;
    /* The inverse surface */
    --mt-panel: #27104d;
    --mt-on-panel: #fff;
    --mt-on-panel-soft: #d6cbee;
    --mt-on-panel-accent: #ffe459;
    --mt-mine-edge: #8b5cf6;
    /* Things to press */
    --mt-accent: #5b21b6;
    --mt-accent-rgb: 91, 33, 182;
    --mt-accent-hover: #4c1d95;
    --mt-accent-wash: #ede9fb;
    --mt-accent-ink: #4c1d95;
    --mt-link: #6d28d9;
    --mt-link-rgb: 109, 40, 217;
    --mt-link-hover: #4c1d95;
    --mt-focus: #5b21b6;
    --mt-selected-bg: #18181b;
    --mt-selected-ink: #fff;
    --mt-button-hover-bg: #f3f3f6;
    /* States */
    --mt-done: #166534;
    --mt-on-done: #fff;
    --mt-done-ink: #166534;
    --mt-now: #ffe459;
    --mt-now-ink: #18181b;
    --mt-now-wash: #fef3c7;
    --mt-wait: #f59e0b;
    --mt-wait-wash: #fef3c7;
    --mt-wait-ink: #92400e;
    --mt-late: #f59e0b;
    --mt-on-late: #18181b;
    --mt-alert: #b91c1c;
    --mt-alert-solid: #f26464;
    --mt-on-alert: #18181b;
    --mt-alert-wash: #fee2e2;
    --mt-attention: #dc2626;
    --mt-on-attention: #fff;
    --mt-info: #1d4ed8;
    --mt-leave-ink: #1d4ed8;
    --mt-leave-wash: #dbeafe;
    --mt-note-wash: #fef3c7;
    --mt-tag-bg: #eeeef1;
    --mt-tag-ink: #52525b;
    --mt-avatar: #ede9fb;
    --mt-on-avatar: #4c1d95;
}
/* A light menu needs the line the dark one got from its own colour. */
html[data-mt-colours="ink"] .mt-app .sidenav-menu { box-shadow: inset -1px 0 0 var(--mt-nav-border); }

html[data-menu-color="dark"] {
    --theme-sidenav-bg: var(--mt-nav-bg);
    --theme-sidenav-border-color: var(--mt-nav-border);
    --theme-sidenav-item-color: var(--mt-nav-ink);
    --theme-sidenav-item-hover-color: var(--mt-nav-hover-ink);
    --theme-sidenav-item-hover-bg: var(--mt-nav-hover-bg);
    --theme-sidenav-item-active-color: var(--mt-nav-current-ink);
    --theme-sidenav-item-active-bg: var(--mt-nav-current-bg);
    --theme-sidenav-item-font-size: .875rem;
    --theme-sidenav-item-padding-y: 7px;
}

html[data-topbar-color="light"] {
    --theme-topbar-height: 3rem;
    --theme-topbar-bg: var(--mt-surface);
    --theme-topbar-item-color: var(--mt-ink-soft);
    --theme-topbar-item-hover-color: var(--mt-accent);
    --theme-topbar-search-border: var(--mt-border);
}

.mt-app {
    font-family: var(--mt-font);
    color: var(--mt-ink);
    line-break: strict;
}

.mt-app h1,
.mt-app h2 { font-family: var(--mt-font); letter-spacing: 0; }

.mt-num { font-variant-numeric: tabular-nums; }

/* INSPINIA removes focus outlines; anything a keyboard can reach gets one back. */
.mt-app :focus-visible {
    outline: 3px solid var(--mt-focus) !important;
    outline-offset: 2px;
}
.mt-app .sidenav-menu :focus-visible { outline-color: var(--mt-nav-focus) !important; }
.mt-app .mt-day :focus-visible { outline-color: var(--mt-on-panel-accent) !important; }

/* Buttons take the palette: deep purple with white text is the main action. */
.mt-app .btn-primary {
    --theme-btn-bg: var(--mt-accent);
    --theme-btn-border-color: var(--mt-accent);
    --theme-btn-hover-bg: var(--mt-accent-hover);
    --theme-btn-hover-border-color: var(--mt-accent-hover);
    --theme-btn-active-bg: var(--mt-accent-hover);
    --theme-btn-active-border-color: var(--mt-accent-hover);
    --theme-btn-focus-shadow-rgb: var(--mt-accent-rgb);
}
.mt-app .btn-light {
    --theme-btn-color: var(--mt-ink);
    --theme-btn-bg: var(--mt-surface);
    --theme-btn-border-color: var(--mt-border-strong);
    --theme-btn-hover-color: var(--mt-ink);
    --theme-btn-hover-bg: var(--mt-button-hover-bg);
    --theme-btn-hover-border-color: var(--mt-ink);
}
.mt-app .btn { font-weight: 600; white-space: nowrap; }
.mt-app .btn-sm { --theme-btn-font-size: .875rem; --theme-btn-padding-x: .75rem; }
.mt-plain { color: var(--mt-link); padding-inline: .25rem; }

/* Menu */
.mt-wordmark {
    display: flex !important;
    align-items: center;
    height: var(--theme-topbar-height);
    padding-inline: 1.5rem;
    color: var(--mt-nav-title) !important;
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -.01em;
    text-decoration: none;
}
.mt-wordmark .logo-sm { font-size: 1.125rem; }
html[data-sidenav-size="condensed"] .mt-wordmark { justify-content: center; padding-inline: 0; }

.mt-app .side-nav-title {
    letter-spacing: 0;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--mt-nav-ink-soft);
}
.mt-app .side-nav .side-nav-item .side-nav-link.active {
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--mt-nav-mark);
}
.mt-count {
    margin-inline-start: auto;
    min-width: 1.6rem;
    padding: .05rem .4rem;
    border-radius: 999px;
    background: var(--mt-nav-count-bg);
    color: var(--mt-nav-count-ink);
    font-size: .8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.mt-count--alert { background: var(--mt-attention); color: var(--mt-on-attention); }
html[data-sidenav-size="condensed"] .sidenav-menu:not(:hover) .mt-count { display: none; }

/* Top bar */
.mt-app .topbar-menu { min-height: var(--theme-topbar-height); align-items: center; border-bottom: 1px solid var(--mt-border); }
.mt-term {
    padding: .3rem .75rem;
    border: 1px solid var(--mt-border);
    border-radius: 999px;
    color: var(--mt-ink-soft);
    font-size: .875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}


/* Page */
.mt-main { padding-top: 1.25rem; max-width: 1320px; margin-inline: 0; }

/* The day panel: the one loud element on the page. */
.mt-day {
    border-radius: 1rem;
    padding: 1.5rem 1.5rem 1.25rem;
    background: var(--mt-panel);
    color: var(--mt-on-panel);
}
.mt-day__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
}
.mt-day__date { margin: 0 0 .35rem; color: var(--mt-on-panel-soft); font-size: var(--mt-text); }
.mt-day__next {
    margin: 0;
    color: var(--mt-on-panel);
    font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
}
.mt-day__next .mt-num { color: var(--mt-on-panel-accent); }
.mt-day__what { margin: .5rem 0 0; color: var(--mt-on-panel-soft); font-size: 1rem; }
.mt-day__actions { display: flex; flex-wrap: wrap; gap: .6rem; }

.mt-btn-yellow {
    --theme-btn-color: var(--mt-now-ink);
    --theme-btn-bg: var(--mt-now);
    --theme-btn-border-color: var(--mt-now);
    --theme-btn-hover-color: var(--mt-now-ink);
    --theme-btn-hover-bg: var(--mt-on-panel);
    --theme-btn-hover-border-color: var(--mt-on-panel);
    --theme-btn-active-color: var(--mt-now-ink);
    --theme-btn-active-bg: var(--mt-on-panel);
    --theme-btn-padding-y: .6rem;
    --theme-btn-padding-x: 1.1rem;
    --theme-btn-font-size: 1rem;
}
.mt-btn-ghost {
    --theme-btn-color: var(--mt-on-panel);
    --theme-btn-bg: transparent;
    --theme-btn-border-color: color-mix(in srgb, var(--mt-on-panel) 55%, transparent);
    --theme-btn-hover-color: var(--mt-on-panel);
    --theme-btn-hover-bg: color-mix(in srgb, var(--mt-on-panel) 10%, transparent);
    --theme-btn-hover-border-color: var(--mt-on-panel);
    --theme-btn-active-color: var(--mt-on-panel);
    --theme-btn-padding-y: .6rem;
    --theme-btn-padding-x: 1.1rem;
    --theme-btn-font-size: 1rem;
}

/* Time ruler: every block sits at its real start and end. */
.mt-ruler-scroll { margin-top: 1.5rem; overflow-x: auto; padding-bottom: .25rem; }
.mt-ruler {
    --who: 5.5rem;
    --lane: 2.75rem;
    position: relative;
    min-width: 38rem;
    padding-bottom: 1.6rem;       /* room for the "now" label */
}
.mt-ruler__hours {
    position: relative;
    height: 1.5rem;
    margin-inline-start: var(--who);
    color: var(--mt-on-panel-soft);
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
}
.mt-ruler__hours span {
    position: absolute;
    left: calc((var(--at) - var(--from)) / var(--span) * 100%);
    transform: translateX(-50%);
}
.mt-ruler__hours span:first-child { transform: none; }
.mt-ruler__hours span:last-child { transform: translateX(-100%); }

.mt-row {
    display: flex;
    align-items: stretch;
    border-top: 1px solid color-mix(in srgb, var(--mt-on-panel) 14%, transparent);
}
.mt-row__who {
    flex: 0 0 var(--who);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: .5rem .75rem .5rem 0;
    line-height: 1.25;
    /* stays put while the ruler scrolls sideways on a phone */
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--mt-panel);
}
.mt-row__who strong { font-size: var(--mt-text); font-weight: 700; }
.mt-row__who span { color: var(--mt-on-panel-soft); font-size: .8125rem; }
.mt-row__track {
    position: relative;
    flex: 1;
    height: calc(var(--lanes, 1) * (var(--lane) + .35rem) + .65rem);
    /* one faint line per hour */
    background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--mt-on-panel) 10%, transparent) 0 1px, transparent 1px calc(100% / 9));
}
.mt-row--me .mt-row__who strong { color: var(--mt-on-panel-accent); }

.mt-slot {
    position: absolute;
    top: calc(.5rem + var(--row, 0) * (var(--lane) + .35rem));
    left: calc((var(--s) - var(--from)) / var(--span) * 100% + 2px);
    width: calc((var(--e) - var(--s)) / var(--span) * 100% - 4px);
    height: var(--lane);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 .55rem;
    z-index: 1;
    border: 1px solid color-mix(in srgb, var(--mt-on-panel) 40%, transparent);
    border-radius: .5rem;
    background: color-mix(in srgb, var(--mt-panel) 78%, transparent);
    color: var(--mt-on-panel);
    line-height: 1.2;
    text-decoration: none;
    overflow: hidden;
}
.mt-slot b { font-size: var(--mt-text); font-weight: 700; white-space: nowrap; }
.mt-slot span { color: var(--mt-on-panel-soft); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mt-slot.is-mine { background: var(--mt-accent); border-color: var(--mt-mine-edge); }
.mt-slot.is-next,
.mt-slot.is-live { background: var(--mt-now); border-color: var(--mt-now); color: var(--mt-now-ink); }
.mt-slot.is-next span,
.mt-slot.is-live span { color: var(--mt-now-ink); }
.mt-slot.is-live { box-shadow: 0 0 0 3px color-mix(in srgb, var(--mt-now) 35%, transparent); }
.mt-slot.is-done { border-color: color-mix(in srgb, var(--mt-on-panel) 22%, transparent); color: var(--mt-on-panel-soft); }
.mt-slot.is-done b { font-weight: 600; }
.mt-slot.is-flag { border: 1.5px dashed var(--mt-attention); }

.mt-clash {
    position: absolute;
    top: .25rem;
    bottom: .25rem;
    left: calc((var(--s) - var(--from)) / var(--span) * 100%);
    width: calc((var(--e) - var(--s)) / var(--span) * 100%);
    border-inline: 2px solid var(--mt-attention);
    background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--mt-attention) 55%, transparent) 0 2px, color-mix(in srgb, var(--mt-attention) 18%, transparent) 2px 7px);
    pointer-events: none;
}

.mt-now {
    position: absolute;
    top: 1.5rem;
    bottom: 1.6rem;
    left: calc(var(--who) + (100% - var(--who)) * (var(--at) - var(--from)) / var(--span));
    width: 2px;
    background: var(--mt-now);
    pointer-events: none;
}
.mt-now span {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: .05rem .45rem;
    border-radius: .3rem;
    background: var(--mt-now);
    color: var(--mt-now-ink);
    font-size: .75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mt-day__alert {
    margin: .5rem 0 0;
    padding-top: .9rem;
    border-top: 1px solid color-mix(in srgb, var(--mt-on-panel) 14%, transparent);
    font-size: var(--mt-text);
}
.mt-day__alert i { margin-inline-end: .45rem; color: var(--mt-attention); font-size: 1.15rem; vertical-align: -.15em; }
.mt-day__alert a { margin-inline-start: .5rem; color: var(--mt-on-panel-accent); font-weight: 600; text-underline-offset: .2em; white-space: nowrap; }
.mt-day__alert a:hover { color: var(--mt-on-panel); }

/* Quiet white surfaces for everything else. */
.mt-app .mt-card {
    margin: 0;
    border: 1px solid var(--mt-border);
    border-radius: .75rem;
    box-shadow: none;
    background: var(--mt-surface);
}
.mt-card__head {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1rem 1.25rem .75rem;
}
.mt-card__head h2 { margin: 0; font-size: 1.125rem; font-weight: 700; }
.mt-card__link { margin-inline-start: auto; font-size: var(--mt-text); font-weight: 600; text-underline-offset: .2em; }
.mt-card__foot { margin: auto 0 0; padding: .75rem 1.25rem 1rem; color: var(--mt-ink-soft); font-size: .8125rem; }
.mt-card__foot .mt-sample { margin-inline-end: .5rem; }

/* Marks invented figures, in the same dashed language as "waiting for a check". */
.mt-sample {
    padding: .05rem .45rem;
    border: 1px dashed var(--mt-border-strong);
    border-radius: .3rem;
    color: var(--mt-ink-soft);
    font-size: .75rem;
    white-space: nowrap;
}

.mt-code {
    display: inline-block;
    min-width: 2.4rem;
    margin-inline-end: .5rem;
    padding: .05rem .35rem;
    border-radius: .3rem;
    background: var(--mt-accent-wash);
    color: var(--mt-accent-ink);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.mt-lessons { list-style: none; margin: 0; padding: 0 0 .5rem; }
.mt-lessons li {
    display: grid;
    grid-template-columns: 7.25rem minmax(0, 1fr) auto auto;
    align-items: center;
    gap: .25rem 1rem;
    padding: .7rem 1.25rem;
    border-top: 1px solid var(--mt-border);
}
.mt-lessons__time { font-weight: 700; }
.mt-lessons__meta { color: var(--mt-ink-soft); white-space: nowrap; }
.mt-lessons__state { min-width: 6rem; text-align: end; color: var(--mt-ink-soft); white-space: nowrap; }
.mt-lessons__state i { margin-inline-end: .25rem; }
.mt-lessons li.is-done .mt-lessons__time,
.mt-lessons li.is-done .mt-lessons__class { color: var(--mt-ink-soft); font-weight: 400; }
.mt-lessons li.is-done .mt-code { background: transparent; color: var(--mt-ink-soft); box-shadow: inset 0 0 0 1px var(--mt-border); }
.mt-lessons li.is-next,
.mt-lessons li.is-live { background: var(--mt-now-wash); box-shadow: inset 4px 0 0 var(--mt-now); }
.mt-lessons li.is-next .mt-code,
.mt-lessons li.is-live .mt-code { background: var(--mt-panel); color: var(--mt-on-panel-accent); }
.mt-lessons li.is-next .mt-lessons__state,
.mt-lessons li.is-live .mt-lessons__state { color: var(--mt-ink); font-weight: 700; }

.mt-week {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .4rem;
    margin: 0;
    padding: .25rem 1.25rem 1.25rem;
}
.mt-week li {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: .5rem .3rem .6rem;
    border: 1px solid var(--mt-border);
    border-radius: .5rem;
    text-align: center;
}
.mt-week__day { font-weight: 700; }
.mt-week__codes { display: flex; flex-direction: column; gap: .25rem; align-items: center; }
.mt-week__codes b {
    width: 100%;
    max-width: 3rem;
    border-radius: .3rem;
    background: var(--mt-accent-wash);
    color: var(--mt-accent-ink);
    font-size: .8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.6;
}
.mt-week__codes b.is-flag { background: transparent; box-shadow: inset 0 0 0 1.5px var(--mt-attention); color: var(--mt-alert); }
.mt-week__codes i { color: var(--mt-ink-soft); font-size: .8125rem; font-style: normal; }
.mt-week li.is-today { border-color: var(--mt-panel); background: var(--mt-panel); color: var(--mt-on-panel); }
.mt-week li.is-today .mt-week__codes b { background: var(--mt-now); color: var(--mt-now-ink); }
.mt-week li.is-empty { border-style: dashed; }

.mt-todo { list-style: none; margin: 0; padding: 0; }
.mt-todo li {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1.25rem;
    border-top: 1px solid var(--mt-border);
}
.mt-todo__n { font-size: 1.75rem; font-weight: 800; line-height: 1; color: var(--mt-accent); }
.mt-todo__text b { display: block; font-weight: 700; }
.mt-todo__text span { display: block; color: var(--mt-ink-soft); font-size: .875rem; }

.mt-app .mt-table { --theme-table-bg: transparent; margin: 0; }
.mt-table thead th {
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--mt-border);
    background: var(--mt-sunken);
    color: var(--mt-ink-soft);
    font-size: .8125rem;
    font-weight: 600;
    white-space: nowrap;
}
.mt-table tbody th,
.mt-table tbody td { padding: .7rem .75rem; border-color: var(--mt-border); white-space: nowrap; }
.mt-table tr > :first-child { padding-inline-start: 1.25rem; }
.mt-table tr > :last-child { padding-inline-end: 1.25rem; }
.mt-table tbody tr:last-child > * { border-bottom: 0; }
.mt-table tbody th { font-weight: 700; }
.mt-table tbody th span { display: block; color: var(--mt-ink-soft); font-size: .8125rem; font-weight: 400; }
.mt-table td small { display: block; margin-top: .15rem; color: var(--mt-ink-soft); font-size: .8125rem; }
.mt-soft { color: var(--mt-ink-soft); }

.mt-state {
    display: inline-block;
    padding: .1rem .55rem;
    border-radius: 999px;
    font-size: .875rem;
    font-weight: 600;
}
.mt-state--alert { background: var(--mt-alert-wash); color: var(--mt-alert); }
.mt-state--open { box-shadow: inset 0 0 0 1px var(--mt-info); color: var(--mt-info); }
.mt-state--wait { background: var(--mt-wait-wash); color: var(--mt-wait-ink); }
.mt-state--done { padding-inline: 0; color: var(--mt-done-ink); }

/* ---- Shell pieces the mockup did not need ---- */

.mt-skip { position: absolute; top: .5rem; left: .5rem; z-index: 2000; padding: .4rem .75rem; border-radius: .4rem; background: var(--mt-surface); }

/* INSPINIA keeps the page 1900px tall beside a narrow menu; the content decides instead. */
.mt-app .content-page { min-height: calc(100vh - var(--theme-topbar-height)) !important; padding-bottom: 2.5rem; }
.mt-app .sidenav-menu .scrollbar { overflow-y: auto; height: calc(100% - var(--theme-topbar-height)); }

/* The phone menu slides in over the page when the menu button adds .sidebar-enable. */
html[data-sidenav-size="offcanvas"].sidebar-enable .sidenav-menu {
    margin-inline-start: 0;
    opacity: 1;
    z-index: 1055;
}

.mt-user { position: relative; }
.mt-user summary {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .25rem;
    border-radius: 999px;
    cursor: pointer;
    list-style: none;
}
.mt-user summary::-webkit-details-marker { display: none; }
.mt-user__mark {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--mt-avatar);
    color: var(--mt-on-avatar);
    font-weight: 700;
}
.mt-user__name { display: block; font-weight: 700; line-height: 1.2; }
.mt-user__roles { display: block; color: var(--mt-ink-soft); font-size: .8125rem; line-height: 1.3; }
.mt-user__menu {
    position: absolute;
    right: 0;
    top: calc(100% + .4rem);
    z-index: 1010;
    width: 15rem;
    padding: 1rem;
    border: 1px solid var(--mt-border);
    border-radius: .75rem;
    background: var(--mt-surface);
    box-shadow: 0 12px 32px color-mix(in srgb, var(--mt-ink) 16%, transparent);
}
.mt-user__menu p { margin: 0 0 .15rem; }
.mt-user__menu strong { display: block; }
.mt-user__contact { margin-bottom: .85rem !important; color: var(--mt-ink-soft); font-size: .875rem; overflow-wrap: anywhere; }

.mt-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .75rem 1.5rem;
    margin-bottom: 1.1rem;
}
/* Whatever follows the title block packs to the right, however many pieces a page puts there. */
.mt-page-head > :first-child { margin-inline-end: auto; }
.mt-page-head h1 { margin: 0; font-size: 1.75rem; font-weight: 800; line-height: 1.2; }
.mt-page-head p { margin: .35rem 0 0; max-width: 46rem; color: var(--mt-ink-soft); }
.mt-page-head a:not(.btn) { font-weight: 600; text-underline-offset: .2em; }
.mt-back { margin: 0 0 .35rem !important; font-size: var(--mt-text); }
.mt-back i { margin-inline-end: .25rem; }

.mt-flashes { display: grid; gap: .5rem; margin-bottom: 1rem; }
.mt-flash {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin: 0;
    padding: .7rem .9rem;
    border-radius: .6rem;
    background: var(--mt-accent-wash);
    font-weight: 600;
}
.mt-flash i { margin-top: .2rem; font-size: 1.1rem; color: var(--mt-accent); }
.mt-flash--warn { background: var(--mt-alert-wash); }
.mt-flash--warn i { color: var(--mt-alert); }
.mt-flash a { margin-inline: .15rem; }
.mt-main > .mt-flash { margin-bottom: 1rem; }

.mt-preview {
    margin: 0 0 .75rem;
    padding: .55rem .9rem;
    border: 1px dashed var(--mt-border-strong);
    border-radius: .6rem;
    color: var(--mt-ink-soft);
}
.mt-preview i { margin-inline-end: .4rem; vertical-align: -.1em; }
.mt-preview a { margin-inline-start: .4rem; font-weight: 600; white-space: nowrap; }

.mt-empty { margin: 0; padding: 1rem 1.25rem 1.25rem; color: var(--mt-ink-soft); }
.mt-empty--box { border: 1px dashed var(--mt-border-strong); border-radius: .75rem; }
.mt-sub { display: block; color: var(--mt-ink-soft); font-size: .8125rem; font-weight: 400; }
.mt-state + .mt-state { margin-inline-start: .3rem; }
.mt-table td .mt-state { margin-block: .1rem; }
.mt-table caption { caption-side: top; }
/* Labels for screen readers inside a wide table are positioned absolutely. Unless the scroller is
   their containing block they count toward the page's width, a phone lays the page out wider than
   its screen, and the menu script then takes the phone for a tablet. */
.mt-app .table-responsive { position: relative; }
/* The scroller takes the card's corners, so a header band does not poke out of them. */
.mt-card > .table-responsive:first-child { border-top-left-radius: calc(.75rem - 1px); border-top-right-radius: calc(.75rem - 1px); }
.mt-card > .table-responsive:last-child { border-bottom-left-radius: calc(.75rem - 1px); border-bottom-right-radius: calc(.75rem - 1px); }

.mt-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .6rem 1rem;
    margin-bottom: 1rem;
}
.mt-filters label { display: grid; gap: .2rem; color: var(--mt-ink-soft); font-size: .8125rem; font-weight: 600; }
.mt-filters select { min-width: 8.5rem; border-color: var(--mt-border-strong); color: var(--mt-ink); }
.mt-filters__check { display: flex !important; align-items: center; gap: .4rem !important; padding-bottom: .35rem; color: var(--mt-ink) !important; font-size: var(--mt-text) !important; }
.mt-filters__check input { margin: 0; border-color: var(--mt-border-strong); }
.mt-filters__clear { padding-bottom: .35rem; font-weight: 600; }

.mt-plainlist,
.mt-history,
.mt-approvals { list-style: none; margin: 0; padding: 0; }
.mt-plainlist li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    padding: .65rem 1.25rem;
    border-top: 1px solid var(--mt-border);
}

/* Forms */
.mt-form { max-width: 46rem; padding: 1.25rem; }
.mt-form fieldset { margin: 0 0 1.25rem; padding: 0; border: 0; }
.mt-form legend,
.mt-approvals legend { float: none; width: auto; margin: 0 0 .6rem; padding: 0; font-size: 1rem; font-weight: 700; }
.mt-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.mt-form__row--three { grid-template-columns: 1.2fr 1fr 1fr; }
.mt-field { margin-bottom: .9rem; }
.mt-app .form-label { margin-bottom: .3rem; color: var(--mt-ink); font-size: var(--mt-text); font-weight: 600; }
.mt-optional { margin-inline-start: .4rem; color: var(--mt-ink-soft); font-size: .8125rem; font-weight: 400; }
.mt-app .form-control,
.mt-app .form-select { border-color: var(--mt-border-strong); color: var(--mt-ink); font-size: 1rem; }
.mt-app .form-control:focus,
.mt-app .form-select:focus { border-color: var(--mt-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mt-focus) 18%, transparent); }
.mt-app .form-check-input { border-color: var(--mt-border-strong); }
.mt-app .form-check-input:checked { background-color: var(--mt-accent); border-color: var(--mt-accent); }
.mt-field.has-error .form-control,
.mt-field.has-error .form-select { border-color: var(--mt-alert); }
.mt-help { margin: .3rem 0 0; color: var(--mt-ink-soft); font-size: .875rem; }
.mt-error { display: flex; gap: .35rem; margin: .3rem 0 0; color: var(--mt-alert); font-size: var(--mt-text); font-weight: 600; }
.mt-error i { margin-top: .15rem; }
.mt-error--top { margin: 0 0 1rem; padding: .6rem .8rem; border-radius: .5rem; background: var(--mt-alert-wash); }
.mt-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.mt-form__actions--card { padding: .25rem 1.25rem 1.25rem; }
.mt-danger {
    max-width: 46rem;
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border: 1px dashed var(--mt-border-strong);
    border-radius: .75rem;
}
.mt-danger p { margin: 0 0 .75rem; color: var(--mt-ink-soft); }

/* Publishing */
.mt-changes { margin: 0; padding: .25rem 1.25rem 1rem 2.6rem; }
.mt-changes li { padding-block: .2rem; }
.mt-history li { border-top: 1px solid var(--mt-border); }
.mt-history summary {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
    padding: .75rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
}

/* Approvals */
.mt-approvals li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem 1.5rem;
    align-items: center;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--mt-border);
}
.mt-approvals__who { display: grid; gap: .1rem; }
.mt-approvals__who strong { font-size: 1.0625rem; }
.mt-approvals__note { margin-top: .25rem; padding: .25rem .5rem; border-radius: .35rem; background: var(--mt-sunken); justify-self: start; }
.mt-approvals__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1.25rem; }
.mt-approvals fieldset { display: flex; align-items: center; gap: .9rem; margin: 0; padding: 0; border: 0; }
.mt-approvals legend { margin: 0; font-size: .8125rem; font-weight: 600; color: var(--mt-ink-soft); }
.mt-approvals .form-check { display: inline-flex; align-items: center; gap: .35rem; margin: 0; padding: 0; font-weight: 600; }
.mt-approvals .form-check input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--mt-accent); }
.mt-approvals__tutor { display: grid; gap: .2rem; color: var(--mt-ink-soft); font-size: .8125rem; font-weight: 600; }
.mt-approvals__tutor select { min-width: 9rem; }
.mt-approvals__buttons { display: flex; gap: .5rem; }
.mt-rowactions { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }

/* Weekly timetable */
.mt-weekgrid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .6rem;
    margin: 0;
    padding: 0;
}
.mt-weekgrid > li { padding: .75rem; border: 1px solid var(--mt-border); border-radius: .75rem; background: var(--mt-surface); }
.mt-weekgrid > li.is-empty { border-style: dashed; background: transparent; }
.mt-weekgrid h2 { margin: 0 0 .6rem; font-size: 1rem; font-weight: 700; }
.mt-weekgrid p { margin: 0; }
.mt-weekgrid__slot {
    display: grid;
    gap: .05rem;
    margin-top: .5rem;
    padding: .5rem .6rem;
    border-radius: .5rem;
    background: var(--mt-accent-wash);
    line-height: 1.35;
}
.mt-weekgrid__slot b { font-size: 1.0625rem; }
.mt-weekgrid__slot .mt-num { font-weight: 700; font-size: .875rem; }
.mt-weekgrid__slot span:not(.mt-num) { font-size: .875rem; }
.mt-weekgrid__slot.is-flag { background: transparent; box-shadow: inset 0 0 0 1.5px var(--mt-attention); }
a.mt-weekgrid__slot { color: inherit; text-decoration: none; }
a.mt-weekgrid__slot:hover { box-shadow: inset 0 0 0 1.5px var(--mt-accent); }
a.mt-weekgrid__slot.is-flag:hover { box-shadow: inset 0 0 0 2px var(--mt-alert); }

/* Registrations */
.mt-page-head__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.mt-h1-sub { color: var(--mt-ink-soft); font-size: 1.125rem; font-weight: 600; }
.mt-code--big { font-size: 1.25rem; vertical-align: .12em; }
.mt-bulk {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    margin-bottom: 1rem;
    padding: .7rem .9rem;
    border-radius: .6rem;
    background: var(--mt-accent-wash);
}
.mt-issue { display: block; margin-top: .25rem; color: var(--mt-ink-soft); font-size: .8125rem; white-space: normal; max-width: 22rem; }
.mt-issue--block { color: var(--mt-alert); font-weight: 600; }
.mt-state--off { padding-inline: 0; color: var(--mt-ink-soft); text-decoration: line-through; }
.mt-filters input[type="search"] { min-width: 10rem; border-color: var(--mt-border-strong); color: var(--mt-ink); }
.mt-form--wide { max-width: none; }
.mt-help--top { margin: 0 0 .9rem; }
.mt-checklist { list-style: none; margin: 0; padding: 0 0 .5rem; }
.mt-checklist li { display: flex; gap: .55rem; padding: .6rem 1.25rem; border-top: 1px solid var(--mt-border); }
.mt-checklist i { margin-top: .2rem; font-size: 1.1rem; color: var(--mt-ink-soft); }
.mt-checklist li.is-block { font-weight: 600; }
.mt-checklist li.is-block i { color: var(--mt-alert); }
.mt-checklist small { display: block; color: var(--mt-ink-soft); font-size: .8125rem; font-weight: 400; }
.mt-facts { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .45rem 1rem; margin: 0; padding: .25rem 1.25rem 1.1rem; }
.mt-facts dt { color: var(--mt-ink-soft); font-weight: 400; }
.mt-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.mt-facts small { display: block; color: var(--mt-ink-soft); font-size: .8125rem; font-weight: 400; }
.mt-card__foot + .mt-card__foot { padding-top: 0; }
.mt-log { list-style: none; margin: 0; padding: 0 0 .5rem; }
.mt-log li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: .25rem .75rem; padding: .5rem 1.25rem; border-top: 1px solid var(--mt-border); font-size: var(--mt-text); }
.mt-log .mt-num { color: var(--mt-ink-soft); }

/* Lessons */
.mt-inline { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem 1rem; padding: 0 1.25rem 1rem; }
.mt-inline .mt-field { flex: 1 1 18rem; margin: 0; }
.mt-inline .btn { margin-top: 1.75rem; }
.mt-wrap { white-space: normal !important; min-width: 12rem; max-width: 28rem; }
.mt-table tr.is-next > * { background: var(--mt-now-wash); }
.mt-table tr.is-next > :first-child { box-shadow: inset 4px 0 0 var(--mt-now); }
.mt-help--pad { margin: 0; padding: 0 1.25rem .9rem; }
.mt-form--bare { max-width: none; padding: 0 1.25rem 1.1rem; }
.mt-form--ruled { margin-top: .25rem; padding-top: 1rem; border-top: 1px solid var(--mt-border); }
.mt-form--ruled h3 { margin: 0 0 .75rem; font-size: 1rem; font-weight: 700; }
.mt-materials { list-style: none; margin: 0; padding: 0 0 .5rem; }
.mt-materials li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1.25rem;
    border-top: 1px solid var(--mt-border);
}
.mt-materials__name a { font-weight: 700; overflow-wrap: anywhere; text-underline-offset: .2em; }
.mt-materials__name small { display: block; color: var(--mt-ink-soft); font-size: .8125rem; }
.mt-lessons__class small { display: block; margin-top: .15rem; color: var(--mt-ink-soft); font-size: .8125rem; font-weight: 400; }
.mt-lessons__state a:not(.btn) { color: var(--mt-ink-soft); text-underline-offset: .2em; }
.mt-share { display: block; padding: 0 1.25rem .75rem; }
.mt-share input { font-size: .875rem; background: var(--mt-sunken); }

.mt-sharepage { min-height: 100vh; padding: 1.5rem 1rem 3rem; background: var(--mt-canvas); }
.mt-sharepage__card { width: min(100%, 36rem); margin: 0 auto; padding: 1.75rem 1.5rem; border: 1px solid var(--mt-border); border-radius: 1rem; background: var(--mt-surface); }
.mt-sharepage__date { margin: 0 0 .25rem; color: var(--mt-ink-soft); }
.mt-sharepage h1 { margin: 0 0 1rem; font-size: 1.5rem; font-weight: 800; line-height: 1.3; }
.mt-sharepage__progress { margin: 0 0 1rem; padding: .75rem 1rem; border-radius: .6rem; background: var(--mt-note-wash); font-size: 1.0625rem; font-weight: 600; }
.mt-sharepage__progress span { display: block; color: var(--mt-ink-soft); font-size: .8125rem; font-weight: 400; }
.mt-materials--share li { grid-template-columns: auto minmax(0, 1fr); padding-inline: 0; }
.mt-materials--share li:first-child { border-top: 0; }
.mt-sharepage__foot { margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--mt-border); color: var(--mt-ink-soft); font-size: .875rem; }

/* Attendance: the roll of one lesson. Each pupil is one row; each mark is one tap. */
.mt-roll { list-style: none; margin: 0; padding: 0; }
.mt-roll > li {
    display: grid;
    grid-template-columns: minmax(9rem, 1fr) auto minmax(9rem, 15rem);
    align-items: center;
    gap: .4rem 1.25rem;
    padding: .6rem 1.25rem;
    border-top: 1px solid var(--mt-border);
}
.mt-roll > li:first-child { border-top: 0; }
.mt-roll__who strong { display: block; font-size: 1.0625rem; }
.mt-roll__who span { display: block; color: var(--mt-ink-soft); font-size: .8125rem; }
.mt-roll__marks { display: flex; gap: .3rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.mt-mark { position: relative; flex: 1 1 0; margin: 0; }
.mt-mark input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.mt-mark span {
    display: block;
    min-width: 3.25rem;
    padding: .45rem .5rem;
    border: 1px solid var(--mt-border-strong);
    border-radius: .5rem;
    background: var(--mt-surface);
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}
.mt-mark input:hover + span { background: var(--mt-hover); }
.mt-mark input:checked + span { border-color: var(--mt-done); background: var(--mt-done); color: var(--mt-on-done); }
.mt-mark--late input:checked + span { border-color: var(--mt-on-late); background: var(--mt-late); color: var(--mt-on-late); }
.mt-mark--absent input:checked + span { border-color: var(--mt-alert-solid); background: var(--mt-alert-solid); color: var(--mt-on-alert); }
.mt-mark--leave input:checked + span { border-color: var(--mt-leave-ink); background: var(--mt-leave-wash); color: var(--mt-leave-ink); box-shadow: inset 0 0 0 1px var(--mt-leave-ink); }
.mt-mark--none span { border-style: dashed; color: var(--mt-ink-soft); font-weight: 400; }
.mt-mark--none input:checked + span { border-color: var(--mt-ink); background: var(--mt-sunken); color: var(--mt-ink); font-weight: 600; }
.mt-mark input:focus-visible + span { outline: 3px solid var(--mt-focus); outline-offset: 2px; }
.mt-roll__note summary { color: var(--mt-link); font-size: var(--mt-text); font-weight: 600; cursor: pointer; }
.mt-roll__note[open] summary { margin-bottom: .3rem; }
.mt-roll__note .form-control { font-size: var(--mt-text); }
.mt-roll__save {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    padding: .75rem 1.25rem;
    border-top: 1px solid var(--mt-border);
    border-radius: 0 0 .75rem .75rem;
    background: var(--mt-surface);
    font-size: .875rem;
}
.mt-roll__hint { margin-bottom: .75rem; }
.mt-roll__seen { max-width: 46rem; margin-top: .75rem; }
.mt-lessons__roll { display: block; margin-top: .3rem; font-weight: 400; }

/* A class's rolls side by side: one small mark per pupil and lesson. */
.mt-att {
    position: relative;
    display: inline-block;
    min-width: 1.6rem;
    padding: .05rem .3rem;
    border-radius: .35rem;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}
.mt-att--present { color: var(--mt-done); }
.mt-att--late { background: var(--mt-late); color: var(--mt-on-late); }
.mt-att--absent { background: var(--mt-alert-solid); color: var(--mt-on-alert); }
.mt-att--leave { box-shadow: inset 0 0 0 1px var(--mt-border-strong); color: var(--mt-ink-soft); }
.mt-att__noted { position: absolute; top: -.15rem; inset-inline-end: -.15rem; width: .4rem; height: .4rem; border-radius: 50%; background: var(--mt-ink); box-shadow: 0 0 0 1.5px var(--mt-surface); }
.mt-register tbody th { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--mt-surface); }
.mt-register thead th:first-child { position: sticky; inset-inline-start: 0; z-index: 1; }
.mt-register__day,
.mt-register__cell { width: 3rem; padding-inline: .35rem !important; text-align: center; }
/* The marks keep to their own width next to the totals; an empty last column takes the rest of the card. */
.mt-register__rest { width: 100%; padding: 0 !important; }
.mt-register thead .mt-register__rest { border-bottom: 1px solid var(--mt-border); background: var(--mt-sunken); }
.mt-register__day a { font-variant-numeric: tabular-nums; text-underline-offset: .2em; }
.mt-register__missed { color: var(--mt-alert); font-weight: 700; }
.mt-register__key { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; border-top: 1px solid var(--mt-border); }
.mt-register__key > span { display: inline-flex; align-items: center; gap: .4rem; }

/* What a family sees of it. */
.mt-attendance li > :first-child { text-underline-offset: .2em; }
.mt-attendance .mt-state { margin-inline-start: auto; }
.mt-attendance__who { margin: 0; padding: .5rem 1.25rem .35rem; font-size: 1rem; font-weight: 700; }
.mt-attendance__older summary { padding: .6rem 1.25rem; border-top: 1px solid var(--mt-border); color: var(--mt-link); font-weight: 600; cursor: pointer; }
.mt-past > li { scroll-margin-top: 4.5rem; }

@media (max-width: 991.98px) {
    .mt-roll > li { grid-template-columns: minmax(0, 1fr); gap: .35rem; padding-block: .75rem; }
}
@media (max-width: 575.98px) {
    .mt-roll > li,
    .mt-roll__save { padding-inline: 1rem; }
    .mt-mark span { min-width: 0; padding-inline: .2rem; }
}

/* Attendance, second step: visitors, cover, leave and the centre's week. */
.mt-roll__sub { margin: 0; padding: .85rem 1.25rem .5rem; border-top: 1px solid var(--mt-border); background: var(--mt-sunken); font-size: 1rem; font-weight: 700; }
.mt-roll__asked { color: var(--mt-info) !important; font-weight: 600; }
.mt-roll__who i { margin-inline-end: .25rem; }
.mt-roll__tell { display: inline-flex; align-items: center; gap: .45rem; margin: 0; font-size: var(--mt-text); font-weight: 600; cursor: pointer; }
.mt-roll__tell .form-check-input { margin: 0; flex: none; }
.mt-rollhistory > summary { padding: .85rem 1.25rem; font-weight: 700; cursor: pointer; }
.mt-rollhistory .mt-plainlist li { font-size: var(--mt-text); }
.mt-plainlist form { margin: 0; }
.mt-att__madeup { display: inline-block; margin-inline-start: .15rem; padding: 0 .2rem; border-radius: .25rem; background: var(--mt-accent-wash); color: var(--mt-accent-ink); font-size: .75rem; font-weight: 700; line-height: 1.5; }
.mt-register__key .mt-att__madeup { margin-inline-start: 0; }
.mt-lessons__leave { display: block; color: var(--mt-ink-soft); font-size: .8125rem; font-weight: 400; }
.mt-table td .mt-state + small { margin-top: .25rem; }

/* What a family sees of them. */
.mt-leave { flex-basis: 100%; }
.mt-leave summary { display: inline-block; color: var(--mt-link); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.mt-leave form { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.mt-leave .form-control { flex: 1 1 12rem; min-width: 0; }
.mt-leave__undo { margin: 0; }
.mt-leave__undo .btn { padding-block: 0; font-size: var(--mt-text); }
.mt-coming li .mt-leave:first-of-type { margin-top: -.1rem; }
.mt-attendance__more { flex-basis: 100%; color: var(--mt-ink-soft); font-size: .875rem; font-weight: 400 !important; }
.mt-attendance__more i { margin-inline-end: .25rem; }
.mt-me__more { margin: .75rem 0 0 !important; }
.mt-me__more a { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; text-underline-offset: .2em; }
.mt-card__foot a { font-weight: 600; text-underline-offset: .2em; white-space: nowrap; }

/* Parents' feedback */
.mt-stages { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.mt-stages a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 2.25rem;
    padding: .2rem .8rem;
    border: 1px solid var(--mt-border-strong);
    border-radius: 999px;
    background: var(--mt-surface);
    color: var(--mt-ink);
    font-weight: 600;
    text-decoration: none;
}
.mt-stages a:hover { border-color: var(--mt-ink); }
.mt-stages a[aria-current] { border-color: var(--mt-selected-bg); background: var(--mt-selected-bg); color: var(--mt-selected-ink); }
.mt-stages .mt-num { font-weight: 400; opacity: .8; }
.mt-card__head .mt-soft { margin-inline-start: auto; font-size: .875rem; }
.mt-lines { margin: 0; padding: 0 0 .5rem; border: 0; }
.mt-lines__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .75rem;
    padding: .65rem 1.25rem;
    border-top: 1px solid var(--mt-border);
    cursor: pointer;
}
.mt-lines__row input { margin-top: .3rem; border-color: var(--mt-border-strong); }
.mt-lines__row span { overflow-wrap: anywhere; }
.mt-lines__row small { display: block; margin-bottom: .15rem; color: var(--mt-ink-soft); font-size: .8125rem; }
.mt-lines__row:has(input:not(:checked)) span { color: var(--mt-ink-soft); }
.mt-lines__row.is-title span { font-weight: 700; }
.mt-lines.has-error { box-shadow: inset 3px 0 0 var(--mt-alert); }
.mt-links { list-style: none; margin: 0; padding: 0; }
.mt-links li { padding-top: .9rem; border-top: 1px solid var(--mt-border); }
.mt-links__head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; padding: 0 1.25rem .6rem; }
.mt-links__head .mt-soft { font-size: .875rem; }
.mt-parentform { width: min(100%, 40rem); }
.mt-parentform__intro { margin: -.5rem 0 1.25rem; color: var(--mt-ink-soft); }
.mt-parentform__questions { margin: 0 0 1.25rem; padding-left: 1.4rem; }
.mt-parentform__questions li { margin-bottom: 1.1rem; padding-left: .2rem; }
.mt-parentform__questions li::marker { font-weight: 700; }
.mt-parentform .form-label { display: block; font-weight: 600; }  /* a block, so the question number sits beside its first line */
.mt-parentform fieldset { margin: 0 0 1.25rem; padding: 1rem 1rem .25rem; border: 1px solid var(--mt-border); border-radius: .75rem; }
.mt-parentform legend { float: none; width: auto; margin: 0; padding: 0 .4rem; font-size: 1rem; font-weight: 700; }
.mt-parentform__consent { background: var(--mt-note-wash); border-color: transparent !important; }
.mt-parentform .btn { --theme-btn-padding-y: .6rem; --theme-btn-font-size: 1rem; }

/* Sign-in pages */
.mt-auth {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1.5rem 1rem;
    background: var(--mt-panel);
}
.mt-auth__card {
    width: min(100%, 27rem);
    padding: 2rem 1.75rem 1.75rem;
    border-radius: 1rem;
    background: var(--mt-surface);
}
.mt-auth__brand { display: block; margin: 0 0 1.25rem; color: var(--mt-accent); font-size: 1.25rem; font-weight: 800; text-decoration: none; }
.mt-auth h1 { margin: 0 0 .5rem; font-size: 1.5rem; font-weight: 800; line-height: 1.25; }
.mt-auth__card > p { color: var(--mt-ink-soft); }
.mt-auth form { margin-top: 1.1rem; }
.mt-auth .btn { --theme-btn-padding-y: .6rem; --theme-btn-font-size: 1rem; }
.mt-auth__other { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1rem; margin: 1rem 0 0; }
.mt-auth__other a { font-weight: 600; }
.mt-auth__note { display: flex; gap: .45rem; padding: .65rem .8rem; border: 1px dashed var(--mt-border-strong); border-radius: .6rem; font-size: var(--mt-text); }
.mt-auth__note i { margin-top: .2rem; }

@media (max-width: 1199.98px) {
    .mt-weekgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .mt-form__row,
    .mt-form__row--three { grid-template-columns: minmax(0, 1fr); }
    .mt-weekgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mt-approvals li { grid-template-columns: minmax(0, 1fr); }
    .mt-page-head h1 { font-size: 1.5rem; }
}

@media (max-width: 991.98px) {
    .mt-lessons li { grid-template-columns: 7.25rem minmax(0, 1fr) auto; }
    .mt-lessons__meta { grid-column: 2; grid-row: 2; }
    .mt-lessons__state { grid-column: 3; grid-row: 1 / span 2; min-width: 0; }
}

@media (max-width: 575.98px) {
    .mt-day { margin-inline: -.25rem; padding: 1.25rem 1rem 1rem; border-radius: .85rem; }
    .mt-day__actions .btn { flex: 1; }
    .mt-lessons li { grid-template-columns: minmax(0, 1fr) auto; padding-inline: 1rem; }
    .mt-lessons__time { grid-column: 1; }
    .mt-lessons__class { grid-column: 1; grid-row: 2; }
    .mt-lessons__meta { grid-column: 1; grid-row: 3; }
    .mt-lessons__state { grid-column: 2; grid-row: 1 / span 3; }
    .mt-week { padding-inline: 1rem; gap: .25rem; }
    .mt-todo li { padding-inline: 1rem; }
    .mt-card__head { padding-inline: 1rem; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    .mt-app * { transition: none !important; }
}

/* ---- Joining, pairing and the pages pupils and parents see (MT-028) ---- */

/* The join page offers two ways in; each row is one large target for a thumb. */
.mt-auth .mt-back { margin-bottom: .75rem !important; }
.mt-choices { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; gap: .6rem; }
.mt-choices a,
.mt-choices__held {
    position: relative;
    display: grid;
    gap: .15rem;
    padding: .9rem 2.5rem .9rem 1rem;
    border: 1px solid var(--mt-border-strong);
    border-radius: .75rem;
    color: var(--mt-ink);
    text-decoration: none;
}
.mt-choices a:hover { border-color: var(--mt-accent); background: var(--mt-hover); }
.mt-choices b { font-size: 1.125rem; font-weight: 800; }
.mt-choices span span { color: var(--mt-ink-soft); font-size: var(--mt-text); }
.mt-choices a > span { color: var(--mt-ink-soft); font-size: var(--mt-text); }
.mt-choices i { position: absolute; inset-inline-end: .8rem; top: 50%; translate: 0 -50%; color: var(--mt-accent); font-size: 1.25rem; }
.mt-choices__held { border-style: dashed; color: var(--mt-ink-soft); }
.mt-auth__note span { min-width: 0; }

/* Member pages: one column sized for a phone, no side menu. */
.mt-me { min-height: 100vh; background: var(--mt-canvas); }
.mt-me__bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .6rem max(1rem, calc((100% - 42rem) / 2));
    border-bottom: 1px solid var(--mt-border);
    background: var(--mt-surface);
}
.mt-me__brand { color: var(--mt-accent); font-size: 1.25rem; font-weight: 800; text-decoration: none; }
.mt-me__main { box-sizing: border-box; width: min(100%, 44rem); margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.mt-me__main > * + * { margin-top: 1rem; }
.mt-me__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin: 0; font-size: 1.625rem; font-weight: 800; line-height: 1.25; }
.mt-me__title > .mt-num { color: var(--mt-ink-soft); font-size: var(--mt-text); font-weight: 600; }
.mt-me__lead { margin: .35rem 0 0 !important; }
.mt-me .mt-back { margin: 0 !important; font-size: var(--mt-text); }
.mt-me .mt-back a { font-weight: 600; text-underline-offset: .2em; }
.mt-me .mt-back + .mt-me__title { margin-top: .35rem; }
.mt-me__card { margin-top: 1rem !important; }
.mt-me__next .mt-day__next { font-size: clamp(1.625rem, 1.2rem + 2vw, 2.25rem); }
.mt-me__next .mt-day__actions { margin-top: 1rem; }
.mt-me__next .mt-code { background: color-mix(in srgb, var(--mt-on-panel) 14%, transparent); color: var(--mt-on-panel); box-shadow: none; }
.mt-me__notice { padding: 1rem 1.1rem; border: 1px dashed var(--mt-border-strong); border-radius: .75rem; background: var(--mt-note-wash); }
.mt-me__notice h2 { display: flex; gap: .45rem; margin: 0 0 .3rem; font-size: 1.0625rem; font-weight: 800; }
.mt-me__notice p { margin: 0; }
.mt-me__notice--warn { background: var(--mt-alert-wash); }

.mt-me__notice--todo { background: var(--mt-surface); }
.mt-me__notice ul { margin: 0; padding-inline-start: 1.1rem; }
.mt-me__notice a { font-weight: 600; text-underline-offset: .2em; }

/* The class a class link names, shown before anything is asked. */
.mt-linkclass { margin: .9rem 0 1rem; padding: .85rem 1rem; border-radius: .75rem; background: var(--mt-panel); color: var(--mt-on-panel); }
.mt-auth__card > .mt-linkclass { color: var(--mt-on-panel); }
.mt-linkclass strong { font-size: 1.125rem; }
.mt-linkclass > span { display: block; margin-top: .25rem; color: var(--mt-on-panel-soft); }
.mt-linkclass .mt-code { background: var(--mt-now); color: var(--mt-now-ink); box-shadow: none; }

/* Which child a parent is looking at. */
.mt-who { display: flex; flex-wrap: wrap; gap: .4rem; }
.mt-who a {
    padding: .4rem .95rem;
    border: 1px solid var(--mt-border-strong);
    border-radius: 999px;
    background: var(--mt-surface);
    color: var(--mt-ink);
    font-weight: 600;
    text-decoration: none;
}
.mt-who a[aria-current="true"] { border-color: var(--mt-panel); background: var(--mt-panel); color: var(--mt-on-panel-accent); }
.mt-who + .mt-me__title,
.mt-me__notice + .mt-me__title,
.mt-flashes + .mt-me__title { margin-top: 1rem; }
.mt-me__title + .mt-preview { margin-top: .75rem; }

.mt-classes { list-style: none; margin: 1rem 0 0; padding: 0; border: 1px solid var(--mt-border); border-radius: .75rem; background: var(--mt-surface); overflow: hidden; }
.mt-classes li + li { border-top: 1px solid var(--mt-border); }
.mt-classes a { position: relative; display: grid; gap: .2rem; padding: .9rem 2.5rem .9rem 1.1rem; color: var(--mt-ink); text-decoration: none; }
.mt-classes a:hover { background: var(--mt-hover); }
.mt-classes__name { font-size: 1.0625rem; font-weight: 700; }
.mt-classes__when { color: var(--mt-ink-soft); font-size: var(--mt-text); }
.mt-classes__last { font-size: var(--mt-text); }
.mt-classes__last span { margin-inline-end: .5rem; color: var(--mt-ink-soft); }
.mt-classes i { position: absolute; inset-inline-end: .9rem; top: 50%; translate: 0 -50%; color: var(--mt-accent); font-size: 1.25rem; }

.mt-links { list-style: none; margin: 0; padding: 0; }
.mt-links li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem 1rem; padding: .65rem 1.25rem; border-top: 1px solid var(--mt-border); }
.mt-links .mt-num { margin-inline-start: .6rem; color: var(--mt-ink-soft); }
.mt-links b.mt-num:first-child { margin-inline-start: 0; color: inherit; }  /* a code shown on its own, as typed */
.mt-pairform { border-top: 1px solid var(--mt-border); padding-top: 1rem; }
.mt-pairform__row { display: flex; gap: .5rem; }
.mt-pairform__row .form-control { min-width: 0; max-width: 16rem; font-variant-numeric: tabular-nums; }

.mt-coming { list-style: none; margin: 0; padding: 0 0 .5rem; }
.mt-coming li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; padding: .6rem 1.25rem; border-top: 1px solid var(--mt-border); }
.mt-coming li > :first-child { min-width: 9.5rem; font-weight: 600; }
.mt-coming .is-closed > :first-child { color: var(--mt-ink-soft); font-weight: 400; text-decoration: line-through; }
.mt-coming__why { color: var(--mt-ink-soft); }

.mt-past { list-style: none; margin: 0; padding: 0; }
.mt-past > li { padding: .9rem 1.25rem .5rem; border-top: 1px solid var(--mt-border); }
.mt-past h3 { margin: 0 0 .4rem; font-size: 1rem; font-weight: 700; }
.mt-past__progress { margin: 0 0 .35rem; padding: .55rem .8rem; border-radius: .5rem; background: var(--mt-note-wash); font-weight: 600; }
.mt-past__progress span { margin-inline-end: .5rem; color: var(--mt-ink-soft); font-size: .8125rem; font-weight: 400; }

/* The admin side of the same flow. */
.mt-joinlink { padding: 1rem 1.25rem; }
.mt-joinlink__row { display: flex; flex-wrap: wrap; gap: .5rem; }
.mt-joinlink__row .form-control { flex: 1 1 16rem; min-width: 0; background: var(--mt-sunken); font-size: var(--mt-text); }
.mt-joinlink__waiting { margin: .6rem 0 0; }
.mt-pagetools { margin-top: .75rem; }
.mt-pagetools > summary { cursor: pointer; color: var(--mt-muted, inherit); font-size: .9375rem; }
.mt-joinlink__waiting .mt-state { margin-inline-end: .5rem; }
/* Pupils waiting for a class, under its head count on the timetable and the teacher's class list. */
.mt-waiting { display: table; margin-top: .25rem; white-space: nowrap; font-size: .8125rem; }
a.mt-waiting { text-decoration: none; }
a.mt-waiting:hover, a.mt-waiting:focus-visible { text-decoration: underline; text-underline-offset: .2em; }
.mt-pairs { list-style: none; margin: 0; padding: 0; }
.mt-pairs li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.3fr) auto;
    align-items: center;
    gap: .5rem 1rem;
    padding: .7rem 1.25rem;
    border-top: 1px solid var(--mt-border);
}
.mt-pairs li > i { color: var(--mt-ink-soft); }
.mt-pairs__who small { display: block; color: var(--mt-ink-soft); font-size: .8125rem; }
.mt-lookup { padding-bottom: .5rem; }
.mt-match { margin: 0 1.25rem 1rem; padding: .9rem 1rem; border: 1px solid var(--mt-accent); border-radius: .6rem; background: var(--mt-sunken); }
.mt-match p { margin: 0 0 .75rem; }
.mt-match p strong { font-size: 1.0625rem; }
.mt-match p > span { display: block; margin-top: .2rem; color: var(--mt-ink-soft); }
.mt-match .form-check { display: flex; align-items: center; gap: .45rem; margin: 0 0 .75rem; padding: 0; }
.mt-match .form-check-input,
.mt-form .form-check-input { margin: 0; border-color: var(--mt-border-strong); }
/* A checkbox and its label share one row, whether the label wraps the box or follows it. */
.mt-form label.form-check,
.mt-form div.form-check { display: flex; align-items: flex-start; gap: .45rem; padding: 0; }
.mt-form label.form-check .form-check-input,
.mt-form div.form-check .form-check-input { margin-top: .25rem; flex: none; }
.mt-codeinput { width: 8.5rem; font-variant-numeric: tabular-nums; }
.mt-reasoninput { width: 11rem; }
.mt-childselect { width: auto; min-width: 12rem; }
.mt-copyrow { display: flex; gap: .4rem; min-width: 15rem; }
.mt-copyrow .form-control { min-width: 0; background: var(--mt-sunken); font-size: .8125rem; }
.mt-table tr.is-waiting > th { box-shadow: inset 4px 0 0 var(--mt-wait); }
.mt-classlist li { align-items: flex-start; }
.mt-classlist__who { display: flex; gap: .65rem; margin: 0; min-width: 14rem; flex: 1 1 18rem; }
.mt-classlist__who .form-check-input { flex: none; width: 1.15rem; height: 1.15rem; margin: .2rem 0 0; border-color: var(--mt-border-strong); }
.mt-classlist__who .mt-issue { max-width: none; }
.mt-classlist__go { border-top: 1px solid var(--mt-border); padding-top: 1rem; }

@media (max-width: 575.98px) {
    .mt-pairs li { grid-template-columns: minmax(0, 1fr); }
    .mt-pairs li > i { display: none; }
    .mt-me .mt-user__name { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Teacher bios */
.mt-profile__current { display: flex; align-items: center; gap: 1rem; margin-bottom: .9rem; }
.mt-profile__current img,
.mt-profile__id img { flex: none; border-radius: 50%; object-fit: cover; background: var(--mt-border); }
.mt-profile__current .mt-field { margin: 0; }
.mt-profile__current .form-check { display: flex; align-items: center; gap: .45rem; margin: 0; padding: 0; }
.mt-profile__status { padding: 0 1.25rem 1.1rem; }
.mt-profile__status p { margin: 0 0 .5rem; }
.mt-profile__withdraw { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--mt-border); }
.mt-profile__withdraw .mt-soft { font-size: .875rem; }
.mt-profile__card { padding: 0 1.25rem 1.1rem; }
.mt-profile__card > p { max-width: 38em; margin: 0 0 .6rem; }
.mt-profile__id { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.mt-profile__id h3 { margin: 0; font-size: 1.125rem; font-weight: 700; }
.mt-profile__id p { margin: 0; color: var(--mt-ink-soft); font-size: .875rem; }
.mt-profile__initial {
    flex: none; display: grid; place-items: center; width: 56px; height: 56px;
    border: 1.5px dashed var(--mt-border-strong); border-radius: 50%; font-size: 1.375rem; font-weight: 600;
}
.mt-profile__card .mt-facts { padding: .25rem 0 .75rem; }
.mt-profile__summary { padding-top: .75rem; border-top: 1px solid var(--mt-border); font-size: var(--mt-text); }

.mt-profile__changes { border-top: 1px solid var(--mt-border); padding: .75rem 1rem; overflow-wrap: anywhere; }
.mt-profile__changes summary { cursor: pointer; font-weight: 600; }
.mt-profile__changes dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem 1rem; margin: .75rem 0 0; }
.mt-profile__changes dt { grid-column: 1 / -1; }
.mt-profile__changes dd { min-width: 0; margin-bottom: .5rem; }
.mt-profile__changes dd > span { display: block; font-size: .875em; margin-bottom: .25rem; }

/* ---- New pupils: the registration form and a registration's own page (MT-060) ---- */

/* One column for a phone, on the same card the share page and the parents' form use. */
.mt-reg { width: min(100%, 40rem); }
.mt-reg h1 { margin-bottom: .5rem; }
/* A field no person sees or reaches with the keyboard. A script that fills in every field gives itself away. */
.mt-reg__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mt-reg__step { margin: 0 0 .25rem; color: var(--mt-ink-soft); font-size: .875rem; font-weight: 600; }
.mt-reg__intro { margin: 0 0 1.1rem; color: var(--mt-ink-soft); }
.mt-reg__intro strong { color: var(--mt-ink); }
.mt-reg__fine { margin: 1rem 0 0; color: var(--mt-ink-soft); font-size: .875rem; }
.mt-reg__fine i { margin-inline-end: .35rem; vertical-align: -.1em; }
.mt-reg .btn { --theme-btn-padding-y: .6rem; --theme-btn-font-size: 1rem; }
.mt-reg .btn-sm { --theme-btn-padding-y: .25rem; --theme-btn-font-size: .875rem; }
.mt-reg form > fieldset { margin: 0 0 1.25rem; padding: 1rem 1rem .25rem; border: 1px solid var(--mt-border); border-radius: .75rem; }
.mt-reg form > fieldset > legend { float: none; width: auto; margin: 0; padding: 0 .4rem; font-size: 1rem; font-weight: 700; }
.mt-reg__after { margin: 0 0 1.25rem; padding: .9rem 1rem; border-radius: .75rem; background: var(--mt-sunken); }
.mt-reg__after h2,
.mt-reg__notice h2 { margin: 0 0 .5rem; font-size: 1rem; font-weight: 700; }
.mt-reg__after ol { margin: 0; padding-inline-start: 1.25rem; }
.mt-reg__after li + li { margin-top: .3rem; }
.mt-reg__after li b { margin-inline-end: .5rem; }
.mt-reg__notice { margin: 1.25rem 0; padding: .9rem 1rem; border-radius: .75rem; background: var(--mt-note-wash); }
.mt-reg__notice ul { margin: 0 0 .9rem; padding-inline-start: 1.1rem; font-size: var(--mt-text); }
.mt-reg__notice li + li { margin-top: .25rem; }
.mt-reg__notice .mt-field { margin: 0; }
.mt-reg__consent { display: flex; align-items: flex-start; gap: .55rem; margin: 0; padding: 0; font-weight: 600; cursor: pointer; }
.mt-reg__consent .form-check-input { flex: none; width: 1.2rem; height: 1.2rem; margin: .15rem 0 0; }

/* Picking a class: every time slot is one row a thumb can hit, grouped by level. */
.mt-slotpick { display: grid; gap: .6rem; }
.mt-slotpick.has-error { padding-inline-start: .75rem; box-shadow: inset 3px 0 0 var(--mt-alert); }
.mt-slotpick__level { border: 1px solid var(--mt-border); border-radius: .75rem; background: var(--mt-surface); overflow: hidden; }
.mt-slotpick__level > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .75rem;
    padding: .7rem 1rem;
    background: var(--mt-sunken);
    cursor: pointer;
}
.mt-slotpick__level > summary b { font-size: 1.0625rem; font-weight: 800; }
.mt-slotpick__level > summary span { color: var(--mt-ink-soft); font-size: .875rem; }
.mt-slotpick__level > summary .mt-num { margin-inline-start: auto; }
.mt-slotpick__row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: .1rem .65rem;
    margin: 0;
    padding: .65rem 1rem;
    border-top: 1px solid var(--mt-border);
    cursor: pointer;
}
.mt-slotpick__row .form-check-input { grid-row: 1 / span 2; width: 1.2rem; height: 1.2rem; margin: 0; }
.mt-slotpick__row .mt-code { justify-self: start; min-width: 2.6rem; text-align: center; }
.mt-slotpick__when { font-weight: 700; }
.mt-slotpick__row small { grid-column: 2 / -1; color: var(--mt-ink-soft); font-size: .875rem; }
.mt-slotpick__row:hover { background: var(--mt-hover); }
.mt-slotpick__row:has(input:checked) { background: var(--mt-accent-wash); box-shadow: inset 4px 0 0 var(--mt-accent); }
.mt-slotpick__row--unsure { grid-template-columns: auto minmax(0, 1fr); border: 1px dashed var(--mt-border-strong); border-radius: .75rem; }
.mt-slotpick__row--unsure small { grid-column: 2; }
.mt-slotpick > .mt-empty { padding: .5rem 0; }

/* The registration's own page: the class asked for, then five steps down the page. */
.mt-reg__noclass { margin: .9rem 0 1rem; padding: .85rem 1rem; border: 1px dashed var(--mt-border-strong); border-radius: .75rem; color: var(--mt-ink-soft); }
.mt-reg__change { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin: -.4rem 0 1rem; font-size: var(--mt-text); }
.mt-reg__change a { font-weight: 600; text-underline-offset: .2em; }
.mt-reg__change span { color: var(--mt-ink-soft); }
.mt-journey { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.mt-journey > li { position: relative; padding: 0 0 1.25rem 2.75rem; }
.mt-journey > li::before {  /* the line that joins one step's number to the next */
    content: "";
    position: absolute;
    inset: 2rem auto 0 .9375rem;
    width: 2px;
    background: var(--mt-border);
}
.mt-journey > li:last-child { padding-bottom: 0; }
.mt-journey > li:last-child::before { display: none; }
.mt-journey h2 { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; min-height: 2rem; margin: 0 0 .35rem; font-size: 1.125rem; font-weight: 800; }
.mt-journey__n {
    position: absolute;
    inset-inline-start: 0;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 2px solid var(--mt-border-strong);
    border-radius: 50%;
    background: var(--mt-surface);
    color: var(--mt-ink-soft);
    font-size: var(--mt-text);
    font-variant-numeric: tabular-nums;
}
.mt-journey__state { padding: .1rem .6rem; border-radius: 999px; background: var(--mt-accent-wash); color: var(--mt-ink); font-size: .8125rem; font-weight: 600; }
.mt-journey__state--you { background: var(--mt-now); }
.mt-journey p { margin: 0 0 .6rem; }
.mt-journey > li > :last-child { margin-bottom: 0; }
.mt-journey .is-done .mt-journey__n { border-color: var(--mt-done); background: var(--mt-done); color: var(--mt-on-done); }
.mt-journey .is-done::before { background: var(--mt-done); }
.mt-journey .is-now .mt-journey__n { border-color: var(--mt-now-ink); background: var(--mt-now); color: var(--mt-now-ink); font-weight: 800; }
.mt-journey .is-later { color: var(--mt-ink-soft); }
.mt-journey .is-later h2 { color: var(--mt-ink-soft); font-weight: 700; }
.mt-reg__papername { display: inline-block; margin-inline-start: .65rem; color: var(--mt-ink-soft); font-size: .875rem; }
.mt-reg form.mt-reg__trial > fieldset { margin: 0 0 .75rem; padding: 0; border: 0; }
.mt-reg form.mt-reg__trial > fieldset > legend { margin: 0 0 .4rem; padding: 0; font-size: var(--mt-text); }
.mt-reg__trial .form-check { display: flex; align-items: center; gap: .55rem; margin: 0; padding: .5rem .75rem; border: 1px solid var(--mt-border); border-radius: .6rem; cursor: pointer; }
.mt-reg__trial .form-check + .form-check { margin-top: .4rem; }
.mt-reg__trial .form-check:has(input:checked) { border-color: var(--mt-accent); background: var(--mt-sunken); font-weight: 700; }
.mt-reg__trial .form-check-input { flex: none; width: 1.15rem; height: 1.15rem; margin: 0; }
.mt-reg__skip { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--mt-border); }
.mt-reg__skip span { color: var(--mt-ink-soft); }
.mt-reg__answer { display: flex; flex-wrap: wrap; gap: .5rem; }
.mt-reg__answer p { flex: 1 0 100%; }
.mt-reg__more > summary { color: var(--mt-link); font-weight: 600; cursor: pointer; }
.mt-reg__more[open] > summary { margin-bottom: .6rem; }

/* ---- List pages: grouped rows that open what they name ---- */

/* One <tbody> per group, headed by a row that names it: a weekday, a date. */
.mt-table .mt-group > th {
    height: auto;
    padding-block: .3rem;
    border-top: 1px solid var(--mt-border);
    background: var(--mt-sunken);
    font-size: .8125rem;
    font-weight: 700;
}
.mt-table tbody:first-of-type > .mt-group > th { border-top: 0; }

/* A row that opens a record. The address is a real link on the name in the row, for the keyboard
   and for screen readers; staff.js lets a click anywhere else on the row follow it too. */
.mt-table tr[data-href] { cursor: pointer; }
.mt-table tr[data-href]:hover > * { background: var(--mt-hover); }
.mt-rowlink { color: inherit; text-decoration: none; }
.mt-rowlink:hover,
.mt-rowlink:focus-visible { text-decoration: underline; text-underline-offset: .2em; }
.mt-table .mt-rowgo { width: 1%; padding-inline-start: 0; color: var(--mt-border-strong); text-align: end; }
/* The one other thing a row offers, as a quiet link at its end. */
.mt-rowact { font-size: .8125rem; font-weight: 600; text-underline-offset: .2em; white-space: nowrap; }
/* A short tag beside a value, and a second name beside the first, where each used to take a line. */
.mt-tag { margin-inline-start: .4rem; padding: 0 .4rem; border-radius: 999px; background: var(--mt-tag-bg); color: var(--mt-tag-ink); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.mt-table tbody th .mt-also { display: inline; margin-inline-start: .4rem; }
.mt-table tbody th .mt-state { margin-inline-start: .4rem; }
/* The lesson that still wants its roll keeps its stripe when the row no longer starts with its heading. */
.mt-table tr.is-waiting > td:first-child { box-shadow: inset 4px 0 0 var(--mt-wait); }
.mt-table tr.is-waiting > th:not(:first-child) { box-shadow: none; }

/* A list does not scroll sideways. When its card is too narrow for every cell on one line, a cell
   wraps between its parts; times, class codes, a note and the name that opens the row stay whole. */
.mt-table--list tbody th,
.mt-table--list tbody td { white-space: normal; }
.mt-table--list .mt-num,
.mt-table--list .mt-code,
.mt-table--list .mt-nowrap,
.mt-table--list .mt-soft,
.mt-table--list .mt-rowlink { white-space: nowrap; }

/* On a phone a list keeps its key columns and folds the rest into a line under the name, so the
   table fits the screen and is still a table to a screen reader. */
.mt-table .mt-narrow { display: none; color: var(--mt-ink-soft); font-size: .8125rem; font-weight: 400; }
@media (max-width: 767.98px) {
    .mt-table--list .mt-wide { display: none; }
    .mt-table--list .mt-narrow { display: block; }
    /* A class name and a note may wrap on a phone; a person's name marked .mt-nowrap stays whole. */
    .mt-table--list .mt-rowlink:not(.mt-nowrap),
    .mt-table--list .mt-soft { white-space: normal; }
    .mt-table--list tbody th .mt-also { display: none; }
}

/* Several quiet links at the end of a row, and a few figures side by side in one card. */
.mt-rowlinks { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: .1rem .9rem; }
.mt-rowlinks--start { justify-content: flex-start; }
.mt-table .mt-narrow.mt-rowlinks { justify-content: flex-start; margin-top: .2rem; }
@media (max-width: 767.98px) {
    .mt-table--list .mt-narrow.mt-rowlinks { display: flex; }
}
.mt-card__actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-inline-start: auto; }
.mt-card__actions form { margin: 0; }
.mt-figures { display: flex; flex-flow: row wrap; margin: 0; padding: .7rem 0; }
.mt-figures > div { flex: 1 1 12rem; padding: .15rem 1.25rem; border-inline-start: 1px solid var(--mt-border); }
.mt-figures > div:first-child { border-inline-start: 0; }
.mt-figures dt { color: var(--mt-ink-soft); font-size: .8125rem; font-weight: 400; }
.mt-figures dd { margin: 0; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.35; }
.mt-figures small { display: block; color: var(--mt-ink-soft); font-size: .8125rem; }
@media (max-width: 575.98px) {
    .mt-figures { flex-direction: column; gap: .5rem; }
    .mt-figures > div { flex: none; border-inline-start: 0; }
}
/* Something a person still has to do, where the theme's orange stood. */
.mt-due { color: var(--mt-alert); font-weight: 600; }
/* A disclosure that sits among buttons looks like one, and opens what it hides under itself. */
.mt-more > summary { list-style: none; }
.mt-more > summary::-webkit-details-marker { display: none; }
.mt-more[open] > summary { margin-bottom: .4rem; }

/* The pages of one class as tabs under its head. */
.mt-tabs { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 0 0 .9rem; border-bottom: 1px solid var(--mt-border); }
.mt-tabs a { margin-bottom: -1px; padding: .4rem .1rem; border-bottom: 2px solid transparent; color: var(--mt-ink-soft); font-weight: 600; text-decoration: none; white-space: nowrap; }
.mt-tabs a:hover { color: var(--mt-ink); }
.mt-tabs a[aria-current] { border-bottom-color: var(--mt-accent); color: var(--mt-ink); }
#class-links { scroll-margin-top: 4rem; }
@media (pointer: coarse), (max-width: 767.98px) {
    .mt-tabs a { padding-block: .6rem; }
}
@media (max-width: 767.98px) {
    .mt-table--list .mt-wrap { min-width: 0; }
}

/* ---- Rich elements ----
   One idea carries most of them: the strip. Anything that can be counted (a lesson, a pupil, a
   class's roll for the week) is one mark, in the day ruler's own language: solid is done, dashed
   is still to come, yellow is next, pink waits for a person. */

.mt-strip { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .35rem .8rem; margin: 0; padding: 0; list-style: none; }
.mt-strip__group { display: grid; gap: .15rem; }
.mt-strip__label { color: var(--mt-ink-soft); font-size: .75rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.mt-strip__marks { display: inline-flex; flex-wrap: wrap; gap: 3px; vertical-align: middle; }
.mt-tick { display: block; flex: none; box-sizing: border-box; width: .55rem; height: 1.35rem; border: 1.5px dashed var(--mt-border-strong); border-radius: .2rem; background: var(--mt-surface); }
a.mt-tick:hover { outline: 2px solid var(--mt-ink); outline-offset: 1px; }
.mt-tick.is-done { border-style: solid; border-color: var(--mt-done); background: var(--mt-done); }
.mt-tick.is-next { border-style: solid; border-color: var(--mt-now-ink); background: var(--mt-now); }
.mt-tick.is-late { border-style: solid; border-color: var(--mt-on-late); background: var(--mt-late); }
.mt-tick.is-due { border-color: var(--mt-alert); background: var(--mt-alert-wash); }
.mt-tick.is-missed { border-style: solid; border-color: var(--mt-alert-solid); background: var(--mt-alert-solid); }
.mt-tick.is-leave { border-style: solid; border-color: var(--mt-leave-ink); background: var(--mt-leave-wash); }
/* No pupils: dotted, and as strong as the dashed mark, so it reads as a state and not as a gap. */
.mt-tick.is-off { border-style: dotted; border-color: var(--mt-border-strong); background: transparent; }
.mt-stripcard { display: grid; gap: .55rem; padding: .7rem 1.25rem .8rem; }
.mt-stripcard__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; }
.mt-stripcard__head h2 { margin: 0; }
.mt-stripcard__head .mt-soft { font-size: .8125rem; }
.mt-strip__key { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; margin: 0; padding: 0; list-style: none; color: var(--mt-ink-soft); font-size: .75rem; }
.mt-strip__key li { display: inline-flex; align-items: center; gap: .35rem; }
.mt-strip__key .mt-tick,
.mt-figures .mt-tick,
.mt-roll__strip .mt-tick { width: .45rem; height: .95rem; }
.mt-figures .mt-strip__marks { margin-top: .25rem; }
.mt-roll__strip { margin-inline-start: auto; }
.mt-roll__left { font-weight: 600; }
.mt-roll__left.is-dirty { color: var(--mt-alert); }

/* A long list keeps its column names, and the day or month a row belongs to, in view. */
@media (min-width: 768px) {
    .mt-card > .table-responsive:has(> .mt-table--list) { overflow: visible; }
    .mt-table--list thead th { position: sticky; top: var(--theme-topbar-height); z-index: 3; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--mt-border); }
    .mt-table--list .mt-group > th { position: sticky; top: calc(var(--theme-topbar-height) + 1.95rem); z-index: 2; box-shadow: inset 0 -1px 0 var(--mt-border); }
    .mt-card > .table-responsive:first-child > .mt-table--list thead th:first-child { border-top-left-radius: calc(.75rem - 1px); }
    .mt-card > .table-responsive:first-child > .mt-table--list thead th:last-child { border-top-right-radius: calc(.75rem - 1px); }
}

/* Type a few characters to narrow a long list. staff.js adds the box to a table that asks for it. */
.mt-find { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; padding: .5rem 1.25rem; border-bottom: 1px solid var(--mt-border); color: var(--mt-ink-soft); }
.mt-find .form-control { flex: 0 1 16rem; min-width: 8rem; }
.mt-find__count { font-size: .8125rem; font-variant-numeric: tabular-nums; }
.mt-table tr[hidden],
.mt-table tbody[hidden] { display: none; }

/* A file field you can also drop a file on. The real input covers the box, so a click, the
   keyboard and a drop all reach it. */
.mt-drop { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; padding: .65rem .85rem; border: 1.5px dashed var(--mt-border-strong); border-radius: .6rem; background: var(--mt-surface); color: var(--mt-ink-soft); }
.mt-drop > i { color: var(--mt-accent); font-size: 1.25rem; }
.mt-drop b { color: var(--mt-link); font-weight: 600; }
.mt-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; opacity: 0; cursor: pointer; }
.mt-drop:focus-within { outline: 3px solid var(--mt-focus); outline-offset: 2px; }
.mt-drop.is-over { border-color: var(--mt-accent); background: var(--mt-hover); }
.mt-drop.has-file { border-style: solid; border-color: var(--mt-accent); color: var(--mt-ink); }
.mt-drop__file { flex-basis: 100%; font-weight: 600; overflow-wrap: anywhere; }
.mt-drop__file:empty { display: none; }

/* How much of a limited text box is used. */
.mt-chars { margin: .15rem 0 0; color: var(--mt-ink-soft); font-size: .75rem; font-variant-numeric: tabular-nums; text-align: end; }
.mt-chars.is-near { color: var(--mt-alert); font-weight: 600; }

/* An empty place says what belongs there, behind a small sign. */
.mt-empty > i.ti:first-child { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; margin-inline-end: .6rem; border-radius: 50%; background: var(--mt-accent-wash); color: var(--mt-accent); font-size: 1rem; vertical-align: middle; }

/* The page's title joins the top bar once its own heading has scrolled away. */
.mt-toptitle { min-width: 0; max-width: 46vw; overflow: hidden; color: var(--mt-ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 575.98px) {
    .mt-toptitle:not([hidden]) ~ .mt-term, .mt-term:has(~ .mt-toptitle:not([hidden])) { display: none; }
}

/* A link at the end of a row, a state that is a link and a mark on a strip are tall enough to hit. */
/* Staff shell only: the family pages share this stylesheet and keep their own sizes. */
:where(.content-page) .mt-rowact { display: inline-block; padding-block: .25rem; }
:where(.content-page) .mt-card__link { padding-block: .2rem; }
:where(.content-page) .mt-table a.mt-state { padding-block: .15rem; }
/* A table inside a table inherits collapsed borders, which drop its padding. */
:where(.content-page) .mt-table a.mt-waiting { display: flex; width: fit-content; }
:where(.content-page) .mt-table tbody th a.small { padding-block: .2rem; }
:where(.content-page) .form-check-label,
:where(.content-page) label.form-check { padding-block: .1rem; }
:where(.content-page summary:not([class])) { padding-block: .1rem; }
/* A tick box whose form gave it no class still gets the house size and colour. */
:where(.content-page) .form-check > input[type="checkbox"]:not(.form-check-input),
:where(.content-page) .form-check > input[type="radio"]:not(.form-check-input) { flex: none; width: 1.1rem; height: 1.1rem; margin: .2rem 0 0; accent-color: var(--mt-accent); }
.mt-strip__group .mt-tick { width: .7rem; height: 1.6rem; }

/* ---- Compact staff shell ----
   Staff work in these pages all day on a laptop, so they run denser than the pages a family opens
   on a phone. Sign-in, family and share pages use this stylesheet too and keep the sizes above:
   every rule here sits under the staff shell. :where() keeps each rule as specific as the one it
   tightens, so the modifiers above still win. A finger gets its room back at the end. */

.app-topbar,
.sidenav-menu,
.content-page { --mt-text: .875rem; }
.mt-app .content-page { font-size: var(--mt-text); }
/* Fifteen menu items fit a 768px-high screen without scrolling. */
.mt-app .side-nav { gap: 2px; padding-bottom: .5rem; }

/* Page head: the title, one quiet line under it, actions to the right. */
:where(.content-page) .mt-main { padding-top: .875rem; }
:where(.content-page) .mt-page-head { gap: .5rem 1.5rem; margin-bottom: .75rem; }
:where(.content-page) .mt-page-head h1 { font-size: 1.375rem; font-weight: 700; }
:where(.content-page) .mt-page-head p { margin-top: .15rem; font-size: .8125rem; }
:where(.content-page) .mt-back { margin-bottom: .15rem !important; }
:where(.content-page) .mt-h1-sub { font-size: .9375rem; }
:where(.content-page) .mt-code--big { font-size: 1rem; }
:where(.content-page) .mt-main > .mt-flash { margin-bottom: .75rem; }

/* A heading no rule above has sized takes the theme's size, and the theme's .h5 and .h6 are
   13.5px and 11px. The assessment pages use both for card headings; give them a floor. */
:where(.content-page) h2,
:where(.content-page) .h5 { font-size: 1rem; font-weight: 700; }
:where(.content-page) h3,
:where(.content-page) .h6 { font-size: .875rem; font-weight: 700; }
:where(.content-page) legend { font-size: .9375rem; font-weight: 700; }

/* Cards */
:where(.content-page) .mt-card__head { padding-block: .7rem .5rem; }
:where(.content-page) .mt-card__head h2 { font-size: 1rem; }
:where(.content-page) .mt-card__link { font-size: .8125rem; }
:where(.content-page) .mt-card__foot { padding-block: .5rem .7rem; }
:where(.content-page) .mt-empty { padding-block: .7rem .9rem; }

/* Tables: a row is 40px unless a cell holds a second line. Two buttons in a row sit side by side
   while the table fits its card and stack before it would scroll sideways. */
:where(.content-page) .mt-table thead th { padding: .4rem .6rem; font-size: .75rem; }
:where(.content-page) .mt-table tbody th,
:where(.content-page) .mt-table tbody td { height: 2.5rem; padding: .35rem .6rem; }
:where(.content-page) .mt-table td small { margin-top: 0; }

/* Lists */
:where(.content-page) :is(.mt-lessons, .mt-plainlist, .mt-checklist, .mt-materials, .mt-pairs, .mt-log) > li { padding-block: .45rem; }
:where(.content-page) .mt-todo li { padding-block: .55rem; }
:where(.content-page) .mt-todo__n { font-size: 1.375rem; }
:where(.content-page) .mt-approvals li { padding-block: .7rem; }

/* Filters, states and notices */
:where(.content-page) .mt-filters { gap: .5rem .75rem; margin-bottom: .75rem; }
:where(.content-page) .mt-filters label { font-size: .75rem; }
:where(.content-page) .mt-stages { margin-bottom: .75rem; }
:where(.content-page) .mt-stages a { min-height: 1.875rem; padding-inline: .7rem; font-size: .8125rem; }
:where(.content-page) .mt-state { font-size: .8125rem; }
:where(.content-page) .mt-flash { padding: .5rem .75rem; }
:where(.content-page) .mt-bulk { margin-bottom: .75rem; padding: .5rem .75rem; }

/* Controls: fields and buttons about 32px tall, 28px for a button in a row. The day panel keeps its own. */
.mt-app :where(.content-page) .form-control,
.mt-app :where(.content-page) .form-select { min-height: 2rem; padding-block: .3rem; font-size: .875rem; }
:where(.content-page) .form-control::file-selector-button { margin-block: -.3rem; padding-block: .3rem; }
.mt-app :where(.content-page) .form-label { margin-bottom: .2rem; font-size: .8125rem; }
:where(.content-page) .mt-help { font-size: .8125rem; }
:where(.content-page) .mt-field { margin-bottom: .7rem; }
:where(.content-page) .mt-form fieldset { margin-bottom: 1rem; }
:where(.content-page) .mt-form legend { font-size: .9375rem; }
/* A form laid straight into a card has no width of its own; its fields stop where other forms do. */
:where(.content-page) .mt-form--bare .mt-field { max-width: 44rem; }
:where(.content-page) .btn:not(.mt-btn-yellow, .mt-btn-ghost) { --theme-btn-padding-y: .3rem; --theme-btn-font-size: .875rem; }
.mt-app .content-page .btn-sm { --theme-btn-padding-y: .25rem; --theme-btn-padding-x: .6rem; --theme-btn-font-size: .8125rem; }

@media (pointer: coarse), (max-width: 767.98px) {
    html[data-menu-color="dark"] { --theme-sidenav-item-padding-y: 11px; }
    /* 16px text also stops iOS from zooming the page when a field takes focus. */
    .mt-app :where(.content-page) .form-control,
    .mt-app :where(.content-page) .form-select { min-height: 2.5rem; padding-block: .45rem; font-size: 1rem; }
    :where(.content-page) .form-control::file-selector-button { margin-block: -.45rem; padding-block: .45rem; }
    /* Everything a finger presses is at least 40px tall. */
    :where(.content-page) .btn:not(.mt-btn-yellow, .mt-btn-ghost) { --theme-btn-padding-y: .55rem; }
    .mt-app .content-page .btn-sm { --theme-btn-padding-y: .6rem; }
    :where(.content-page) .mt-stages a { min-height: 2.5rem; }
    :where(.content-page) .mt-mark span { padding-block: .55rem; }
    :where(.content-page) .mt-rowact { margin-block: -.4rem; padding: .65rem .35rem; }
    :where(.content-page) .mt-card__link { padding-block: .6rem; }
    :where(.content-page) .form-check-label { padding-block: .6rem; }
    :where(.content-page) .mt-filters__check { min-height: 2.5rem; }
    :where(.content-page) .mt-filters__clear { padding-block: .6rem; }
    :where(.content-page summary:not([class])) { padding-block: .6rem; }
    :where(.content-page) .mt-table tbody th,
    :where(.content-page) .mt-table tbody td { height: 2.75rem; }
}
/* On a phone a wide table scrolls sideways whatever happens, so its buttons stay on one line
   and the row keeps one height. */
@media (max-width: 767.98px) {
    :where(.content-page) .mt-table .mt-rowactions { flex-wrap: nowrap; }
}

/* ---- Meaning that does not depend on colour ---- */

/* A link inside a sentence is underlined. Its colour alone is too close to the text around it for
   anyone who cannot tell the two hues apart (WCAG 1.4.1). Buttons, pills and row links have other cues. */
:where(.content-page) :is(p:not(.mt-back), .mt-empty, .mt-help, .mt-preview, .mt-flash) a:not(.btn, .mt-state, .mt-waiting) {
    text-decoration: underline;
    text-underline-offset: .2em;
}

/* Forced colours (Windows High Contrast) removes backgrounds, and these marks say what they mean with a
   fill. Each gets a shape of its own in the system's colours: solid is done, a thick hollow box is missed,
   a thick dashed one is overdue, a thin dashed one is still to come, dotted is no pupils. */
@media (forced-colors: active) {
    .mt-tick { forced-color-adjust: none; border-color: CanvasText; background: Canvas; }
    .mt-tick.is-done { border-color: CanvasText; background: CanvasText; }
    .mt-tick.is-next,
    .mt-tick.is-late { border-color: Highlight; background: Highlight; }
    .mt-tick.is-missed { border-width: 3px; border-color: CanvasText; background: Canvas; }
    .mt-tick.is-due { border-width: 2.5px; border-color: CanvasText; background: Canvas; }
    .mt-tick.is-leave { border-style: double; border-width: 3px; border-color: CanvasText; background: Canvas; }
    .mt-tick.is-off { border-color: GrayText; background: Canvas; }
    a.mt-tick:focus-visible { outline-color: Highlight !important; }
    .mt-stages a[aria-current],
    .mt-mark input:checked + span { forced-color-adjust: none; border-color: Highlight; background: Highlight; color: HighlightText; }
    .mt-tabs a[aria-current] { border-bottom-color: Highlight; }
    .mt-app .side-nav .side-nav-item .side-nav-link.active { outline: 2px solid Highlight; outline-offset: -2px; }
}
