.calendar-maintenance-book {
  margin-inline-end: 8px;
}

.calendar-maintenance-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1500;

  background:
    rgba(15,23,42,.42);

  opacity: 0;
  visibility: hidden;

  transition: .18s ease;
}

.calendar-maintenance-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.calendar-maintenance-modal {
  position: fixed;

  left: 50%;
  top: 50%;

  z-index: 1510;

  width:
    min(
      820px,
      calc(100vw - 48px)
    );

  max-height:
    calc(100vh - 64px);

  overflow-y: auto;

  box-sizing: border-box;

  padding: 24px;

  background: #fff;

  border-radius: 18px;

  box-shadow:
    0 24px 70px
    rgba(15,23,42,.24);

  opacity: 0;
  visibility: hidden;

  transform:
    translate(-50%, -47%)
    scale(.985);

  transition: .18s ease;
}

.calendar-maintenance-modal.open {
  opacity: 1;
  visibility: visible;

  transform:
    translate(-50%, -50%)
    scale(1);
}

.calendar-maintenance-head {
  display: flex;

  justify-content:
    space-between;

  gap: 18px;

  align-items:
    flex-start;

  padding-bottom: 18px;

  margin-bottom: 18px;

  border-bottom:
    1px solid #edf1f4;
}

.calendar-maintenance-head h2 {
  margin: 5px 0;
}

.calendar-maintenance-head p {
  margin: 0;

  color: #64748b;

  font-size: 12px;
}

.calendar-maintenance-form {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0,1fr));

  gap: 14px;
}

.calendar-maintenance-form label {
  display: flex;

  flex-direction: column;

  gap: 6px;
}

.calendar-maintenance-form label > span,
.calendar-maint-end > span {
  color: #475569;

  font-size: 12px;

  font-weight: 700;
}

.calendar-maintenance-form input,
.calendar-maintenance-form select,
.calendar-maintenance-form textarea {
  width: 100%;

  box-sizing: border-box;

  border:
    1px solid #d7dee6;

  border-radius: 9px;

  padding: 10px 11px;

  background: #fff;

  color: #172033;

  font: inherit;

  outline: none;
}

.calendar-maintenance-form input:focus,
.calendar-maintenance-form select:focus,
.calendar-maintenance-form textarea:focus {
  border-color: #27894d;

  box-shadow:
    0 0 0 3px
    rgba(39,137,77,.10);
}

.calendar-maintenance-wide {
  grid-column: 1 / -1;
}

.calendar-maint-end {
  border:
    1px solid #dce8e1;

  border-radius: 9px;

  padding: 10px 12px;

  background: #f5fbf7;
}

.calendar-maint-end strong {
  display: block;

  margin-top: 5px;

  color: #27894d;

  font-variant-numeric:
    tabular-nums;
}

.calendar-maint-request-context {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0,1fr));

  gap: 8px;

  padding: 10px;

  border:
    1px solid #dce8e1;

  border-radius: 10px;

  background: #fbfefc;
}

.calendar-maint-request-context.hidden {
  display: none;
}

.calendar-maint-request-context > div {
  padding: 8px;

  border-radius: 7px;

  background: #fff;
}

.calendar-maint-request-context span {
  display: block;

  color: #94a3b8;

  font-size: 10px;

  margin-bottom: 3px;
}

.calendar-maintenance-error {
  min-height: 20px;

  color: #b91c1c;

  font-size: 12px;
}

.calendar-maintenance-notice {
  padding: 11px;

  border:
    1px solid #fed7aa;

  border-radius: 9px;

  background: #fff7ed;

  color: #9a3412;

  font-size: 12px;

  line-height: 1.7;
}

.calendar-maintenance-actions {
  display: flex;

  justify-content:
    flex-end;

  gap: 9px;

  padding-top: 14px;

  border-top:
    1px solid #edf1f4;
}

.calendar-maintenance-loading,
.calendar-maintenance-success {
  padding: 14px;
}

.calendar-maintenance-success dl {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0,1fr));

  gap: 9px;

  margin: 20px 0;
}

.calendar-maintenance-success dl > div {
  padding: 10px;

  border:
    1px solid #e5eaee;

  border-radius: 9px;
}

.calendar-maintenance-success dt {
  color: #94a3b8;

  font-size: 10px;
}

.calendar-maintenance-success dd {
  margin: 4px 0 0;

  font-weight: 800;
}


@media (max-width: 700px) {
  .calendar-maintenance-modal {
    inset: 0;

    left: 0;
    top: 0;

    width: 100vw;

    height: 100dvh;

    max-width: none;
    max-height: none;

    padding: 18px;

    border-radius: 0;

    transform:
      translateY(2%);
  }

  .calendar-maintenance-modal.open {
    transform:
      translateY(0);
  }

  .calendar-maintenance-form,
  .calendar-maint-request-context,
  .calendar-maintenance-success dl {
    grid-template-columns:
      1fr;
  }

  .calendar-maintenance-wide {
    grid-column: auto;
  }

  .calendar-maintenance-form input,
  .calendar-maintenance-form select {
    min-height: 44px;

    font-size: 16px;
  }

  .calendar-maintenance-actions {
    position: sticky;

    bottom: -18px;

    margin:
      12px -18px -18px;

    padding:
      12px 18px
      calc(
        14px
        + env(
          safe-area-inset-bottom
        )
      );

    background: #fff;
  }

  .calendar-maintenance-actions button {
    flex: 1;

    min-height: 44px;
  }
}
