/* Config pages of the infohub: calm and readable, first for a phone or a narrow window. No framework. */

:root {
    --ink: #1c2126;
    --muted: #5a636c;
    --line: #d7dce1;
    --paper: #ffffff;
    --ground: #f3f4f6;
    --tint: #e8f0f7;
    --accent: #1d5d8f;
    --accent-ink: #ffffff;
    --danger: #a4262c;
    --warn: #8a5a00;
    --warn-ground: #fff4d6;
    --ok: #1f6f3f;
    --radius: 8px;
    --touch: 44px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    color: var(--ink);
    background: var(--ground);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--ground);
}

a {
    color: var(--accent);
}

code {
    font-size: 0.92em;
    background: var(--ground);
    padding: 0 0.25em;
    border-radius: 3px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* Frame */

.top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 1rem;
    padding: 0 1rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.brand {
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    padding: 0.6rem 0;
}

.top nav {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.4rem;
}

.top nav a {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
    padding: 0 0.4rem;
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.top nav a[aria-current="page"] {
    color: var(--ink);
    font-weight: 600;
    border-bottom-color: var(--accent);
}

.logout {
    margin-left: auto;
}

main {
    max-width: 76rem;
    margin: 0 auto;
    padding: 1rem 1rem 3rem;
}

h1 {
    font-size: 1.45rem;
    margin: 0.25rem 0 0.75rem;
}

h2 {
    font-size: 1.15rem;
    margin: 0 0 0.5rem;
}

h3 {
    font-size: 1rem;
    margin: 0 0 0.35rem;
}

.crumbs {
    margin: 0;
}

.crumbs a {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
    text-decoration: none;
}

.page-head,
.group-head,
.card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.page-head h1 {
    margin: 0;
}

.notice,
.problem {
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius);
    border: 1px solid;
    margin: 0 0 1rem;
    transition: opacity 0.6s;
}

.notice {
    color: var(--ok);
    border-color: var(--ok);
    background: #eaf6ee;
    font-weight: 600;
}

.notice.fading {
    opacity: 0;
}

.problem {
    color: var(--danger);
    border-color: var(--danger);
    background: #fbefef;
}

.problem-text {
    color: var(--danger);
}

.empty,
.hint,
.summary {
    color: var(--muted);
}

.hint {
    font-size: 0.9rem;
    margin: 0.3rem 0 0;
}

.summary {
    display: block;
    font-size: 0.9rem;
}

.mark {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.05rem 0.5rem;
    border: 1px solid var(--muted);
    border-radius: 999px;
    color: var(--muted);
}

/* Cards and lists */

.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.items li {
    padding: 0.6rem 0;
    border-top: 1px solid var(--line);
}

.items li:first-child {
    border-top: none;
}

.items li > a {
    display: inline-block;
    font-weight: 600;
    padding: 0.2rem 0;
}

.status-line {
    display: block;
    font-size: 0.9rem;
    margin: 0.15rem 0 0;
}

.status-line:empty {
    display: none;
}

details.small,
details.more,
details.howto {
    margin: 0.75rem 0;
}

details > summary {
    cursor: pointer;
}

details.small > summary,
details.more > summary,
details.howto > summary {
    color: var(--accent);
    min-height: var(--touch);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

details.more[open] {
    border-left: 3px solid var(--line);
    padding-left: 0.75rem;
}

.howto ul {
    margin: 0.25rem 0 0;
    padding-left: 1.2rem;
    font-size: 0.92rem;
}

.howto li + li {
    margin-top: 0.4rem;
}

/* Overview */

.display .delivered {
    margin: 0 0 0.5rem;
}

.delivered img,
.preview img,
.thumb img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--paper);
}

.delivered figcaption {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.3rem;
}

.placeholder {
    display: grid;
    place-items: center;
    aspect-ratio: 800 / 480;
    padding: 1rem;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 4px;
    background: var(--paper);
    margin: 0;
}

.warnings {
    list-style: none;
    margin: 0.5rem 0;
    padding: 0;
}

.warnings li,
.warning {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--warn);
    background: var(--warn-ground);
    color: #4a3200;
    font-size: 0.92rem;
}

.warnings li + li {
    margin-top: 0.35rem;
}

.warning {
    margin: 0 0 0.75rem;
}

.facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 1rem;
    margin: 0.25rem 0 0;
    font-size: 0.92rem;
}

.facts dt {
    color: var(--muted);
}

.facts dd {
    margin: 0;
}

.now {
    margin: 0.75rem 0;
}

.card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 0;
}

.steps {
    padding-left: 1.4rem;
    margin: 0;
}

.steps li + li {
    margin-top: 0.5rem;
}

.todos ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.todos li {
    border-top: 1px solid var(--line);
}

.todos li:first-child {
    border-top: none;
}

.todos a {
    display: block;
    padding: 0.65rem 0;
}

/* Day view */

.segments {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
}

.segments li {
    display: flex;
    gap: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-left: 4px solid var(--line);
}

.segments li[data-asleep] {
    color: var(--muted);
}

.segments li.current {
    border-left-color: var(--accent);
    background: var(--tint);
    font-weight: 600;
}

.segments .time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--muted);
    min-width: 6.8rem;
    font-weight: 400;
}

.tabs {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    margin: -0.25rem -0.25rem 0.75rem;
    padding: 0.25rem;
}

.tabs a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
    padding: 0 0.8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
}

.tabs a[aria-current="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-bottom: 0.25rem;
}

.switcher a {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
}

.switcher a[aria-current="page"] {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.more-schedules {
    margin: 0.5rem 0;
}

/* Forms */

.editor {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.editor.narrow {
    max-width: 22rem;
}

.field {
    margin-bottom: 1.1rem;
}

.field > label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.required {
    color: var(--danger);
}

.status {
    font-weight: 400;
    color: var(--muted);
    margin-left: 0.35rem;
}

input[type="text"],
input[type="time"],
input[type="password"],
select {
    width: 100%;
    max-width: 32rem;
    min-height: var(--touch);
    font: inherit;
    padding: 0.4rem 0.6rem;
    border: 1px solid #b9c0c7;
    border-radius: var(--radius);
    background: var(--paper);
    color: inherit;
}

/* Our own arrow: the browser's sits flush against the rounded border. */
select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235a636c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 0.75rem;
}

input[type="checkbox"],
input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

.invalid input,
.invalid select,
td.invalid input {
    border-color: var(--danger);
}

.error {
    color: var(--danger);
    font-size: 0.9rem;
    margin: 0.3rem 0 0;
}

fieldset {
    border: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

legend {
    font-weight: 600;
    padding: 0;
    margin-bottom: 0.3rem;
}

label.check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: var(--touch);
    font-weight: 400;
}

.radios label.check {
    align-items: flex-start;
    padding: 0.55rem 0;
}

.radios label.check input {
    margin-top: 0.1rem;
}

.with-suffix {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.with-suffix input {
    width: 6rem;
}

fieldset.area {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.75rem 0.9rem 0.1rem;
    margin-bottom: 1rem;
    background: #fafbfc;
}

fieldset.area > legend {
    float: left;
    width: 100%;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

fieldset.area > legend + * {
    clear: both;
}

/* Layout tiles */

.tiles {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
}

.tile {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    max-width: 9rem;
    min-width: 0;
    padding: 0.6rem 0.25rem;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    text-align: center;
    font-size: 0.85rem;
    cursor: pointer;
}

/* The grid of a split has up to six steps; on a narrow window they wrap to a second row. */
.splits {
    flex-wrap: wrap;
}

.splits .tile {
    flex-basis: 4.6rem;
    max-width: 5.6rem;
    padding-inline: 0.15rem;
}

.splits .error {
    flex-basis: 100%;
}

.tile input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.tile svg .frame {
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.5;
}

.tile svg .area {
    fill: #c9d3dc;
}

.tile:has(input:checked) {
    border-color: var(--accent);
    background: var(--tint);
    font-weight: 600;
}

.tile:has(input:checked) svg .area {
    fill: var(--accent);
}

.tile:has(input:focus-visible) {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* Day chips */

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.chip input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch);
    min-height: var(--touch);
    padding: 0 0.4rem;
    border: 1px solid #b9c0c7;
    border-radius: 999px;
    background: var(--paper);
    cursor: pointer;
}

.chip input:checked + span {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

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

.shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.25rem;
    width: 100%;
}

/* Tables (timetable, roof faces) */

fieldset.table {
    overflow-x: auto;
}

.scroll {
    position: relative;
    overflow-x: auto;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0.5rem;
}

th {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    padding: 0.2rem 0.25rem;
    color: var(--muted);
    background: var(--paper);
}

td {
    padding: 0.15rem 0.2rem;
    background: var(--paper);
}

/* The first column (the period) stays in place while the days scroll sideways. */
th:first-child,
td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    box-shadow: 1px 0 0 var(--line);
}

td input[type="text"] {
    min-width: 3.6rem;
    max-width: 6rem;
    padding: 0.3rem 0.4rem;
}

td input[type="time"] {
    min-width: 6.4rem;
    max-width: 8rem;
    padding: 0.3rem 0.4rem;
}

/* Buttons */

button,
.button {
    font: inherit;
    min-height: var(--touch);
    padding: 0.45rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--accent);
    background: var(--paper);
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

button.primary,
.button.primary {
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
}

button.danger {
    border-color: var(--danger);
    color: var(--danger);
}

button.link {
    border: none;
    background: none;
    padding: 0.2rem 0.4rem;
    color: var(--accent);
    text-decoration: underline;
}

button.link.danger-text {
    color: var(--danger);
}

button.icon {
    min-width: var(--touch);
    padding: 0.2rem 0.5rem;
}

button:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Answers the Enter key without being seen. */
button.default {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* The save bar stays at the bottom of the window on long forms. */
.savebar {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin: 1rem -1rem -1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--radius) var(--radius);
}

form.delete {
    margin-top: 1.5rem;
}

/* Editors with a preview or the day view */

.editor-grid {
    display: grid;
    gap: 1rem;
    align-items: start;
}

.editor-grid > * {
    min-width: 0;
}

/* On a narrow window the preview stays on top while the form scrolls below it. */
.with-preview .preview {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: 0 -1rem;
    padding: 0.5rem 1rem;
    background: var(--ground);
    border-bottom: 1px solid var(--line);
}

.with-preview .preview img,
.with-preview .preview .placeholder {
    width: auto;
    max-width: 100%;
    max-height: calc(33vh - 2.5rem);
    margin: 0 auto;
}

.with-preview .preview .placeholder {
    width: 100%;
    font-size: 0.9rem;
}

.with-preview .preview .hint {
    text-align: center;
    margin-top: 0.25rem;
}

@media (min-width: 64rem) {
    .editor-grid {
        grid-template-columns: minmax(0, 40rem) minmax(0, 1fr);
    }

    .editor-grid > .editor {
        grid-column: 1;
        grid-row: 1;
    }

    .editor-grid > .preview,
    .editor-grid > .dayview {
        grid-column: 2;
        grid-row: 1;
        position: sticky;
        top: 1rem;
    }

    .with-preview .preview {
        margin: 0;
        padding: 0;
        border: none;
    }

    .with-preview .preview img,
    .with-preview .preview .placeholder {
        max-height: none;
        width: 100%;
    }
}

/* Schedule entries */

.entries {
    margin-bottom: 1rem;
}

details.entry {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    margin-bottom: 0.5rem;
}

details.entry[open] {
    border-color: #a9b4be;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

details.entry.dragging {
    opacity: 0.5;
}

details.entry.drop-before {
    box-shadow: 0 -3px 0 var(--accent);
}

details.entry > summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0.3rem 0.3rem 0.75rem;
    min-height: 3.25rem;
    list-style: none;
}

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

.num {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--ground);
    font-size: 0.85rem;
    font-weight: 600;
}

.sentence {
    flex: 1 1 auto;
}

.flag {
    display: inline-grid;
    place-items: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    background: var(--warn);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
}

.moves {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.grip {
    cursor: grab;
    color: var(--muted);
    padding: 0 0.35rem;
    font-size: 1.2rem;
}

.entry-body {
    padding: 0.25rem 0.9rem 0.75rem;
    border-top: 1px solid var(--line);
}

.entry-body > .field:first-of-type,
.entry-body > .warning + .field {
    margin-top: 0.75rem;
}

.times {
    display: flex;
    gap: 0.75rem;
}

.times .field {
    flex: 1 1 0;
    max-width: 10rem;
}

.entry-buttons {
    display: flex;
    justify-content: flex-end;
}

/* Screens gallery */

.gallery {
    list-style: none;
    margin: 0.75rem 0;
    padding: 0;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr));
}

.gallery > li,
.screen-card > * {
    min-width: 0;
}

.thumb {
    display: block;
}

.screen-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0.75rem;
}

.screen-card.dragging {
    opacity: 0.5;
}

.screen-card.drop-before {
    box-shadow: -4px 0 0 var(--accent);
}

.screen-card-text {
    flex: 1 1 auto;
}

.screen-card .name {
    font-weight: 600;
    font-size: 1.05rem;
}

.screen-card .moves {
    justify-content: flex-end;
}

/* Overview: cards side by side on wide screens */

@media (min-width: 64rem) {
    main:has(> .display) {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(28rem, 1fr));
        gap: 0 1rem;
        align-items: start;
    }

    main:has(> .display) > :not(.display) {
        grid-column: 1 / -1;
    }
}

/* Stop suggestions below a stop input */

.suggestions {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    max-width: 32rem;
}

.suggestions li + li {
    border-top: 1px solid var(--line);
}

button.suggestion {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    text-align: left;
    border: none;
    border-radius: 0;
    background: none;
    color: var(--ink);
}

button.suggestion:hover,
button.suggestion:focus {
    background: var(--tint);
}

/* Timetable of a person (tags/timetable.html) */

.tt-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--paper);
}

.tt table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 0;
}

.tt th,
.tt td {
    position: static;
    padding: 0;
    background: none;
    box-shadow: none;
    border-top: 1px solid var(--line);
    text-align: center;
}

.tt thead th {
    border-top: 0;
    padding: 0.45rem 0;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--ground);
}

.tt th:first-child {
    width: 4.6rem;
    background: var(--ground);
    border-right: 1px solid var(--line);
}

.tt-nr {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--ink);
}

.tt-time {
    display: block;
    padding: 0 0.15rem 0.3rem;
    font-size: 0.66rem;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.tt .tt-cell + .tt-cell {
    border-left: 1px solid var(--line);
}

/* A subject: a quiet tint and a bar in the same hue; the text stays. A free period stays plain. */
.tt .tt-cell[style] {
    background: hsl(var(--h) 70% 92%);
    box-shadow: inset 3px 0 0 hsl(var(--h) 45% 58%);
}

/* Equal neighbours are one double period. */
.tt .tt-cell.dbl-up {
    border-top-color: transparent;
}

.tt .tt-cell input[type="text"] {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 3rem;
    min-height: var(--touch);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: center;
    text-transform: uppercase;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

/* The arrow of the suggestions would take room from the abbreviation. */
.tt .tt-cell input::-webkit-calendar-picker-indicator {
    display: none !important;
}

.tt .tt-cell input::placeholder {
    font-weight: 400;
    color: #b4bbc2;
}

.tt .tt-cell input:focus {
    outline: 3px solid var(--accent);
    outline-offset: -3px;
    background: var(--paper);
}

.tt-pause td {
    padding: 0.15rem 0.25rem;
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--muted);
    background: var(--ground);
}

/* Without the tick the times are only text; the inputs stay in the page and are posted either way. */
.tt-times {
    display: none;
}

.tt-toggle:checked ~ .tt-card .tt-times {
    display: table-row;
}

.tt-times td {
    background: #f7f9fb;
}

.tt-edit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
}

.tt-edit-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 0.25rem;
}

.tt-edit input[type="time"] {
    width: 6.5rem;
    min-width: 0;
    max-width: none;
    min-height: var(--touch);
}

.tt-edit input[aria-invalid="true"] {
    border-color: var(--danger);
}

.tt-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.tt-switch {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
    padding: 0.45rem 1rem;
    box-sizing: border-box;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    color: var(--accent);
    background: var(--paper);
    cursor: pointer;
}

.tt-toggle:checked ~ .tt-tools .tt-switch {
    background: var(--tint);
    font-weight: 600;
}

.tt-toggle:checked ~ .tt-tools .tt-switch::before {
    content: "✓";
    margin-right: 0.35rem;
}

.tt-toggle:focus-visible ~ .tt-tools .tt-switch {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.tt-empty {
    padding: 1.25rem 1rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    text-align: center;
    background: var(--ground);
}

.tt-empty p {
    margin: 0 0 0.75rem;
}

@media (min-width: 40.01rem) {
    .tt-card {
        max-width: 40rem;
    }
}

/* On a narrow window the timetable uses the room of the form's padding, so all five days fit. */
@media (max-width: 40rem) {
    .tt-card,
    .tt-empty {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
}

@media (max-width: 26rem) {
    .tt-edit-label {
        display: none;
    }

    .tt-edit input[type="time"] {
        width: 6.1rem;
    }
}
