.teacher-diary-duty-row,
.teacher-diary-meeting-setup-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
    padding: 0.9rem;
    border: 1px solid var(--teacher-diary-border);
    border-radius: 16px;
    background: var(--teacher-diary-soft);
}

.teacher-diary-recurring-name-field,
.teacher-diary-recurring-room-field {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.teacher-diary-recurring-schedule {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) repeat(2, minmax(0, 1fr)) minmax(0, 0.9fr) auto;
    gap: 0.65rem;
    align-items: center;
    min-width: 0;
}

.teacher-diary-recurring-schedule > .form-control,
.teacher-diary-recurring-schedule > .form-select,
.teacher-diary-recurring-name-field .form-control,
.teacher-diary-recurring-room-field .form-control {
    min-width: 0;
}

.teacher-diary-duty-cell,
.teacher-diary-scheduled-meeting-cell {
    width: 100%;
    min-height: 42px;
    border-radius: 16px;
    padding: 0.45rem 0.7rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    appearance: none;
    text-align: left;
    border: 1px solid #dae5ee;
    color: var(--teacher-diary-ink);
    cursor: default;
}

.teacher-diary-duty-cell {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    background: linear-gradient(180deg, #f1f8ff 0%, #e7f2fc 100%);
    border-color: #c7dced;
}

.teacher-diary-duty-cell.is-empty-state,
.teacher-diary-scheduled-meeting-cell.is-empty-state {
    color: #8b95a1;
    align-items: center;
}

.teacher-diary-scheduled-meeting-cell {
    background: linear-gradient(180deg, #f7f4fb 0%, #eee8f5 100%);
    border-color: #d8cde4;
}

.teacher-diary-scheduled-meeting-item {
    display: grid;
    gap: 0.15rem;
}

.teacher-diary-recurring-room {
    color: var(--teacher-diary-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.teacher-diary-row-header--duty,
.teacher-diary-row-header--scheduled-meeting,
.teacher-diary-calendar-row--duty .teacher-diary-calendar-cell,
.teacher-diary-calendar-row--scheduled-meeting .teacher-diary-calendar-cell {
    background: #e3e8ed !important;
}

@media (max-width: 767.98px) {
    .teacher-diary-recurring-schedule {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .teacher-diary-recurring-schedule .btn {
        grid-column: 1 / -1;
    }
}

/* Populated planning and non-lesson slots. */
.teacher-diary-calendar-cell .has-diary-content {
    background: #fff3b0;
    color: #493b00;
    border-color: #d6b84b;
}
.teacher-diary-calendar-cell .has-diary-content:hover {
    background: #ffea87;
}
.teacher-diary-todo-edit-input { min-width: 0; width: 100%; }
.teacher-diary-todo-item:has(.teacher-diary-todo-edit-input:not([hidden])) { flex-wrap: wrap; }
